Version: 202201
Create Discount Code
POST/openapi/2022-01/price_rules/:price_rule_id/discount_codes
Creates a discount code associated with the specified price rule.
Request
Path Parameters
price_rule_id stringrequired
Price rule ID
- application/json
- Body
- Example
Body
discount_code object
codestringrequired
Discount code, e.g. SGTIOZT
{
"discount_code": {
"code": "string"
}
}
Responses
- 200
200
- application/json
- Schema
- Example
- Result
Schema
discount_code object
idstring
Example:
f819c126-a581-4d66-a909-08282dd35916price_rule_idstring
Example:
588fea0b-f15d-4c1d-9390-23661f0194facodestring
Example:
VIJK8GB0created_atstring
Example:
2022-06-17 07:48:29updated_atstring
Example:
2022-06-17 07:48:29use_with_otherstring
Example:
1usage_countstring
Example:
0{
"discount_code": {
"id": "f819c126-a581-4d66-a909-08282dd35916",
"price_rule_id": "588fea0b-f15d-4c1d-9390-23661f0194fa",
"code": "VIJK8GB0",
"created_at": "2022-06-17 07:48:29",
"updated_at": "2022-06-17 07:48:29",
"use_with_other": "1",
"usage_count": "0"
}
}
{
"discount_code": {
"id": "f819c126-a581-4d66-a909-08282dd35916",
"price_rule_id": "588fea0b-f15d-4c1d-9390-23661f0194fa",
"code": "VIJK8GB0",
"created_at": "2022-06-17 07:48:29",
"updated_at": "2022-06-17 07:48:29",
"use_with_other": "1",
"usage_count": "0"
}
}