PIX (Brazil)

PIX is the instant payment ecosystem created and managed by Banco Central do Brasil. Launched in November 2020, it enables real-time money transfers and payments 24/7/365 between any of the 700+ participating institutions, using flexible key types instead of traditional bank account numbers.

mcp2p exposes PIX as three MCP tools. Enable the rail by including "pix" in your rails array when calling createMcp2pServer.

Overview

  • Settlement time: Under 10 seconds in normal conditions. Final in real time.
  • Operating hours: 24/7/365 — PIX never closes.
  • Currency: Brazilian real (BRL). Amounts in centavos (minor units).
  • Routing: Via PIX key (CPF, CNPJ, email, phone, or EVP). No bank account number needed.
  • Limits: Banco Central imposes default limits; your bank may apply additional restrictions. Night-time limits are lower by default.

Available tools

pix_send_payment

2FA required

Send a PIX instant payment to any registered PIX key. Requires 2FA authorization.

ParameterTypeRequiredDescription
pixKeystringYesRecipient PIX key. The SDK auto-detects the key type.
amountnumberYesAmount in centavos (minor units). E.g. 10000 = BRL 100.00
descriptionstringNoPayment description visible to the recipient (max 140 chars)
verificationCodestringNo6-digit OTP from Twilio Verify. Omit on first call to trigger SMS.

pix_check_status

No 2FA

Check the current status of a PIX payment by its end-to-end ID (E2EID).

ParameterTypeRequiredDescription
e2eIdstringYesEnd-to-end ID (E2EID) returned by pix_send_payment

pix_request_refund

2FA required

Request a PIX Devolução (refund) for a completed payment. Requires 2FA authorization.

ParameterTypeRequiredDescription
e2eIdstringYesE2EID of the original payment
amountnumberNoAmount to refund in centavos. Defaults to full amount if omitted.
reasonstringYesRefund reason: "FRAUD", "OPERATIONAL_FAULT", or "CUSTOMER_REQUEST"
verificationCodestringNo6-digit OTP. Omit on first call to trigger SMS.

PIX key types

The SDK auto-detects the PIX key type from the value passed in the pixKey parameter. You do not need to specify the type explicitly. Detection runs in this priority order: CPF, CNPJ, phone (E.164), UUID v4 (EVP), then email.

TypeFormatExampleValidationNotes
CPF11 digits12345678909Modulus-11 algorithm with two check digitsBrazilian individual tax ID. Most common key type for individuals.
CNPJ14 digits11222333000181Modulus-11 algorithm with two check digitsBrazilian company registration number.
Emailuser@domainuser@example.comStandard RFC 5322 email formatMust be registered as a PIX key with the recipient's bank.
Phone+55XXXXXXXXXXX+5511999998888+55 country code, 10–11 digits after codeBrazilian mobile number in E.164 format.
EVPUUID v4123e4567-e89b-12d3-a456-426614174000Standard UUID v4 formatRandom key (Chave Aleatória). Auto-generated by the payer's bank.
If key type detection is ambiguous or the format is invalid, the tool returns PIX_INVALID_KEY before any SMS is sent. Pass CPF and CNPJ as digit-only strings (no dots, dashes, or slashes).

Code example

// User: "Send BRL 150 to CPF 123.456.789-09"

// ── Turn 1: AI calls tool without verification code ──────────────────────────
// Tool call: pix_send_payment
// {
//   pixKey: "12345678909",   // CPF digits only — SDK auto-detects as CPF
//   amount: 15000,           // BRL 150.00 in centavos
//   description: "Lunch split"
// }
//
// SDK response:
// {
//   status: "2fa_required",
//   message: "Verification code sent via SMS."
// }

// ── Turn 2: User provides code ────────────────────────────────────────────────
// Tool call: pix_send_payment (same params + verificationCode)
// {
//   pixKey: "12345678909",
//   amount: 15000,
//   description: "Lunch split",
//   verificationCode: "583921"
// }
//
// SDK response:
// {
//   status: "success",
//   e2eId: "E90400888202401261458300000000001",
//   amount: 15000,
//   currency: "BRL",
//   settledAt: "2024-01-26T14:58:06Z"
// }

Error codes

CodeDescription
PIX_INVALID_KEYPIX key fails format or checksum validation
PIX_KEY_NOT_FOUNDPIX key is not registered in the DICT (Diretório de Identificadores)
PIX_LIMIT_EXCEEDEDAmount exceeds the Banco Central daily or per-transaction limit
PIX_INSUFFICIENT_FUNDSSource account has insufficient balance
PIX_RECIPIENT_UNAVAILABLEThe recipient's institution is temporarily unavailable in the PIX network
PIX_TIMEOUTPayment timed out waiting for Banco Central confirmation
PIX_DUPLICATE_E2EIDA payment with this E2EID already exists

See the Error Codes page for the complete reference.

Next steps