Requires read_discounts access scope.
For more info, refer to:
GET https://{handle}.myshopline.com/admin/openapi/v20260301/sales/discount/code
handle : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is open001.myshopline.com , the store handle is open001 .
Promo code query
Query Parameters
  • code string
    Promo code
    Example: 8KRKY3Q85AWA
  • ends_at string
    End time
    Example: 2024-12-11T11:33:00+08:00
  • page_num integer
    Page number
    Example: 1
  • page_size integer
    Paging size
    Example: 10
  • starts_at string
    Start time
    Example: 2022-11-11T11:33:00+08:00
  • value_type string
    Types of discount (fixed_amount-amount off, percentage-percent off, nth_items_discount_benefit-quantity discount)
    Example: percentage
Request Headers
  • Content-Type string required
    The field must be set to the fixed value application/json; charset=utf-8.
  • Authorization string required
    The access token for the API resource. Refer to App authorization to obtain the access token, and then pass the obtained token in the Bearer format.
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Status Codes
For the complete list of codes and messages, see Http status code.

Response Headers
  • traceId
    A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.
Response Body
  • discount_codesobject[]
    Promo code information
  • ends_at string
    End time
    Example: 2022-07-28T17:26:00+08:00
  • starts_at string
    Start time
    Example: 2022-05-28T17:26:00+08:00
  • title string
    Headline
    Example: Order percentage discount code
  • value_type string
    Discount type
    Example: percentage
  • code string
    Promo code
    Example: 8KRKY3Q85AWA
  • customer_getsobject[]
    Conditions and Benefits
  • prerequisite_quantity_rangeobject
    Total number
  • less_than_or_equal_to long
    Less than or equal to
  • greater_than long
    Greater than
  • greater_than_or_equal_to long
    Greater than or equal to
  • less_than long
    Less than
  • prerequisite_subtotal_rangeobject
    Total amount
  • greater_than long
    Greater than
  • greater_than_or_equal_to long
    Greater than or equal to
  • less_than long
    Less than
  • less_than_or_equal_to long
    Less than or equal to
  • value long
    Values
    Example: -10
  • page_infoobject
    Paging information
  • page_num integer
    Page number
    Example: 1
  • page_size integer
    Paging size
    Example: 10
  • total integer
    Total number
    Example: 1
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301

ParamOptions

header required
query
query
query
query
query
query

Language

curl --request GET \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301/sales/discount/code \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
Genju discount code activity based on discount code
Response
{
"page_info": {
"page_num": 1,
"page_size": 10,
"total": 1
},
"discount_codes": [
{
"code": "8KRKY3Q85AWA",
"customer_gets": [
{
"prerequisite_subtotal_range": {
"greater_than_or_equal_to": 10000
},
"value": -10
}
],
"starts_at": "2023-08-10T11:26:00+08:00",
"title": "Order percentage discount code",
"value_type": "percentage"
}
]
}
Was this article helpful to you?