需要 read_discounts 权限点。
更多权限点使用信息,请参考:
GET https://{handle}.myshopline.com/admin/openapi/v20250601/sales/discount/code
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
优惠码查询
查询参数
  • code string
    折扣码
    Example: 8KRKY3Q85AWA
  • ends_at string
    结束时间
    Example: 2024-12-11T11:33:00+08:00
  • page_num integer
    页码
    Example: 1
  • page_size integer
    分页大小
    Example: 10
  • starts_at string
    开始时间
    Example: 2022-11-11T11:33:00+08:00
  • value_type string
    优惠类型(fixed_amount-满减,percentage-满折,nth_items_discount_benefit-第n件折扣)
    Example: percentage
请求头
  • Content-Type required
    字段值固定为application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。请参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
响应
更多状态码信息请参考 HTTP 状态码

响应头
  • traceId
    traceId
响应体
  • discount_codesobject[]
    优惠码信息
  • code string
    折扣码
    Example: LM36NAKX0THB
  • customer_getsobject[]
    条件和权益
  • prerequisite_quantity_rangeobject
    总个数
  • greater_than long
    大于
  • greater_than_or_equal_to long
    大于等于
  • less_than long
    小于
  • less_than_or_equal_to long
    小于等于
  • prerequisite_subtotal_rangeobject
    总金额
  • greater_than long
    大于
  • greater_than_or_equal_to long
    大于等于
  • less_than long
    小于
  • less_than_or_equal_to long
    小于等于
  • value long
    数值
    Example: -10
  • ends_at string
    结束时间
    Example: 2022-07-28T17:26:00+08:00
  • starts_at string
    开始时间
    Example: 2022-05-28T17:26:00+08:00
  • title string
    标题
    Example: Order percentage discount code
  • value_type string
    优惠类型
    Example: percentage
  • page_infoobject
    分页信息
  • page_num integer
    页码
    Example: 1
  • page_size integer
    分页大小
    Example: 10
  • total integer
    总数
    Example: 1
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601

ParamOptions

header required
query
query
query
query
query
query

Language

curl --request GET \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601/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
根据折扣码查询折扣码活动
Response
{
"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"
}
],
"page_info": {
"page_num": 1,
"page_size": 10,
"total": 1
}
}
这篇文章对你有帮助吗?