【发布时间】:2016-10-15 06:17:57
【问题描述】:
我一直在尝试开发一款在 Shopify 上通过不同渠道接受订单的应用。我通过 API 成功下订单,但我无法在订单中包含折扣代码。 POST 数据的 JSON 对象如下:
{
order: {
email : request.params.order.email, // string
financial_status : 'pending', // string
send_receipt : true, // boolean
send_fulfillment_receipt : false, // boolean
note : request.params.order.note, // string
discount_codes : [], // supposed to be an array of Object| Problem here,
line_items : request.params.order.line_items, // array
customer : request.params.customer, // JSON object
billing_address : request.params.order.billing_address, // JSON object
shipping_address : request.params.order.shipping_address // JSON object
}
}
根据文档,discount_codes 是这样的 -
Applicable discount codes that can be applied to the order. If no codes exist the value will default to blank. A Discount code will include the following fields:
amount: The amount of the discount.
code: The discount code.
type: The type of discount. Can be one of : "percentage", "shipping", "fixed_amount" (default).
我做错了什么?我的 discount_codes 是这个
[{amount: 100,code:'WELCOME10',type:'percentage'}]
以前有人做过吗?
【问题讨论】:
-
请同时提供正在发送的实际 discunt_code(在评估变量之后)
-
[{amount: 100,code:'WELCOME10',type:'percentage'}]