> ## Documentation Index
> Fetch the complete documentation index at: https://developers.firmly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Apply and manage promotional codes

The Promotions API allows you to apply and clear promotional codes on shopping carts. All promotion validation, discount calculation, and business rules are handled by the merchant's e-commerce platform.

## Overview

The Promotions API provides two simple operations:

* **Add promotional codes** to a cart
* **Clear promotional codes** from a cart

Firmly passes these requests to the merchant system, which determines:

* Whether the code is valid
* What discounts apply
* How the cart totals are affected

## Available Endpoints

<CardGroup cols={2}>
  <Card title="Add Promo Codes" href="/api-reference/promotions/add-promo-codes" icon="plus">
    Apply promotional codes to the cart
  </Card>

  <Card title="Clear Promo Codes" href="/api-reference/promotions/clear-promo-codes" icon="x-circle">
    Remove all promotional codes from the cart
  </Card>
</CardGroup>

## How It Works

When you submit promotional codes through Firmly:

1. **Firmly receives** the promo code(s) from your request
2. **Forwards to merchant** - The codes are sent to the merchant's platform
3. **Merchant validates** - The merchant system checks validity and applicability
4. **Returns updated cart** - The cart response includes any applied discounts

## Important Notes

<Note>
  Firmly does not control promotion logic. Each merchant platform determines:

  * Which codes are valid
  * Discount amounts and types
  * Stacking rules for multiple codes
  * Eligibility requirements
</Note>

## Error Handling

If a promotional code is invalid or cannot be applied, the merchant system will return an appropriate error. Common scenarios include:

* Invalid or expired codes
* Codes that don't meet requirements (e.g., minimum purchase amount)
* Codes that cannot be combined with other promotions

## Next Steps

<CardGroup cols={2}>
  <Card title="Add Promo Codes" icon="tag" href="/api-reference/promotions/add-promo-codes">
    Learn how to apply promotional codes
  </Card>

  <Card title="View Cart" icon="shopping-cart" href="/api-reference/cart-management/get-cart">
    Check cart totals after applying promotions
  </Card>
</CardGroup>
