Version: 202506
Batch create discount codes
POST/openapi/2025-06/price_rules/:price_rule_id/discount_codes/batch
Creates multiple discount codes in a single request.
Request
Path Parameters
price_rule_id stringrequired
Price rule ID
- application/json
- Body
- Example
Bodyrequired
- Array [
- ]
discount_codes object[]required
List of discount codes
codestring
Code
{
"discount_codes": [
{
"code": "string"
}
]
}
Responses
- 200
OK
- application/json
- Schema
- Example
Schema
- Array [
- ]
codestring
error code
messagestring
error message
data object
discount_codes object[]
List of discount codes
idstring
Discount ID
price_rule_idstring
Price rule ID
codestring
Discount code
created_atstring
Creation timestamp, in ISO-8601 format
updated_atstring
Last update timestamp, in ISO-8601 format
use_with_otherint32
Whether discount can be used with others
usage_countint32
Number of times used
errors object
Validation errors keyed by field name
property name*string
{
"code": "string",
"message": "string",
"data": {
"discount_codes": [
{
"id": "string",
"price_rule_id": "string",
"code": "string",
"created_at": "string",
"updated_at": "string",
"use_with_other": 0,
"usage_count": 0,
"errors": {}
}
]
}
}