Creates a new PIX cashout transaction using PIX copy-and-paste (Pix Copia e Cola) content and automatically approves it for processing. This endpoint allows you to initiate a transfer by providing the PIX copy-and-paste code (BR Code), which contains all recipient information. The transaction is created with NEW status, immediately transitioned to PROCESSING, and a background task is initiated to complete the transfer.
Headers
| Parameter | Type | Description | Required or Optional | Example |
|---|---|---|---|---|
| Authorization | String | Bearer + Access_token | required | Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzEzMzAwOTMxLCJpYXQiOjE3MTMyOTczMzEsImp0aSI6Ijc2ZWI4ZTE5ZjM4YjQ4NmZiODdmNzNjNTdkMWVmNDJhIiwidXNlcl9pZCI6MjQ2fQ.5zekMa7CUj9p-MvNHns5ke4ZPhYV3Y1CLOsYL7hDUUo |
| hmac | String | HMAC (Hash-based Message Authentication Code) is an authentication algorithm that combines a private key with a message to create a Message Authentication Code (MAC). | required | hmac: 57373705c83bc5efe41001790c54642e670088c0c87d56bc8f990f2260c7740b99f4081ff231b87f82118c1e77a959e1f40eacf690a8fa61a827a9ba01d546f6 |
| idempotency-key | String | Optional UUID to prevent duplicate transactions. When provided, ensures that retrying the same request will not create multiple transactions. See Idempotency section below. | optional | 550e8400-e29b-41d4-a716-446655440000 |
Body Details
{
"source_account_branch_identifier": "0001",
"source_account_number": "123456",
"pix_copy_and_paste": "00020126360014br.gov.bcb.pix0114+55119999999995204000053039865406100.505802BR5925FULANO DE TAL6014BELO HORIZONTE62070503***63041D3D",
"amount": 100.50,
"tag": "payment-reference-123"
}
| Field | Type | Description | Required or Optional |
|---|---|---|---|
| source_account_branch_identifier | String | Branch identifier of the source account from which the transfer will be made. | required |
| source_account_number | String | Account number of the source account from which the transfer will be made. | required |
| pix_copy_and_paste | String | PIX copy-and-paste code (BR Code) containing the recipient information and transaction details. | required |
| amount | Decimal | Amount to be transferred. Must be greater than 0 and have up to 2 decimal places. | required |
| tag | String | Optional reference tag for tracking purposes. Free text field for client use. | optional |
Request Examples
Transfer using PIX copy-and-paste:
POST /create-copy-and-paste-transfer
Authorization: Bearer <access_token>
hmac: <computed_hmac>
Content-Type: application/json
{
"source_account_branch_identifier": "0001",
"source_account_number": "123456",
"pix_copy_and_paste": "00020126360014br.gov.bcb.pix0114+55119999999995204000053039865406100.505802BR5925FULANO DE TAL6014BELO HORIZONTE62070503***63041D3D",
"amount": 100.50
}
Transfer with idempotency key:
POST /create-copy-and-paste-transfer
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": "123456",
"pix_copy_and_paste": "00020126580014br.gov.bcb.pix0136123e4567-e89b-12d3-a456-4266141740005204000053039865406250.005802BR5913Maria Santos6009SAO PAULO62070503***6304A1B2",
"amount": 250.00,
"tag": "invoice-2024-001"
}
Transfer using static QR code:
POST /create-copy-and-paste-transfer
Authorization: Bearer <access_token>
hmac: <computed_hmac>
Content-Type: application/json
{
"source_account_branch_identifier": "0001",
"source_account_number": "123456",
"pix_copy_and_paste": "00020126330014br.gov.bcb.pix0111123456789015204000053039865802BR5913Store Name6009SAO PAULO62070503***63044D5E",
"amount": 50.00,
"tag": "store-payment"
}
Response Details
{
"worked": true,
"id": 789460,
"transaction_id": 789460,
"code_transaction": "E789460",
"status": "PROCESSING",
"amount": 100.5,
"fee": 0.0,
"key": "+5511999999999",
"tag": "payment-reference-123",
"from_accout": "123456",
"recipient_instution": "12345678",
"recipient_instution_name": "Example Bank",
"recipient_account_id": "654321",
"recipient_branch_id": "0001",
"recipient_legal_id": "12345678901",
"recipient_name": "FULANO DE TAL",
"recipient_account_type": "CONTA_CORRENTE",
"operationUuid": null,
"idempotency_key": "550e8400-e29b-41d4-a716-446655440000",
"erro_descriptor": null,
"new_erro_descriptor": null
}
| Field | Type | Description |
|---|---|---|
| worked | Boolean | Always true for successful requests. |
| id | Integer | Unique identifier of the transaction. |
| transaction_id | Integer | Transaction identifier (same as id). |
| code_transaction | String | Human-readable transaction code. |
| status | String | Current status of the transaction. Will be PROCESSING for this endpoint. |
| amount | Float | Amount transferred. |
| fee | Float | Transaction fee charged. Currently 0.0 for PIX transactions. |
| key | String | PIX key extracted from the copy-and-paste code, if available. |
| tag | String | Reference tag provided in the request, or null if not provided. |
| from_accout | String | Source account number from which the transfer was made. |
| recipient_instution | String | ISPB code of the recipient's financial institution. |
| recipient_instution_name | String | Name of the recipient's financial institution. |
| recipient_account_id | String | Recipient's account number extracted from the copy-and-paste code. |
| recipient_branch_id | String | Recipient's branch identifier extracted from the copy-and-paste code. |
| recipient_legal_id | String | Recipient's CPF or CNPJ extracted from the copy-and-paste code. |
| recipient_name | String | Recipient's name extracted from the copy-and-paste code. |
| recipient_account_type | String | Type of recipient's account extracted from the copy-and-paste code. |
| operationUuid | String | Operation UUID from the payment system, or null if not yet assigned. |
| idempotency_key | String | The idempotency key provided in the request, or null if not provided. |
| erro_descriptor | String | Error description if the transaction failed, or null if successful. |
| new_erro_descriptor | String | Additional error information, or null if not applicable. |
Error Responses
| HTTP Code | Error Message | Description |
|---|---|---|
| 400 | Account not found | The specified source account does not exist. |
| 400 | Invalid PIX copy and paste code | The provided PIX copy-and-paste code is invalid or malformed. |
| 401 | Unauthorized | Invalid or missing authentication token. Ensure you are sending a valid Bearer token and HMAC signature. |
| 422 | Validation error | Request validation failed. Check that all required fields are present and in the correct format. |
Business Rules
- Copy-and-Paste Validation: The PIX copy-and-paste code must be valid and contain all necessary recipient information.
- Amount Validation: The amount must be greater than zero and have at most 2 decimal places.
- Transaction Status: The transaction is created with
NEWstatus, then immediately transitioned toPROCESSINGstatus. - Background Processing: After the response is returned, a background task processes the cashout approval.
- HMAC Validation: The request body must be validated using the provided HMAC signature.
- Automatic Approval: This endpoint always auto-approves the transaction for immediate processing.
Idempotency
This endpoint supports the optional idempotency-key header to prevent duplicate transactions. Since this endpoint automatically approves transactions, using idempotency keys is critically important to avoid duplicate money transfers, especially when scanning QR codes or pasting BR Codes multiple times.
For complete details on how idempotency works, including key format, response codes, and best practices, see the Idempotency section in the main documentation.
PIX Copy-and-Paste (BR Code) Format
The PIX copy-and-paste code, also known as BR Code, is a string that encodes all the information needed for a PIX transfer. It typically contains:
- Recipient's PIX key or account information
- Recipient's name
- Transaction amount (for static QR codes with fixed amounts)
- Additional transaction information
Example BR Code Structure
00020126360014br.gov.bcb.pix0114+55119999999995204000053039865406100.505802BR5925FULANO DE TAL6014BELO HORIZONTE62070503***63041D3D
This code includes:
- PIX key:
+5511999999999 - Suggested amount:
100.50 - Recipient name:
FULANO DE TAL - City:
BELO HORIZONTE
The system automatically extracts all necessary information from this code.
Use Cases
- QR Code Payments: Users scan a QR code displayed by the merchant, and your app extracts the BR Code to make the payment.
- Copy-Paste Payments: Users receive a PIX code via message, email, or website, copy it, and paste it into your app.
- Dynamic QR Codes: Each payment has a unique QR code with specific amount and identifier.
- Static QR Codes: Merchants display a static QR code where users enter the amount.
For more detailed examples and implementation guidance, see the Create Cashout documentation.
