Skip to main content
Generate 1–500 random promotion codes for an active coupon. All codes in the batch share the same restrictions and batchId, and are returned together in the response — for example, to export as a CSV of single-use codes.
Authentication: API Key
Always send an X-Idempotency-Key and retry with the same key. Codes are random, so a retry without the key creates a second batch.

Request Body

Each code is prefix + random part, e.g. VIP-7KQ2MZ9H3X. Generated codes never match an active code in the same store and environment.

Example Request

Success Response (200)

Response Fields

Errors

Retry policy: Never retry 4xx — fix the request and resubmit. Retry 5xx with exponential backoff (start 5s, max 3 attempts). Always retry with the same X-Idempotency-Key.