There is a store that I'm posting shipments to via the rest api. I'm POSTing to the /V1/orders/<order_number>/ship endpoint. My post data looks like:
{
"items":
[
{
"orderItemId": 123456,
"qty": 3
}
],
"tracks":
[
{
"track_number": 12341234123423
"carrier_code": "FEDEXG"
}
]
}
and when I query the api to look at my shipment, the shipment is there, but tracks is an empty array []. If I try to add the tracking data after the fact with /V1/shipments/track,
and the following data:
{
"entity": {
"order_id": 123456,
"entity_id": 12345,
"track_number": 123123123123,
"carrier_code": "FEDEXG"
}
}
i get the following error message:
{
"message": "Could not save the shipment tracking.",
"trace": "#0 [internal function]: Magento\\Sales\\Model\\Order\\Shipment\\TrackRepository->save(Object(Magento\\Sales\\Model\\Order\\Shipment\\Track))\n#1
/home/company/public_html/vendor/magento/module-webapi/Controller/Rest.php(330): call_user_func_array(Array, Array)\n#2
/home/company/public_html/vendor/magento/module-webapi/Controller/Rest.php(239): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n#3
/home/company/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#4
/home/company/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callParent('dispatch', Array)\n#5
/home/company/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\\Webapi\\Controller\\Rest\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#6
/home/company/public_html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(39): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callPlugins('dispatch', Array, Array)\n#7
/home/company/public_html/vendor/magento/framework/App/Http.php(135): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#8
/home/company/public_html/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\\Framework\\App\\Http->launch()\n#9 /home/company/public_html/vendor/magento/framework/App/Bootstrap.php(256): Magento\\Framework\\App\\Http\\Interceptor->launch()\n#10
/home/company/public_html/index.php(39): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#11 {main}"
}
Anyone know what I am doing wrong here? I'd be fine with either adding tracking data at the time I make the shipment, or adding it after. I just need a way to add tracking data to the shipment.