Skip to main content
DELETE
/
api
/
v1
/
i
/
orders
/
{id}
curl -X DELETE "https://api.example.com/api/v1/i/orders/a3d5c8e7-9b4f-4a2e-8c7d-1f3e5a6b9c0d/" \
  -H "Authorization: Bearer YOUR_TOKEN"
// Empty response body

Description

Deletes an order from the system. This permanently removes the order and all associated order items.

Authentication

Requires authentication. The order must belong to the authenticated customer.

Path Parameters

id
uuid
required
The unique identifier of the order to delete

Response

Returns 204 No Content on successful deletion with an empty response body.
curl -X DELETE "https://api.example.com/api/v1/i/orders/a3d5c8e7-9b4f-4a2e-8c7d-1f3e5a6b9c0d/" \
  -H "Authorization: Bearer YOUR_TOKEN"
// Empty response body

Deletion Behavior

Permanent DeletionThis operation permanently deletes the order and all associated data. This action cannot be undone.
When an order is deleted:
1

Order Items Removed

All order items associated with this order are deleted (cascade deletion).
2

Order Removed

The order record itself is permanently removed from the database.
3

References Preserved

Related records that reference the order are handled:
  • Billing Address: Remains in the database (SET_NULL behavior)
  • Customer: Unaffected
  • Voucher: Freed for potential reuse
  • Offers: Unaffected (historical records)

Alternative: Order Status

Instead of deleting orders, you may want to mark them as cancelled using the order status field. While there’s no dedicated endpoint for status updates, you can:
  1. Keep the order in the database with status: cancelled
  2. Maintain order history for analytics and customer records
  3. Allow customers to view their cancelled orders
The DELETE endpoint is provided for cases where complete removal is necessary.

Use Cases

When to DELETE an order:

  • Customer created order by mistake immediately
  • Order contains incorrect items and needs to be recreated
  • Testing or development purposes
  • Customer requests complete data removal

When to mark as CANCELLED:

  • Order was partially processed
  • Need to maintain order history
  • For business analytics and reporting
  • Customer might want to reference it later

Access Control

Customer OwnershipOnly the customer who created the order can delete it. Attempting to delete another customer’s order will result in a 404 Not Found error.

Cascade Deletion

The following related records are automatically deleted:
  • OrderItems: All items within the order
    • Item references to products and variants are removed
    • Offer associations are cleared
    • Pricing history is lost

Notes

  • Deletion is immediate and cannot be rolled back
  • No confirmation step is required from the API (implement in your client)
  • The endpoint doesn’t check order status before deletion (any status can be deleted)
  • Associated addresses are NOT deleted and may be reused by other orders
  • Vouchers associated with deleted orders become available for reuse
  • Products and variants referenced by order items remain in the catalog
  • Consider implementing soft deletion in your application for better data retention

Build docs developers (and LLMs) love