get https://{subdomain}.myshoplaza.com/openapi/2022-01/price_rules//discount_codes
Requires
price_rules
access scope. More access scope
The Get Discount Code List API retrieves all discount codes associated with a specific price rule.
This API is especially useful for:
- Fetching all discount codes linked to a particular price rule.
- Managing and validating discount codes efficiently.
- Monitoring usage and details of all discount codes under a price rule.
Request Parameters
Public Request Parameters
Path Parameters
Field | Type | Required | Example | Description |
---|---|---|---|---|
price_rule_id | string | Yes | 588fea0b-f15d-4c1d-9390-23661f0194fa | ID of the price rule associated with the discount codes. |
Response Explanation
Public Response Parameters
Success Response
Field | Type | Example | Description |
---|---|---|---|
discount_code.id | string | f819c126-a581-4d66-a909-08282dd35916 | ID of the created discount code. |
discount_code.price_rule_id | string | 588fea0b-f15d-4c1d-9390-23661f0194fa | ID of the associated price rule. |
discount_code.code | string | VIJK8GB0 | The generated discount code. |
discount_code.created_at | string | 2022-06-17 07:48:29 | Timestamp of when the discount code was created. |
discount_code.updated_at | string | 2022-06-17 07:48:29 | Timestamp of the last update. |
discount_code.use_with_other | string | 1 | Indicates whether the discount code can be used with other promotions. |
discount_code.usage_count | string | 0 | Number of times the discount code has been used. |
Error Response
Error responses in the API can be represented using two different fields: errors
and error
. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.
Field | Type | Example | Description |
---|---|---|---|
errors | Array | [ "invalid line_item id"] | A list of errors encountered during the request processing. |
Field | Type | Example | Description |
---|---|---|---|
error | String | "store is not active" | Indicates an error encountered during the process |
Error Detail
Status Code | Message | Possible Reason | Example Response |
---|---|---|---|
400 | Bad Request | Invalid input format or request structure (e.g., missing required fields or incorrect data types). | Bad Request |
Unauthorized | The request is missing valid authentication credentials or the credentials provided are invalid. | Unauthorized | |
404 | Not Found | The ID provided is not existed. | Not Found |