{"openapi":"3.0.3","info":{"title":"PontoGate API","version":"1.0.0","description":"API REST para criar cobranças PIX, consultar saldo/extrato, saques e webhooks.\n\n**Ambientes:** a chave de API define o ambiente. Chaves `pg_test_…` operam no **sandbox** (nenhum dinheiro real); chaves `pg_live_…` operam em **produção** e só existem após a verificação cadastral (KYC).\n\n**Valores** sempre em centavos (inteiros).\n\n**Webhooks:** cabeçalho `PontoGate-Signature: t=<timestamp>,v1=<hmac>` onde `hmac = HMAC_SHA256(secret, \"<timestamp>.<corpo bruto>\")`. Rejeite eventos com timestamp antigo (>5 min) e use `PontoGate-Event-Id` para deduplicar.\n\n**Limites:** 120 requisições/min por chave (429 + `Retry-After`)."},"servers":[{"url":"https://pontogate.omundoplay.online/api/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Cobranças"},{"name":"Saldo"},{"name":"Saques"},{"name":"Webhooks"},{"name":"Eventos"}],"paths":{"/charges":{"post":{"tags":["Cobranças"],"summary":"Criar cobrança PIX","description":"Escopo `charges:write`. Se `external_id` já existir, retorna 409 `duplicate_charge` (anti-duplicidade).","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":120},"description":"Repetir a mesma chave devolve a mesma resposta sem repetir a operação."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChargeCreate"}}}},"responses":{"201":{"description":"Cobrança criada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Charge"}}}},"409":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Cobranças"],"summary":"Listar cobranças","description":"Escopo `charges:read`.","parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","maximum":100,"default":20}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","paid","expired","cancelled","refunded","in_review"]}},{"name":"external_id","in":"query","schema":{"type":"string"}},{"name":"created_from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"created_to","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Lista"}}}},"/charges/{id}":{"get":{"tags":["Cobranças"],"summary":"Consultar cobrança","description":"Use `?refresh=1` para consultar o PSP e atualizar o status.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Charge"}}}},"404":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/charges/{id}/cancel":{"post":{"tags":["Cobranças"],"summary":"Cancelar cobrança pendente","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Charge"}}}},"409":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/charges/{id}/qrcode.svg":{"get":{"tags":["Cobranças"],"summary":"QR Code PIX (SVG)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"SVG","content":{"image/svg+xml":{"schema":{"type":"string"}}}}}}},"/balance":{"get":{"tags":["Saldo"],"summary":"Consultar saldo","description":"Escopo `balance:read`.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}}}}},"/transactions":{"get":{"tags":["Saldo"],"summary":"Extrato (lançamentos)","parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","maximum":100,"default":20}},{"name":"page","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Lista"}}}},"/withdrawals":{"get":{"tags":["Saques"],"summary":"Listar saques","parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","maximum":100,"default":20}},{"name":"page","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Lista"}}},"post":{"tags":["Saques"],"summary":"Solicitar saque","description":"Escopo `withdrawals:write`. Disponível somente se habilitado para a conta. Saques podem exigir aprovação administrativa.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":120},"description":"Repetir a mesma chave devolve a mesma resposta sem repetir a operação."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount","pix_key_id"],"properties":{"amount":{"type":"integer"},"pix_key_id":{"type":"integer"},"external_id":{"type":"string"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}}},"403":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Erro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/withdrawals/{id}":{"get":{"tags":["Saques"],"summary":"Consultar saque","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}}}}}},"/pix-keys":{"get":{"tags":["Saques"],"summary":"Listar chaves PIX cadastradas","responses":{"200":{"description":"Lista"}}}},"/webhook-endpoints":{"get":{"tags":["Webhooks"],"summary":"Listar endpoints","responses":{"200":{"description":"Lista"}}},"post":{"tags":["Webhooks"],"summary":"Cadastrar endpoint","description":"O `secret` de assinatura é retornado apenas na criação.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Criado"}}}},"/webhook-endpoints/{id}":{"patch":{"tags":["Webhooks"],"summary":"Atualizar endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"delete":{"tags":["Webhooks"],"summary":"Remover endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/events":{"get":{"tags":["Eventos"],"summary":"Listar eventos","description":"Escopo `events:read`. Tipos: charge.created, charge.paid, charge.expired, charge.cancelled, charge.refunded, charge.in_review, withdrawal.created, withdrawal.completed, withdrawal.failed, withdrawal.rejected, withdrawal.cancelled.","parameters":[{"name":"per_page","in":"query","schema":{"type":"integer","maximum":100,"default":20}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"type","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Lista"}}}},"/events/{id}":{"get":{"tags":["Eventos"],"summary":"Consultar evento","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Chave de API: `Authorization: Bearer pg_test_…`"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"fields":{"type":"object"}}}}},"ChargeCreate":{"type":"object","required":["amount"],"properties":{"amount":{"type":"integer","example":15000,"description":"Centavos"},"description":{"type":"string","maxLength":140},"external_id":{"type":"string","description":"Seu identificador único do pedido"},"expires_in_minutes":{"type":"integer","default":60},"payer":{"type":"object","properties":{"name":{"type":"string"},"document":{"type":"string"}}},"metadata":{"type":"object"}}},"Charge":{"type":"object","properties":{"id":{"type":"string","example":"ch_01hx…"},"environment":{"type":"string","enum":["sandbox","live"]},"status":{"type":"string","enum":["pending","paid","expired","cancelled","refunded","in_review"]},"amount":{"type":"integer"},"fee":{"type":"integer"},"net_amount":{"type":"integer"},"pix":{"type":"object","properties":{"copy_paste":{"type":"string"},"qr_code_svg":{"type":"string"}}},"expires_at":{"type":"string","format":"date-time"},"paid_at":{"type":"string","format":"date-time","nullable":true}}},"Balance":{"type":"object","properties":{"available":{"type":"integer"},"pending":{"type":"integer"},"blocked":{"type":"integer"},"currency":{"type":"string"}}},"Withdrawal":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["requested","pending_approval","approved","processing","completed","failed","rejected","cancelled"]},"amount":{"type":"integer"},"fee":{"type":"integer"}}}}}}