【问题标题】:Stock Quantity of ProductVariant not decreased in shopify shop when placing order via API通过 API 下订单时,shopify 商店中 ProductVariant 的库存数量没有减少
【发布时间】:2016-09-26 20:24:11
【问题描述】:

我将以下订单发布到 shopify api Order 端点。订单显示在商店中,一切正常,除了通过 API 下达的订单中变体的库存数量不会被 shopify 自动减少。当我在管理控制台下订单时,它们会自动减少。 Shopify 库存跟踪已为产品打开。任何想法将不胜感激。

  {
  "order": {
    "email": "someName@yahoo.com",
    "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
  }
}

【问题讨论】:

  • 你能分享一下这个变体的 JSON 吗?
  • 我按问题中的顺序添加了三个变体的 JSON

标签: api rest shopify


【解决方案1】:

您使用 API 创建了虚假订单。像这样的虚假订单不会在没有额外努力的情况下进行交易或触发通常的内部制衡。也许如果您尝试向订单添加履行,Shopify 可能会影响库存水平?似乎还是要尝试一下。

【讨论】:

  • 有没有办法通过 API 创建“真实”订单?如果不是,并且看到我需要通过 API 创建一些接近的东西,如果不是“真实”订单,你会建议什么?
  • “真实”一词是指 API 生成的订单不能交易任何资金。它们是产品的容器,分配给客户的地址,包含一些关于金额的信息,但没有任何真实的付款信息。
  • 至于您的问题,您是否分配了履行并解决了库存问题?
  • 出于业务原因,我无法在订单上分配履行,这将由管理员在管理员中手动完成。您如何建议我为订单“触发通常的内部检查和平衡”,包括减少库存数量。
  • 通过履行。
猜你喜欢
  • 1970-01-01
  • 2021-08-16
  • 1970-01-01
  • 2014-05-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-13
相关资源
最近更新 更多