Inventory not updating when after fulfill order which is created from API

Sajith_Lakjaya_
Shopify Partner
1 0 2

I have created a order using API and fulfill it from shopify admin section, But inventory isn't decremented.

Here is the request and response for create that order

 Request

{  
   "send_receipt":false,
   "send_fulfillment_receipt":false,
   "inventory_behavior":"decrement_obeying_policy",
   "order":{  
      "billing_address":{  
         "address1":"101 main streer",
         "address2":"",
         "city":"los angeles",
         "country_code":"US",
         "default":false,
         "last_name":"xxxxx"
      },
      "buyer_accepts_marketing":false,
      "created_at":"2017-03-30T05:08:40.6770078Z",
      "email":"xxxxxx",
      "financial_status":"paid",
      "line_items":[  
         {  
            "fulfillable_quantity":1,
            "grams":0,
            "price":150.0,
            "quantity":1,
            "requires_shipping":true,
            "variant_id":40711279302,
            "gift_card":false,
            "taxable":false,
            "total_discount":0.0
         }
      ],
      "note":"Order 2280261 placed on xxxxx",
      "number":0,
      "order_number":0,
      "shipping_lines":[  
         {  
            "price":25.0,
            "title":"Shipping Cost"
         }
      ],
      "subtotal_price":150.0,
      "taxes_included":false,
      "total_discounts":0.0,
      "total_line_items_price":0.0,
      "total_price":175.0,
      "total_price_usd":0.0,
      "total_tax":0.0,
      "updated_at":"0001-01-01T00:00:00"
   }
}

Response

{
  "order": {
    "id": 5363459654,
    "email": "xxxxxxxxxxxx",
    "closed_at": null,
    "created_at": "2017-03-30T01:24:16-04:00",
    "updated_at": "2017-03-30T01:24:16-04:00",
    "number": 50,
    "note": "Order 2280261 placed on xxxxx",
    "token": "2da54f393bcc76505fc8d744adad0aee",
    "gateway": "",
    "test": false,
    "total_price": "175.00",
    "subtotal_price": "150.00",
    "total_weight": 0,
    "total_tax": "0.00",
    "taxes_included": false,
    "currency": "USD",
    "financial_status": "paid",
    "confirmed": true,
    "total_discounts": "0.00",
    "total_line_items_price": "150.00",
    "cart_token": null,
    "buyer_accepts_marketing": false,
    "name": "#1050",
    "referring_site": null,
    "landing_site": null,
    "cancelled_at": null,
    "cancel_reason": null,
    "total_price_usd": "175.00",
    "checkout_token": null,
    "reference": null,
    "user_id": null,
    "location_id": null,
    "source_identifier": null,
    "source_url": null,
    "processed_at": "2017-03-30T01:08:40-04:00",
    "device_id": null,
    "browser_ip": null,
    "landing_site_ref": null,
    "order_number": 1050,
    "discount_codes": [],
    "note_attributes": [],
    "payment_gateway_names": [],
    "processing_method": "",
    "checkout_id": null,
    "source_name": "1332793",
    "fulfillment_status": null,
    "tax_lines": [],
    "tags": "",
    "contact_email": "xxxxxxxxx",
    "order_status_url": null,
    "line_items": [
      {
        "id": 10609912838,
        "variant_id": 40711279302,
        "title": "NIKE FLYKNIT RACER",
        "quantity": 1,
        "price": "150.00",
        "grams": 0,
        "sku": "",
        "variant_title": "10.5",
        "vendor": "My xxxxxx Store",
        "fulfillment_service": "manual",
        "product_id": 10185979846,
        "requires_shipping": true,
        "taxable": false,
        "gift_card": false,
        "name": "NIKE FLYKNIT RACER - 10.5",
        "variant_inventory_management": "shopify",
        "properties": [],
        "product_exists": true,
        "fulfillable_quantity": 1,
        "total_discount": "0.00",
        "fulfillment_status": null,
        "tax_lines": []
      }
    ],
    "shipping_lines": [
      {
        "id": 4414125830,
        "title": "Shipping Cost",
        "price": "25.00",
        "code": "Shipping Cost",
        "source": null,
        "phone": null,
        "requested_fulfillment_service_id": null,
        "delivery_category": null,
        "carrier_identifier": null,
        "tax_lines": []
      }
    ],
    "billing_address": {
      "first_name": null,
      "address1": "101 main streer",
      "phone": null,
      "city": "los angeles",
      "zip": null,
      "province": null,
      "country": "United States",
      "last_name": "xxxxxxx",
      "address2": "",
      "company": null,
      "latitude": null,
      "longitude": null,
      "name": "xxxxxx",
      "country_code": "US",
      "province_code": null
    },
    "fulfillments": [],
    "refunds": [],
    "customer": {
      "id": 5959790726,
      "email": "xxxxxxx",
      "accepts_marketing": false,
      "created_at": "2017-03-29T08:10:08-04:00",
      "updated_at": "2017-03-30T01:24:16-04:00",
      "first_name": null,
      "last_name": "xxxxx",
      "orders_count": 19,
      "state": "disabled",
      "total_spent": "0.00",
      "last_order_id": 5363459654,
      "note": null,
      "verified_email": true,
      "multipass_identifier": null,
      "tax_exempt": false,
      "phone": null,
      "tags": "",
      "last_order_name": "#1050",
      "default_address": {
        "id": 6289966278,
        "first_name": null,
        "last_name": "xxxxxxx",
        "company": null,
        "address1": "101 main streer",
        "address2": "",
        "city": "los angeles",
        "province": null,
        "country": "United States",
        "zip": null,
        "phone": null,
        "name": "xxxxxxxxx",
        "province_code": null,
        "country_code": "US",
        "country_name": "United States",
        "default": true
      }
    }
  }
}

If i create the order manually (Shopify Admin) and fulfil it manually (Shopify Admin)) then inventory is decremented.  Why isn't inventory decremented in the first instance, but is in the second?

 

APIANT
Shopify Partner
24 1 30

I have the same issue. 

Do I have to use the inventory API after fulfilling an order to deduct the inventory level?

0 Likes
janjua
New Member
1 0 0

Any solution for this?

0 Likes