Skip to main content

Overview

Cancel an order that cannot be fulfilled. You must provide a cancellation date and reason for the cancellation.

Cancel Order

Cancel an order by providing the cancellation date and reason.
curl -X POST 'https://order.api.e-cross.tech/ext/orders/ACME-ECOM-TEST-003/cancel' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "cancelDate": "2025-01-05T20:00:00Z",
    "cancelReason": "Missing inventory to fulfill the order"
  }'
{
  "orderId": "ACME-ECOM-TEST-003",
  "status": "CANCELLED",
  "cancelDate": "2025-01-05T20:00:00Z",
  "statusHistory": [
    {
      "eventData": {
        "cancelReason": "Missing inventory to fulfill the order"
      },
      "receivedDate": "2025-01-05T20:01:00Z",
      "eventDate": "2025-01-05T20:00:00Z",
      "status": "CANCELLED"
    }
  ]
}

Path Parameters

orderId
string
required
The e-CROSS order ID of the order to cancel.

Request Parameters

cancelDate
string
required
The date and time of the cancellation event, in ISO 8601 format (e.g., 2025-01-05T20:00:00Z).
cancelReason
string
required
Human-readable reason for the cancellation. Examples:
  • “Missing inventory to fulfill the order”
  • “Customer requested cancellation”
  • “Payment issue”
  • “Product discontinued”

Response Fields

The response returns the complete order object with updated status. Key fields include:
status
string
required
The order status, which will be CANCELLED after successful cancellation.
cancelDate
string
required
The date when the order was cancelled, in ISO 8601 format.
statusHistory
array
required
The status history will include a new entry with status CANCELLED and the cancelReason in the eventData.
Once an order is cancelled, it cannot be uncancelled. Ensure you have the correct order ID and cancellation reason before proceeding.
Common reasons for cancellation include missing inventory, customer requests, payment issues, or product discontinuation. Provide clear, descriptive reasons to help with order management and reporting.

Create Shipment

Next: Learn how to create shipments for first mile dispatch