---
title: "Apply coupon to cart"
method: POST
path: "/apply-coupon"
tags: ["Cart"]
---

# Apply coupon to cart

`POST /apply-coupon`

## Request

- Base URL: `http://localhost:8000/api/shop`
- URL: `http://localhost:8000/api/shop/apply-coupon`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-shop-api/docs/apply-coupon/post.ts> (a function with typed inputs; its response is checked against the schema)

Apply a discount coupon code to the cart.

## Headers

- `X-STOREFRONT-KEY` string, required
- `X-Locale` string
- `X-Channel` string
- `X-Currency` string

## Request body

- object
  - `couponCode` string, required: Coupon code to apply

## Response `201`

Coupon applied. Returns the full cart.

## Other responses

- `400`: Missing couponCode, or coupon invalid/inactive/not applicable to this cart.
- `422`: Validation Error

---

[API](https://skmtc.dev/bagisto/apis/bagisto-shop-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-shop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-shop-api/revisions/f619df36bf29?raw)
