Create Order: Unable to reserve inventory

Highlighted
New Member
1 0 0

Hi there!

I'm developing an app in Shopify, and I'm trying to create an order in one store that has installed my app,

this is the request:

{ "method": "post", "url": "https://xxxx.myshopify.com/admin/api/2020-04/orders.json", "headers": { "Content-Type": "application/json", "X-Shopify-Access-Token": "shpat_xxxx" } }

with this body:

{
"order": {
"name": "319816",
"order_number": "319816",
"tags": "LazadaPH",
"billing_address": {
"address1": "St g",
"city": "Malaybalay",
"country": "Philippines",
"first_name": "Jacque",
"name": "Jacque",
"phone": "xxxx"
},
"shipping_address": {
"address1": "St",
"city": "Malaybalay",
"country": "Philippines",
"first_name": "Jacque",
"name": "Jacque",
"phone": "xxxx"
},
"customer": {
"first_name": "Jaki"
},
"financial_status": "paid",
"location_id": "31103189075",
"payment_gateway_names": [
"Lazada_GENERIC"
],
"phone": "xxxx",
"processing_method": "direct",
"source_name": "LazadaPH",
"taxes_included": true,
"total_price": 850.0,
"line_items": [
{
"price": 850.0,
"quantity": 1,
"sku": "RC0010-BX",
"title": "TheRack",
"variant_id": "21461967110227",
"location_id": "31103189075",
"name": "TheRack"
}
],
"shipping_lines": [
{
"code": "E",
"price": 148.0,
"source": "LazadaPH",
"title": "Entrego"
}
],
"inventory_behaviour": "decrement_obeying_policy"
}
}

 and this is the response:

{"response_code":422}

{"errors":{"line_items":["Unable to reserve inventory"]}}
 
 
After that response, I consult the inventory level of the item of the order, and the inventory has SKU in that store.
Please, Could you help me in this case? What I should do?
Regards!
0 Likes