---
title: "Add coupon codes"
method: POST
path: "/coupons/{coupon_id}"
tags: ["Coupons"]
---

# Add coupon codes

`POST /coupons/{coupon_id}`

Adds new codes to an existing coupon. This operation is additive —
existing codes are preserved and the new codes are appended.

**Code handling**

- **Case:** Codes are normalized to uppercase on storage. `summer10`
  and `SUMMER10` are treated as the same code.
- **Duplicates:** Duplicate codes within a single request are
  accepted without error and echoed verbatim in the response, but
  storage silently dedupes to a single entry per unique
  (case-insensitive) code. Call
  `GET /coupons/{coupon_id}/codes` after a write to confirm the
  stored state.
- **Format:** Codes must contain only alphanumeric characters,
  hyphens, and underscores. Spaces and other special characters
  are rejected.

## Path parameters

- `coupon_id` string, required

## Request body

- AddCodesRequest
  - `codes` string[], required — Coupon codes to add to the coupon. **Code handling** - **Case:** Codes are normalized to uppercase on storage. `summer10` and `SUMMER10` are stored as the same code. - **Duplicates:** Duplicate codes within a single request do not cause the request to be rejected. The API accepts the request, returns `result: success`, and echoes every submitted code verbatim in the response. However, storage silently dedupes (case-insensitively) to a single entry per unique code. Call `GET /coupons/{coupon_id}/codes` after the write to confirm the stored state. - **Format:** Alphanumeric characters, hyphens, and underscores only. Spaces and other special characters are rejected.

## Response `200`

Codes successfully added.

- AddCodesSuccessResponse
  - `coupon` string — Path identifier of the coupon the codes were added to.
  - `codes` string[] — The codes as they were submitted in the request — echoed verbatim, including any case variation. **Code handling** - **Request echo, not stored state:** This array reflects the request payload, not what was persisted. Codes are normalized to uppercase on storage, and duplicates (including case-insensitive duplicates) are silently deduped. The response is not a reliable indicator of what was actually stored. - **Verification:** Call `GET /coupons/{coupon_id}/codes` after a write to confirm the stored codes.
  - `result` 'success' — Indicates the operation succeeded.

## Other responses

- `400` — Validation or request error. Returns `200 OK` — always check the `result` field rather than relying on the HTTP status code alone.

---

[API](https://skmtc.dev/fastspring/apis/fastspring-api-accounts.md) · [All operations](https://skmtc.dev/fastspring/apis/fastspring-api-accounts/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fastspring/fastspring-api-accounts/revisions/ae2f0b97db3e/schema)
