Remove Discount
Removes a specified discount code and associated tracking tags from a cart, updates the marketing channel, recalculates totals, and returns the updated cart details.
Overview
- Method: POST
- Path:
/brand/cart/remove-discount - Tags: brand
Use Cases
- Customer cancels a discount before checkout.
- Switch a discount code to apply a different promotion.
- Remove invalid or expired discounts from the cart.
- Admin adjustment to correct pricing or policy issues.
- Cleanup tracking tags associated with the discount for accurate analytics.
Parameters
No parameters required.
Request Body
- Content Type:
application/json - Required: Yes
Fields
| Field | Type | Required | Details |
|---|---|---|---|
| discountCode | string | Yes |
Responses
200
Successful response
Content Type: application/json
{
"cart": "string",
"email": "string",
"billing_address_id": "string",
"shipping_address_id": "string",
"region_id": "string",
"customer_id": "string",
"payment_id": "string",
"completed_at": "2024-01-01T00:00:00.000Z",
"payment_authorized_at": "2024-01-01T00:00:00.000Z",
"idempotency_key": "string",
"context": {
"key": {}
},
"sales_channel_id": "string",
"shipping_total": 123,
"discount_total": 123,
"item_tax_total": 123,
"shipping_tax_total": 123,
"tax_total": 123,
"refunded_total": 123,
"total": 123,
"subtotal": 123,
"refundable_amount": 123,
"gift_card_total": 123,
"gift_card_tax_total": 123,
"returnable_items": [
{}
],
"created_at": "2024-01-01T00:00:00.000Z",
"updated_at": "2024-01-01T00:00:00.000Z",
"deleted_at": "2024-01-01T00:00:00.000Z",
"metadata": {
"key": {}
},
"sales_channel": {},
"shipping_address": "string",
"first_name": "string",
"last_name": "string",
"address_1": "string",
"address_2": "string",
"city": "string",
"country_code": "string",
"province": "string",
"postal_code": "string",
"phone": "string"
}400
Bad Request
Content Type: application/json
{
"error": "string",
"details": [
{}
]
}401
Unauthorized
404
Not Found
500
Internal Server Error
Example Usage
curl -X POST \
https://api.pillexa.com/brand/cart/remove-discount \
-H "Content-Type: application/json" \
-d '{"example": "data"}'