---
title: "Bulk update coupon codes"
method: PUT
path: "/coupon-codes/batch"
tags: ["Coupon Codes"]
---

# Bulk update coupon codes

`PUT /coupon-codes/batch`

## Request

- Base URL: `https://api.fabric.inc/v3`
- URL: `https://api.fabric.inc/v3/coupon-codes/batch`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/fabric/apis/offers-coupon-codes/docs/coupon-codes/batch/put.ts> (a function with typed inputs; its response is checked against the schema)

Use this endpoint to update multiple coupon codes using identifiers. Identifiers are a unique combination of a coupon code and a promotion ID. You can update up to 25 codes at a time.

## Headers

- `x-fabric-tenant-id` string, required
- `x-fabric-channel-id` string
- `x-client-id` string
- `x-fabric-request-id` string

## Request body

- BulkUpdateCouponCodesRequest: The details to update the coupon codes.
  - `data` object[], required: The coupon codes to be updated.
    - `identifier` object, required: The ID of the coupon code. It's a unique combination of a coupon code and the associated promotion ID.
      - `promotionId` union, required
        - string: A 24-character system-generated promotion ID.
        - object: The merchant-specified attributes for the promotion, in `name:value` pairs.
          - `name` string, required: The merchant-specified unique name for the additional property associated with the promotion.
          - `values` string, required: The merchant-specified `value` for the `name` attribute associated with the promotion.
      - `couponCode` string, required: The coupon code.
    - `userId` string: The ID of the user who can redeem the coupon.
    - `status` 'ACTIVE' | 'INACTIVE': Coupon code status. `ACTIVE` represents the coupon codes are ready to be redeemed and `INACTIVE` represents the coupon codes are disabled and can't be redeemed.
    - `additionalAttributes` object[]: The merchant-specified additional attributes for the coupon code.
      - `name` string, required: The merchant-specified `name` associated with the coupon code.
      - `values` union, required
        - string: The merchant-specified `values` for the `name` attribute associated with the coupon code.
        - string[]: The merchant-specified attribute `values` associated with the coupon code.

## Response `200`

Accepted

- BulkUpdateCouponCodesResponse: The list of updated coupon codes.
  - `data` CouponCodes[]: The list of updated coupon codes.
    - `id` string, required: 24-character system-generated coupon code
    - `title` string: Title of the promotion associated with the coupon code
    - `userId` string, nullable: User ID of the user who created the coupon code
    - `couponCode` string, required: Coupon code
    - `versionId` string: Version ID of the coupon code, for internal reference
    - `promotionId` string, required: 24-character system-generated promotion ID
    - `startAt` string, date-time: Start date of the coupon code, in UTC format
    - `endAt` string, date-time: End date of the coupon code, in UTC format
    - `status` 'ACTIVE' | 'INACTIVE' | 'REDEEMED', required: Status of the coupon code
    - `additionalAttributes` object[]: Merchant-specified attributes associated with the coupon code
      - `name` string, required: Merchant-specified attribute `name` associated with the coupon code
      - `values` union, required
        - string: Merchant-specified attribute `value` associated with the coupon code
        - string[]: Merchant-specified attribute `values` associated with the coupon code
    - `promotionAdditionalAttributes` object[]: Merchant-specified attributes of the promotion associated with the coupon code
      - `name` string, required: Merchant-specified attribute `name` associated with the related promotion
      - `values` union, required
        - string: Merchant-specified attribute `value` associated with the related promotion
        - string[]: Merchant-specified attribute `values` associated with the related promotion
    - `createdAt` string, date-time, required: Record's creation time
    - `updatedAt` string, date-time, required: Record's last updated time
  - `errors` object[]: The list of possible errors.
    - `identifier` object: The ID of the coupon code. It's a unique combination of `couponCode` and associated `promotionId`.
      - `promotionId` union
        - string: A 24-character system-generated promotion ID.
        - object: The merchant-specified attributes for the promotion, in `name:value` pairs.
          - `name` string, required: The merchant-specified unique name for the additional property associated with the promotion.
          - `values` string, required: The merchant-specified `value` for the `name` attribute associated with the promotion.
      - `couponCode` string: The coupon code.
    - `type` string: The error code.
    - `message` string: An error message corresponding to the `type`.

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `500`: Internal server error

---

[API](https://skmtc.dev/fabric/apis/offers-coupon-codes.md) - [All operations](https://skmtc.dev/fabric/apis/offers-coupon-codes/llms.txt) - [OpenAPI document](https://skmtc.dev/fabric/apis/offers-coupon-codes/revisions/6fc0aab6f08f?raw)
