Coupons
+Batch-generate coupon codes
+POST /{org}/sites/{site}/coupons/batch
Base URL https://api.adobecommerce.live · Staging https://api-stage.adobecommerce.live
Generates `count` (max 500) unique codes with an optional `prefix`, all referencing the given coupon type.
+ +Path parameters
+| Name | Type | Required | Description |
org | string | yes | Organization identifier. |
site | string | yes | Site identifier. |
Request headers
+| Name | Type | Required | Description |
Authorization | string | yes | Bearer token. `Bearer <jwt>`. |
Content-Type | string | yes | Must be `application/json`. |
Request body
+| Field | Type | Required | Description |
typeId | string | yes | Coupon type the generated codes reference. |
count | integer | no | Number of codes to generate (max 500). Defaults to 1. |
prefix | string | no | Optional code prefix. Defaults to "CODE". |
discountOverride | object | null | no | Overrides the coupon type's flat discount for this code. Not allowed when the type is a product-list coupon. |
usageLimit | number | null | no | Total redemption limit for every code; null for unlimited. |
usesPerCustomer | number | null | no | Per-customer redemption limit for every code; null for unlimited. |
expiresAt | string | no | Expiry timestamp (ISO 8601) applied to every generated code. |
Response
+201 The generated code count and code names.
+| Field | Type | Required | Description |
count | integer | yes | Number of codes generated. |
codes | string[] | yes | The generated code names. |
400 Missing typeId, or referenced coupon type not found.
+| Field | Type | Required | Description |
code | string | yes | Machine-readable error code. |
message | string | yes | Human-readable error message. |
errors | object[] | no | Per-field validation failures. |
405 Method not allowed — only POST.
+| Field | Type | Required | Description |
code | string | yes | Machine-readable error code (also sent as the `x-error-code` header). |
message | string | yes | Human-readable error message (also sent as the `x-error` header). |
resource | string | no | The resource type involved, when applicable. |
retryable | boolean | no | Whether the caller may retry the request. |
details | object | no | Optional structured detail. |
{
+ "typeId": "summer-10",
+ "count": 50,
+ "prefix": "SUMMER"
+}
+ {
+ "count": 2,
+ "codes": [
+ "SUMMER-ABCD1234",
+ "SUMMER-EFGH5678"
+ ]
+}
+ {
+ "code": "validation_failed",
+ "message": "invalid request",
+ "errors": [
+ {
+ "path": "$.typeId",
+ "message": "is required"
+ }
+ ]
+}
+ {
+ "code": "method_not_allowed",
+ "message": "GET not allowed"
+}
+