Getting 400 bad request when I try to post a fulfillment - any ideas?
This is my body
{
"fulfillment":{
"line_items_by_fulfillment_order":{
"fulfillment_order_id":XXXXXXXX,
"fulfillment_order_line_items":[
{
"id":1XXXXXXXX,
"quantity":1
}
]
},
"tracking_info":{
"number":"XXXXXXXXXXXXX",
"url":"https:\/\/ups.com",
"company":"UPS"
},
"notify_customer":true,
"message":"Your items have been shipped."
}
}
This is my request
function createFulfillmentCan($data){
$client = new Client();
$body = json_encode($data,true);
try {
$response = $client->request('POST', "https://xxxxxxxxx.myshopify.com/admin/api/2022-10/fulfillments.json", [
'headers' => [
'Content-Type' => 'application/json',
'X-Shopify-Access-Token' => 'xxxx_XXXXXXXXXXXXXXXXXXXXX'
],
'body' => $body
]
);
if($response->getStatusCode() == 200){
return true;
}
} catch(\GuzzleHttp\Exception\RequestException $e){
return false;
}