
Card (Money In)
Cancel (void or refund) a card transaction. Performs void for registered/pending/processing transactions, or refund for successful transactions.
| Method | Path | Format | Authentication |
|---|---|---|---|
| PATCH | /api/v2.0/card/{account_id}/cancel/{id} | json | OAuth 2.0 with Access Token |
The Cancel endpoint performs either a void or refund depending on the current transaction status:
registered, pending, or processing (payment not yet captured).success (payment already captured).Both void and refund return status: "success". Use cancel_type to distinguish between them.
| Field | Value | Type | Mandatory | Description | Example |
|---|---|---|---|---|---|
| Authorization | Bearer {access_token} | Alphanumeric | Mandatory | Bearer token obtained from the access token endpoint. | Bearer eyJ0eXAiOiJKV1{…} |
| Parameter | Type | Mandatory | Description | Example |
|---|---|---|---|---|
| account_id | String | Required | Merchant Account ULID | 01K5G4FZZ18DMK0M5QTR8Y9QY9 |
| id | String | Required | Transaction ID | 9901JAB3CD4E5F6G7H8J9K0M1N2 |
PATCH /api/v2.0/card/01K5G4FZZ18DMK0M5QTR8Y9QY9/cancel/9901JAB3CD4E5F6G7H8J9K0M1N2
cURL Example:
curl -X PATCH "https://your-domain.com/api/v2.0/card/01K5G4FZZ18DMK0M5QTR8Y9QY9/cancel/9901JAB3CD4E5F6G7H8J9K0M1N2" \
-H "X-PARTNER-ID: {api_key}" \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGc..."
| Field | Type | Mandatory | Description | Example |
|---|---|---|---|---|
| response_code | String | Mandatory | Response code | SP000 |
| response_message | String | Mandatory | Human-readable response message | Successfully |
| data | Object | Mandatory | Response data | - |
| > transaction_id | String | Mandatory | Transaction ID | 9901JAB3CD4E5F6G7H8J9K0M1N2 |
| > reference_no | String | Mandatory | Merchant order reference number | ORD-20260225-001 |
| > status | String | Mandatory | Always success for both void and refund | success |
| > cancel_type | String | Mandatory | Type of cancellation performed (void or refund) | void |
When voiding a transaction that has not been captured:
Success: Transaction voided.
{
"response_code": "SP000",
"response_message": "Successfully",
"data": {
"transaction_id": "9901JAB3CD4E5F6G7H8J9K0M1N2",
"reference_no": "ORD-20260225-001",
"status": "success",
"cancel_type": "void"
}
}
When refunding a captured/successful transaction:
Success: Transaction refunded.
{
"response_code": "SP000",
"response_message": "Successfully",
"data": {
"transaction_id": "9901JAB3CD4E5F6G7H8J9K0M1N2",
"reference_no": "ORD-20260225-001",
"status": "success",
"cancel_type": "refund"
}
}
Error: Cannot cancel the transaction.
{
"response_code": "SP012",
"response_message": "Cannot cancel: transaction status is success",
"data": {
"transaction_id": "9901JAB3CD4E5F6G7H8J9K0M1N2"
}
}
| Current Status | Cancel Type | Resulting Status |
|---|---|---|
registered | Void | success |
pending | Void | success |
processing | Void | success |
success | Refund | success |
status: "success". Use the cancel_type field to distinguish whether the operation was a void or refund.cancelled, refunded, or failed cannot be cancelled again.transaction_id returned from the payment response as the {id} path parameter.