Skip to main content
POST
/
api
/
v2
/
cancel-order
Cancel Order
curl --request POST \
  --url https://api.example.com/api/v2/cancel-order \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "order_id": 123,
  "cancel_reason": "<string>",
  "refund_mode": 123,
  "bank_details": {},
  "has_product_id": 123
}
'
{
  "refund_mode": 123,
  "product_amount": 123,
  "discount_amount": 123,
  "tss_money_refund": 123,
  "tss_points_refund": 123,
  "gift_voucher_refund": 123,
  "shipping_refund": 123,
  "platform_fee_refund": 123,
  "success": true,
  "message": "<string>",
  "refund_details": {},
  "refund_details.total_refund": 123,
  "refund_details.refund_mode": "<string>",
  "refund_details.processing_time": "<string>",
  "error": "<string>"
}

Overview

Cancel orders and process refunds automatically. The cancellation API supports both full order cancellation and line-item level cancellation, with intelligent refund routing based on payment method and order status.

Endpoints

Cancel Entire Order

POST /api/v2/cancel-order
Cancels all items in an order and initiates refund.

Cancel Specific Line Item

POST /api/v2/cancel-order-line-item
Cancels individual products within an order.

Get Cancellation Details

GET /api/v2/order/cancel/{orderId}
Retrieve cancellation eligibility and details for an order.

Authentication

All cancellation endpoints require user authentication.
Authorization
string
required
Bearer token for authenticated user session

Cancel Order Request

order_id
integer
required
The ID of the order to cancel
cancel_reason
string
Reason for cancellation (optional)
refund_mode
integer
Preferred refund method:
  • 1 - Original payment source
  • 2 - Bank account
  • 3 - TSS Money (wallet)
  • 4 - Gift voucher
bank_details
object
Required if refund_mode is bank transfer:
  • account_number - Bank account number
  • ifsc_code - Bank IFSC code
  • account_holder_name - Account holder name

Cancel Line Item Request

has_product_id
integer
required
The ID of the specific line item (has_product) to cancel
cancel_reason
string
Reason for cancelling this item
refund_mode
integer
Preferred refund method (see Cancel Order refund modes)

Cancellation Policies

Cancellation Windows

  • Open Window: Order can be cancelled freely
    • Before order is shipped
    • Typically 24-48 hours after order placement
  • Closed Window: Cancellation restricted or not allowed
    • After order is shipped
    • For international orders
    • For certain product categories

Cancellation Restrictions

The following orders cannot be cancelled:
  1. International Orders: Orders shipped outside India
    • Message: “International orders cannot be cancelled”
  2. Already Delivered: Orders with status “Delivered”
  3. Already Cancelled: Orders with status “Cancelled”
  4. Return/Exchange in Progress: Orders with active return/exchange requests
  5. Special Product Categories:
    • Non-exchangeable products (from NON_EXCHANGEABLE_PRODUCTS list)
    • Some exclusive membership products

Product-Level Cancellation Rules

  • Minimum one product must remain in the order
  • Cannot cancel if it’s the only remaining product
  • Single valid product cancellation may affect coupon eligibility
  • Bundle products may have special cancellation rules

Refund Processing

Refund Modes

refund_mode
integer
Refund will be processed via:
Mode IDRefund MethodProcessing TimeNotes
1Original Source5-7 business daysDefault for prepaid orders
2Bank Transfer7-10 business daysRequires bank details
3TSS MoneyInstantAdded to wallet immediately
4Gift VoucherInstantFor gift voucher orders only

Refund Components

Refunds include the following components based on order:
product_amount
decimal
Base product price refunded
discount_amount
decimal
Proportional coupon/discount refunded
tss_money_refund
decimal
TSS Money returned to wallet
tss_points_refund
decimal
TSS Points credited back
gift_voucher_refund
decimal
Gift voucher amount returned
shipping_refund
decimal
Shipping charges refunded (if applicable)
platform_fee_refund
decimal
Platform fee refunded for undelivered orders

Automated Refund Flow

  1. Cancellation Initiated
    • Order/line item status updated to “Cancelled”
    • Refund calculation performed
  2. Refund Routing
    • TSS Money → Instant credit to wallet
    • TSS Points → Instant credit to points balance
    • Gift Vouchers → Reactivated and credited
    • Payment Gateway → Automated refund initiated
  3. Inventory Release
    • Stock released back to inventory
    • Hold removed from warehouse
  4. Notifications
    • Email sent with refund details
    • SMS notification (if configured)
    • Refund tracking available

Refund Restrictions

COD Orders

  • No monetary refund (payment not made)
  • TSS Money/Points/Vouchers still refunded
  • Coupon code may be restored

Undelivered Orders (RTO)

For Return to Origin (RTO) orders:
POST /api/v2/return-payamt-tss-money-undelivered-order
  • Automatic refund processing
  • Platform fees may be refunded (if ENABLE_PLATFORM_FEE_REFUND_ON_UNDELIVERED enabled)
  • Deduction for return shipping if applicable

Partial Cancellations

  • Refund calculated proportionally
  • Shipping charges not refunded for partial cancellations
  • Minimum order value restrictions may apply to remaining items
  • Coupon eligibility re-evaluated

Response

success
boolean
Whether cancellation was successful
message
string
Success or error message
refund_details
object
Detailed refund breakdown
refund_details.total_refund
decimal
Total amount being refunded
refund_details.refund_mode
string
Method of refund (e.g., “TSS Money”, “Original Source”)
refund_details.processing_time
string
Expected refund processing time

Example Request - Cancel Order

{
  "order_id": 123456,
  "cancel_reason": "Changed my mind",
  "refund_mode": 3
}

Example Request - Cancel Line Item

{
  "has_product_id": 789012,
  "cancel_reason": "Wrong size selected",
  "refund_mode": 1
}

Example Response

{
  "success": true,
  "message": "Order cancelled successfully",
  "refund_details": {
    "total_refund": 1299.00,
    "refund_mode": "TSS Money",
    "processing_time": "Instant",
    "breakdown": {
      "product_amount": 1199.00,
      "tss_money_refund": 100.00,
      "discount_amount": 0.00,
      "shipping_refund": 0.00
    }
  }
}

Error Responses

error
string
Error message

Common Errors

  • Order not found - Invalid order ID
  • Order cannot be cancelled at this stage - Outside cancellation window
  • International orders cannot be cancelled - International shipping restriction
  • This order has already been cancelled - Duplicate cancellation attempt
  • Cannot cancel last product in order - Use full order cancellation instead
  • Invalid refund mode selected - Unsupported refund method
  • Bank details required for bank transfer - Missing required information

Return and Exchange

For delivered orders, use return/exchange endpoints instead:
  • Return Window: MAX_RETURN_DAYS from delivery (typically 7-15 days)
  • Exchange Window: MAX_EXCHANGE_DAYS from delivery
  • Exchange Limit: Maximum MAX_EXCHANGE_TIMES exchanges per order

Return Statuses

StatusDescription
RETURN_INITIATED (30)Return request created
RETURN_PICKED_UP (31)Product picked up from customer
RETURN_IN_TRANSIT (32)Return shipment in transit
RETURN_RECEIVED (33)Return received at warehouse
REVERSE_PICKUP_TERMINATED (34)Return pickup cancelled

Exchange Statuses

StatusDescription
EXCHANGE_INITIATEDExchange request created
PRODUCT_PICKED_UPOriginal product picked up
EXCHANGE_IN_TRANSITExchange shipment in transit
EXCHANGE_COMPLETEDNew product delivered
EXCHANGE_TERMINATEDExchange cancelled

Additional Endpoints

Incomplete Order Line Item

POST /api/v2/incomplete-order-line-item
Mark line item as incomplete (not available to fulfill).

Restore Coupon

POST /api/v2/restore-coupon
Restore coupon usage after order cancellation.

Cancel Hyperlocal Order

POST /api/v2/cancel-hl-order
Special endpoint for same-day delivery cancellations.

Refund Hyperlocal Charges

POST /api/v2/refund-hl-charges
Refund hyperlocal delivery fees for cancelled same-day orders.

Notes

  • Cancellations are final and cannot be reversed
  • Refunds to payment gateway typically take 5-7 business days
  • TSS Money and TSS Points refunds are instant
  • Inventory is automatically released upon cancellation
  • Exclusive membership purchases have special cancellation rules
  • Some artist/brand collaborations may have non-cancellable products
  • Automated refund emails are sent to registered email address
  • Cancel duplicate order endpoint available for admin use

Build docs developers (and LLMs) love