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
Rohan Hapani
17.6k9 gold badges57 silver badges99 bronze badges
asked Aug 8, 2019 at 11:48
shivashankar m
2,5064 gold badges29 silver badges53 bronze badges
-
this json reponse issue, try with without json format.Anas Mansuri– Anas Mansuri2019年08月08日 11:58:23 +00:00Commented Aug 8, 2019 at 11:58
-
how can i revert itshivashankar m– shivashankar m2019年08月08日 12:39:36 +00:00Commented Aug 8, 2019 at 12:39
-
@shivashankarm is it working for you?Rohan Hapani– Rohan Hapani2019年08月09日 08:42:48 +00:00Commented Aug 9, 2019 at 8:42
1 Answer 1
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;
answered Aug 8, 2019 at 12:43
Rohan Hapani
17.6k9 gold badges57 silver badges99 bronze badges
-
I have tried with above, answer iam getting "message": "Could not save shipment" this error.shivashankar m– shivashankar m2019年08月08日 12:48:46 +00:00Commented Aug 8, 2019 at 12:48
-
Please check my updated answer.Rohan Hapani– Rohan Hapani2019年08月08日 13:18:58 +00:00Commented Aug 8, 2019 at 13:18
-
Hi @Rohan the above fix is for magento2.2.6 version only right?shivashankar m– shivashankar m2019年08月08日 19:33:02 +00:00Commented Aug 8, 2019 at 19:33
-
Yes.... You can use in any version. If this error will return.Rohan Hapani– Rohan Hapani2019年08月09日 04:07:11 +00:00Commented Aug 9, 2019 at 4:07
-
for local system it's working fine without change any codeshivashankar m– shivashankar m2019年08月09日 08:44:54 +00:00Commented Aug 9, 2019 at 8:44
Explore related questions
See similar questions with these tags.
default