开放 API
使用说明
获取授权
全部 API
- Shop
- Metafields
- Customer
- CustomerAddress
- Account
- Product
- ProductVariant
- ProductImage
- Theme
- Asset
- Country
- Province
- City
- District
- ScriptTag
- Order
- Shipment
- ShipmentSupplier
- Payment
- PaymentMethod
- Redirect
- Page
- Webhook
- Blog
- BlogAuthor
- CustomerLevel
- StoreFile
- Promotion
- Coupon
- Post
- AfterSale
Coupon
CouponGroup
CouponGroup 为网站的优惠券信息
CouponGroup 相关API
CouponGroup 属性
- id
Integer 类型,优惠券分组的ID。{ "id": 1234 }
- name
String 类型,优惠券的名称。{ "name" : "周年庆优惠券" }
- prefix
String 类型,复用性优惠券的编码。{ "prefix" : "ABCD"}
- enable_mobile_regist
Integer 类型,优惠券的使用条件,订单满多少才可以使用。{ "active_amount" : 400}
- discount_amount
Integer 类型,优惠券的折扣,或者使用金额。{ "discount_amount" : 80}
- quantity_provided
Integer 类型,优惠券最大使用张数。{ "quantity_provided" : 1000 }
- ctype
String 类型,优惠券的类型 normal:普通券,single:复用券。{ "ctype" : "normal" }
- atype
String 类型,优惠券顾客使用方式 single:每个顾客只允许使用一张,normal:每个顾客允许使用多张。{ "atype" : "single" }
- utype
String 类型,优惠券的优惠方式 amount:金额 percentage: 折扣。{ "utype" : "amount" }
- expired_at
DateTime 类型,优惠券的过期时间。{ "expired_at" : "http://standard.v.youhaosuda.com" }
- no_expires
Bool 类型,优惠券是否永久有效 true:永久有效 false: 有使用期限。{ "no_expires" : true }
- quantity_type
Bool 类型,优惠券是否不限制使用张数,只作用在复用型优惠券上,true表示不显示使用张数,false表示限制使用张数(此时配合quantity_provided来获取使用张数限制)。{ "quantity_type" : true }
- used_amount
Number 类型,已经被使用(被领取、被使用)的优惠券数据。{ "used_amount" : 10}
GET /coupon_groups
获取优惠券列表
- 获取优惠券列表
- GET /coupon_groups
HTTP/1.1 200 OK
{ "coupon_groups": [ { "active_amount": 0, "actived_at": "2016-10-09T20:13:00.000+08:00", "atype": "single", "ctype": "normal", "dealing": false, "discount_amount": 1000, "discount_percentage": null, "expired_at": null, "id": 1593, "is_saved": true, "name": "fvafew", "no_expires": true, "prefix": "", "quantity_provided": 100, "status": "actived", "utype": "amount" } ] }
GET /coupon_groups/:id
获取单张优惠券信息
- 获取单张优惠券信息
- GET /coupon_groups/1593
HTTP/1.1 200 OK
{ "coupon_group": { "active_amount": 0, "actived_at": "2016-10-09T20:13:00.000+08:00", "atype": "single", "ctype": "normal", "dealing": false, "discount_amount": 1000, "discount_percentage": null, "expired_at": null, "id": 1593, "is_saved": true, "name": "fvafew", "no_expires": true, "prefix": "", "quantity_provided": 100, "status": "actived", "utype": "amount" } }
PUT /coupon_groups/:id/deliver
派发优惠券
- customer_ids
- 必须,需要分配优惠券的顾客ID,Array类型
- 派发优惠券
- PUT /coupon_groups/1593/deliver
{ "customer_ids": [1,2] }
{}