Saltar al contenido principal
POST
Initiate a DARF payment

Autorizaciones

Authorization
string
header
requerido

JWT bearer token issued by the identity provider.

Encabezados

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
requerido

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.

Cuerpo

application/json
fineAmount
string
requerido

Fine amount as a decimal string, up to two decimal places. Must be non-negative.

Maximum string length: 32
Ejemplo:

"5.00"

interestAmount
string
requerido

Interest amount as a decimal string, up to two decimal places. Must be non-negative.

Maximum string length: 32
Ejemplo:

"10.00"

mainAmount
string
requerido

Principal amount as a decimal string, up to two decimal places. Must be positive.

Maximum string length: 32
Ejemplo:

"100.00"

midazAccountId
string
requerido

Midaz account the payment settles from. The TAXPAYER of the DARF is the registered owner of this account, read from the Midaz CRM: the request does not state one. A holder whose registered name exceeds 80 bytes cannot be paid on this rail: the name is never shortened to fit, and the refusal is 422 PBP-0207.

referenceDate
string<date>
requerido

Tax period reference date, YYYY-MM-DD.

Ejemplo:

"2026-04-01"

treasuryRevenueCode
string
requerido

Federal revenue code (código da receita) of the DARF: the four digits of the code, zero-padded, for example 0086. A value in the provider's prefixed form, such as TRC_0086, is also accepted. At most 20 characters. The code is not checked against the revenue code catalogue by this API; the payment provider refuses an unknown code.

Ejemplo:

86

type
string
requerido

DARF type: S for Simples, N for Normal.

Ejemplo:

"S"

description
string

Optional free-text description carried on the payment.

dueDate
string<date>

Optional due date, YYYY-MM-DD.

Ejemplo:

"2026-05-10"

history
string

Optional free-text history 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.

referenceNumber
integer<int64>

Optional reference number carried to the tax authority.

totalIncomeAmount
string

Optional total income amount as a decimal string.

Maximum string length: 32
totalIncomePercent
string

Optional total income percentage as a decimal string.

Maximum string length: 32
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.
Ejemplo:

"2026-09-16"

Respuesta

Created. The provider acknowledged the DARF 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, in whatever status it has reached.

createdAt
string
requerido
id
string
requerido
ledgerId
string
requerido

Midaz ledger the payment was written with. Always present.

organizationId
string
requerido

Midaz organization the payment was written with. Always present.

status
string
requerido

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.

totalAmount
string
requerido
type
string
requerido
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.
Ejemplo:

"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.
Ejemplo:

"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.
Ejemplo:

false