{"openapi":"3.1.0","info":{"title":"Leigan Payments API","version":"1.1.2","description":"Leigan Payments public API for Pix payments, balance, payouts and refunds in BRL. Amounts are integer cents. A successful creation response does not confirm settlement. Reconcile resource states and signed events. After a timeout or uncertain result, keep the same Idempotency-Key and JSON body; a new key may duplicate the request. Errors contain code, an English message and request_id. Examples are fictional."},"servers":[{"url":"https://api.leiganpayments.com/v1","description":"Production API."}],"security":[{"BearerAuth":[]}],"paths":{"/transactions":{"post":{"summary":"Create PIX payment","description":"Creates a Pix payment request. Store data.id and display the returned Pix code. Confirm payment through paid status in GET /transactions/{id} or the transaction.status_changed event. After a timeout, check the request; when resending, keep the same Idempotency-Key and JSON body.","operationId":"post_transactions","tags":["Cobranças"],"x-required-scopes":["transactions:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Request key with 8 to 120 characters. For compatibility across creation endpoints, use visible ASCII without spaces. Store the key before sending; on retry preserve the same key, endpoint, business and JSON body. Do not reuse it for a different request. Same resource ID, without a new movement; use GET to reconcile status.","schema":{"type":"string","minLength":8,"maxLength":120}}],"responses":{"200":{"description":"Idempotent replay of the same resource and ID, without a new movement. The representation may reflect its current state.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"},"idempotent_replay":{"type":"boolean","description":"True when this key identifies a previously received request; does not represent a new creation. Does not confirm financial settlement."}},"required":["data","idempotent_replay"]},"example":{"data":{"id":"pix_exemplo_1043","amount":10000,"fee":900,"net":9100,"status":"pending","buyer_name":"Cliente Exemplo","buyer_email":"cliente@example.com","reference":"pedido-1043","created_at":"2026-10-18T12:00:00.000Z","paid_at":null,"origin":"api","buyer_document":"***4725","buyer_phone":"***9999","end_to_end_id":null,"payment_method":"pix","pix":{"copy_paste":"CODIGO_PIX_RETORNADO_PELA_API","expires_at":"2026-10-18T13:00:00.000Z"},"payer":null},"idempotent_replay":true}}}},"201":{"description":"Request created.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"},"idempotent_replay":{"type":"boolean","description":"True when this key identifies a previously received request; does not represent a new creation. Does not confirm financial settlement."}},"required":["data","idempotent_replay"]},"example":{"data":{"id":"pix_exemplo_1043","amount":10000,"fee":900,"net":9100,"status":"pending","buyer_name":"Cliente Exemplo","buyer_email":"cliente@example.com","reference":"pedido-1043","created_at":"2026-10-18T12:00:00.000Z","paid_at":null,"origin":"api","buyer_document":"***4725","buyer_phone":"***9999","end_to_end_id":null,"payment_method":"pix","pix":{"copy_paste":"CODIGO_PIX_RETORNADO_PELA_API","expires_at":"2026-10-18T13:00:00.000Z"},"payer":null},"idempotent_replay":false}}}},"400":{"description":"Invalid request or JSON.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Invalid JSON.","request_id":"req_exemplo"}}}}},"401":{"description":"Missing, invalid or revoked credential.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_exemplo"}}}}},"403":{"description":"Scope, IP, user access or account authorization denied.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"API scope not allowed.","request_id":"req_exemplo"}}}}},"409":{"description":"Idempotency conflict or insufficient balance.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"idempotency_conflict","message":"Idempotency key mismatch.","request_id":"req_exemplo"}}}}},"413":{"description":"The request body exceeds 65,536 bytes.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"payload_too_large","message":"Request body is too large.","request_id":"req_exemplo"}}}}},"415":{"description":"Unsupported content type.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unsupported_media_type","message":"Use Content-Type: application/json.","request_id":"req_exemplo"}}}}},"422":{"description":"Invalid field, filter, limit or idempotency key.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"validation_error","message":"Invalid Idempotency-Key.","request_id":"req_exemplo"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal error.","request_id":"req_exemplo"}}}}},"502":{"description":"Unconfirmed result. Query the ID when known and preserve the same key and JSON body if resending.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_provider_response","message":"Payment unconfirmed. Check status.","request_id":"req_example_20261111"}}}}},"503":{"description":"Service temporarily unavailable or result still unconfirmed. Respect Retry-After when supplied. When resending, keep the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Minimum wait in seconds before retrying when supplied. Preserve the key and JSON body when retrying a POST."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"payments_unavailable","message":"Payments unavailable.","request_id":"req_exemplo"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransaction"},"example":{"amount":10000,"payment_method":"pix","external_reference":"pedido-1043","buyer":{"name":"Cliente Exemplo","email":"cliente@example.com","document":"52998224725","phone":"11999999999"}}}}}},"get":{"summary":"List payments","description":"Lists payment requests for this account. Use limit and offset for pagination and filters to select a period or status. Continue while pagination.has_more is true. Deduplicate by ID when querying an active period.","operationId":"get_transactions","tags":["Cobranças"],"x-required-scopes":["transactions:read"],"parameters":[{"name":"limit","in":"query","required":false,"description":"Items per page.","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},{"name":"offset","in":"query","required":false,"description":"Records to skip. Next page: offset + limit.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"status","in":"query","required":false,"description":"Public resource status.","schema":{"type":"string","enum":["pending","paid","expired","refunding","refunded"]}},{"name":"search","in":"query","required":false,"description":"Partial search by payment ID, end_to_end_id, reference, submitted buyer name or email, and confirmed payer name. Does not search Idempotency-Key.","schema":{"type":"string","maxLength":160}},{"name":"from","in":"query","required":false,"description":"Created at or after this instant (inclusive). ISO 8601 with timezone, or YYYY-MM-DD in UTC.","schema":{"type":"string","description":""}},{"name":"to","in":"query","required":false,"description":"Created before this instant (exclusive). Must be later than from.","schema":{"type":"string","description":""}},{"name":"origin","in":"query","required":false,"description":"Payment source.","schema":{"type":"string","enum":["api","panel"]}}],"responses":{"200":{"description":"Query completed.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"example":{"data":[{"id":"pix_exemplo_1043","amount":10000,"fee":900,"net":9100,"status":"pending","buyer_name":"Cliente Exemplo","buyer_email":"cliente@example.com","reference":"pedido-1043","created_at":"2026-10-18T12:00:00.000Z","paid_at":null,"origin":"api","buyer_document":"***4725","buyer_phone":"***9999","end_to_end_id":null,"payment_method":"pix","pix":{"copy_paste":"CODIGO_PIX_RETORNADO_PELA_API","expires_at":"2026-10-18T13:00:00.000Z"},"payer":null}],"pagination":{"limit":100,"offset":0,"total":1,"has_more":false}}}}},"401":{"description":"Missing, invalid or revoked credential.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_exemplo"}}}}},"403":{"description":"Scope, IP, user access or account authorization denied.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"API scope not allowed.","request_id":"req_exemplo"}}}}},"422":{"description":"Invalid field, filter, limit or idempotency key.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"validation_error","message":"Use limit 1-100 and integer offset >= 0.","request_id":"req_exemplo"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal error.","request_id":"req_exemplo"}}}}}}}},"/transactions/{id}":{"get":{"summary":"Get payment","description":"Looks up a payment request by ID. Use status to confirm payment, and fee and net to check the amounts.","operationId":"get_transactions_id","tags":["Cobranças"],"x-required-scopes":["transactions:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque resource ID returned by the API. Use the corresponding payment or payout ID; do not substitute an E2E, Idempotency-Key, external reference or event ID.","schema":{"type":"string","description":""}}],"responses":{"200":{"description":"Query completed.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Transaction"}},"required":["data"]},"example":{"data":{"id":"pix_exemplo_1043","amount":10000,"fee":900,"net":9100,"status":"pending","buyer_name":"Cliente Exemplo","buyer_email":"cliente@example.com","reference":"pedido-1043","created_at":"2026-10-18T12:00:00.000Z","paid_at":null,"origin":"api","buyer_document":"***4725","buyer_phone":"***9999","end_to_end_id":null,"payment_method":"pix","pix":{"copy_paste":"CODIGO_PIX_RETORNADO_PELA_API","expires_at":"2026-10-18T13:00:00.000Z"},"payer":null}}}}},"401":{"description":"Missing, invalid or revoked credential.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_exemplo"}}}}},"403":{"description":"Scope, IP, user access or account authorization denied.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"API scope not allowed.","request_id":"req_exemplo"}}}}},"404":{"description":"Resource not found or owned by another account.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Transaction not found.","request_id":"req_exemplo"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal error.","request_id":"req_exemplo"}}}}}}}},"/withdrawals":{"post":{"summary":"Create PIX payout","description":"Requests a Pix payout. Available balance must cover amount + fee. Store data.id and track GET /withdrawals/{id} or withdrawal.status_changed until completed or cancelled. After a timeout, check the request and keep the same Idempotency-Key and JSON body when resending. Beneficiary bank details become available after confirmation.","operationId":"post_withdrawals","tags":["Saques"],"x-required-scopes":["withdrawals:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Request key with 8 to 120 characters. For compatibility across creation endpoints, use visible ASCII without spaces. Store the key before sending; on retry preserve the same key, endpoint, business and JSON body. Do not reuse it for a different request. Same resource ID, without a new movement; use GET to reconcile status.","schema":{"type":"string","minLength":8,"maxLength":120}}],"responses":{"200":{"description":"Idempotent replay of the same resource and ID, without a new movement. The representation may reflect its current state.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Withdrawal"},"idempotent_replay":{"type":"boolean","description":"True when this key identifies a previously received request; does not represent a new creation. Does not confirm financial settlement."}},"required":["data","idempotent_replay"]},"example":{"data":{"id":"wdr_exemplo_1044","amount":10000,"fee":500,"status":"processing","pix_key":"destino@example.com","pix_key_type":"email","created_at":"2026-10-18T12:10:00.000Z","beneficiary":null,"paid_at":null,"end_to_end_id":null},"idempotent_replay":true}}}},"201":{"description":"Request accepted and balance reserved. Query data.id to track the transfer.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Withdrawal"},"idempotent_replay":{"type":"boolean","description":"True when this key identifies a previously received request; does not represent a new creation. Does not confirm financial settlement."}},"required":["data","idempotent_replay"]},"example":{"data":{"id":"wdr_exemplo_1044","amount":10000,"fee":500,"status":"processing","pix_key":"destino@example.com","pix_key_type":"email","created_at":"2026-10-18T12:10:00.000Z","beneficiary":null,"paid_at":null,"end_to_end_id":null},"idempotent_replay":false}}}},"400":{"description":"Invalid request or JSON.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Invalid JSON.","request_id":"req_exemplo"}}}}},"401":{"description":"Missing, invalid or revoked credential.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_exemplo"}}}}},"403":{"description":"Scope, IP, user access or account authorization denied.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"API scope not allowed.","request_id":"req_exemplo"}}}}},"409":{"description":"Idempotency conflict or insufficient balance.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"idempotency_conflict","message":"Idempotency key mismatch.","request_id":"req_exemplo"}}}}},"413":{"description":"The request body exceeds 65,536 bytes.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"payload_too_large","message":"Request body is too large.","request_id":"req_exemplo"}}}}},"415":{"description":"Unsupported content type.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unsupported_media_type","message":"Use Content-Type: application/json.","request_id":"req_exemplo"}}}}},"422":{"description":"Invalid field, filter, limit or idempotency key.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"validation_error","message":"Invalid Idempotency-Key.","request_id":"req_exemplo"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal error.","request_id":"req_exemplo"}}}}},"502":{"description":"Unconfirmed result. Query the ID when known and preserve the same key and JSON body if resending.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_provider_response","message":"Payment unconfirmed. Check status.","request_id":"req_example_20261111"}}}}},"503":{"description":"Service unavailable, temporary capacity pressure or an unconfirmed result. Respect Retry-After when supplied. An uncertain result does not authorize a new request with a different key.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Minimum wait in seconds before retrying when supplied. Preserve the key and JSON body when retrying a POST."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"payments_unavailable","message":"Payments unavailable.","request_id":"req_exemplo"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWithdrawal"},"example":{"amount":10000,"pix_key":"destino@example.com","pix_key_type":"email"}}}}},"get":{"summary":"List payouts","description":"Lists payouts for this account. Use limit and offset for pagination and filters to select the period or status. Continue while pagination.has_more is true.","operationId":"get_withdrawals","tags":["Saques"],"x-required-scopes":["withdrawals:read"],"parameters":[{"name":"limit","in":"query","required":false,"description":"Items per page.","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},{"name":"offset","in":"query","required":false,"description":"Records to skip. Next page: offset + limit.","schema":{"type":"integer","minimum":0,"default":0}},{"name":"status","in":"query","required":false,"description":"Public resource status.","schema":{"type":"string","enum":["processing","completed","cancelled"]}},{"name":"search","in":"query","required":false,"description":"Partial search by payout ID, Pix key or confirmed beneficiary name. Does not search E2E, return identifiers or Idempotency-Key.","schema":{"type":"string","maxLength":160}},{"name":"from","in":"query","required":false,"description":"Created at or after this instant (inclusive). ISO 8601 with timezone, or YYYY-MM-DD in UTC.","schema":{"type":"string","description":""}},{"name":"to","in":"query","required":false,"description":"Created before this instant (exclusive). Must be later than from.","schema":{"type":"string","description":""}}],"responses":{"200":{"description":"Query completed.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Withdrawal"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"example":{"data":[{"id":"wdr_exemplo_1044","amount":10000,"fee":500,"status":"processing","pix_key":"destino@example.com","pix_key_type":"email","created_at":"2026-10-18T12:10:00.000Z","beneficiary":null,"paid_at":null,"end_to_end_id":null}],"pagination":{"limit":100,"offset":0,"total":1,"has_more":false}}}}},"401":{"description":"Missing, invalid or revoked credential.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_exemplo"}}}}},"403":{"description":"Scope, IP, user access or account authorization denied.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"API scope not allowed.","request_id":"req_exemplo"}}}}},"422":{"description":"Invalid field, filter, limit or idempotency key.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"validation_error","message":"Use limit 1-100 and integer offset >= 0.","request_id":"req_exemplo"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal error.","request_id":"req_exemplo"}}}}}}}},"/withdrawals/{id}":{"get":{"summary":"Get payout","description":"Looks up a payout by ID. completed confirms the transfer. Beneficiary bank details appear when available in the confirmation. Use GET /requests to find a request without its ID. For an identified and confirmed bank return, refund.type is partial or full. refund.amount is the cumulative amount credited back in BRL cents, excluding the fee. For a BRL 100.00 payout, refund.amount=3000 means BRL 30.00 was returned. Apply only the increase over the prior total and deduplicate notifications by event ID. If refund is absent, return details are unavailable.","operationId":"get_withdrawals_id","tags":["Saques"],"x-required-scopes":["withdrawals:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque resource ID returned by the API. Use the corresponding payment or payout ID; do not substitute an E2E, Idempotency-Key, external reference or event ID.","schema":{"type":"string","description":""}}],"responses":{"200":{"description":"Query completed.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Withdrawal"}},"required":["data"]},"example":{"data":{"id":"wdr_exemplo_1044","amount":10000,"fee":500,"status":"processing","pix_key":"destino@example.com","pix_key_type":"email","created_at":"2026-10-18T12:10:00.000Z","beneficiary":null,"paid_at":null,"end_to_end_id":null}}}}},"401":{"description":"Missing, invalid or revoked credential.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_exemplo"}}}}},"403":{"description":"Scope, IP, user access or account authorization denied.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"API scope not allowed.","request_id":"req_exemplo"}}}}},"404":{"description":"Resource not found or owned by another account.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Payout not found.","request_id":"req_exemplo"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal error.","request_id":"req_exemplo"}}}}}}}},"/balance":{"get":{"summary":"Get balance","description":"Returns available balance in available and reserved amounts in reserved, with their reasons. available already accounts for reservations: do not subtract reserved again. If reserved is null, reservation details are temporarily unavailable; check again later. med_reserved is the MED portion of reserved. med_reserve_pending is the outstanding net reserve for open disputes. Future credits on this account cover the gap. Do not subtract these fields from available. Amounts are in cents, or null if unavailable.","operationId":"get_balance","tags":["Saldo"],"x-required-scopes":["balance:read"],"parameters":[],"responses":{"200":{"description":"Query completed. In this example, the wallet has BRL 1,010.00 after a separate BRL 250.00 MED reserve. With a 1% fee, the maximum payout is BRL 1,000.00. Amounts in the JSON are in cents.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Balance"}},"required":["data"]},"example":{"data":{"available":101000,"reserved":25000,"withdrawable_now":100000,"currency":"BRL","simulation":false,"reservations":[{"id":"rsv_example","amount":25000,"reason":"pix_funds_under_review","status":"reserved"}],"reservation_state":"verified","reservation_source":"internal_ledger","as_of":"2026-11-17T15:00:00.000Z","med_reserved":25000,"med_reserve_pending":0}}}}},"401":{"description":"Missing, invalid or revoked credential.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_exemplo"}}}}},"403":{"description":"Scope, IP, user access or account authorization denied.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"API scope not allowed.","request_id":"req_exemplo"}}}}},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal error.","request_id":"req_exemplo"}}}}}}}},"/transactions/{id}/refund":{"post":{"tags":["Reembolsos"],"summary":"Refund PIX payment","description":"Requests a full refund to the original payer. Requires transactions:refund, refunds enabled and an IP allowed by both the key and the account. Send only the optional reason. Balance must cover the original net credit. Query GET on this path until refunded or rejected. After a timeout, keep the original key and JSON body.","operationId":"post_transactions_id_refund","x-required-scopes":["transactions:refund"],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque resource ID returned by the API. Use the corresponding payment or payout ID; do not substitute an E2E, Idempotency-Key, external reference or event ID.","schema":{"type":"string","description":""}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Request key with 8 to 120 characters. For compatibility across creation endpoints, use visible ASCII without spaces. Store the key before sending; on retry preserve the same key, endpoint, business and JSON body. Do not reuse it for a different request. Same resource ID, without a new movement; use GET to reconcile status.","schema":{"type":"string","minLength":8,"maxLength":120,"pattern":"^[\\x21-\\x7e]{8,120}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"reason":{"type":"string","maxLength":200,"description":"Optional reason without control characters. General limit: 200 characters; the effective limit may be 140 depending on the payment. Use up to 140 characters for compatibility.","pattern":"^[^\\u0000-\\u001f]*$"}}},"example":{"reason":"Buyer cancellation"}}}},"responses":{"200":{"description":"Idempotent replay with an existing result; same request, without a new refund. A processing request returns 202 instead.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Refund"},"idempotent_replay":{"type":"boolean","description":"True when this key identifies a previously received request; does not represent a new creation. Does not confirm financial settlement."}},"required":["data","idempotent_replay"]},"example":{"data":{"id":"rfd_exemplo","transaction_id":"pix_exemplo_1043","status":"refunded","amount":1000,"balance_debit":820,"fee_returned":180,"retained_fee":0,"currency":"BRL","reason":"Buyer cancellation","created_at":"2026-10-22T18:00:00.000Z","updated_at":"2026-10-22T18:00:01.000Z","completed_at":"2026-10-22T18:00:01.000Z"},"idempotent_replay":true}}},"headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}}},"201":{"description":"Request recorded. Check data.status: rejected indicates confirmed refusal and release of the reservation.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Refund"},"idempotent_replay":{"type":"boolean","description":"True when this key identifies a previously received request; does not represent a new creation. Does not confirm financial settlement."}},"required":["data","idempotent_replay"]},"example":{"data":{"id":"rfd_exemplo","transaction_id":"pix_exemplo_1043","status":"refunded","amount":1000,"balance_debit":820,"fee_returned":180,"retained_fee":0,"currency":"BRL","reason":"Buyer cancellation","created_at":"2026-10-22T18:00:00.000Z","updated_at":"2026-10-22T18:00:01.000Z","completed_at":"2026-10-22T18:00:01.000Z"},"idempotent_replay":false}}},"headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}}},"202":{"description":"Refund processing, including on idempotent replay. The reservation is retained until confirmation. Query the same request and preserve the original key.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Refund"},"idempotent_replay":{"type":"boolean","description":"True when this key identifies a previously received request; does not represent a new creation. Does not confirm financial settlement."}},"required":["data","idempotent_replay"]},"example":{"data":{"id":"rfd_exemplo","transaction_id":"pix_exemplo_1043","status":"processing","amount":1000,"balance_debit":820,"fee_returned":180,"retained_fee":0,"currency":"BRL","reason":"Buyer cancellation","created_at":"2026-10-22T18:00:00.000Z","updated_at":"2026-10-22T18:00:01.000Z","completed_at":null},"idempotent_replay":false}}},"headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}}},"400":{"description":"Invalid request or JSON.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Invalid JSON.","request_id":"req_exemplo"}}}}},"401":{"description":"Missing, invalid or revoked credential.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_exemplo"}}}}},"403":{"description":"Refund not enabled, missing scope, unauthorized IP or suspended access.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"refund_not_enabled","message":"Refunds not enabled.","request_id":"req_exemplo"}}}}},"404":{"description":"Resource not found or owned by another account.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Transaction not found.","request_id":"req_exemplo"}}}}},"409":{"description":"Ineligible payment, insufficient balance, existing refund or idempotency conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"refund_already_requested","message":"Refund exists. Check status.","request_id":"req_exemplo"}}}},"headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}}},"413":{"description":"The request body exceeds 65,536 bytes.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"payload_too_large","message":"Request body is too large.","request_id":"req_exemplo"}}}}},"415":{"description":"Unsupported content type.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unsupported_media_type","message":"Use Content-Type: application/json.","request_id":"req_exemplo"}}}}},"422":{"description":"Invalid body or idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_refund_request","message":"Invalid refund request.","request_id":"req_exemplo"}}}},"headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}}},"429":{"description":"Request limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_exemplo"}}}},"headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."},"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Minimum wait in seconds before retrying when supplied. Preserve the key and JSON body when retrying a POST."}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal error.","request_id":"req_exemplo"}}}}}}},"get":{"tags":["Reembolsos"],"summary":"Get refund","description":"Looks up a payment refund. Returns data:null when no refund has been requested. Requires transactions:read. If the status is processing, wait and check again.","operationId":"get_transactions_id_refund","x-required-scopes":["transactions:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Opaque resource ID returned by the API. Use the corresponding payment or payout ID; do not substitute an E2E, Idempotency-Key, external reference or event ID.","schema":{"type":"string","description":""}}],"responses":{"200":{"description":"Current payment refund, or data:null when no request exists.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/Refund"},{"type":"null"}]}},"required":["data"]},"example":{"data":{"id":"rfd_exemplo","transaction_id":"pix_exemplo_1043","status":"refunded","amount":1000,"balance_debit":820,"fee_returned":180,"retained_fee":0,"currency":"BRL","reason":"Buyer cancellation","created_at":"2026-10-22T18:00:00.000Z","updated_at":"2026-10-22T18:00:01.000Z","completed_at":"2026-10-22T18:00:01.000Z"}}}},"headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}}},"401":{"description":"Missing, invalid or revoked credential.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_exemplo"}}}}},"403":{"description":"Scope, IP, user access or account authorization denied.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"API scope not allowed.","request_id":"req_exemplo"}}}}},"404":{"description":"Resource not found or owned by another account.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Transaction not found.","request_id":"req_exemplo"}}}}},"409":{"description":"The refund result needs verification. Contact support with request_id.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"refund_reconciliation_required","message":"Refund requires review. Contact support.","request_id":"req_example_20261111"}}}}},"422":{"description":"Invalid identifier or refund result unavailable. Check error.code.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"validation_error","message":"Invalid request data.","request_id":"req_example_20261111"}}}}},"429":{"description":"Request limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_exemplo"}}}},"headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."},"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Minimum wait in seconds before retrying when supplied. Preserve the key and JSON body when retrying a POST."}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal error.","request_id":"req_exemplo"}}}}},"502":{"description":"The result could not be confirmed. Keep the identifiers and query the existing request.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_provider_response","message":"Payment unconfirmed. Check status.","request_id":"req_example_20261111"}}}}},"503":{"description":"Query temporarily unavailable or result still unconfirmed. Do not create another refund to replace this request.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."},"X-RateLimit-Limit":{"schema":{"type":"integer","minimum":1},"description":"Per-IP limit for this endpoint in its window; not a general TPS allowance."},"X-RateLimit-Remaining":{"schema":{"type":"integer","minimum":0},"description":"Remaining requests in this endpoint counter."},"X-RateLimit-Reset":{"schema":{"type":"integer","minimum":0},"description":"Unix time in seconds when this counter resets."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"payment_processing","message":"Payment unconfirmed. Check status.","request_id":"req_example_20261111"}}}}}}}},"/account":{"get":{"summary":"My account","description":"Returns the account identity, limits, enabled functions and permissions of the credential being used. observed_ip shows the request origin IP address.","operationId":"get_account","tags":["Operação"],"x-required-scopes":["balance:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MerchantAccount"}},"required":["data"]},"example":{"data":{"id":"acc_11111111111111111111111111111111","name":"Minha operação","number":1,"status":"approved","api_enabled":true,"capabilities":{"pix_in":{"enabled":true,"reason":null},"pix_out":{"enabled":true,"reason":null},"source":"platform_configuration","controls_updated_at":"2026-11-17T15:00:00.000Z"},"limits":{"pix_in":{"minimum":500,"maximum":500000},"pix_out":{"minimum":100,"maximum":1000000},"currency":"BRL","unit":"centavos"},"credential":{"id":"key_66666666666666666666666666666666","name":"Produção","scopes":["balance:read","transactions:read","withdrawals:read"],"observed_ip":"203.0.113.10","origin_restricted":true},"as_of":"2026-11-17T15:00:00.000Z"}}}}},"401":{"description":"Invalid API credentials.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_99999999999999999999999999999999"}}}}},"403":{"description":"Required permission is missing from this API credential.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"scope_not_allowed","message":"Required permission is missing from this API credential.","request_id":"req_99999999999999999999999999999999"}}}}},"404":{"description":"Resource not found.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Resource not found.","request_id":"req_99999999999999999999999999999999"}}}}},"405":{"description":"Method not allowed.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_not_allowed","message":"Method not allowed.","request_id":"req_99999999999999999999999999999999"}}}}},"422":{"description":"Invalid or repeated query parameters.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_filters","message":"Invalid or repeated query parameters.","request_id":"req_99999999999999999999999999999999"}}}}},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"Service unavailable.","request_id":"req_99999999999999999999999999999999"}}}}}}}},"/fees":{"get":{"summary":"Get my fees","description":"Returns current account fees, including percentages, fixed amounts, tiers and applicable conditions. Percentages use basis points: 100 bps = 1%. Fixed amounts are in cents. Use the payout quote to check the estimated fee for an amount.","operationId":"get_fees","tags":["Operação"],"x-required-scopes":["balance:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MerchantFees"}},"required":["data"]},"example":{"data":{"account_id":"acc_11111111111111111111111111111111","currency":"BRL","amount_unit":"centavos","percentage_unit":"basis_points","pix_in":{"percentage_bps":200,"fixed":0,"rounding":"nearest_cent"},"pix_out":{"percentage_bps":100,"fixed":0,"rounding":"nearest_cent","tiers":null},"conditions":{"payer_cnpj_exceptions":false,"recipient_cnpj_exceptions":true,"payout_cnpj_exceptions_enabled":true},"limits":{"pix_in":{"minimum":500,"maximum":500000},"pix_out":{"minimum":100,"maximum":1000000},"currency":"BRL","unit":"centavos"},"as_of":"2026-11-17T15:00:00.000Z"}}}}},"401":{"description":"Invalid API credentials.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_99999999999999999999999999999999"}}}}},"403":{"description":"Required permission is missing from this API credential.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"scope_not_allowed","message":"Required permission is missing from this API credential.","request_id":"req_99999999999999999999999999999999"}}}}},"404":{"description":"Resource not found.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Resource not found.","request_id":"req_99999999999999999999999999999999"}}}}},"405":{"description":"Method not allowed.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_not_allowed","message":"Method not allowed.","request_id":"req_99999999999999999999999999999999"}}}}},"422":{"description":"Invalid or repeated query parameters.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_filters","message":"Invalid or repeated query parameters.","request_id":"req_99999999999999999999999999999999"}}}}},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"Service unavailable.","request_id":"req_99999999999999999999999999999999"}}}}}}}},"/withdrawals/quote":{"post":{"summary":"Quote a payout","description":"Calculates the estimated payout fee and total debit. Send amount, pix_key and pix_key_type. The fee is recalculated when the payout is requested and may be adjusted based on confirmed beneficiary details. To request the payout, use POST /withdrawals with withdrawals:write and sufficient balance.","operationId":"quote_withdrawal","tags":["Operação"],"x-required-scopes":["withdrawals:read"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WithdrawalQuote"}},"required":["data"]},"example":{"data":{"account_id":"acc_11111111111111111111111111111111","amount":1000,"fee":10,"total_debit":1010,"recipient_amount":1000,"currency":"BRL","amount_unit":"centavos","fee_condition":null,"recipient_document_pending":true,"indicative":true,"unavailable_reason":null,"as_of":"2026-11-17T15:00:00.000Z","configuration_ready":true}}}}},"401":{"description":"Invalid API credentials.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_99999999999999999999999999999999"}}}}},"403":{"description":"Required permission is missing from this API credential.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"scope_not_allowed","message":"Required permission is missing from this API credential.","request_id":"req_99999999999999999999999999999999"}}}}},"404":{"description":"Resource not found.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Resource not found.","request_id":"req_99999999999999999999999999999999"}}}}},"405":{"description":"Method not allowed.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_not_allowed","message":"Method not allowed.","request_id":"req_99999999999999999999999999999999"}}}}},"422":{"description":"Send a valid amount, pix_key and pix_key_type.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_quote","message":"Send a valid amount, pix_key and pix_key_type.","request_id":"req_99999999999999999999999999999999"}}}}},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"Service unavailable.","request_id":"req_99999999999999999999999999999999"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"amount":{"type":"integer","format":"int64","description":"Payout principal in integer BRL cents. Available balance must cover amount + fee. Subject to the business effective limits.","minimum":1000},"pix_key":{"type":"string","description":"Destination key in the format specified by pix_key_type.","minLength":1,"maxLength":140},"pix_key_type":{"type":"string","description":"cpf_cnpj: 11/14 digits; email: email address; phone: + and country code, 10–15 digits; random: UUID.","enum":["cpf_cnpj","email","phone","random"]}},"required":["amount","pix_key","pix_key_type"]},"example":{"amount":1000,"pix_key":"recipient@example.com","pix_key_type":"email"}}}}}},"/requests":{"get":{"summary":"Find a request by idempotency key","description":"Finds a request using its original Idempotency-Key. Use type=transaction with transactions:read or type=withdrawal with withdrawals:read. accepted means the request was created; check resource.status to confirm the payment or payout. If resource is null or the state is verification_pending, wait and check again. When resending creation, keep the original key and JSON body.","operationId":"lookup_request","tags":["Operação"],"x-required-scopes":[],"parameters":[{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["transaction","withdrawal"]}},{"name":"idempotency_key","in":"query","required":true,"schema":{"type":"string","minLength":8,"maxLength":120}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RequestLookup"}},"required":["data"]},"example":{"data":{"type":"transaction","idempotency_key":"order-20261117-001","request_state":"accepted","resource":{"id":"pix_22222222222222222222222222222222","status":"paid","amount":1000,"fee":20},"created_at":"2026-11-17T15:00:00.000Z","updated_at":"2026-11-17T15:00:00.000Z","as_of":"2026-11-17T15:00:00.000Z"}}}}},"401":{"description":"Invalid API credentials.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_99999999999999999999999999999999"}}}}},"403":{"description":"Required permission is missing from this API credential.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"scope_not_allowed","message":"Required permission is missing from this API credential.","request_id":"req_99999999999999999999999999999999"}}}}},"404":{"description":"No request registered with this key for this account.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"request_not_found","message":"No request registered with this key for this account.","request_id":"req_99999999999999999999999999999999"}}}}},"405":{"description":"Method not allowed.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_not_allowed","message":"Method not allowed.","request_id":"req_99999999999999999999999999999999"}}}}},"422":{"description":"Invalid or repeated query parameters.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_filters","message":"Invalid or repeated query parameters.","request_id":"req_99999999999999999999999999999999"}}}}},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"Service unavailable.","request_id":"req_99999999999999999999999999999999"}}}}}},"x-required-scopes-by-type":{"transaction":"transactions:read","withdrawal":"withdrawals:read"}}},"/webhooks/deliveries":{"get":{"summary":"List webhook deliveries","description":"Lists webhook deliveries for this account. Use filters and next_cursor to continue, keeping the same filters. Cursors are valid for 15 minutes. Continue while has_more is true, including after an empty page. Delivery statuses may change during the search.","operationId":"list_webhook_deliveries","tags":["Webhooks"],"x-required-scopes":["webhooks:read"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2048}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["delivered","failed","retrying","pending","archived"]}},{"name":"event_type","in":"query","required":false,"schema":{"type":"string","enum":["transaction.created","transaction.status_changed","withdrawal.created","withdrawal.status_changed","endpoint.test"]}},{"name":"resource_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantDeliveryPage"},"example":{"data":[{"id":"dlv_44444444444444444444444444444444","event_id":"evt_77777777777777777777777777777777","event_type":"transaction.status_changed","resource_id":"pix_22222222222222222222222222222222","status":"failed","attempts":3,"response_code":500,"created_at":"2026-11-17T15:00:00.000Z","endpoint_url":"https://merchant.example/webhook","replay_of":null,"public_error":"endpoint_rejected","next_attempt_at":null}],"page":{"limit":25,"has_more":false,"next_cursor":null,"snapshot_at":"2026-11-17T15:00:00.000Z"},"as_of":"2026-11-17T15:00:00.000Z"}}}},"401":{"description":"Invalid API credentials.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_99999999999999999999999999999999"}}}}},"403":{"description":"Required permission is missing from this API credential.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"scope_not_allowed","message":"Required permission is missing from this API credential.","request_id":"req_99999999999999999999999999999999"}}}}},"404":{"description":"Resource not found.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Resource not found.","request_id":"req_99999999999999999999999999999999"}}}}},"405":{"description":"Method not allowed.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_not_allowed","message":"Method not allowed.","request_id":"req_99999999999999999999999999999999"}}}}},"422":{"description":"Invalid or repeated query parameters.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_filters","message":"Invalid or repeated query parameters.","request_id":"req_99999999999999999999999999999999"}}}}},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"Service unavailable.","request_id":"req_99999999999999999999999999999999"}}}}}}}},"/webhooks/deliveries/{id}":{"get":{"summary":"Get webhook delivery","description":"Returns the event, related resource, HTTP result and delivery attempts. history includes up to 20 recent attempts; history_truncated indicates more history. Check endpoint_url and public_error for the destination and outcome.","operationId":"get_webhook_delivery","tags":["Webhooks"],"x-required-scopes":["webhooks:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MerchantDeliveryDetail"}},"required":["data"]},"example":{"data":{"id":"dlv_44444444444444444444444444444444","event_id":"evt_77777777777777777777777777777777","event_type":"transaction.status_changed","resource_id":"pix_22222222222222222222222222222222","status":"failed","attempts":3,"response_code":500,"created_at":"2026-11-17T15:00:00.000Z","endpoint_url":"https://merchant.example/webhook","replay_of":null,"public_error":"endpoint_rejected","next_attempt_at":null}}}}},"401":{"description":"Invalid API credentials.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_99999999999999999999999999999999"}}}}},"403":{"description":"Required permission is missing from this API credential.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"scope_not_allowed","message":"Required permission is missing from this API credential.","request_id":"req_99999999999999999999999999999999"}}}}},"404":{"description":"Resource not found.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Resource not found.","request_id":"req_99999999999999999999999999999999"}}}}},"405":{"description":"Method not allowed.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_not_allowed","message":"Method not allowed.","request_id":"req_99999999999999999999999999999999"}}}}},"422":{"description":"Invalid or repeated query parameters.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_filters","message":"Invalid or repeated query parameters.","request_id":"req_99999999999999999999999999999999"}}}}},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"Service unavailable.","request_id":"req_99999999999999999999999999999999"}}}}}}}},"/webhooks/deliveries/{id}/retry":{"post":{"summary":"Retry webhook delivery","description":"Requests another delivery of the same event notification. Requires webhooks:retry and Idempotency-Key. Use {} for a failed delivery or force:true for one already delivered. The endpoint must be active with no delivery in progress for the same event. Wait at least 30 seconds between replays; the limit is 6 requests per minute per credential. The receiver must deduplicate by event.id. For webhook_legacy_format, query the resource and contact support about replay.","operationId":"retry_webhook_delivery","tags":["Webhooks"],"x-required-scopes":["webhooks:retry"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"8–120 printable ASCII characters. Preserve this key and the same body when retrying.","schema":{"type":"string","minLength":8,"maxLength":120}}],"responses":{"200":{"description":"Replay of the same notification retry request; idempotent_replay=true.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RetryDelivery"}},"required":["data"]},"example":{"data":{"id":"dlv_88888888888888888888888888888888","queued":true}}}}},"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RetryDelivery"}},"required":["data"]},"example":{"data":{"id":"dlv_88888888888888888888888888888888","queued":true}}}}},"401":{"description":"Invalid API credentials.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_99999999999999999999999999999999"}}}}},"403":{"description":"Required permission is missing from this API credential.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"scope_not_allowed","message":"Required permission is missing from this API credential.","request_id":"req_99999999999999999999999999999999"}}}}},"404":{"description":"Resource not found.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Resource not found.","request_id":"req_99999999999999999999999999999999"}}}}},"405":{"description":"Method not allowed.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_not_allowed","message":"Method not allowed.","request_id":"req_99999999999999999999999999999999"}}}}},"409":{"description":"A delivery is already in progress for this event and endpoint.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"webhook_in_progress","message":"A delivery is already in progress for this event and endpoint.","request_id":"req_99999999999999999999999999999999"}}}}},"422":{"description":"Invalid or repeated query parameters.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_filters","message":"Invalid or repeated query parameters.","request_id":"req_99999999999999999999999999999999"}}}}},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"service_unavailable","message":"Service unavailable.","request_id":"req_99999999999999999999999999999999"}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"force":{"type":"boolean","default":false}}},"example":{}}}}}},"/transactions/{id}/receipt.pdf":{"get":{"summary":"Download receipt","description":"Downloads a PDF receipt for a payment request with paid status. Use language=pt or language=en to choose the language. Query the payment by ID for subsequent updates.","operationId":"receipt_transactions","tags":["Comprovantes"],"x-required-scopes":["transactions:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"language","in":"query","required":false,"schema":{"type":"string","enum":["en","pt"],"default":"en"}}],"responses":{"200":{"description":"PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Invalid API credentials.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_99999999999999999999999999999999"}}}}},"403":{"description":"Access denied.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"Access denied.","request_id":"req_99999999999999999999999999999999"}}}}},"404":{"description":"Resource not found.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Resource not found.","request_id":"req_99999999999999999999999999999999"}}}}},"409":{"description":"Receipt unavailable.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"receipt_not_available","message":"Receipt unavailable.","request_id":"req_99999999999999999999999999999999"}}}}},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/withdrawals/{id}/receipt.pdf":{"get":{"summary":"Download receipt","description":"Downloads a PDF receipt for a payout with completed status. Use language=pt or language=en to choose the language. Query the payout by ID for subsequent updates.","operationId":"receipt_withdrawals","tags":["Comprovantes"],"x-required-scopes":["withdrawals:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"language","in":"query","required":false,"schema":{"type":"string","enum":["en","pt"],"default":"en"}}],"responses":{"200":{"description":"PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Invalid API credentials.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_99999999999999999999999999999999"}}}}},"403":{"description":"Access denied.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"Access denied.","request_id":"req_99999999999999999999999999999999"}}}}},"404":{"description":"Resource not found.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Resource not found.","request_id":"req_99999999999999999999999999999999"}}}}},"409":{"description":"Receipt unavailable.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"receipt_not_available","message":"Receipt unavailable.","request_id":"req_99999999999999999999999999999999"}}}}},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/meds":{"get":{"summary":"List Pix disputes (MED)","description":"Lists Pix disputes for the authenticated operation. Amounts are in BRL cents. open, disputed and reserved cover all open cases. matched counts cases in the selected status. released means funds were released; returned means funds were returned to the payer. An empty operation returns items: []. Cases may include reason (a report, not a finding of fraud), dispute_id, end_to_end_id, reported_by, opened_at, closed_at, disputed_amount (gross disputed) and returned_amount. Missing or null fields mean unavailable information. An open case may have zero reserved. For returned cases, recovered_amount includes funds already reserved and applied. recovery_pending is the remaining net amount to cover from future credits on this account. Null means the amount is awaiting confirmation.","operationId":"list_med_cases","tags":["Saldo"],"x-required-scopes":["transactions:read"],"parameters":[{"in":"query","name":"status","required":false,"schema":{"type":"string","enum":["open","released","returned"]}},{"in":"query","name":"page","required":false,"schema":{"type":"integer","minimum":1,"maximum":9999999,"default":1}}],"responses":{"200":{"description":"Query completed.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"account_id":{"type":"string"},"currency":{"type":"string","enum":["BRL"]},"page":{"type":"integer","minimum":0},"page_size":{"type":"integer","minimum":0},"cases":{"type":"integer","minimum":0},"matched":{"type":"integer","minimum":0},"open":{"type":"integer","minimum":0},"disputed":{"type":"integer","minimum":0},"reserved":{"type":"integer","minimum":0},"items":{"type":"array","items":{"type":"object","properties":{"transaction_id":{"type":"string"},"status":{"type":"string","enum":["open","released","returned"]},"gross":{"type":"integer","minimum":0},"net":{"type":"integer","minimum":0},"reserved":{"type":"integer","minimum":0},"paid_at":{"type":["string","null"]},"reason":{"type":["string","null"]},"dispute_id":{"type":["string","null"]},"end_to_end_id":{"type":["string","null"]},"reported_by":{"type":["string","null"],"enum":["payer_bank","receiver_bank",null]},"opened_at":{"type":["string","null"]},"closed_at":{"type":["string","null"]},"disputed_amount":{"type":["integer","null"]},"returned_amount":{"type":["integer","null"]},"recovered_amount":{"type":["integer","null"],"minimum":0},"recovery_pending":{"type":["integer","null"],"minimum":0}},"required":["transaction_id","status","gross","net","reserved","paid_at"]}}},"required":["account_id","currency","page","page_size","cases","matched","open","disputed","reserved","items"]}},"required":["data"]},"example":{"data":{"account_id":"acc_example","currency":"BRL","page":1,"page_size":15,"cases":0,"matched":0,"open":0,"disputed":0,"reserved":0,"items":[]}}}}},"401":{"description":"Missing, invalid or revoked credential.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_credentials","message":"Invalid API credentials.","request_id":"req_exemplo"}}}}},"403":{"description":"Scope, IP, user access or account authorization denied.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"access_denied","message":"API scope not allowed.","request_id":"req_exemplo"}}}}},"422":{"description":"Invalid filters."},"429":{"description":"Too many requests.","headers":{"X-Request-ID":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests.","request_id":"req_99999999999999999999999999999999"}}}}},"500":{"description":"The request could not be completed. Keep the request ID for support. When resending a POST, preserve the original key and JSON body.","headers":{"X-Request-ID":{"schema":{"type":"string","description":""},"description":"Unique request identifier."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"Internal error.","request_id":"req_exemplo"}}}}}}}}},"webhooks":{"transaction.created":{"post":{"summary":"transaction.created","description":"Payment request created; does not confirm payment.","security":[],"parameters":[{"name":"X-leigan-Event-Id","in":"header","required":true,"description":"Same value as id in the JSON body.","schema":{"type":"string","description":""}},{"name":"X-leigan-Signature","in":"header","required":true,"description":"t=timestamp,v1=hmac_sha256_hex. HMAC-SHA256 with the endpoint secret over timestamp + dot + original body bytes. The timestamp changes for each attempt. Verify the signature, clock and 300-second tolerance before processing.","schema":{"type":"string","description":""}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventTransactionCreated"},"example":{"id":"evt_exemplo_transaction_created","type":"transaction.created","created_at":"2026-10-18T12:05:00.000Z","data":{"id":"pix_exemplo_1043","amount":10000,"fee":900,"net":9100,"status":"pending","buyer_name":"Cliente Exemplo","buyer_email":"cliente@example.com","reference":"pedido-1043","created_at":"2026-10-18T12:00:00.000Z","paid_at":null,"origin":"api","buyer_document":"***4725","buyer_phone":"***9999","end_to_end_id":null,"payment_method":"pix","pix":{"copy_paste":"CODIGO_PIX_RETORNADO_PELA_API","expires_at":"2026-10-18T13:00:00.000Z"},"payer":null}}}}},"responses":{"204":{"description":"Event received and persisted by your endpoint. Any 2xx response acknowledges delivery."}}}},"transaction.status_changed":{"post":{"summary":"transaction.status_changed","description":"Payment status changed. Inspect status to identify payment, expiration or refund.","security":[],"parameters":[{"name":"X-leigan-Event-Id","in":"header","required":true,"description":"Same value as id in the JSON body.","schema":{"type":"string","description":""}},{"name":"X-leigan-Signature","in":"header","required":true,"description":"t=timestamp,v1=hmac_sha256_hex. HMAC-SHA256 with the endpoint secret over timestamp + dot + original body bytes. The timestamp changes for each attempt. Verify the signature, clock and 300-second tolerance before processing.","schema":{"type":"string","description":""}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventTransactionStatusChanged"},"example":{"id":"evt_exemplo_transaction_status_changed","type":"transaction.status_changed","created_at":"2026-10-18T12:05:00.000Z","data":{"id":"pix_exemplo_1043","amount":10000,"fee":900,"net":9100,"status":"paid","buyer_name":"Pagador Confirmado","buyer_email":null,"reference":"pedido-1043","created_at":"2026-10-18T12:00:00.000Z","paid_at":"2026-10-18T12:05:00.000Z","origin":"api","buyer_document":"52998224725","buyer_phone":null,"end_to_end_id":null,"payment_method":"pix","pix":null,"payer":{"name":"Pagador Confirmado","document":"52998224725","ispb":"00000001","branch":"0001","account":"123456","account_type":"TRAN"},"order_buyer":{"name":"Cliente Exemplo","email":"cliente@example.com","document":"***4725","phone":"***9999"}}}}}},"responses":{"204":{"description":"Event received and persisted by your endpoint. Any 2xx response acknowledges delivery."}}}},"withdrawal.created":{"post":{"summary":"withdrawal.created","description":"Payout request received; not yet completed.","security":[],"parameters":[{"name":"X-leigan-Event-Id","in":"header","required":true,"description":"Same value as id in the JSON body.","schema":{"type":"string","description":""}},{"name":"X-leigan-Signature","in":"header","required":true,"description":"t=timestamp,v1=hmac_sha256_hex. HMAC-SHA256 with the endpoint secret over timestamp + dot + original body bytes. The timestamp changes for each attempt. Verify the signature, clock and 300-second tolerance before processing.","schema":{"type":"string","description":""}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventWithdrawalCreated"},"example":{"id":"evt_exemplo_withdrawal_created","type":"withdrawal.created","created_at":"2026-10-18T12:10:00Z","data":{"id":"wdr_exemplo_1044","amount":10000,"fee":500,"status":"processing","pix_key":"destino@example.com","pix_key_type":"email","created_at":"2026-10-18T12:10:00.000Z","beneficiary":null,"paid_at":null,"end_to_end_id":null}}}}},"responses":{"204":{"description":"Event received and persisted by your endpoint. Any 2xx response acknowledges delivery."}}}},"withdrawal.status_changed":{"post":{"summary":"withdrawal.status_changed","description":"Payout status or confirmed details updated. Inspect data.status; cancelled may represent rejection or a later return. Deliveries may repeat or arrive out of order; reconcile by payout ID.","security":[],"parameters":[{"name":"X-leigan-Event-Id","in":"header","required":true,"description":"Same value as id in the JSON body.","schema":{"type":"string","description":""}},{"name":"X-leigan-Signature","in":"header","required":true,"description":"t=timestamp,v1=hmac_sha256_hex. HMAC-SHA256 with the endpoint secret over timestamp + dot + original body bytes. The timestamp changes for each attempt. Verify the signature, clock and 300-second tolerance before processing.","schema":{"type":"string","description":""}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventWithdrawalStatusChanged"},"example":{"id":"evt_exemplo_withdrawal_status_changed","type":"withdrawal.status_changed","created_at":"2026-10-18T12:15:00Z","data":{"id":"wdr_exemplo_1044","amount":10000,"fee":500,"status":"completed","pix_key":"destino@example.com","pix_key_type":"email","created_at":"2026-10-18T12:10:00.000Z","beneficiary":{"name":"Beneficiário Confirmado","document":"52998224725","ispb":"00000001","branch":"0001","account":"123456","account_type":"TRAN"},"paid_at":"2026-10-18T12:15:00Z","end_to_end_id":"E00000000202610181215ABC12345678"}}}}},"responses":{"204":{"description":"Event received and persisted by your endpoint. Any 2xx response acknowledges delivery."}}}},"endpoint.test":{"post":{"summary":"endpoint.test","description":"Test requested from the dashboard.","security":[],"parameters":[{"name":"X-leigan-Event-Id","in":"header","required":true,"description":"Same value as id in the JSON body.","schema":{"type":"string","description":""}},{"name":"X-leigan-Signature","in":"header","required":true,"description":"t=timestamp,v1=hmac_sha256_hex. HMAC-SHA256 with the endpoint secret over timestamp + dot + original body bytes. The timestamp changes for each attempt. Verify the signature, clock and 300-second tolerance before processing.","schema":{"type":"string","description":""}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventEndpointTest"},"example":{"id":"evt_exemplo_endpoint_test","type":"endpoint.test","created_at":"2026-10-18T12:05:00.000Z","data":{"message":"Webhook connection test."}}}}},"responses":{"204":{"description":"Event received and persisted by your endpoint. Any 2xx response acknowledges delivery."}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Business API key created in the dashboard and shown once. Use Authorization: Bearer lg_live_… on your server only. The business must be approved with API access enabled; each endpoint requires its scope. Key and business IP restrictions both apply to payouts and refunds."}},"schemas":{"Buyer":{"type":"object","properties":{"name":{"type":"string","description":"Payer full name.","minLength":1,"maxLength":120},"email":{"type":"string","description":"Payer email.","format":"email"},"document":{"type":"string","description":"CPF: 11 digits. CNPJ: 14 digits. No punctuation.","pattern":"^(\\d{11}|\\d{14})$"},"phone":{"type":"string","description":"Area code and phone number; country code and optional + accepted.","pattern":"^\\+?\\d{10,15}$"}},"required":["name","email","document","phone"],"additionalProperties":false},"CreateTransaction":{"type":"object","properties":{"amount":{"type":"integer","format":"int64","description":"Gross amount in integer BRL cents: 10000 = R$100.00. Subject to the business effective limits; amount must exceed the fee.","minimum":1000},"payment_method":{"type":"string","description":"Payment method. Defaults to pix when omitted.","const":"pix","default":"pix"},"external_reference":{"type":"string","description":"Your reference, returned in data.reference. Does not replace Idempotency-Key.","maxLength":100,"default":""},"buyer":{"$ref":"#/components/schemas/Buyer"}},"required":["amount","buyer"],"additionalProperties":false},"CreateWithdrawal":{"type":"object","properties":{"amount":{"type":"integer","format":"int64","description":"Payout principal in integer BRL cents. Available balance must cover amount + fee. Subject to the business effective limits.","minimum":1000},"pix_key":{"type":"string","description":"Destination key in the format specified by pix_key_type.","minLength":1,"maxLength":140},"pix_key_type":{"type":"string","description":"cpf_cnpj: 11/14 digits; email: email address; phone: + and country code, 10–15 digits; random: UUID.","enum":["cpf_cnpj","email","phone","random"]}},"required":["amount","pix_key","pix_key_type"],"additionalProperties":false},"Transaction":{"type":"object","properties":{"id":{"type":"string","description":"Opaque payment identifier."},"amount":{"type":"integer","format":"int64","description":"Gross amount."},"fee":{"type":"integer","format":"int64","description":"Effective fee in cents. A pricing condition may be confirmed with payment. Returns zero after a confirmed full refund."},"net":{"type":"integer","format":"int64","description":"Account net amount in cents. Zero after a confirmed full refund; the original debit is in refund.balance_debit."},"status":{"type":"string","description":"pending: awaiting payment; paid: payment confirmed; expired: payment request expired or closed without confirmation; refunding: refund processing with a reservation; refunded: full return confirmed. Later confirmations may update status: reconcile by ID.","enum":["pending","paid","expired","refunding","refunded"]},"buyer_name":{"type":["string","null"],"description":"After real payment: confirmed payer name, or null when unavailable. Before payment: name supplied in the request."},"buyer_email":{"type":["string","null"],"description":"After real payment: null; the institution does not confirm email. Before payment: value supplied in the request."},"buyer_document":{"type":["string","null"],"description":"After real payment: confirmed payer CPF/CNPJ, or null when unavailable. Before payment: masked request document."},"buyer_phone":{"type":["string","null"],"description":"After real payment: null; the institution does not confirm phone. Before payment: masked request value."},"reference":{"type":"string","description":"external_reference supplied on creation; empty when omitted."},"origin":{"type":"string","description":"Set by the server. Lists include API and dashboard payments.","enum":["api","panel"]},"end_to_end_id":{"type":["string","null"],"description":"E2E of the original Pix settlement when available; may be null. Does not replace data.id or identify a refund request."},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp in UTC."},"paid_at":{"type":["string","null"],"format":"date-time","description":"Confirmation timestamp in UTC; null before payment."},"payment_method":{"type":"string","description":"Payment method.","const":"pix"},"pix":{"type":["object","null"],"properties":{"copy_paste":{"type":"string","description":"PIX payload. Display the exact value returned by the API to the payer."},"expires_at":{"type":["string","null"],"format":"date-time","description":"Expiry supplied for the payment request when available; null when not supplied. Do not assume a fixed lifetime."}},"required":["copy_paste","expires_at"],"description":"Pix code while pending and available; null when unavailable, paid or expired. Use only the returned code."},"fee_condition":{"type":"object","description":"Present when a CNPJ-specific pricing condition applies to the payment.","properties":{"label":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"fee":{"type":"integer","description":"Applied fee in cents."},"standard_fee":{"type":"integer","description":"Standard movement fee in cents."}}},"payer":{"$ref":"#/components/schemas/TransferParty"},"order_buyer":{"type":"object","description":"Original request data; may differ from the actual payer. Present after real payment.","properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]},"document":{"type":["string","null"]},"phone":{"type":["string","null"]}}},"refund":{"anyOf":[{"$ref":"#/components/schemas/Refund"},{"type":"null"}],"description":"Present when a refund request exists."}},"required":["id","amount","fee","net","status","buyer_name","buyer_email","buyer_document","buyer_phone","reference","origin","end_to_end_id","created_at","paid_at","payment_method","pix"],"additionalProperties":false},"Withdrawal":{"type":"object","properties":{"id":{"type":"string","description":"Opaque payout identifier."},"amount":{"type":"integer","format":"int64","description":"Requested principal."},"fee":{"type":"integer","format":"int64","description":"Effective fee in cents under the business current conditions, which may include a percentage, fixed amount, tiers or special conditions. Initial reservation covers amount + fee; the recipient receives amount. Reconcile fee after confirmation because an applicable condition may reduce it. A later return may retain the fee."},"pix_key":{"type":"string","description":"Destination PIX key."},"pix_key_type":{"type":"string","description":"PIX key type.","enum":["cpf_cnpj","email","phone","random"]},"status":{"type":"string","description":"processing: request in progress, without transfer confirmation; completed: transfer confirmed; cancelled: cancellation, rejection or identified return. Cancelled does not guarantee a full return of principal and fee: a later return may be partial and retain the fee.","enum":["processing","completed","cancelled"]},"created_at":{"type":"string","format":"date-time","description":"Request timestamp in UTC."},"fee_condition":{"type":"object","description":"Present when special registered-CNPJ pricing applies. Does not expose the CNPJ allowlist.","properties":{"label":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"fee":{"type":"integer","description":"Applied fee in cents."},"standard_fee":{"type":"integer","description":"Standard movement fee in cents."}}},"beneficiary":{"$ref":"#/components/schemas/TransferParty"},"paid_at":{"type":["string","null"],"format":"date-time","description":"Transfer confirmation time when supplied. May be null or absent; not the return time."},"end_to_end_id":{"type":["string","null"],"description":"E2E of the original Pix transfer when available. May be null or absent; does not replace the payout ID."},"return_end_to_end_id":{"type":"string","description":"Bank return identifier when available, distinct from the original E2E and payout ID. Conditional field: not present for every return and does not imply that the fee was returned."},"idempotency_key":{"type":["string","null"],"minLength":8,"maxLength":120,"description":"Payout creation key, included in data.idempotency_key in new webhooks. Use it to match the confirmation to the original request."},"refund":{"type":"object","additionalProperties":false,"required":["type","amount"],"description":"For an identified and confirmed bank return, refund.type is partial or full. refund.amount is the cumulative amount credited back in BRL cents, excluding the fee. For a BRL 100.00 payout, refund.amount=3000 means BRL 30.00 was returned. Apply only the increase over the prior total and deduplicate notifications by event ID. If refund is absent, return details are unavailable.","properties":{"type":{"type":"string","enum":["partial","full"]},"amount":{"type":"integer","minimum":1}},"example":{"type":"partial","amount":3000}}},"required":["id","amount","fee","pix_key","pix_key_type","status","created_at"],"additionalProperties":false},"Balance":{"type":"object","properties":{"available":{"type":"integer","description":"Available balance already includes reservations and payouts. Do not subtract reserved again."},"currency":{"type":"string"},"simulation":{"type":"boolean"},"reserved":{"type":["integer","null"],"minimum":0},"reservations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"integer","minimum":0},"reason":{"type":"string"},"status":{"type":"string"}},"required":["id","amount","reason","status"]}},"reservation_state":{"type":"string","enum":["verified","unavailable"]},"reservation_source":{"type":"string"},"as_of":{"type":"string"},"withdrawable_now":{"type":"integer","minimum":0,"description":"For accounts with a cumulative payout limit, the largest payout amount currently requestable in a single withdrawal, in cents, accounting for fees. Zero means no payout is currently available."},"med_reserved":{"type":["integer","null"],"minimum":0},"med_reserve_pending":{"type":["integer","null"],"minimum":0}},"required":["available","currency","simulation","reserved","reservations","reservation_state","reservation_source","as_of"],"example":{"available":910000,"currency":"BRL","simulation":false,"reserved":709390,"reservations":[{"id":"rsv_example","amount":709390,"reason":"provider_disputes_review","status":"reserved"}],"reservation_state":"verified","reservation_source":"internal_ledger","as_of":"2026-11-17T15:00:00.000Z"},"additionalProperties":false},"Pagination":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100,"description":"Requested page size."},"offset":{"type":"integer","minimum":0,"description":"Number of skipped records."},"total":{"type":"integer","minimum":0,"description":"Total records matching the same filters."},"has_more":{"type":"boolean","description":"Whether another page follows."}},"required":["limit","offset","total","has_more"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable error code for programmatic handling."},"message":{"type":"string","description":"Short English explanation. Use code, not message, for automatic handling."},"request_id":{"type":"string","description":"Same identifier as X-Request-ID. Include it when contacting support."},"observed_ip":{"type":"string","description":"Observed caller IP, only for IP rejection errors after valid credential authentication."}},"required":["code","message","request_id"]}},"required":["error"],"example":{"error":{"code":"validation_error","message":"Invalid request data.","request_id":"req_0123456789abcdef0123456789abcdef"}},"additionalProperties":false},"EventTransactionCreated":{"type":"object","properties":{"id":{"type":"string","description":"Unique event ID. Use it to deduplicate deliveries."},"type":{"type":"string","description":"Event type.","const":"transaction.created"},"created_at":{"type":"string","format":"date-time","description":"Event creation timestamp, preserved on retries."},"data":{"$ref":"#/components/schemas/Transaction"}},"required":["id","type","created_at","data"],"additionalProperties":false},"EventTransactionStatusChanged":{"type":"object","properties":{"id":{"type":"string","description":"Unique event ID. Use it to deduplicate deliveries."},"type":{"type":"string","description":"Event type.","const":"transaction.status_changed"},"created_at":{"type":"string","format":"date-time","description":"Event creation timestamp, preserved on retries."},"data":{"$ref":"#/components/schemas/Transaction"}},"required":["id","type","created_at","data"],"additionalProperties":false},"EventWithdrawalCreated":{"type":"object","properties":{"id":{"type":"string","description":"Unique event ID. Use it to deduplicate deliveries."},"type":{"type":"string","description":"Event type.","const":"withdrawal.created"},"created_at":{"type":"string","format":"date-time","description":"Event creation timestamp, preserved on retries."},"data":{"$ref":"#/components/schemas/Withdrawal"}},"required":["id","type","created_at","data"],"additionalProperties":false},"EventWithdrawalStatusChanged":{"type":"object","properties":{"id":{"type":"string","description":"Unique event ID. Use it to deduplicate deliveries."},"type":{"type":"string","description":"Event type.","const":"withdrawal.status_changed"},"created_at":{"type":"string","format":"date-time","description":"Event creation timestamp, preserved on retries."},"data":{"$ref":"#/components/schemas/Withdrawal"}},"required":["id","type","created_at","data"],"additionalProperties":false,"description":"For an identified and confirmed bank return, refund.type is partial or full. refund.amount is the cumulative amount credited back in BRL cents, excluding the fee. For a BRL 100.00 payout, refund.amount=3000 means BRL 30.00 was returned. Apply only the increase over the prior total and deduplicate notifications by event ID. If refund is absent, return details are unavailable."},"EventEndpointTest":{"type":"object","properties":{"id":{"type":"string","description":"Unique event ID. Use it to deduplicate deliveries."},"type":{"type":"string","description":"Event type.","const":"endpoint.test"},"created_at":{"type":"string","format":"date-time","description":"Event creation timestamp, preserved on retries."},"data":{"type":"object","properties":{"message":{"type":"string","description":"Test message."}},"required":["message"]}},"required":["id","type","created_at","data"],"additionalProperties":false},"TransferParty":{"type":["object","null"],"description":"Confirmed payer or beneficiary bank details; null when unavailable.","properties":{"name":{"type":["string","null"],"description":"Confirmed person or legal entity name."},"document":{"type":["string","null"],"description":"Full CNPJ when supplied. CPF remains masked as confirmed by the bank."},"ispb":{"type":["string","null"],"description":"Supplied when available in the bank confirmation. Branch and account values retain leading zeroes."},"branch":{"type":["string","null"],"description":"Supplied when available in the bank confirmation. Branch and account values retain leading zeroes."},"account":{"type":["string","null"],"description":"Supplied when available in the bank confirmation. Branch and account values retain leading zeroes."},"account_type":{"type":["string","null"],"description":"Account type: CACC (checking), SVGS (savings), SLRY (salary), TRAN (payment) or OTHR. May be null until confirmation."},"bank_name":{"type":["string","null"],"maxLength":160,"description":"Payer or beneficiary financial institution name, when available."}}},"Refund":{"type":"object","description":"Full refund to the original payer. All amounts in integer BRL cents.","properties":{"id":{"type":"string","description":"Opaque refund request ID. Not the bank return identifier."},"transaction_id":{"type":"string","description":"Original payment ID; use it in the refund query path."},"status":{"type":"string","enum":["processing","refunded","rejected"],"description":"processing: request in progress; refunded: refund confirmed; rejected: request rejected and reservation released."},"amount":{"type":"integer","description":"Full requested refund amount in cents. Only refunded status confirms completion."},"balance_debit":{"type":"integer","description":"Original net amount deducted from account balance. The fee is not credited again."},"fee_returned":{"type":"integer","description":"Original fee reversed by Leigan; already included in the difference between gross refund and net debit."},"retained_fee":{"type":"integer","const":0},"currency":{"type":"string","const":"BRL"},"reason":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}},"required":["id","transaction_id","status","amount","balance_debit","fee_returned","retained_fee","currency","created_at","updated_at","completed_at"],"additionalProperties":false},"MerchantAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"number":{"type":["integer","null"],"minimum":0},"status":{"type":"string"},"api_enabled":{"type":"boolean"},"capabilities":{"type":"object","properties":{"pix_in":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"type":["string","null"],"enum":[null,"paused","account_unavailable","route_not_assigned","route_not_ready"]}},"required":["enabled","reason"]},"pix_out":{"type":"object","properties":{"enabled":{"type":"boolean"},"reason":{"type":["string","null"],"enum":[null,"paused","account_unavailable","route_not_assigned","route_not_ready"]}},"required":["enabled","reason"]},"source":{"type":"string"},"controls_updated_at":{"type":["string","null"]}},"required":["pix_in","pix_out","source","controls_updated_at"]},"limits":{"type":"object","properties":{"pix_in":{"type":"object","properties":{"minimum":{"type":"integer","minimum":0},"maximum":{"type":"integer","minimum":0}},"required":["minimum","maximum"]},"pix_out":{"type":"object","properties":{"minimum":{"type":"integer","minimum":0},"maximum":{"type":"integer","minimum":0}},"required":["minimum","maximum"]},"currency":{"type":"string"},"unit":{"type":"string"}},"required":["pix_in","pix_out","currency","unit"]},"credential":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"observed_ip":{"type":"string"},"origin_restricted":{"type":"boolean"}},"required":["id","name","scopes","observed_ip","origin_restricted"]},"as_of":{"type":"string"}},"required":["id","name","number","status","api_enabled","capabilities","limits","credential","as_of"],"example":{"id":"acc_11111111111111111111111111111111","name":"Minha operação","number":1,"status":"approved","api_enabled":true,"capabilities":{"pix_in":{"enabled":true,"reason":null},"pix_out":{"enabled":true,"reason":null},"source":"platform_configuration","controls_updated_at":"2026-11-17T15:00:00.000Z"},"limits":{"pix_in":{"minimum":500,"maximum":500000},"pix_out":{"minimum":100,"maximum":1000000},"currency":"BRL","unit":"centavos"},"credential":{"id":"key_66666666666666666666666666666666","name":"Produção","scopes":["balance:read","transactions:read","withdrawals:read"],"observed_ip":"203.0.113.10","origin_restricted":true},"as_of":"2026-11-17T15:00:00.000Z"},"additionalProperties":false},"MerchantFees":{"type":"object","properties":{"account_id":{"type":"string"},"currency":{"type":"string"},"amount_unit":{"type":"string"},"percentage_unit":{"type":"string"},"pix_in":{"type":"object","properties":{"percentage_bps":{"type":"integer","minimum":0},"fixed":{"type":"integer","minimum":0},"rounding":{"type":"string"}},"required":["percentage_bps","fixed","rounding"]},"pix_out":{"type":"object","properties":{"percentage_bps":{"type":"integer","minimum":0},"fixed":{"type":"integer","minimum":0},"rounding":{"type":"string"},"tiers":{"type":["object","null"],"properties":{"threshold":{"type":"integer"},"below":{"type":"object","properties":{"percentage_bps":{"type":"integer"},"fixed":{"type":"integer"}}},"at_or_above":{"type":"object","properties":{"percentage_bps":{"type":"integer"},"fixed":{"type":"integer"}}}}}},"required":["percentage_bps","fixed","rounding","tiers"]},"conditions":{"type":"object","properties":{"payer_cnpj_exceptions":{"type":"boolean"},"recipient_cnpj_exceptions":{"type":"boolean"},"payout_cnpj_exceptions_enabled":{"type":"boolean"}},"required":["payer_cnpj_exceptions","recipient_cnpj_exceptions","payout_cnpj_exceptions_enabled"]},"limits":{"type":"object","properties":{"pix_in":{"type":"object","properties":{"minimum":{"type":"integer","minimum":0},"maximum":{"type":"integer","minimum":0}},"required":["minimum","maximum"]},"pix_out":{"type":"object","properties":{"minimum":{"type":"integer","minimum":0},"maximum":{"type":"integer","minimum":0}},"required":["minimum","maximum"]},"currency":{"type":"string"},"unit":{"type":"string"}},"required":["pix_in","pix_out","currency","unit"]},"as_of":{"type":"string"}},"required":["account_id","currency","amount_unit","percentage_unit","pix_in","pix_out","conditions","limits","as_of"],"example":{"account_id":"acc_11111111111111111111111111111111","currency":"BRL","amount_unit":"centavos","percentage_unit":"basis_points","pix_in":{"percentage_bps":200,"fixed":0,"rounding":"nearest_cent"},"pix_out":{"percentage_bps":100,"fixed":0,"rounding":"nearest_cent","tiers":null},"conditions":{"payer_cnpj_exceptions":false,"recipient_cnpj_exceptions":true,"payout_cnpj_exceptions_enabled":true},"limits":{"pix_in":{"minimum":500,"maximum":500000},"pix_out":{"minimum":100,"maximum":1000000},"currency":"BRL","unit":"centavos"},"as_of":"2026-11-17T15:00:00.000Z"},"additionalProperties":false},"WithdrawalQuote":{"type":"object","properties":{"account_id":{"type":"string"},"amount":{"type":"integer","minimum":0},"fee":{"type":"integer","minimum":0},"total_debit":{"type":"integer","minimum":0},"recipient_amount":{"type":"integer","minimum":0},"currency":{"type":"string"},"amount_unit":{"type":"string"},"fee_condition":{"type":["string","null"]},"recipient_document_pending":{"type":"boolean"},"indicative":{"type":"boolean"},"unavailable_reason":{"type":["string","null"]},"as_of":{"type":"string"},"configuration_ready":{"type":"boolean","description":"Indicates whether payouts are enabled for the account. A payout request requires withdrawals:write and sufficient balance."}},"required":["account_id","amount","fee","total_debit","recipient_amount","currency","amount_unit","fee_condition","recipient_document_pending","indicative","unavailable_reason","as_of","configuration_ready"],"example":{"account_id":"acc_11111111111111111111111111111111","amount":1000,"fee":10,"total_debit":1010,"recipient_amount":1000,"currency":"BRL","amount_unit":"centavos","fee_condition":null,"recipient_document_pending":true,"indicative":true,"unavailable_reason":null,"as_of":"2026-11-17T15:00:00.000Z","configuration_ready":true},"additionalProperties":false},"RequestLookup":{"type":"object","properties":{"type":{"type":"string"},"idempotency_key":{"type":"string"},"request_state":{"type":"string","enum":["accepted","processing","rejected","verification_pending"]},"resource":{"type":["object","null"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"amount":{"type":"integer","minimum":0},"fee":{"type":"integer","minimum":0}},"required":["id","status","amount","fee"]},"created_at":{"type":["string","null"]},"updated_at":{"type":["string","null"]},"as_of":{"type":"string"}},"required":["type","idempotency_key","request_state","resource","created_at","updated_at","as_of"],"example":{"type":"transaction","idempotency_key":"order-20261117-001","request_state":"accepted","resource":{"id":"pix_22222222222222222222222222222222","status":"paid","amount":1000,"fee":20},"created_at":"2026-11-17T15:00:00.000Z","updated_at":"2026-11-17T15:00:00.000Z","as_of":"2026-11-17T15:00:00.000Z"},"additionalProperties":false},"MerchantDelivery":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"resource_id":{"type":"string"},"status":{"type":"string","enum":["delivered","failed","retrying","pending","archived"]},"attempts":{"type":"integer","minimum":0},"response_code":{"type":["integer","null"],"minimum":0},"created_at":{"type":"string"},"endpoint_url":{"type":["string","null"]},"replay_of":{"type":["string","null"]},"public_error":{"type":"string"},"next_attempt_at":{"type":["string","null"]}},"required":["id","event_id","event_type","resource_id","status","attempts","response_code","created_at","endpoint_url","replay_of","public_error","next_attempt_at"],"example":{"id":"dlv_44444444444444444444444444444444","event_id":"evt_77777777777777777777777777777777","event_type":"transaction.status_changed","resource_id":"pix_22222222222222222222222222222222","status":"failed","attempts":3,"response_code":500,"created_at":"2026-11-17T15:00:00.000Z","endpoint_url":"https://merchant.example/webhook","replay_of":null,"public_error":"endpoint_rejected","next_attempt_at":null},"additionalProperties":false},"RetryDelivery":{"type":"object","properties":{"id":{"type":"string"},"queued":{"type":"boolean"}},"required":["id","queued"],"example":{"id":"dlv_88888888888888888888888888888888","queued":true},"additionalProperties":false},"MerchantDeliveryDetail":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"resource_id":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"integer","minimum":0},"response_code":{"type":["integer","null"],"minimum":0},"created_at":{"type":"string"},"endpoint_url":{"type":["string","null"]},"replay_of":{"type":["string","null"]},"public_error":{"type":"string"},"next_attempt_at":{"type":["string","null"]},"history":{"type":"array","items":{"type":"object","properties":{"attempt":{"type":"integer","minimum":0},"response_code":{"type":["integer","null"],"minimum":0},"created_at":{"type":"string"},"public_error":{"type":"string"}},"required":["attempt","response_code","created_at","public_error"]}},"history_truncated":{"type":"boolean"}},"required":["id","event_id","event_type","resource_id","status","attempts","response_code","created_at","endpoint_url","replay_of","public_error","next_attempt_at","history","history_truncated"],"additionalProperties":false},"MerchantDeliveryPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MerchantDelivery"}},"page":{"type":"object","properties":{"limit":{"type":"integer","minimum":0},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]},"snapshot_at":{"type":"string"}},"required":["limit","has_more","next_cursor","snapshot_at"]},"as_of":{"type":"string"}},"required":["data","page","as_of"],"additionalProperties":false}}}}