Skip to content

/pix-automatico/cashin/create Create Debit Order ​

Background ​

Creates one period's debit order under an approved (APPROVED) debit authorization. After the debit order is created, Adopay asynchronously submits a debit instruction to the payer's bank: the initial orderStatus is PENDING, and the debit result can be tracked through Get Debit Order Details. If the debit fails on the debit date, a retry can be initiated as described in Debit Retry.

Creation Window

A regular-debit (REGULAR) debit order must be created between 2 and 10 calendar days before the debit date. This is a Central Bank of Brazil requirement that lets the payer's bank notify the payer in advance. Example: if the debit date is 2026-11-15, create the order between 2026-11-05 and 2026-11-13. We recommend a scheduled job that creates orders 8 to 9 days before the debit date; see Time Constraints.

Note: the payee can cancel a debit order only before 22:00 (America/Sao_Paulo) on the day before the debit date; see Cancel Debit Order.

Endpoint ​

ItemValue
MethodPOST
Path/pix-automatico/cashin/create
Content-Typeapplication/json
PurposeCreate a debit order for an approved debit authorization

Authentication ​

Uses the common signature authentication (ES256 request signing). See Authentication and Request Signing.

Request Fields ​

For authentication headers, see Authentication; they are not listed in the table below.

FieldLocationTypeLengthRequiredDescription
mchOrderNoBodystring64YesMerchant order number. Each debit order gets a newly generated number from the merchant (a new number for each period and for each retry). Unique within the same endpoint and the same merchant, and used for duplicate order prevention; reuse the original number only when resending the same request after a timeout or network failure. A duplicate submission within the validity period returns the result of the first accepted request; see Idempotency.
authorizationIdBodystring64YesDebit authorization ID, generated by the Adopay system and globally unique within the Adopay system.
scheduledDateBodystring10YesScheduled debit date, i.e. the date on which the payer's bank actually debits the payer's account, in the format YYYY-MM-DD (a date in the America/Sao_Paulo time zone). When cashinType is REGULAR, it must be the 2nd to the 10th calendar day after the creation day; when RETRY, each retry specifies its own new debit date, which must fall between the current day and the 7th calendar day after the original debit order's debit date.
amountBodydecimal25,2ConditionalDebit amount, two decimal places. May be omitted when cashinType is RETRY, in which case it defaults to the original debit order's amount; required when REGULAR.
cashinTypeBodystring16NoDebit order type, i.e. which kind of debit this order is; see the enum below. Defaults to REGULAR. Use REGULAR for periodic debits; use RETRY to debit again after a debit failure on the debit date.
originPlatOrderNoBodystring64ConditionalPlatform order number of the original debit order. Required when cashinType is RETRY: provide the platOrderNo of the debit order of this period's first debit attempt (attemptNumber is 1); the 2nd and 3rd retries of the same period also use this same order number, not the order number of the previous retry order. Do not send it when REGULAR.

cashinType Debit Order Type Enum ​

ValueDescription
REGULARRegular debit (default): automatic periodic debit under the authorization.
RETRYRetry: debit the same period once more after the debit failed on this period's debit date; see Debit Retry.

Debit orders have one more type, QRCODE (the payment embedded in the sign-up QR code, i.e. the first payment). It is created automatically by the system when a composite QR code is created and cannot be created through this endpoint; see First Payment.

Validation Rules ​

  • The debit authorization must be in APPROVED status and have no cancellation request in progress (cancellation.status is PENDING); otherwise a state conflict is returned.
  • For a fixed-amount debit authorization (amountType is FIXED), amount must equal amountValue; otherwise a validation failure is returned.
  • For a variable-amount debit authorization, this endpoint does not validate an upper limit; if the amount exceeds the limit the payer has set at their bank, the scheduling of that debit order is rejected (orderStatus is FAILED, failureReason is SCHEDULE_REJECTED).

Debit Retry ​

When the debit fails on the debit date (orderStatus is FAILED, failureReason is SETTLEMENT_FAILURE) and the debit authorization's allowRetry is true, a retry debit order can be created with cashinType = RETRY:

  • Within one period, the debit order of the first debit attempt is called the original debit order (attemptNumber is 1); each retry after that is a new retry debit order (cashinType is RETRY) whose originPlatOrderNo is always the original debit order's order number, with attemptNumber running from 2 to 4. A retry debit order has its own platOrderNo; use its own order number to query its result.
  • At most 3 retries per period; a retry debit order's scheduledDate must be between the current day and the 7th calendar day after the original debit order's debit date, and is not subject to the 2-to-10-calendar-day window.
  • Only one retry can be in progress for the same original debit order at a time (orderStatus is PENDING or SCHEDULED).
  • Whether a further retry is possible, the remaining retries, and the latest date are determined by retry.retryable, retry.remainingRetries, and retry.retryDeadline of the most recent failed debit order.
  • We recommend spreading retries across the 7 calendar days (for example, on the 1st, 3rd, and 6th day after the debit date), and confirming before each retry that the debit authorization is still APPROVED.

Example: a period's debit date is 2026-12-03; the first debit fails, the 1st retry also fails, and the 2nd retry succeeds. This period has 3 debit orders in total:

Debit ordercashinTypeoriginPlatOrderNoattemptNumberscheduledDateResult
A (original debit order)REGULARnull12026-12-03FAILED (SETTLEMENT_FAILURE)
BRETRYA's platOrderNo22026-12-04FAILED (SETTLEMENT_FAILURE)
CRETRYA's platOrderNo (not B's)32026-12-06SUCCESS

The following cases return a state conflict:

  • The debit authorization is not APPROVED, has a cancellation request in progress, or its allowRetry is false;
  • The original debit order's orderStatus is not FAILED, or its failureReason is not SETTLEMENT_FAILURE;
  • The retries for this period are used up, or retry.retryDeadline has passed;
  • The original debit order already has a retry debit order in progress.

Other failure reasons are not retried: SUBMISSION_FAILED means the debit instruction did not reach the payer's bank and does not consume a retry, so create a new regular debit order within the creation window; for SCHEDULE_REJECTED, a retry will not change the result, so adjust the amount or contact the payer.

Request Example ​

Request header example:

http
POST /pix-automatico/cashin/create HTTP/1.1
Content-Type: application/json
X-Merchant-Id: 2492265300
X-Timestamp: 1787011200
X-Nonce: a9f3c1d47e8b9a2c4d1f9e8a7b6c5d4e
Digest: SHA-256=<Base64 digest>
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<ES256_SIGNATURE_BASE64>"

Request body example (regular debit):

json
{
  "mchOrderNo": "CASHIN20261025000001",
  "authorizationId": "0f8c1f3e-5b7a-4c0e-9a55-2d3b1a9c7e10",
  "scheduledDate": "2026-11-03",
  "amount": 150.00,
  "cashinType": "REGULAR"
}

Request body example (debit retry, corresponding to the failed debit order in Example 2 of Get Debit Order Details):

json
{
  "mchOrderNo": "CASHIN20261204000003",
  "authorizationId": "0f8c1f3e-5b7a-4c0e-9a55-2d3b1a9c7e10",
  "scheduledDate": "2026-12-04",
  "cashinType": "RETRY",
  "originPlatOrderNo": "PAC202611250000000002"
}

Response Fields ​

The endpoint uses the standard status, msg, and data response envelope. After successful creation, data.orderStatus is PENDING; the actual debit result must be confirmed through Get Debit Order Details.

FieldTypeLengthReturnedDescription
statusint4YesResponse code
msgstring128YesMessage corresponding to status
dataobjectN/AOn successDebit order object; may be omitted when the request fails at signature verification or protocol parsing. Cancellation information (cancellation) and retry information (retry) are not returned at creation; obtain them through Get Debit Order Details when needed.
data.mchOrderNostring64YesMerchant order number, echoing the request value.
data.platOrderNostring64YesPlatform order number of the debit order; it identifies this debit order for query, cancellation, and refund.
data.authorizationIdstring64YesID of the debit authorization it belongs to.
data.cashinTypestring16YesDebit order type: REGULAR or RETRY; see the enum above.
data.attemptNumberint19YesWhich debit attempt of this period: 1 for the original debit order, and 2 to 4 for the 1st to 3rd retries respectively.
data.originPlatOrderNostring64NoPlatform order number of the original debit order; returned only for retry debit orders (cashinType is RETRY).
data.scheduledDatestring10YesScheduled debit date, in the format YYYY-MM-DD (a date in the America/Sao_Paulo time zone).
data.amountdecimal25,2YesDebit amount, two decimal places.
data.e2eIdstring64NoPix EndToEndId.
data.orderStatusstring16YesDebit result status; PENDING after successful creation. For the values, see Get Debit Order Details.
data.createdAtint19YesCreation time, Unix timestamp in seconds.
data.payTimeint19NoDebit success time, Unix timestamp in seconds.
data.failureReasonstring32NoDebit failure reason.

Response Example ​

json
{
  "status": 200,
  "msg": "sucesso",
  "data": {
    "mchOrderNo": "CASHIN20261025000001",
    "platOrderNo": "PAC202610250000000001",
    "authorizationId": "0f8c1f3e-5b7a-4c0e-9a55-2d3b1a9c7e10",
    "cashinType": "REGULAR",
    "attemptNumber": 1,
    "originPlatOrderNo": null,
    "scheduledDate": "2026-11-03",
    "amount": 150.00,
    "e2eId": null,
    "orderStatus": "PENDING",
    "createdAt": 1792929600,
    "payTime": null,
    "failureReason": null
  }
}

Response Error Codes ​


Back to Pix Subscription Overview