Skip to main content
Offer codes (also called discount codes) allow you to provide discounts to customers. You can create both percentage-based and fixed-amount discounts, and make them universal (apply to all products) or product-specific.

List Offer Codes

Retrieve all offer codes for a product, including universal offer codes.

Path Parameters

string
required
The unique identifier of the product

Response

boolean
Whether the request was successful
array
Array of offer code objects

Get Offer Code

Retrieve details for a specific offer code.

Path Parameters

string
required
The unique identifier of the product
string
required
The unique identifier of the offer code

Response

boolean
Whether the request was successful
object
The offer code object

Create Offer Code

Create a new offer code for a product.

Path Parameters

string
required
The unique identifier of the product

Body Parameters

string
required
The discount code that customers will use (letters, numbers, dashes, and underscores only)
string
required
Type of discount: percent for percentage-based or fixed for fixed-amount
integer
required
For percentage discounts: the percentage (0-100) For fixed discounts: can be used instead of amount_cents
integer
For fixed discounts: the discount amount in cents (alternative to amount_off)
boolean
default:"false"
Whether the code applies to all of your products. Pass "true" or "false" as a string.
integer
Maximum number of times this code can be used (omit for unlimited)
You must provide either amount_off or amount_cents when creating an offer code. For percentage discounts, use amount_off. For fixed-amount discounts, use either parameter.

Response

boolean
Whether the request was successful
object
The created offer code object

Update Offer Code

Update an existing offer code’s maximum purchase count.

Path Parameters

string
required
The unique identifier of the product
string
required
The unique identifier of the offer code

Body Parameters

integer
Maximum number of times this code can be used

Response

boolean
Whether the request was successful
object
The updated offer code object

Delete Offer Code

Soft delete an offer code (marks it as deleted but preserves data).

Path Parameters

string
required
The unique identifier of the product
string
required
The unique identifier of the offer code

Response

boolean
Whether the request was successful

Error Codes

Bad Request - Missing required offer code parameters (amount_off or amount_cents)
Unauthorized - Invalid or missing access token
Forbidden - Insufficient permissions (requires edit_products scope for create/update/delete)
Not Found - Product or offer code not found
Unprocessable Entity - Invalid offer code parameters (e.g., discount exceeds product price)