---
title: "cart.coupon.add"
method: POST
path: "/cart.coupon.add.json"
tags: ["cart"]
---

# cart.coupon.add

`POST /cart.coupon.add.json`

## Request

- Base URL: `https://api.api2cart.com/v1.1`
- URL: `https://api.api2cart.com/v1.1/cart.coupon.add.json`
- Auth: API key in header `x-api-key` and API key in header `x-store-key`

Use this method to create a coupon with specified conditions.

## Request body

- CartCouponAdd
  - `code` string, required: Coupon code
  - `action_type` 'percent' | 'fixed', required: Coupon discount type
  - `action_apply_to` 'order_total' | 'item_price' | 'shipping', required: Defines where discount should be applied
  - `action_scope` 'order' | 'matching_items', required: Specify how discount should be applied. If scope=matching_items, then discount will be applied to each of the items that match action conditions. Scope order means that discount will be applied once.
  - `action_amount` number, required: Defines the discount amount value.
  - `codes` string[]: Entity codes
  - `name` string: Coupon name
  - `date_start` string: Date start
  - `date_end` string: Defines when discount code will be expired.
  - `usage_limit` integer: Usage limit for coupon.
  - `usage_limit_per_customer` integer: Usage limit per customer.
  - `action_condition_entity` string: Defines entity for action condition.
  - `action_condition_key` string: Defines entity attribute code for action condition.
  - `action_condition_operator` string: Defines condition operator.
  - `action_condition_value` string: Defines condition attribute value/s. Can be comma separated string.
  - `include_tax` boolean: Indicates whether to apply a discount for taxes.
  - `store_id` string: Store Id
  - `free_cash_on_delivery` boolean: Defines whether the coupon provides free cash on delivery
  - `customer_id` string: Retrieves orders specified by customer id
  - `idempotency_key` string: A unique identifier associated with a specific request. Repeated requests with the same <strong>idempotency_key</strong> return a cached response without re-executing the business logic. <strong>Please note that the cache lifetime is 15 minutes.</strong>

## Response `200`

successful operation

- object
  - `return_code` integer
  - `return_message` string
  - `result` object
    - `coupon_id` string

---

[API](https://skmtc.dev/api2cart/apis/api2cart-openapi.md) · [All operations](https://skmtc.dev/api2cart/apis/api2cart-openapi/llms.txt) · [OpenAPI document](https://skmtc.dev/api2cart/apis/api2cart-openapi/revisions/c34440741693?raw)
