Pular para o conteúdo principal
POST
Initiate a payment

Autorizações

Authorization
string
header
obrigatório

JWT bearer token issued by the identity provider.

Cabeçalhos

X-Organization-Id
string

Midaz organization the account and the ledger entry live under. Required: a request without it, or with a value that is not a canonical UUID, is refused with 400 PBP-0025.

Idempotency-Key
string
obrigatório

Client-supplied idempotency key, a UUID. Required: a request without it, with a value that is not a UUID, or with the nil UUID (00000000-0000-0000-0000-000000000000) is refused with 400 PBP-0012.

Corpo

application/json
digitableLine
string
obrigatório

Bankslip or utilities digitable line, digits only.

Exemplo:

1.905009540144816e+44

midazAccountId
string
obrigatório

Midaz account the payment settles from. Who PAYS is the registered owner of this account, read from the Midaz CRM: the request does not state a payer.

description
string

Free-text description carried on the payment.

ledgerId
string

Midaz ledger the account lives in and the entry is posted to. Required: absent, blank or not a canonical UUID is refused with 400 PBP-0026.

amount
string
Under development

Optional amount to pay, a decimal string with two decimal places, for a slip that accepts partial or divergent payment. Absent: the amount the pre-payment consult calculates for today is paid, as before. Present: the provider must pay an informed amount (else 422 PBP-0701, capability PAYMENT_AMOUNT_INFORMED) and the slip must accept it (else 422 PBP-0217); the accepted amount is the one reserved, reported to the clearing base and debited. Exactly two decimal places and greater than zero: zero (0.00) is refused by the pattern with 400 PBP-0001. Part of the request identity: the same Idempotency-Key with another amount is 422 PBP-0013.

Maximum string length: 32
Pattern: ^(0\.(0[1-9]|[1-9][0-9])|[1-9][0-9]{0,15}\.[0-9]{2})$
Exemplo:

"100.00"

channel
enum<string>
Under development

Optional channel through which the payer paid the slip. Absent: the tenant's default payment channel (INTERNET unless Lerian recorded another one at the tenant's request; the default can never be DDA). The value is fixed when the request is received and recorded with the payment. A value outside the enum is refused with 400 PBP-0001. DDA requires a bankslip presented to this payer through DDA (receiverBoletoId, delivered with the DDA payer flow); without it, 422 PBP-0220. Part of the request identity: the same Idempotency-Key with another channel is 422 PBP-0013.

A provider that reports the channel to the clearing base sends the code below; a provider that does not (BTG) ignores it. Codes of the CanPgto domain, Manual de Leiautes da Plataforma Centralizada de Recebíveis (PCR), MAPX-OP016-2009 V63, §10.1:

Code 4 (PIX) is not accepted: a slip paid through Pix is the BolePix flow, not this operation.

Opções disponíveis:
BRANCH,
ATM,
INTERNET,
BANKING_AGENT,
CALL_CENTER,
ELECTRONIC_FILE,
DDA,
DIGITAL_BANKING_AGENT
Exemplo:

"INTERNET"

paymentMethod
enum<string>
Under development

Optional means of payment the payer used. Absent: the tenant's default payment method (ACCOUNT_DEBIT unless Lerian recorded another one at the tenant's request). The value is fixed when the request is received and recorded with the payment. A value outside the enum is refused with 400 PBP-0001. The payment is always debited from midazAccountId; this member only states the means reported to the clearing base. Part of the request identity: the same Idempotency-Key with another paymentMethod is 422 PBP-0013.

A provider that reports the means of payment to the clearing base sends the code below; a provider that does not (BTG) ignores it. Codes of the MeioPgto domain, Manual de Leiautes da Plataforma Centralizada de Recebíveis (PCR), MAPX-OP016-2009 V63, §10.36:

Opções disponíveis:
CASH,
ACCOUNT_DEBIT,
CREDIT_CARD,
CHECK
Exemplo:

"ACCOUNT_DEBIT"

receiverBoletoId
string<uuid>
Under development

Presented boleto being paid. With channel DDA it must be presented to the holder of midazAccountId, and digitableLine must be that boleto's line; otherwise 422 PBP-0220, the payment code also returned when channel DDA comes without receiverBoletoId.

scheduledDate
string<date>
Under development

Planned. Date on which you want the payment to run, YYYY-MM-DD, with no time or time zone. Without it, the payment runs immediately.

  • It is not the date the payment runs. On a non-business day the payment runs on effectiveScheduledDate: always read that field.
  • Valid window: tomorrow ≤ scheduledDate ≤ min(dueDate, today + 30 calendar days). Outside it, creation is refused with one of the window codes.
  • In the first phase, a date on a non-business day is refused with PBP-0006.
Exemplo:

"2026-09-16"

Resposta

Created. The provider acknowledged the payment. It is CREATED and has providerId. Follow its outcome with GET /v1/payments/{id}. A key that already names an acknowledged payment also returns 201, with the payment as it stands.

amount
string
obrigatório
createdAt
string
obrigatório
digitableLine
string
obrigatório
id
string
obrigatório
ledgerId
string
obrigatório

Midaz ledger the payment was written with. Always present.

organizationId
string
obrigatório

Midaz organization the payment was written with. Always present.

status
string
obrigatório

The payment's status when this answer was produced. CREATED on a 201 for a new payment; UNCONFIRMED on a 202, while the outcome at the payment provider is unknown. A request already on record is answered with the payment's status at that moment, which may be any status a payment takes. A replay of the same Idempotency-Key serves the stored answer, whose status may since have changed: read the payment by id for its current state.

type
string
obrigatório
dueDate
string
providerId
string

Identifier the payment provider assigned to this payment. Quote it, together with providerRequestId, when you contact the provider about this payment. Absent while the payment is UNCONFIRMED (the 202 answer): the provider has acknowledged nothing yet. Read the payment by id later to obtain it.

providerRequestId
string

Reference this API sent to the payment provider when it instructed the payment, exactly as sent. Which of providerId and providerRequestId the provider accepts for a lookup depends on the provider and on the payment type, so quote both when you contact the provider. Absent when the payment carries no such reference.

scheduledDate
string<date>
Under development

Planned. Date on which you want the payment to run, YYYY-MM-DD, with no time or time zone. Without it, the payment runs immediately.

  • It is not the date the payment runs. On a non-business day the payment runs on effectiveScheduledDate: always read that field.
  • Valid window: tomorrow ≤ scheduledDate ≤ min(dueDate, today + 30 calendar days). Outside it, creation is refused with one of the window codes.
  • In the first phase, a date on a non-business day is refused with PBP-0006.
Exemplo:

"2026-09-16"

effectiveScheduledDate
string<date>
Under development

Planned. Business day on which the payment runs, YYYY-MM-DD. Read this date to know when the money goes out.

  • Computed at acceptance as the first business day on or after scheduledDate. Equal to it when the requested date is a business day.
  • Fixed at acceptance: a later calendar change does not move it.
  • Only one thing moves it: when the provider refuses the execution for cutoff or time window, the payment is rescheduled to the next business day, up to the attempt limit. A rescheduled payment leaves the effectiveScheduledDateFrom/effectiveScheduledDateTo interval it was in and enters the next one.
  • Present only in scheduled payments. Absent in an immediate payment.
Exemplo:

"2026-09-14"

effectiveAfterDueDate
boolean
Under development

Planned. true when the effective date rolled past the title's due date; false otherwise, including in an immediate payment.

  • The window is checked on the requested date (tomorrow ≤ scheduledDate ≤ min(dueDate, today + 30 days)). The roll to the next business day happens after that check, so it can pass the due date: a boleto due on a Saturday, scheduled for that day, runs on Monday.
  • This case is accepted, not refused, and has no error code. Use the field to warn whoever scheduled the payment.
  • If the title does not accept payment on the next business day without a change in value, the amount can rise. See amountIsEstimated.
  • In the first phase there is no roll: a requested date on a non-business day is refused with PBP-0006, so the field is always false.
Exemplo:

false

amountIsEstimated
boolean
Under development

Planned. true when amount is the value looked up at acceptance and not the final value; false in an immediate payment, where the instruction was already sent with that value.

  • In a scheduled payment it is true from creation. The final value is the one the execution on the scheduled day uses; read it with GET /v1/payments/{id} once executedAt is set.
Exemplo:

true