Skip to main content

Create Payment

Create a PIX payment (payout) to a beneficiary. Two methods are available: via PIX key (recommended) or via bank details.


EnvironmentURL
Productionhttps://api-pix.crypto2pay.app/v2/payout/pix

POST /v2/payout/pix

Headers

HeaderValue
AuthorizationYOUR_API_KEY
Content-Typeapplication/json

Request Body

ParameterTypeDescription
transaction_idstringrequiredUnique identifier for the transaction. UUID v4 recommended.
currencystringrequiredCurrency code. Only BRL is accepted.
amountnumberrequiredPayment amount in reais (BRL).
namestringrequiredBeneficiary full name.
document_typestringrequiredCPF or CNPJ.
document_numberstringrequiredDocument number — digits only, no punctuation.
pix_keystringrequiredPIX key of the beneficiary.
phone_numberstringoptionalBeneficiary phone number.
emailstringoptionalBeneficiary e-mail address.
webhookstringoptionalURL to receive payment status notifications.

Accepted PIX Key Formats

  • CPF — e.g. 12345678900
  • CNPJ — e.g. 12345678000195
  • E-mail — e.g. user@example.com
  • Phone number — e.g. +5511999999999
  • Random key (chave aleatória) — e.g. 123e4567-e89b-12d3-a456-426614174000

Example Request

curl -X POST https://api-pix.crypto2pay.app/v2/payout/pix \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transaction_id": "9233a90c-1b2a-4c3d-8e5f-6a7b8c9d0e1f",
"currency": "BRL",
"amount": 1500,
"name": "Maria Silva",
"document_type": "CPF",
"document_number": "12345678900",
"pix_key": "maria@example.com",
"webhook": "https://yourapp.com/webhooks/payout"
}'

Response 200

{
"id": 796,
"transaction_id": "9233a90c-1b2a-4c3d-8e5f-6a7b8c9d0e1f",
"status": 0,
"currency": "BRL",
"amount": 1500,
"bank": {
"type": "email",
"bank_name": "COOPERATIVA DE CRÉDITO",
"ispb": "82527557",
"account_agency": "3879",
"account_number": "7716539016157248"
}
}

Response Fields

FieldTypeDescription
idnumberInternal payment ID.
transaction_idstringThe transaction ID you provided.
statusnumberCurrent payment status (see Status Codes).
currencystringCurrency code.
amountnumberPayment amount in reais.
bank.typestringPIX key type resolved for the beneficiary.
bank.bank_namestringName of the beneficiary's bank or financial institution.
bank.ispbstringISPB code of the beneficiary's institution.
bank.account_agencystringBeneficiary's bank branch.
bank.account_numberstringBeneficiary's account number.

Errors

HTTP StatusDescription
400pix_key is missing or in an unsupported format.
409transaction_id already exists — duplicate request.

Method 2: Bank Details

EnvironmentURL
Productionhttps://api-pix.crypto2pay.app/v2/payout

POST /v2/payout

Headers

HeaderValue
AuthorizationYOUR_API_KEY
Content-Typeapplication/json

Request Body

ParameterTypeDescription
transaction_idstringrequiredUnique identifier for the transaction. UUID v4 recommended.
currencystringrequiredCurrency code. Only BRL is accepted.
amountnumberrequiredPayment amount in reais (BRL).
namestringrequiredBeneficiary full name.
document_typestringrequiredCPF or CNPJ.
document_numberstringrequiredDocument number — digits only, no punctuation.
bank.typestringrequiredMust be "PIX".
bank.ispbstringrequiredISPB code of the beneficiary's financial institution.
bank.account_agencystringrequiredBeneficiary's bank branch (up to 4 digits).
bank.account_numberstringrequiredBeneficiary's account number.
bank.bank_namestringoptionalName of the beneficiary's bank.
phone_numberstringoptionalBeneficiary phone number.
emailstringoptionalBeneficiary e-mail address.
webhookstringoptionalURL to receive payment status notifications.

Example Request

curl -X POST https://api-pix.crypto2pay.app/v2/payout \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transaction_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"currency": "BRL",
"amount": 300,
"name": "João Souza",
"document_type": "CPF",
"document_number": "98765432100",
"bank": {
"type": "PIX",
"ispb": "00000000",
"account_agency": "0001",
"account_number": "123456789",
"bank_name": "BANCO DO BRASIL"
},
"webhook": "https://yourapp.com/webhooks/payout"
}'

Response 200

{
"id": 797,
"transaction_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": 0,
"currency": "BRL",
"amount": 300,
"bank": {
"type": "PIX",
"bank_name": "BANCO DO BRASIL",
"ispb": "00000000",
"account_agency": "0001",
"account_number": "123456789"
}
}

Errors

HTTP StatusDescription
400bank.ispb is missing or invalid.
400bank.account_agency exceeds the maximum allowed length.
409transaction_id already exists — duplicate request.

Payment Status Codes

CodeStatusDescription
0CreatedPayment has been created and is pending processing.
1Paid / CompletedPayment was successfully processed and delivered.
2RejectedPayment was rejected by the receiving institution.
3ReversedPayment was completed but subsequently reversed by the customer or bank.

Status flow:

0 → 1 (success) · 0 → 2 (rejection) · 0 → 1 → 3 (reversal)