Pix cashout using pix key (create payment for approval)

Creates a new PIX cashout transaction using a PIX key. This endpoint is designed for API integrations where transfers are initiated using the recipient's PIX key. The transaction is created with NEW status and requires approval before being processed.

Headers

ParameterTypeDescriptionRequired or OptionalExample
AuthorizationStringBearer + Access_tokenrequiredBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzEzMzAwOTMxLCJpYXQiOjE3MTMyOTczMzEsImp0aSI6Ijc2ZWI4ZTE5ZjM4YjQ4NmZiODdmNzNjNTdkMWVmNDJhIiwidXNlcl9pZCI6MjQ2fQ.5zekMa7CUj9p-MvNHns5ke4ZPhYV3Y1CLOsYL7hDUUo
hmacStringHMAC (Hash-based Message Authentication Code) is an authentication algorithm that combines a private key with a message to create a Message Authentication Code (MAC).requiredhmac: 57373705c83bc5efe41001790c54642e670088c0c87d56bc8f990f2260c7740b99f4081ff231b87f82118c1e77a959e1f40eacf690a8fa61a827a9ba01d546f6
idempotency-keyStringOptional UUID to prevent duplicate transactions. When provided, ensures that retrying the same request will not create multiple transactions. See Idempotency section below.optional550e8400-e29b-41d4-a716-446655440000

Body Details

{
  "source_account_branch_identifier": "0001",
  "source_account_number": "123456",
  "amount": 100.50,
  "key": "[email protected]",
  "tag": "payment-reference-123"
}
FieldTypeDescriptionRequired or Optional
source_account_branch_identifierStringBranch identifier of the source account from which the transfer will be made.required
source_account_numberStringAccount number of the source account from which the transfer will be made.required
amountDecimalAmount to be transferred. Must be greater than 0 and have up to 2 decimal places.required
keyStringPIX key of the recipient (email, phone, CPF/CNPJ, or EVP random key).required
tagStringOptional reference tag for tracking purposes. Free text field for client use.optional

Request Examples

Basic transfer:

POST /create-cashout
Authorization: Bearer <access_token>
hmac: <computed_hmac>
Content-Type: application/json

{
  "source_account_branch_identifier": "0001",
  "source_account_number": "123456",
  "amount": 100.50,
  "key": "[email protected]"
}

Transfer with tag:

POST /create-cashout
Authorization: Bearer <access_token>
hmac: <computed_hmac>
Content-Type: application/json

{
  "source_account_branch_identifier": "0001",
  "source_account_number": "123456",
  "amount": 250.00,
  "key": "+5511999999999",
  "tag": "invoice-payment-456"
}

Transfer with idempotency key:

POST /create-cashout
Authorization: Bearer <access_token>
hmac: <computed_hmac>
idempotency-key: 550e8400-e29b-41d4-a716-446655440000
Content-Type: application/json

{
  "source_account_branch_identifier": "0001",
  "source_account_number": "900002",
  "amount": 1500.00,
  "key": "12345678901",
  "tag": "contract-payment"
}

Response Details

{
  "worked": true,
  "id": 789461,
  "transaction_id": 789461,
  "code_transaction": null,
  "status": "NEW",
  "amount": 100.5,
  "fee": 0.0,
  "key": "recip***@example.com",
  "tag": "payment-reference-123",
  "from_accout": "123456",
  "recipient_instution": null,
  "recipient_instution_name": null,
  "recipient_account_id": null,
  "recipient_branch_id": null,
  "recipient_legal_id": null,
  "recipient_name": null,
  "recipient_account_type": null,
  "operationUuid": null,
  "idempotency_key": "550e8400-e29b-41d4-a716-446655440000",
  "erro_descriptor": "",
  "new_erro_descriptor": ""
}
FieldTypeDescription
workedBooleanAlways true for successful requests.
idIntegerUnique identifier of the transaction.
transaction_idIntegerTransaction identifier (same as id).
code_transactionStringHuman-readable transaction code. Will be null for transactions with status NEW.
statusStringCurrent status of the transaction. Will be NEW for newly created cashouts.
amountFloatAmount transferred.
feeFloatTransaction fee charged. Currently 0.0 for PIX transactions.
keyStringPIX key used for the transfer (may be masked for security).
tagStringReference tag provided in the request, or empty string if not provided.
from_accoutStringSource account number from which the transfer was made.
recipient_instutionStringISPB code of the recipient's financial institution. Will be null for status NEW when using PIX keys.
recipient_instution_nameStringName of the recipient's financial institution. Will be null for status NEW.
recipient_account_idStringRecipient's account number. Will be null for status NEW.
recipient_branch_idStringRecipient's branch identifier. Will be null for status NEW.
recipient_legal_idStringRecipient's CPF or CNPJ. Will be null for status NEW.
recipient_nameStringRecipient's name. Will be null for status NEW.
recipient_account_typeStringType of recipient's account. Will be null for status NEW.
operationUuidStringOperation UUID from the payment system, or null if not yet assigned.
idempotency_keyStringThe idempotency key provided in the request, or null if not provided.
erro_descriptorStringError description if the transaction failed, or empty string if successful.
new_erro_descriptorStringAdditional error information, or empty string if not applicable.

Error Responses

HTTP CodeError MessageDescription
400Account not foundThe specified source account does not exist.
400Invalid Pix KeyThe provided PIX key is invalid or in an incorrect format.
401UnauthorizedInvalid or missing authentication token. Ensure you are sending a valid Bearer token and HMAC signature.
422Validation errorRequest validation failed. Check that all required fields are present and in the correct format.

Business Rules

  1. Authentication: This endpoint requires API authentication (audience type: API) with Bearer token and HMAC signature.
  2. HMAC Validation: The request body must be validated using the provided HMAC signature.
  3. PIX Key Validation: The PIX key must be valid according to PIX standards (email, phone, CPF/CNPJ, or EVP).
  4. Amount Validation: The amount must be greater than zero and have at most 2 decimal places.
  5. Transaction Status: Newly created transactions have status NEW and require approval before being processed.
  6. Account Identification: The source account is identified by branch identifier and account number.

Idempotency

This endpoint supports the optional idempotency-key header to prevent duplicate transactions.

For complete details on how idempotency works, including key format, response codes, and best practices, see the Idempotency section in the main documentation.

Differences from Other Endpoints

This endpoint is similar to /create-cashout but may have specific use cases or workflow differences. For transfers using complete recipient account details instead of PIX keys, see the Create Cashout Manual documentation.

Use Cases

  1. API Integration: Third-party systems integrate with the API to initiate transfers automatically.
  2. PIX Key Transfers: Quick transfers using just the recipient's PIX key (email, phone, CPF/CNPJ, or EVP).
  3. Transaction Tracking: Use the optional tag field to associate transfers with internal references.
  4. Two-Step Workflow: Transactions are created with NEW status and require explicit approval before processing.
  5. Secure Transfers: HMAC validation ensures request integrity and prevents tampering.

For more detailed examples and implementation guidance, see the Create Cashout documentation.

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json