通过WooCommerce rest API创建订单时遇到问题。有两个问题:
通过移动设备创建订单时:- 以“银行转帐”作为付款方式的新订单创建了三个订单记录:- 1.订单状态从待处理付款更改为处理中 2.减少订单库存 3.订单状态从待处理的付款更改为暂停
在创建订单和更新订单付款明细时,我尝试通过API传递订单状态=保留状态。但是问题仍然存在。
订购创建api
POST wc-api / v3 / orders /
身体
{
"order": {
"customer_id": 6925,
"billing_address": {
"first_name": "Android",
"last_name": "Testing",
"address_1": "Address of Developer",
"address_2": "Cengkareng",
"city": "Jakarta Barat",
"state": "6",
"postcode": "12345",
"country": "ID",
"email": "ankurgecr@gmail.com",
"phone": "1234567890"
},
"shipping_address": {
"first_name": "Android",
"last_name": "Testing",
"address_1": "Address of Developer",
"address_2": "Cengkareng",
"city": "Jakarta Barat",
"state": "6",
"postcode": "12345",
"country": "ID"
},
"line_items": [
{
"product_id": 32776,
"quantity": 1,
"subtotal": 10000,
"total": 10000,
"variations": {
"Color": "Blue"
}
}
],
"fee_lines": [
{
"title": "Rp",
"total": 846
}
],
"shipping_lines": [
{
"method_id": "OKE",
"method_title": "JNE OKE",
"total": 29500
}
],
"is_vat_exempt": false
}
}
订单更新API
POST wc-api / orders / [orderID]
身体
{
"order": {
"status": "on-hold",
"payment_details": {
"method_id": "bacs",
"method_title": "Bank Transfer BCA / MANDIRI",
"paid": true
},
"set_paid": true
}
}
Custoemr应该会收到一封电子邮件,显示订单状态为“待定”。
我要附上一张图片以获得实际结果。
注意:如果我们要从网站结帐中放置订单,则工作正常,只有问题在于其余的API。