Carlos
Carlos

Reputation: 1331

BigCommerce Order API Empty Error Response

I am using the BigCommerce Order API endpoint to create an order, previously it was working fine but in the last week, i have had errors. The API returns a 500 Internal Server Error without any descriptive response:

enter image description here

I have contacted BigCommerce via live chat and phone support but none could provide an explanation and pretty much sent me to the developer community forum. Below is the request body i am using along with other details:

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": "[email protected]",
    "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": "[email protected]",
      "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": ""
}

One thing i should mention is that the order creation works if i remove a certain product from the request. The product has stock and does not differ from the other products from the request

Upvotes: 0

Views: 298

Answers (1)

ilkovs
ilkovs

Reputation: 446

Did you try creating a new order here? Add the store credentials and try.

https://developer.bigcommerce.com/api-reference/store-management/orders/orders/createanorder

If it works there, the issue is on your end.

Upvotes: 0

Related Questions