需要 read_discounts 权限点。
更多权限点使用信息,请参考:
GET https://{handle}.myshopline.com/admin/openapi/v20250601/sales/price_rules/:price_rule_id/batch/:batch_id.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
根据任务Id查询优惠码信息
路径参数
  • batch_id string required
    任务id
    Example: 6018676942227642851
  • price_rule_id string required
    折扣码规则id
    Example: 6018642574989862445
请求头
  • 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_code_creationobject
    优惠码创建任务信息
  • codes_count integer
    任务准备创建优惠码的数量
    Example: 1
  • completed_at string
    任务优惠码的创建完成时间
    Example: 2023-07-11T17:53:39+08:00
  • created_at string
    任务的创建时间
    Example: 2023-07-11T17:53:30+08:00
  • failed_count integer
    任务已创建失败的优惠码数量
  • id string
    任务的Id
    Example: 6018676942227642851
  • imported_count integer
    任务已创建优惠码的数量
    Example: 1
  • logs array
    创建的日志
    Example: []
  • price_rule_id string
    折扣码规则id
    Example: 6018642574989862445
  • started_at string
    批量创建折扣码任务的开始时间
    Example: 2023-07-11T17:53:39+08:00
  • status string
    任务状态,queued:已确认,但尚未开始;running:正在进行中;completed:已完成
    Example: completed
  • updated_at string
    任务的更新时间
    Example: 2023-07-11T17:53:39+08:00
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601

ParamOptions

path required
path required
header required

Language

curl --request GET \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601/sales/price_rules/price_rule_id/batch/batch_id.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
根据批量创建任务id和price_rule_id查询 批量创建折扣码任务信息
Response
{
"discount_code_creation": {
"codes_count": 1,
"completed_at": "2023-07-11T17:53:39+08:00",
"created_at": "2023-07-11T17:53:30+08:00",
"failed_count": 0,
"id": "6018676942227642851",
"imported_count": 1,
"logs": [],
"price_rule_id": "6018642574989862445",
"started_at": "2023-07-11T17:53:39+08:00",
"status": "completed",
"updated_at": "2023-07-11T17:53:39+08:00"
}
}
这篇文章对你有帮助吗?