# Discounts

<details>

<summary>Can I use a discount code on platforms that don't support them?</summary>

It's possible to add discount codes to unsupported platforms, they will have the `NOT_SUPPORTED` status and will be ignored during order submission. This will not cause any errors blocking checkout.

</details>

<details>

<summary>Are discount codes case sensitive?</summary>

While some ecommerce platforms *do* support case insensitive discount codes, this is not universal and some platforms do treat codes as case sensitive. Therefore, since you might not know which platform a code is being applied to and what that platform's rules are, it is best to treat codes as case sensitive and message that to your shoppers.

</details>

<details>

<summary>What does the discounted order look like inside of the e-commerce platform?</summary>

BigCommerce

![images/discounts-using-code1.png](/files/o164H26Y0ehQTC62vfOR)

Magento

![images/discounts-using-code2.png](/files/Pv7h1VL364Gu8cijhRdj)

WooCommerce (Accepts multiple discount codes)

![images/discounts-using-code3.png](/files/XEXaFvX9VOrU5qO256jT)

</details>

<details>

<summary>How does commission work with discount codes?</summary>

The commission is calculated based on the discounted item price.\
During final order submission, after a cart has been fully populated and any discounts are applied we request the final pricing for the cart from the external commerce platform and calculate the commission from those values.

</details>

<details>

<summary>How long does the API call usually take to add a discount?</summary>

Most platforms allow adding discount codes during cart creation, so this approach doesn't add relevant time to the API call, assuming you send in the discounts as part of [create cart](/api-reference/orders-and-checkout/carts/create-cart.md).

The stand alone [add discount API](/api-reference/orders-and-checkout/cart-discounts/add-discount-to-cart.md) varies per platform, but averages around 1 second.

</details>

<details>

<summary>What's the best architectural approach for using the discount code on add cart versus using the dedicated endpoint?</summary>

For a channel just posting orders for the user, it's recommended to add all discounts during cart creation saving the extra call.

For checkout style channels allowing users to add/remove discounts to the cart themselves, it can still make sense to wait to create the cart in Violet until all discounts are added. However, for maximum responsiveness to user inputs and flows, using the [standalone endpoint](/api-reference/orders-and-checkout/cart-discounts/add-discount-to-cart.md) may make the most sense.

</details>

<details>

<summary>How is a discount code different from a promo code? Or other promotion?</summary>

Discount codes and promo codes are used interchangeably in platforms, the same as coupons.

Some platforms may also offer promotions that are added to carts automatically based on preset rules. This is typically just a "retail price" and a "sale price" with the traditional ~~strike through~~ of the retail price.

</details>

<details>

<summary>How can I test these different scenarios and statuses in Test Mode so I know my app is handling each error and case correctly?</summary>

You can test each of the different statuses using the following approaches

* `PENDING`
  * Add a discount code to a platform that doesn’t process it right away, like WooCommerce.
* `APPLIED`
  * Add a valid discount code to a platform that process it right away, like BigCommerce or Magento.
  * Or price a cart with a valid `PENDING` discount code.
* `INVALID`
  * Add any invalid discount code to a platform that process it right away, like BigCommerce or Magento.
  * Or price a cart with a invalid `PENDING` discount code.
* `NOT_SUPPORTED`
  * Add a discount code to any platform that is not listed in our [supported platforms](/prism/checkout-guides/discounts.md#supported-platforms) table.
* `ERROR`
  * Not reproducible in normal circumstances.
* `EXPIRED`
  * Prepare a cart with an `APPLIED` discount, go to merchant platform and disable that discount code, price the cart through the API again.

</details>

<details>

<summary>Can I use discount codes with Apple Pay?</summary>

While most discount codes can be used with Apple Pay, there is limited support for Free Shipping discount codes when using the full [Apple Pay Checkout](/prism/payments/payment-integrations/supported-providers/apple-pay.md) flow. Note these limitations do not apply to the Apple Pay Payment flow.

The issue is that many free shipping codes require a shipping method to have been selected before being applied, but the shopper only selects shipping in the Apple Pay screen, which does not have native support for discount code entry and is thus after your experience's discount entry screen.

One alternative you could consider is storing the shipping code locally until the shipping method is selected and then applying it, while informing the user that it will be applied at checkout.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.violet.io/faqs/discounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
