get https://{subdomain}.myshoplaza.com/openapi/2022-01/salespops/datagraph
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
Query Parameters
Name | Type | Description | Required/Optional | Example |
---|---|---|---|---|
type | string | The data type, e.g., banner | Required | banner |
subtype | string | The data subtype, e.g., sales_pop_exposure | Required | sales_pop_exposure |
begin_time | int | The datagraph begin time, in timestamp format | Required | 1680000000 |
end_time | int | The datagraph end time, in timestamp format | Required | 1680086400 |
tz | int | The time zone offset, e.g., 8 for UTC+8 | Required | 8 |
Response Explanation
Public Response Parameters
Success Response
Name | Type | Description | Example |
---|---|---|---|
checkout | int | The total number of checkouts | 0 |
click | int | The total number of clicks | 0 |
exposure | int | The total number of exposures | 0 |
purchase | int | The total number of purchases | 0 |
sales | int | The total sales generated | 0 |
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 | |
500 | Internal Server Error | Invalid input format | Internal Server Error |