提问者:小点点

我在shopify order api中获取的位置id为null


我通过shopify admin创建了一个订单,并在执行订单时添加了客户详细信息。json api,我正在获取位置\u id=“null”

现在我需要位置ID来更新履行状态。

如果可能,如何更新订单的位置id。这是我创建订单时的响应。

 {
"orders": [
    {
        "id": 568323571800,
        "email": "sample_test_123_gmail@gmail.com",
        "closed_at": null,
        "created_at": "2018-08-02T15:41:06+05:30",
        "updated_at": "2018-08-02T15:46:06+05:30",
        "number": 9,
        "note": "",
        "token": "a666eb3aea251cc585afc006cbf5b315",
        "gateway": "Cash on Delivery (COD)",
        "test": false,
        "total_price": "200.00",
        "subtotal_price": "200.00",
        "total_weight": 100,
        "total_tax": "0.00",
        "taxes_included": false,
        "currency": "INR",
        "financial_status": "pending",
        "confirmed": true,
        "total_discounts": "0.00",
        "total_line_items_price": "200.00",
        "cart_token": null,
        "buyer_accepts_marketing": false,
        "name": "#1009",
        "referring_site": null,
        "landing_site": null,
        "cancelled_at": null,
        "cancel_reason": null,
        "total_price_usd": "2.92",
        "checkout_token": null,
        "reference": null,
        "user_id": 23090102360,
        "location_id": null,

共3个答案

匿名用户

位置ID与您的库存相关联。首先,确保您已经为库存设置了位置。其次,确保将Shopify设置为您的库存管理提供商。如果您现在为Shopify管理的项目创建订单,您可能会看到一个位置ID。您创建这样的草稿订单的测试可能还没有与Shopify位置完全集成?当您使用前端而不是API预订订单时会发生什么?

匿名用户

订单上的location_id将返回null,除非订单是从Shopify POS位置发出的,在这种情况下,它将返回与该位置关联的location_id

请参见履行指南:https://help.shopify.com/en/api/guides/managing-fulfillments

匿名用户

要按顺序获取locationId,需要在productCreate中传递带有位置id和可用数量的InventoryQuantilities输入。然后您将按顺序获得locationId

{
  "input": {
     "title": "Demo Product",
     "descriptionHtml": "des",
     "productType": "type",
     "vendor": "vendor",
     "handle": "abc1",
     "tags": ["tag1", "tag2"],
     "variants": [
        {
          "title": "small",
          "price": 100,
          "compareAtPrice": 110,
          "position": 1,
          "inventoryQuantities": {
              "availableQuantity": 100,
              "locationId": "gid://shopify/Location/55274340513"
           },
          "inventoryItem": {
             "cost": 200,
             "tracked": true
           }
          }
      ]
   }
}