Hi,
I’m currently trying to update the quantity of an order using the following PHP method. This causes a 400 error. Where am I going wrong? The PHP variables all have values so I figured all the required fields are complete.
I’ve tried to just view an order using similar and it works so it’s correctly identifying the order, it’s just not updating it.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.veeqo.com/orders/$order_id");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, "{
\"order\": {
\"line_items_attributes\": [
{
\"sellable_id\": $product_id,
\"price_per_unit\": $product_price,
\"quantity\": 10,
}
]
}
}");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"x-api-key: 123"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);