Discount Code List

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:

  1. Fetching paginated lists of discount codes for review.
  2. Retrieving details and links for further management of discount codes.
  3. Validating and auditing discount code data for use.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Query Parameters

FieldTypeRequiredDescriptionExample
limitint32NoNumber of records per page. Maximum: 250.50
pageint32NoPage number to retrieve.1
need_detail_urlbooleanNoIf true, returns detail URLs in the response.true

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

FieldTypeExampleDescription
pageint321Current page number.
limitint3220Number of records per page.
totalstring"1"Total number of discount codes available.
dataarray[object]See below.List of discount codes.
data[].allocation_limitstring"1"Allocation limit for the discount code.
data[].allocation_limit_amountstring"0.0000"Maximum allocation amount for the discount code.
data[].allocation_methodstring""Method of allocation for the discount code.
data[].app_idstring""App ID associated with the discount code.
data[].codestring"123234"Unique code for the discount.
data[].customer_selectionstring"all"Type of customer selection for the discount.
data[].detail_urlstring"tzt.myshoplaza.com/promotions/coupon/1783371b-76c1-41ab-a09c-531ff54425fc"Detail URL for managing the discount.
data[].discount_typestring"percentage"Type of discount, e.g., fixed amount or percentage.
data[].ends_atstring"-1"End timestamp for the discount code.
data[].entitled_filter_idsarray[string][]List of entitled filter IDs.
data[].entitled_filter_listarray[string][]List of entitled filters.
data[].entitled_product_idsarray[string][]List of entitled product IDs.
data[].idstring"1783371b-76c1-41ab-a09c-531ff54425fc"Unique identifier for the discount code.
data[].is_admin_showstring"1"Whether the code is displayed for admins.
data[].once_per_customerstring"1"Whether the discount can be used once per customer.
data[].prerequisitestring"0"Indicates if there are prerequisites for the discount.
data[].prerequisite_customer_idsarray[string][]List of prerequisite customer IDs.
data[].prerequisite_customer_segment_idsarray[string][]List of prerequisite customer segment IDs.
data[].product_numnullnullNumber of products associated with the discount.
data[].progressstring"ongoing"Current progress status of the discount.
data[].sortstring"{\"by\":\"title\",\"direction\":\"asc\"}"Sort order of the discount codes.
data[].starts_atstring"1682652119"Start timestamp for the discount code.
data[].statusstring"1"Current status of the discount code.
data[].target_price_typestring"combined_price"Target price type for the discount, e.g., combined price.
data[].target_selectionstring"all"Target selection type for the discount.
data[].target_typestring"line_item"Target type for the discount, e.g., line item.
data[].times_usedstring"0"Number of times the discount code has been used.
data[].titlestring"tzt"Title of the discount.
data[].usage_limitstring"1"Usage limit for the discount code.
data[].use_with_otherstring"0"Whether the discount can be used with other discounts.
data[].using_statestring"normal"Current usage state of the discount code.
data[].valuefloat1Discount value.
data[].value_typestring"percentage"Type of value, e.g., fixed amount or percentage.
data[].variant_product_idsarray[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.

FieldTypeExampleDescription
errorsArray[ "invalid line_item id"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!