/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
| Item | Value |
|---|---|
| Method | POST |
| Path | /pix-automatico/cashin/create |
| Content-Type | application/json |
| Purpose | Create a debit order for an approved debit authorization |
Authentication
Uses the common signature authentication (ES256 request signing); set X-Merchant-Id to the partner's primary merchant ID. See Authentication and Request Signing.
Request Fields
For authentication headers, see Authentication; they are not listed in the table below.
| Field | Location | Type | Length | Required | Description |
|---|---|---|---|---|---|
subMerchantNo | Body | string | 64 | Yes | Sub-merchant ID. Used to verify that the debit authorization this debit is based on (authorizationId), and for RETRY the original debit order (origin), belong to this sub-merchant; otherwise resource not found is returned. |
mchOrderNo | Body | string | 64 | Yes | Merchant order number. Each debit order gets a newly generated number from the partner (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. |
authorizationId | Body | string | 64 | Yes | Debit authorization ID, generated by the Adopay system and globally unique within the Adopay system. |
scheduledDate | Body | string | 10 | Yes | Scheduled 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. |
amount | Body | decimal | 25,2 | Conditional | Debit 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. |
cashinType | Body | string | 16 | No | Debit 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. |
origin | Body | string | 64 | Conditional | Platform 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
| Value | Description |
|---|---|
REGULAR | Regular debit (default): automatic periodic debit under the authorization. |
RETRY | Retry: 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
subMerchantNois submitted to verify that the objects being debited belong to this sub-merchant: the debit authorization identified byauthorizationIdmust belong tosubMerchantNo; whencashinTypeisRETRY, the original debit order identified byoriginmust also belong toPlat Order No subMerchantNo. Otherwise resource not found is returned and no debit order is created.- The debit authorization must be in
APPROVEDstatus and have no cancellation request in progress (cancellation.isstatus PENDING); otherwise a state conflict is returned. - For a fixed-amount debit authorization (
amountTypeisFIXED),amountmust equalamountValue; 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 (
orderStatusisFAILED,failureReasonisSCHEDULE_).REJECTED
Debit Retry
When the debit fails on the debit date (orderStatus is FAILED, failureReason is SETTLEMENT_) 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 (
attemptNumberis1); each retry after that is a new retry debit order (cashinTypeisRETRY) whoseoriginis always the original debit order's order number, withPlat Order No attemptNumberrunning from2to4. A retry debit order has its ownplatOrderNo; use its own order number to query its result. - At most 3 retries per period; a retry debit order's
scheduledDatemust 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 (
orderStatusisPENDINGorSCHEDULED). - Whether a further retry is possible, the remaining retries, and the latest date are determined by
retry.,retryable retry., andremaining Retries retry.of the most recent failed debit order.retryDeadline - 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 order | cashinType | origin | attemptNumber | scheduledDate | Result |
|---|---|---|---|---|---|
| A (original debit order) | REGULAR | null | 1 | 2026-12-03 | FAILED (SETTLEMENT_) |
| B | RETRY | A's platOrderNo | 2 | 2026-12-04 | FAILED (SETTLEMENT_) |
| C | RETRY | A's platOrderNo (not B's) | 3 | 2026-12-06 | SUCCESS |
The following cases return a state conflict:
- The debit authorization is not
APPROVED, has a cancellation request in progress, or itsallowRetryisfalse; - The original debit order's
orderStatusis notFAILED, or itsfailureReasonis notSETTLEMENT_;FAILURE - The retries for this period are used up, or
retry.has passed;retryDeadline - The original debit order already has a retry debit order in progress.
Other failure reasons are not retried: SUBMISSION_ 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_, a retry will not change the result, so adjust the amount or contact the payer.
Request Example
Request header example:
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):
{
"subMerchantNo": "SUB00000001",
"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):
{
"subMerchantNo": "SUB00000001",
"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. is PENDING; the actual debit result must be confirmed through Get Debit Order Details.
| Field | Type | Length | Returned | Description |
|---|---|---|---|---|
status | int | 4 | Yes | Response code |
msg | string | 128 | Yes | Message corresponding to status |
data | object | N/A | On success | Debit 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. | string | 64 | Yes | Sub-merchant ID, identical to subMerchantNo in the request. |
data. | string | 64 | Yes | Merchant order number, echoing the request value. |
data. | string | 64 | Yes | Platform order number of the debit order; it identifies this debit order for query, cancellation, and refund. |
data. | string | 64 | Yes | ID of the debit authorization it belongs to. |
data. | string | 16 | Yes | Debit order type: REGULAR or RETRY; see the enum above. |
data. | int | 19 | Yes | Which debit attempt of this period: 1 for the original debit order, and 2 to 4 for the 1st to 3rd retries respectively. |
data. | string | 64 | No | Platform order number of the original debit order; returned only for retry debit orders (cashinType is RETRY). |
data. | string | 10 | Yes | Scheduled debit date, in the format YYYY-MM-DD (a date in the America/Sao_Paulo time zone). |
data. | decimal | 25,2 | Yes | Debit amount, two decimal places. |
data. | string | 64 | No | Pix EndToEndId. |
data. | string | 16 | Yes | Debit result status; PENDING after successful creation. For the values, see Get Debit Order Details. |
data. | int | 19 | Yes | Creation time, Unix timestamp in seconds. |
data. | int | 19 | No | Debit success time, Unix timestamp in seconds. |
data. | string | 32 | No | Debit failure reason. |
Response Example
{
"status": 200,
"msg": "sucesso",
"data": {
"subMerchantNo": "SUB00000001",
"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