Magento 2.2.6 : Shipment creation using REST API
-
09-03-2021 - |
Domanda
Unable to create shipment in Magento 2.2.6
I am using the following source code like this in postman
{ "entity" : { "order_id" : 70, "items" : [{ "order_item_id" : 94, "qty" : 1 } ], "tracks" : [{ "carrierCode" : "UPS", "order_id" : 70, "title" : "ground", "trackNumber" : "12345678", "parentId" : 1001 } ] } }
Thanks
Soluzione
It seems like your track array field format is wrong. Please try this below :
{
"entity":{
"order_id":70,
"items":[
{
"order_item_id":94,
"qty":1
}
],
"tracks":[
{
"carrier_code":"UPS",
"order_id":70,
"title":"ground",
"track_number":"12345678",
"parent_id":1001
}
]
],
}
}
For more reference : Click here
UPDATE :
Go to this path /vendor/magento/framework/DB/Adapter/Pdo/Mysql.php
and replace at line no 3036
case 'longtext':
if (is_array($value)) {
$value = json_encode($value);
}
$value = (string)$value;
if ($column['NULLABLE'] && $value == '') {
$value = null;
}
break;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange