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

ParameterTypeRequiredDescription
order_idstringYesThe unique identifier of the order to cancel (case-insensitive)

Request Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token for authentication
Content-TypestringYesMust be application/json
X-Idempotency-KeystringNoUnique 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

StatusCan Cancel?Description
pending✅ YesOrder awaiting payment
confirming❌ NoPayment detected, awaiting confirmations
paid❌ NoPayment confirmed and complete
expired❌ NoOrder expired without payment
failed❌ NoPayment failed or rejected
underpaid❌ NoPayment received but less than requested
canceled✅ N/AAlready 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 pending status can be canceled.
  • Authorization: Only the merchant who created the order can cancel it.
  • Expired Orders: Orders that have already expired cannot be canceled.