get https://{subdomain}.myshoplaza.com/openapi/2022-01/discount_codes
Retrieves a list of discount code.
Requires
price_rules
access scope. More access scope
The Discount Code List API retrieves a list of all discount codes.
This API is especially useful for:
- Fetching paginated lists of discount codes for review.
- Retrieving details and links for further management of discount codes.
- Validating and auditing discount code data for use.
Request Parameters
Public Request Parameters
Query Parameters
Field | Type | Required | Description | Example |
---|---|---|---|---|
limit | int32 | No | Number of records per page. Maximum: 250. | 50 |
page | int32 | No | Page number to retrieve. | 1 |
need_detail_url | boolean | No | If true , returns detail URLs in the response. | true |
Response Explanation
Public Response Parameters
Successful Response
Field | Type | Example | Description |
---|---|---|---|
page |
int32 |
1 |
Current page number. |
limit |
int32 |
20 |
Number of records per page. |
total |
string |
"1" |
Total number of discount codes available. |
data |
array[object] |
See below. | List of discount codes. |
data[]. |
string |
"1" |
Allocation limit for the discount code. |
data[]. |
string |
"0.0000" |
Maximum allocation amount for the discount code. |
data[]. |
string |
"" |
Method of allocation for the discount code. |
data[]. |
string |
"" |
App ID associated with the discount code. |
data[]. |
string |
"123234" |
Unique code for the discount. |
data[]. |
string |
"all" |
Type of customer selection for the discount. |
data[]. |
string |
"tzt.myshoplaza.com/promotions/coupon/1783371b-76c1-41ab-a09c-531ff54425fc" |
Detail URL for managing the discount. |
data[]. |
string |
"percentage" |
Type of discount, e.g., fixed amount or percentage. |
data[]. |
string |
"-1" |
End timestamp for the discount code. |
data[]. |
array[string] |
[] |
List of entitled filter IDs. |
data[]. |
array[string] |
[] |
List of entitled filters. |
data[]. |
array[string] |
[] |
List of entitled product IDs. |
data[]. |
string |
"1783371b-76c1-41ab-a09c-531ff54425fc" |
Unique identifier for the discount code. |
data[]. |
string |
"1" |
Whether the code is displayed for admins. |
data[]. |
string |
"1" |
Whether the discount can be used once per customer. |
data[]. |
string |
"0" |
Indicates if there are prerequisites for the discount. |
data[]. |
array[string] |
[] |
List of prerequisite customer IDs. |
data[]. |
array[string] |
[] |
List of prerequisite customer segment IDs. |
data[]. |
null |
null |
Number of products associated with the discount. |
data[]. |
string |
"ongoing" |
Current progress status of the discount. |
data[]. |
string |
"{"by":"title","direction":"asc"}" |
Sort order of the discount codes. |
data[]. |
string |
"1682652119" |
Start timestamp for the discount code. |
data[]. |
string |
"1" |
Current status of the discount code. |
data[]. |
string |
"combined_price" |
Target price type for the discount, e.g., combined price. |
data[]. |
string |
"all" |
Target selection type for the discount. |
data[]. |
string |
"line_item" |
Target type for the discount, e.g., line item. |
data[]. |
string |
"0" |
Number of times the discount code has been used. |
data[]. |
string |
"tzt" |
Title of the discount. |
data[]. |
string |
"1" |
Usage limit for the discount code. |
data[]. |
string |
"0" |
Whether the discount can be used with other discounts. |
data[]. |
string |
"normal" |
Current usage state of the discount code. |
data[]. |
float |
1 |
Discount value. |
data[]. |
string |
"percentage" |
Type of value, e.g., fixed amount or percentage. |
data[]. |
array[string] |
[] |
List of variant product IDs. |
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 |