优惠券API / 更新优惠券
优惠券API / 更新优惠券
发布日期:2017-10-27
浏览次数:1943
1.1 说明
| 路径 | http://www.your_website_domain.com/FeiEditor/api_v1/shop/coupons/update |
| 方法 | POST |
| 说明 | 创建一个新用户 |
1.2 参数
| 名称 | 必须 | 类型 | 描述 |
| id | Yes | int | 需要更新的优惠券的编号 |
| code | No | string | 优惠券代码,不能有重复的 |
| type | No | string |
优惠券类型,可以是fixed_cart, percent, fixed_product 和 percent_product 中的任何一个。默认是 fixed_cart 。
fixed_cart - 通用固定金额
percent - 通用百分比
fixed_product - 某商品固定金额
percent_product - 某商品百分比
|
| amount | No | int | 优惠券金额或百分比,数字 |
| individual_use | No | 布尔值 | 是否只能单独使用此优惠券,默认是否 |
| product_ids | No | string | 能使用此优惠券使用的商品,如果需要多个用英文逗号隔开,例如:123,456。 |
| exclude_product_ids | No | string | 不能使用此优惠券使用的商品,如果需要多个用英文逗号隔开,例如:123,456。 |
| usage_limit | No | int | 这个优惠券最多被使用多少次,默认没有限制 |
| usage_limit_per_user | No | int | 每个顾客最大可以使用的数量,默认没有限制 |
| expiry_date | No | date | 过期日期,例如:2100-01-01,默认不过期 |
| enable_free_shipping | No | 布尔值 | 是否免运费 |
| product_category_ids | No | string | 能使用此优惠券使用的商品分类,如果需要多个用英文逗号隔开,例如:123,456。 |
| exclude_product_category_ids | No | string | 不能使用此优惠券的商品分类,如果需要多个用英文逗号隔开,例如:123,456。 |
| minimum_amount | No | int | 购物车中满多少才能使用此优惠券 |
| customer_emails | No | string | 能使用此优惠券的客户的邮箱,如果有多个客户请用英文逗号分开。例如:user01@api.com,user02@api.com |
| description | No | string | 优惠券的描述 |
1.3 返回结果
| 正确结果 |
| 返回格式:JSON |
| { "customer": { "id": 1, "created_at": "2017-10-10T18:00:00Z", "email": "demo@api.com", "first_name": "Demo", "last_name": "User", "username": "demouser01", "last_order_id": 123, "last_order_date": "2017-10-10T18:00:00Z", "orders_count": 10, "total_spent": "1034.58", "avatar_url": "", "billing_address": { "first_name": "", "last_name": "", "company": "", "address_1": "", "address_2": "", "city": "", "state": "", "postcode": "", "country": "", "email": "", "phone": "" }, "shipping_address": { "first_name": "", "last_name": "", "company": "", "address_1": "", "address_2": "", "city": "", "state": "", "postcode": "", "country": "" } } } |
