Remove Coupon
Remove an applied coupon code from the cart.
Authentication
This mutation supports both authenticated customers and guest users:
- Authenticated customers: Provide a valid customer authentication token in the
Authorizationheader. Obtain this token via the Customer Login API. - Guest users: Provide the Guest Cart Token
cartTokenobtained from the Create Cart mutation.
Authorization: Bearer <accessToken>Response
| Field | Type | Description |
|---|---|---|
createRemoveCoupon | Cart | Updated cart without coupon |
message | String | Success or error message |
success | Boolean | Removal success status |
Cart Response Fields
| Field | Type | Description |
|---|---|---|
id | String | Cart ID |
couponCode | String | Coupon code (null if removed) |
discountAmount | Float | Discount amount (0 if removed) |
grandTotal | Float | Cart total without discount |
discountAmount | Float | Discounted amount |
Behavior
- Removes the applied coupon from the cart
- Recalculates cart totals
- Discount is no longer applied
- Cart becomes valid again without coupon requirement
Error Responses
json
{
"errors": {
"cartId": ["Cart not found."],
"coupon": ["No coupon is currently applied to this cart."]
}
}
