Error 406 on Fulfillment Creation

aql_looper
Shopify Partner
1 0 0

Hello, 

 

For the past years I have been using a quite basic way to fulfill using the Rest API with the URL

 

$url = '/admin/api/2021-04/orders/'.$order['id'].'/fulfillments.json';
 
and a the following data (converted to json)
 
$lines = array('fulfillment' => array(
        'location_id' => $location,
        'tracking_number' => $tracking['number'],
        'tracking_urls' => array($tracking['url']),
        'tracking_company' => $tracking['company'],
        "notify_customer" => true
        )
 
Now I am trying to update the way of fulfilling programatically the orders and be able to fulfill by line (as we are sending partial orders) with the updated way using FulfillmentOrders. Now the URL is the following
 
$url = '/admin/api/2022-07/orders/fulfillments.json';
 
and the data structure is
 
$lines = array('fulfillment' => array(
        'message' => "Cerrando pedido",
        "notify_customer" => true,
        'tracking_info' => $tracking,
        'line_items_by_fulfillment_order' => array(
            array(
                'fulfillment_order_id' => $fulfillment_order_id,
                'fulfillment_order_line_items' => $line_items
                )
            )
        )
    );
 
As an example, using this data in my test site (changed here the tracking info)
 
{"fulfillment":{"message":"Cerrando pedido",
"notify_customer":true,
"tracking_info":{"number":"XXXXX",
"url":"https:\/\/www.xxx.com\/xxxxx\/?xxxxx=XXXXX",
"company":"YYYY"},
"line_items_by_fulfillment_order":[{"fulfillment_order_id":"5976026382574",
"fulfillment_order_line_items":[{"id":"12751265136878",
"quantity":1}]}]}}
 
I have checked that the FulfillmentOrder is open, the data structure is the same as the example in the documentation and the id values are the ones according to the fields, but i am still getting a 406 error and I cannot find the error (in my php code with curl and in the Thunder Client).
 
Can anyone help please?
 
Kind regards, 
 
Alvaro
 
 
Replies 0 (0)