需要 write_gift_card 权限点。
更多权限点使用信息,请参考:
POST https://{handle}.myshopline.com/admin/openapi/v20250601/gift_cards.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
创建礼品卡
请求头
  • Content-Type required
    字段值固定为application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。请参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
  • code string
    礼品卡编码
    Example: dbe95e7f02606fc4
  • customer_id string
    当前礼品卡分配给的客户的客户ID
    Example: 4200113946
  • expires_on string
    当前礼品卡的到期时间
    Example: 2022-08-16T21:20:50+08:00
  • initial_value string required
    礼品卡初始金额
    Example: 200
  • note string
    当前礼品卡的备注信息,字符数量限制500
    Example: This is a note
响应
更多状态码信息请参考 HTTP 状态码

响应头
  • traceId
    traceId
响应体
  • gift_cardobject
    礼品卡信息
  • api_client_id string
    调用方ID
    Example: 30157043359245339231360282
  • balance string
    礼品卡余额
    Example: 200
  • code string
    礼品卡编码
    Example: dbe95e7f02606fc4
  • created_at string
    礼品卡创建时间
    Example: 2023-08-16T23:59:59+08:00
  • currency string
    礼品卡面值对应币种
    Example: CNY
  • customer_id string
    当前礼品卡分配给的客户的客户ID
    Example: 4200113946
  • disabled_at string
    礼品卡禁用时间
    Example: 2023-08-16T23:59:59+08:00
  • expires_on string
    当前礼品卡的到期时间,null为永不过期
    Example: 2023-08-16T23:59:59+08:00
  • id string
    礼品卡ID
    Example: 30157043359245339231360282
  • initial_value string
    礼品卡初始金额
    Example: 200
  • last_characters string
    code的最后四位字符
    Example: 6fc4
  • line_item_id string
    关联的订单物品
    Example: 18060183094426803997483534
  • note string
    当前礼品卡的备注信息
    Example: This is a note
  • order_id string
    关联的订单ID
    Example: 24060486231247568944830202
  • updated_at string
    礼品卡更新时间
    Example: 2023-08-16T23:59:59+08:00
  • user_id string
    用户在admin界面上创建礼品卡时的管理员账户ID
    Example: 4214250478
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601

ParamOptions

header required

Body

required
{
  "code": "dbe95e7f02606fc4",
  "customer_id": "4200113946",
  "expires_on": "2022-08-16T21:20:50+08:00",
  "initial_value": "200",
  "note": "This is a note"
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601/gift_cards.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json' \
--data '
{
"code": "dbe95e7f02606fc4",
"customer_id": "4200113946",
"expires_on": "2022-08-16T21:20:50+08:00",
"initial_value": "200",
"note": "This is a note"
}
'
这篇文章对你有帮助吗?

Error loading component.

Error loading component.