Order Status Transition
POST /papi/v1/ramp/connect/sandbox/order-status-transition
The Order Status Transition API allows merchants to manually transition order statuses in the sandbox environment for testing purposes. This API simulates various order state changes without requiring actual payment processing or blockchain transactions. Refer to the order status list 7.order-status.md
Request Body
| Field | Type | Mandatory | Remarks |
|---|---|---|---|
| externalOrderId | string | Yes | The unique order id from the partner side. Supports only letters and numbers. |
| targetStatus | int | Yes | The target status to transition to. Must be a positive integer. |
Response Body
| Field | Type | Remarks |
|---|---|---|
| success | boolean | Indicates if the request succeeded |
| code | string | Response code |
| message | string | Response message |
The API supports different status transitions based on the order type and business type. Below are the supported transitions:
1. BUY Orders (FIAT/P2P Business Type)
For Regular Withdraw Orders:
| Target Status Code | Status Name | Description |
|---|---|---|
| 2 | ON_RAMP_COMPLETED | purchase crypto completed successfully |
| 11 | WITHDRAW_PROCESSING | Withdrawal is being processed |
| 96 | WITHDRAW_ABANDONED | Withdrawal was abandoned |
| 97 | ON_RAMP_FAILED | purchase crypto failed |
| 98 | WITHDRAW_FAILED | Withdrawal failed |
| 20 | COMPLETED | Order fully completed |
For Swap Orders (Buy Any Token):
| Target Status Code | Status Name | Description |
|---|---|---|
| 2 | ON_RAMP_COMPLETED | purchase crypto completed successfully |
| 15 | SWAP_PROCESSING | Token swap is being processed |
| 93 | SWAP_ABANDONED | Token swap was abandoned |
| 94 | SWAP_FAILED | Token swap failed |
| 97 | ON_RAMP_FAILED | purchase crypto failed |
| 20 | COMPLETED | Order fully completed |
2. BUY Orders (CONVERT Business Type)
| Target Status Code | Status Name | Description |
|---|---|---|
| 4 | CONVERT_COMPLETED | Crypto conversion completed successfully |
| 11 | WITHDRAW_PROCESSING | Withdrawal is being processed |
| 92 | CONVERT_FAILED | Crypto conversion failed |
| 96 | WITHDRAW_ABANDONED | Withdrawal was abandoned |
| 98 | WITHDRAW_FAILED | Withdrawal failed |
| 20 | COMPLETED | Order fully completed |
3. SEND Orders (Send Crypto)
| Target Status Code | Status Name | Description |
|---|---|---|
| 20 | COMPLETED | Crypto sent successfully |
| 98 | WITHDRAW_FAILED | Crypto send failed |
Status Transition Flow
BUY Order (FIAT/P2P) - Regular Flow
INIT(0) → ON_RAMP_PROCESSING(1) → ON_RAMP_COMPLETED(2) → WITHDRAW_PROCESSING(11) → COMPLETED(20)
BUY Order (FIAT/P2P) - Swap Flow
INIT(0) → ON_RAMP_PROCESSING(1) → ON_RAMP_COMPLETED(2) → SWAP_PROCESSING(15) → COMPLETED(20)
BUY Order (CONVERT) Flow
INIT(0) → CONVERT_PROCESSING(3) → CONVERT_COMPLETED(4) → WITHDRAW_PROCESSING(11) → COMPLETED(20)
SEND Order Flow
INIT(0) → WITHDRAW_PROCESSING(11) → COMPLETED(20)
Example 1: Transition order to completed status
Request Parameters:
{
"externalOrderId": "946972922319",
"targetStatus": 11
}
Response:
{
"success": true,
"code": "000000",
"message": "success",
"data": null
}
Example 2: Transition order to pending status
Request Parameters:
{
"externalOrderId": "946972922320",
"targetStatus": 20
}
Response:
{
"success": true,
"code": "000000",
"message": "success",
"data": null
}
Example 3: Transition order to failed status
Request Parameters:
{
"externalOrderId": "946972922321",
"targetStatus": 40
}
Response:
{
"success": true,
"code": "000000",
"message": "success",
"data": null
}