API заказа BigCommerce Пустой ответ об ошибке - PullRequest
0 голосов
/ 15 октября 2019

Я использую конечную точку API BigCommerce Order для создания заказа, ранее он работал нормально, но на прошлой неделе у меня были ошибки. API возвращает внутреннюю ошибку сервера 500 без какого-либо описательного ответа:

enter image description here

Я связался с BigCommerce через чат и поддержку по телефону, но никто не смог объяснитьи в значительной степени послал меня на форум сообщества разработчиков. Ниже приводится тело запроса, которое я использую вместе с другими деталями:

Endpoint:
https://api.bigcommerce.com/stores/{code}/v2/orders

Method: POST

Headers:
X-Auth-Client: {token}
X-Auth-Token: {token}
Content-Type:application/json

{
  "customer_id": 0,
  "status_id": 10,
  "date_created": "Mon, 14 Oct 2019 23:25:58 GMT",
  "subtotal_ex_tax": 265.00,
  "subtotal_inc_tax": 265.00,
  "base_shipping_cost": 0.00,
  "shipping_cost_ex_tax": 0.00,
  "shipping_cost_inc_tax": 0.00,
  "base_handling_cost": 0,
  "handling_cost_ex_tax": 0,
  "handling_cost_inc_tax": 0,
  "base_wrapping_cost": 0,
  "wrapping_cost_ex_tax": 0,
  "wrapping_cost_inc_tax": 0,
  "total_ex_tax": 265.00,
  "total_inc_tax": 265.00,
  "refunded_amount": 0,
  "order_is_digital": false,
  "staff_notes": "",
  "customer_message": "",
  "discount_amount": 0,
  "billing_address": {
    "city": "Secaucus",
    "company": "Test",
    "country": "United States",
    "country_iso2": "US",
    "email": "test@test.com",
    "first_name": "Carlos",
    "last_name": "Dominguez",
    "phone": "555-555-5555",
    "state": "New Jersey",
    "street_1": "Test Av 749",
    "street_2": "",
    "zip": "07094"
  },
  "shipping_addresses": [
    {
      "city": "Secaucus",
      "company": "Test",
      "country": "United States",
      "country_iso2": "US",
      "email": "test@test.com",
      "first_name": "Carlos",
      "last_name": "Dominguez",
      "phone": "555-555-5555",
      "state": "New Jersey",
      "street_1": "Test Av 749",
      "street_2": "",
      "zip": "07094"
    }
  ],
  "products": [
    {
      "product_id": 100,
      "quantity": 1,
      "price_ex_tax": "40.00",
      "price_inc_tax": "40.00",
      "name": "Product 1",
      "sku": "ABC123",
      "product_options": [
        {
          "id": "1000",
          "value": "100"
        }
      ]
    },
    {
      "product_id": 101,
      "quantity": 1,
      "price_ex_tax": "75.00",
      "price_inc_tax": "75.00",
      "name": "Product 2",
      "sku": "ABCXYZ",
      "product_options": [
        {
          "id": "1001",
          "value": "1001"
        }
      ]
    },
    {
      "product_id": 102,
      "quantity": 1,
      "price_ex_tax": "75.00",
      "price_inc_tax": "75.00",
      "name": " Product 3",
      "sku": "QWERT12",
      "product_options": [
        {
          "id": "1003",
          "value": "105"
        }
      ]
    },
    {
      "product_id": 105,
      "quantity": 1,
      "price_ex_tax": "75.00",
      "price_inc_tax": "75.00",
      "name": "Product 4",
      "sku": "PLPOO54",
      "product_options": [
        {
          "id": 1333,
          "value": "270"
        }
      ]
    }
  ],
  "external_source": "CompanyName",
  "payment_method": "CompanyName",
  "payment_provider_id": ""
}

Одна вещь, которую я должен упомянуть, это то, что создание заказа работает, если я удалю определенный продукт из запроса. Товар есть в наличии и не отличается от других товаров по запросу

...