We have a custom store that when an order is placed we create an order in Shopify using the Shopify Ruby gem. Our checkout/process has worked well for many months now. The other day we started getting 400 (bad request) errors back from our posts. We have a retry mechanism in place and some orders eventually go through and others never do. There are other orders that go through with no issues at all. It is really puzzling.
The response from the Ruby gem is:
product variant 123 not found, `price` must provided.
To rule out issues with the gem, I am hit the API directly (https://{{store}}/admin/api/2020-04/orders.json) and get:
{
"errors": {
"order": "Required parameter missing or invalid"
}
}
Below is the post body, I have emptied out the customer, billing and shipping data.
{
"financial_status": "paid",
"line_items": [
{
"variant_id": "123",
"quantity": 1,
"tax_lines": [
{
"price": 5.69,
"rate": 0.0575,
"title": "Ohio State tax"
},
{
"price": 1.49,
"rate": 0.015,
"title": "Huron County tax"
}
]
}
],
"total_tax": "7.18",
"customer": {},
"billing_address": {},
"shipping_address": {},
"shipping_lines": [
{
"code": "Economy",
"price": "0.0",
"source": "xxxx",
"title": "Economy",
"tax_lines": []
}
],
"send_receipt": false,
"send_fulfillment_receipt": false,
"suppress_notifications": true,
"inventory_behaviour": "decrement_ignoring_policy"
}
When I hit the variant API (https://{{store}}/admin/api/2020-04/variants/123.json), I get the variant returned to me no problem. I have other orders placed with this variant with no issues as well.
Any input is really appreciated.