Apply a validated coupon code to a pending order and automatically calculate the discount.
| Header | Type | Description |
|---|---|---|
Content-Type | string | Always set to application/json. |
x-shop-id | string | Shop identifier to associate the user with your store. |
Authorization | string | Bearer token for authenticated user (required). |
| Field | Type | Required | Description |
|---|---|---|---|
orderId | string | Yes | Order ID to apply the coupon to. |
code | string | Yes | Coupon code to apply (case-insensitive). |
| Field | Type | Description |
|---|---|---|
order._id | string | Order identifier. |
order.orderId | number | Human-readable order number. |
order.subtotal | number | Order subtotal before shipping and discount. |
order.shippingCost | number | Shipping cost for the order. |
order.discount | number | Discount amount applied by the coupon. |
order.total | number | Final order total (subtotal + shipping - discount). |
order.coupon | object | Applied coupon details. |
pending status (cannot apply to completed/cancelled orders)JWT issued by the Salesive Store API for authenticated shoppers.
Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.
Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.