税金行不会自动生成Shopify API订单

时间:2016-06-03 17:55:48

标签: rest shopify

我将以下内容发布到Shopify API订单端点:

    {
  "order": {
    "email": "some@email.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": "10101 Musick 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": "some Order"
  }
}

并收到没有填写税行的回复。我在shopify论坛上看到税收线应该是自动的 由shopify计算和填写。我也尝试过与客户合作,但这也不起作用。

1 个答案:

答案 0 :(得分:0)

订单API不会自动计算税金,但如果您的应用知道它们的数量,那么您可以使用tax_linestotal_tax包含此数据:

{
  "order": {
    "line_items": [{
      "title": "Big Brown Bear Boots",
      "price": 74.99,
      "quantity": 3,
      "tax_lines": [{
        "price": 13.50,
        "rate": 0.06,
        "title": "State tax"
      }]
    }],
    "total_tax": 13.50
  }
}