Initiate a DARF payment
Pays a DARF (federal tax) through the provider the tenant routes DARF_PAYMENT to.
How it works
- The taxpayer is always the registered owner of the funding account (
midazAccountId). Do not sendpersonType,taxIdorname. - The owner’s name must fit the 80 bytes a DARF accepts (accented characters use more than one byte). It is never shortened.
- Funds are reserved in the ledger before the provider is instructed.
201: the provider acknowledged the payment (statusCREATED).202: the outcome is not known (statusUNCONFIRMED). Follow both withGET /v1/payments/{id}.- After a
202, do not resend under a newIdempotency-Key: you can pay the tax twice. - A retry under the same
Idempotency-Keyreturns the stored answer of a201, a202, or a refusal that consumes the key (see each code). After a refusal that releases the key, the same key runs the request again. While the first request runs, the same key gets409PBP-0007. - To find what a request created when you have no payment id, call
GET /v1/paymentswithidempotencyKey.
Planned changes
- An antifraud step, with new outcomes on
202,422and503. - Payment scheduling: a future
scheduledDateis sent to the provider on its effective date (first business day on or after it), once. AddsscheduledDate(DARF too),effectiveScheduledDate,effectiveAfterDueDate,amountIsEstimated,executedAt,failureReason, thePROCESSINGstatus and new error codes. This change will be specified again before it applies.
Encabezados
Cuerpo
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.
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.
86
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.
"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.
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.
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.
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.
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.
"2026-09-16"
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/effectiveScheduledDateTointerval it was in and enters the next one. - Present only in scheduled payments. Absent in an immediate payment.
"2026-09-14"
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 alwaysfalse.
false

