Hello, I’m using the Ordoro v3 API. I’m able to create new orders through the “/order” endpoint, and I can verify those orders are successfully created because they show up on the ordoro.com UI. I can also create labels for those orders through the UI.
The problem is when I try to create labels via the “/shipment/shipment_id/label/generate” endpoint. I get a json object returned that looks like: “{“error_message”: “‘postal_reporting_number’”, “param”: null}”
I’m not clear what I’m supposed to pass in for the shipment_id, but when I append “1” to the order_id, such as M-123-1, I get the above error. When I pass I in any other value I get an error that says “No shipment with id ‘M-123-10’ for company_id XXXXX”.
I am making this api call in PHP cUrl. Any ideas on what I’m doing wrong?
$ch = curl_init();
$username = env('ORDORO_USERNAME');
$password = env('ORDORO_PASSWORD');
curl_setopt($ch, CURLOPT_URL, "https://apiverson.ordoro.com/shipment/M-123-1/label/generate");
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{
\"shipper_id\": 203984,
\"weight\": 2,
\"box_shape\": \"PKG\",
\"shipping_method\": \"PM\"
}");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Accept: application/json')
);
$response = curl_exec($ch);
curl_close($ch);
dd($response);