1
votes

I am posting the following Order to the shopify api Order endpoint. The Order shows up in the shop and everything works as it should, except that the stock quantity of the variants in orders placed via the API are not decreased automatically by shopify. When I place an order within the admin console, they are decreased automatically. Shopify inventory tracking is turned on for the products. Any ideas would be greatly appreciated.

  {
  "order": {
    "email": "[email protected]",
    "financial_status": "paid",
    "fulfillment_status": null,
    "send_receipt": true,
    "send_fulfillment_receipt": true,
    "note": "Created by someName",
    "line_items": [
      {
        "variant_id": 21718275463,
        "quantity": 1,
        "price": 99,
        "requires_shipping": true,
        "product_id": 6820646151
      },
      {
        "variant_id": 21717700871,
        "quantity": 1,
        "price": 1000,
        "requires_shipping": true,
        "product_id": 6820646151
      },
      {
        "variant_id": 21717690055,
        "quantity": 1,
        "price": 555,
        "requires_shipping": true,
        "product_id": 6821668807
      }
    ],
    "processing_method": "offsite",
    "shipping_address": {
      "first_name": "Chris",
      "address1": "111 Love Road",
      "phone": "9999999999",
      "city": "St. Louis",
      "zip": "63123",
      "province": "MO",
      "country": "United States",
      "last_name": "Becker",
      "name": "Chris Becker",
      "country_code": "US",
      "province_code": "MO"
    },
    "source_name": "someName",
    "taxes_included": false,
    "shipping_lines": [
      {
        "title": "standard",
        "price": 0.00,
        "code": null,
        "source": "brand owner on shopify",
        "carrier_identifier": null,
        "tax_lines": null
      }
    ],
    "tags": "someName"
  }
}


    {
  "variant": {
    "id": 21718275463,
    "product_id": 6820646151,
    "title": "m / red",
    "price": "99.00",
    "sku": "",
    "position": 2,
    "grams": 0,
    "inventory_policy": "deny",
    "compare_at_price": "900.00",
    "fulfillment_service": "manual",
    "inventory_management": "shopify",
    "option1": "m",
    "option2": "red",
    "option3": null,
    "created_at": "2016-05-27T13:16:26-04:00",
    "updated_at": "2016-05-28T13:28:20-04:00",
    "taxable": false,
    "barcode": "",
    "image_id": 13217378823,
    "inventory_quantity": 1,
    "weight": 0,
    "weight_unit": "lb",
    "old_inventory_quantity": 1,
    "requires_shipping": true
  }
}


{
  "variant": {
    "id": 21717700871,
    "product_id": 6820646151,
    "title": "s / green",
    "price": "1000.00",
    "sku": "",
    "position": 1,
    "grams": 0,
    "inventory_policy": "deny",
    "compare_at_price": "1111.00",
    "fulfillment_service": "manual",
    "inventory_management": "shopify",
    "option1": "s",
    "option2": "green",
    "option3": null,
    "created_at": "2016-05-27T13:05:56-04:00",
    "updated_at": "2016-05-28T12:17:22-04:00",
    "taxable": true,
    "barcode": "",
    "image_id": 13160712135,
    "inventory_quantity": 2,
    "weight": 0,
    "weight_unit": "lb",
    "old_inventory_quantity": 2,
    "requires_shipping": true
  }
}


    {
  "variant": {
    "id": 21717690055,
    "product_id": 6821668807,
    "title": "Default Title",
    "price": "555.00",
    "sku": "",
    "position": 1,
    "grams": 0,
    "inventory_policy": "deny",
    "compare_at_price": "666.00",
    "fulfillment_service": "manual",
    "inventory_management": "shopify",
    "option1": "Default Title",
    "option2": null,
    "option3": null,
    "created_at": "2016-05-27T13:05:39-04:00",
    "updated_at": "2016-05-28T12:17:22-04:00",
    "taxable": true,
    "barcode": "",
    "image_id": null,
    "inventory_quantity": 2,
    "weight": 0,
    "weight_unit": "lb",
    "old_inventory_quantity": 2,
    "requires_shipping": true
  }
}
1
Can you share the variant's JSON as well? - HymnZzy
I added the JSON for the three variants in the order in the question - Christopher Bell

1 Answers

0
votes

You created a fake order using the API. Fake orders like that don't transact money or trigger the usual internal checks and balances without some extra effort. Maybe if you tried adding a fulfillment to the order, Shopify might ding inventory levels? Seems like something to try anyway.