123pag123pag

API documentation

Authentication, PIX charges, balance, withdrawals and webhooks. Use the credentials generated in Dashboard → API after the parent account KYC is approved.

Base URL: /api/v1

Authentication

Every request needs the Client ID and secret. Credentials live in Dashboard → API after the account KYC is approved.

Send the header on every call. Client ID and secret are in the Credentials and webhooks tab.

Authorization: Basic base64(client_id:secret)
# ou
Authorization: Bearer client_id:secret

Charges

Create immediate PIX charges and look up status by internal id or txid. The QR Code and copy-paste always use the copy_paste field in the response — same for every provider.

POST/charges

Create PIX charge

Creates an immediate PIX charge and returns the EMV code in copy_paste. Use that field for the QR Code and copy-paste — the same value the panel payment link shows. nome_pagador is optional. notification_url is required when the account has no registered webhook.

Parameters

NameInTypeRequiredDescription
amountbodynumberYesAmount in BRL (reais), not cents. Example: 19.90 = R$ 19.90. Must be greater than zero.
descriptionbodystringYesDescription shown on the charge.
nome_pagadorbodystringNoPayer name (max. 191 characters). Also accepted as pagador.nome.
pagadorbodyobjectNoOptional payer data: nome, cpf, cep, rua, numero, complemento, bairro, cidade, estado.
notification_urlbodystringNoHTTPS URL that also receives the POST for this charge. Also accepted as url_notification. Required when the account has no registered webhook. Optional when a webhook already exists: both receive the same event. Max 500 characters. Internal addresses are rejected.

Request example

{
  "amount": 19.9,
  "description": "Pedido 1024",
  "nome_pagador": "Maria Silva"
}

Responses

200 — Charge created.

{
  "id": 123,
  "txid": "...",
  "status": "ATIVA",
  "copy_paste": "...",
  "qrCode": "",
  "amount": 19.9,
  "description": "Pedido 1024",
  "nome_pagador": "Maria Silva",
  "saldo_liquido": 19.3,
  "taxa_matriz": 3,
  "taxa_matriz_fixa": 0,
  "taxa_matriz_minima": 0,
  "retencao_matriz": 0.6,
  "saldo_liquido_matriz": 19.3
}

400 — Invalid JSON, amount, description or notification_url.

{
  "error": "Informe um amount válido."
}

401 — Invalid credentials.

{
  "error": "Credenciais inválidas."
}

403 — KYC not approved.

{
  "error": "KYC não aprovado."
}
  • copy_paste is the PIX EMV (copy-and-paste) code. Use ONLY it for the QR Code and the copy button. Do not use id or txid, and do not look for qr_code / qr_code_image — the 123pag API does not return a QR image.
  • Build the QR by encoding the full copy_paste string, without truncating, stripping characters, or changing spaces. Example: https://api.qrserver.com/v1/create-qr-code/?size=240x240&data= + URL-encode(copy_paste).
  • amount is in reais (e.g. 19.90), never in cents. The same rule applies for every underlying provider (Monetarie, Magen, etc.).
  • This is the same flow as the payment link: 123pag creates the PIX at the provider and returns copy_paste; the link checkout only displays that value.
  • saldo_liquido already includes the account fee deduction.
  • Franchise responses also include taxa_franquia*, retencao_franquia and saldo_liquido_franquia.
  • status: ATIVA, CONCLUIDA, EXPIRADA, CANCELADA or ESTORNADA.
  • notification_url is required when the account has no registered webhook. When a webhook exists, the field is optional and adds one more destination without replacing the account URLs.
GET/charges/{id}

Get charge

Looks up a charge by numeric id or txid and refreshes status with the provider.

Parameters

NameInTypeRequiredDescription
idpathstringYesInternal charge id or the PIX txid.

Responses

200 — Charge found.

{
  "id": 123,
  "txid": "...",
  "status": "CONCLUIDA",
  "copy_paste": "...",
  "qrCode": "",
  "amount": 19.9,
  "description": "Pedido 1024",
  "nome_pagador": "Maria Silva",
  "pagador": {
    "nome": "João Pagador",
    "documento": "39053344705",
    "banco": "Banco Exemplo",
    "ispb": "00000000",
    "agencia": "0001",
    "conta": "123456"
  },
  "end_to_end_id": "E123...",
  "saldo_liquido": 19.3
}

404 — Charge not found.

{
  "error": "Cobrança não encontrada."
}

401 — Invalid credentials.

{
  "error": "Credenciais inválidas."
}
  • Quando a cobrança está CONCLUIDA, o retorno inclui end_to_end_id (identificador E2E do PIX).
  • pagador traz os dados reais da liquidação (nome, documento, banco, ISPB, agência, conta) quando a provedora envia. nome_pagador continua sendo o nome opcional da criação.

Balance

Look up available withdrawal balance, precautionary holds and registered PIX keys.

GET/balance

Get balance

Returns the amount available to withdraw. saldo_disponivel, saldo_consolidado and saldo_total are the same value.

Responses

200 — Authenticated account balance.

{
  "saldo_disponivel": 26150,
  "saldo_consolidado": 26150,
  "bloqueio_cautelar": 150,
  "saldo_total": 26150,
  "provedor": "...",
  "taxa_saque": 0,
  "taxa_saque_pct": 1.8,
  "saldos_por_provedora": [
    {
      "provedor": "...",
      "saldo": 25150,
      "taxa_saque": 0,
      "taxa_saque_pct": 0,
      "saldo_saque": 25150
    },
    {
      "provedor": "...",
      "saldo": 1000,
      "taxa_saque": 0,
      "taxa_saque_pct": 0,
      "saldo_saque": 1000
    }
  ],
  "chaves_pix": [
    {
      "id": 1,
      "tipo": "cnpj",
      "chave": "00000000000191",
      "rotulo": "Principal"
    }
  ]
}

401 — Invalid credentials.

{
  "error": "Credenciais inválidas."
}
  • saldo_disponivel, saldo_consolidado e saldo_total trazem o mesmo valor: o saldo que pode ser sacado, sem descontar uma taxa de saída futura.
  • saldos_por_provedora lista cada origem. saldo e saldo_saque de cada origem são o mesmo valor. Um saque usa apenas uma origem.

Withdrawals

Request a PIX to any key (the account holder's document is optional), list withdrawals and download the receipt.

POST/withdrawals

Request withdrawal

Withdraws up to the available balance to any PIX key. Send chave_pix. The account holder's document (CPF/CNPJ) is optional. In the dashboard, withdrawals still go only to registered keys.

Parameters

NameInTypeRequiredDescription
valorbodynumberYesWithdrawal amount in BRL. Also accepted as amount.
chave_pixbodystringYesDestination PIX key (CPF, CNPJ, email, phone or random). Also accepted as pix_chave, pix_key or chave.
destinatario_nomebodystringNoNome do beneficiário enviado à provedora no saque. Também aceito como nome, nome_beneficiario ou beneficiary_name. Se omitido, usa a razão social ou o nome da conta.
documentobodystringNoOptional CPF or CNPJ of the PIX key holder. Also accepted as document, destinatario_documento, cpf_cnpj or tax_id. When sent, it must be valid.
pix_tipobodystringNoKey type: cpf, cnpj, email, celular or aleatoria. Detected automatically when omitted. Also accepted as tipo or pix_key_type.
rotulobodystringNoCompatibility: label of a PIX key registered on the profile, if chave_pix is not sent. Also accepted as chave_pix_rotulo or pix_key_label.
chave_pix_idbodynumberNoCompatibility: id of a registered PIX key. Also accepted as pix_key_id.
referenciabodystringNoYour order id. Also accepted as external_id or order_id. Echoed in the response and the webhook as referencia and external_id. Repeating the same referencia returns the withdrawal already created.
notification_urlbodystringNoHTTPS URL that also receives the POST for this withdrawal. Also accepted as url_notification. Required when the account has no registered webhook. Optional when a webhook already exists: both receive the same event. Max 500 characters. Internal addresses are rejected.

Request example

{
  "valor": 500,
  "chave_pix": "loja@email.com",
  "destinatario_nome": "Loja Centro",
  "documento": "39053344705",
  "pix_tipo": "email",
  "referencia": "pedido-1024"
}

Responses

200 — Withdrawal created.

{
  "id": 42,
  "valor": 500,
  "status": "pendente",
  "automatico": false,
  "pix_tipo": "email",
  "pix_chave": "loja@email.com",
  "destinatario_nome": "Loja Centro",
  "destinatario_documento": "39053344705",
  "end_to_end_id": null,
  "referencia": "pedido-1024",
  "external_id": "pedido-1024",
  "created_at": "2026-09-16T13:00:00Z"
}

400 — Invalid amount, PIX key, balance or notification_url.

{
  "error": "Informe um valor válido."
}

401 — Invalid credentials.

{
  "error": "Credenciais inválidas."
}
  • POST returns immediately with the id and status pendente. PIX settlement does not hold this response.
  • The withdrawal.updated webhook is sent only after the POST response. Store the id (or referencia) before reconciling the callback.
  • POST status is pendente. pago or falhou arrive on the webhook and on GET. end_to_end_id stays null until the PIX settles.
  • referencia (also external_id or order_id) is optional, up to 64 characters, and is returned on POST, GET and the webhook as referencia and external_id. The same referencia does not create another withdrawal. You can look it up later with GET /withdrawals/{referencia}.
  • The withdrawn amount is the PIX amount. The payout fee is not withheld from the balance.
  • Via API, PIX can go to any key (chave_pix). The account holder's document is optional. In the dashboard, withdrawals use registered keys only.
  • notification_url is required when the account has no registered webhook. When a webhook exists, the field is optional and adds one more destination without replacing the account URLs.
GET/withdrawals

List withdrawals

Lists withdrawals for the authenticated account, newest first (up to 100).

Responses

200 — Withdrawal list.

{
  "items": [
    {
      "id": 42,
      "valor": 500,
      "status": "pago",
      "pix_tipo": "cnpj",
      "pix_chave": "00000000000191",
      "created_at": "2026-09-16T13:00:00Z",
      "processado_at": "2026-09-16T13:05:00Z",
      "destinatario_nome": "Loja Centro",
      "destinatario_documento": "00000000000191",
      "destinatario_banco": "Banco Exemplo",
      "destinatario_ispb": "00000000",
      "destinatario_agencia": "0001",
      "destinatario_conta": "123456",
      "end_to_end_id": "E123...",
      "referencia": "pedido-1024",
      "external_id": "pedido-1024"
    }
  ]
}

401 — Invalid credentials.

{
  "error": "Credenciais inválidas."
}
GET/withdrawals/{id}

Get withdrawal

Looks up a withdrawal by numeric id or by referencia (also external_id / order_id from the POST).

Parameters

NameInTypeRequiredDescription
idpathstringYesNumeric withdrawal id, or the referencia / external_id / order_id used at creation.

Responses

200 — Withdrawal found.

{
  "id": 42,
  "valor": 500,
  "status": "pago",
  "pix_tipo": "cnpj",
  "pix_chave": "00000000000191",
  "created_at": "2026-09-16T13:00:00Z",
  "processado_at": "2026-09-16T13:05:00Z",
  "destinatario_nome": "Loja Centro",
  "destinatario_documento": "00000000000191",
  "destinatario_banco": "Banco Exemplo",
  "destinatario_ispb": "00000000",
  "destinatario_agencia": "0001",
  "destinatario_conta": "123456",
  "end_to_end_id": "E123...",
  "referencia": "pedido-1024",
  "external_id": "pedido-1024"
}

400 — Invalid id.

{
  "error": "Saque inválido."
}

404 — Withdrawal not found.

{
  "error": "Saque não encontrado."
}

401 — Invalid credentials.

{
  "error": "Credenciais inválidas."
}
  • If the path is digits only, it looks up by internal id. Otherwise it looks up by referencia (the same value accepted as external_id or order_id on POST).
  • Digit-only referencias collide with the id — use letters or a hyphen (e.g. order-1024).
GET/withdrawals/{id}/receipt

Withdrawal receipt

Returns the 123pag receipt HTML page. Only when the withdrawal is paid.

Parameters

NameInTypeRequiredDescription
idpathstringYesNumeric id of the paid withdrawal.

Responses

200 — Receipt HTML.

<!doctype html>
<html>…comprovante 123pag…</html>

409 — Withdrawal not yet paid or has no receipt.

{
  "error": "Saque ainda não pago ou sem comprovante."
}

401 — Invalid credentials.

{
  "error": "Credenciais inválidas."
}

Webhooks

123pag sends a JSON POST to each registered URL when charges, withdrawals or precautionary holds change status. If the charge or withdrawal was created with notification_url, the same POST also goes to that URL.

pix.updated

PIX (incoming)

Sent when a PIX charge is created already paid or updated. If the charge has notification_url, the same POST also goes to that URL.

POST to each registered URL · Content-Type: application/json

{
  "event": "pix.updated",
  "id": 123,
  "txid": "...",
  "referencia": "pedido-1024",
  "external_id": "pedido-1024",
  "status": "CONCLUIDA",
  "amount": 10,
  "saldo_liquido": 6.03,
  "description": "Pedido 1024",
  "nome_pagador": "Maria Silva",
  "pagador": {
    "nome": "João Pagador",
    "documento": "39053344705",
    "banco": "Banco Exemplo",
    "ispb": "00000000",
    "agencia": "0001",
    "conta": "123456"
  },
  "end_to_end_id": "E123..."
}

withdrawal.updated

Withdrawal

Sent after the POST /withdrawals response, when the withdrawal status changes. Includes referencia and external_id when they were sent. If the withdrawal has notification_url, the same POST also goes to that URL.

POST to each registered URL · Content-Type: application/json

{
  "event": "withdrawal.updated",
  "id": 42,
  "valor": 500,
  "status": "pago",
  "pix_chave": "00000000000191",
  "referencia": "pedido-1024",
  "external_id": "pedido-1024",
  "destinatario_nome": "Loja Centro",
  "destinatario_documento": "00000000000191",
  "destinatario_banco": "Banco Exemplo",
  "destinatario_ispb": "00000000",
  "destinatario_agencia": "0001",
  "destinatario_conta": "123456",
  "end_to_end_id": "E123..."
}

infraction.updated

Precautionary hold (MED)

Sent when an infraction or MED is updated. If the charge has notification_url, the same POST also goes to that URL.

POST to each registered URL · Content-Type: application/json

{
  "event": "infraction.updated",
  "id": 7,
  "status": "WAITING",
  "tipo": "REFUND_REQUEST",
  "valor": 19.9,
  "transacao_id": 123,
  "end_to_end_id": "E123...",
  "referencia": "pedido-1024",
  "external_id": "pedido-1024"
}