Orders API
Cancel Order
Cancel a pending payment order.
Cancel a pending payment order. Only orders with pending status can be canceled. Once canceled, the order cannot be reactivated or paid.
DELETE https://api.uzoba.xyz/v1/orders/{order_id}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
order_id | string | Yes | The unique identifier of the order to cancel (case-insensitive) |
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token for authentication |
Content-Type | string | Yes | Must be application/json |
X-Idempotency-Key | string | No | Unique key to prevent duplicate cancellation requests (minimum 12 characters) |
Example Request
curl -X DELETE {{base_url}}/api/v1/orders/ucym7xnu \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: 7f8a9b2c3d4e5f"Example Response
{
"success": true,
"message": "Order cancelled successfully"
}Order Already Cancelled (200 OK)
{
"success": true,
"message": "Order already cancelled"
}Order Status Reference
| Status | Can Cancel? | Description |
|---|---|---|
pending | ✅ Yes | Order awaiting payment |
confirming | ❌ No | Payment detected, awaiting confirmations |
paid | ❌ No | Payment confirmed and complete |
expired | ❌ No | Order expired without payment |
failed | ❌ No | Payment failed or rejected |
underpaid | ❌ No | Payment received but less than requested |
canceled | ✅ N/A | Already canceled (idempotent) |
Notes
Warning
Irreversible: Once canceled, an order cannot be reactivated or paid.
- Idempotent: Safe to retry without risk of duplicate cancellations.
- Pending Only: Only orders with
pendingstatus can be canceled. - Authorization: Only the merchant who created the order can cancel it.
- Expired Orders: Orders that have already expired cannot be canceled.