How do I create a shipment via REST API? Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Magento 2 Cannot create shipment Rest Apiv1.6.0 - CreateShipment SOAP v2 call ships all itemsHow to create new shipment using Magento REST API?REST API create simple productMagento 2 Custom Web Api callMagento's REST API responses claiming oauth_callback param is emptyMagento 2: How to create new customer cart via rest API?Checkout experience via REST API Magento2 - how to setup quote_currencyMagento 2 : Custom model with EAV attributes. PUT is not workingMagento 2 REST API -> PUT example (PHP)GET products for my cart with customer token
What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?
How many time has Arya actually used Needle?
What should one know about term logic before studying propositional and predicate logic?
Noise in Eigenvalues plot
Meaning of 境 in その日を境に
How to resize main filesystem
Why not use the yoke to control yaw, as well as pitch and roll?
What does 丫 mean? 丫是什么意思?
Marquee sign letters
How does the body cool itself in a stillsuit?
As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?
Understanding piped commands in GNU/Linux
Why do C and C++ allow the expression (int) + 4*5?
An isoperimetric-type inequality inside a cube
Besides transaction validation, are there any other uses of the Script language in Bitcoin
Does the main washing effect of soap come from foam?
Sally's older brother
Does the universe have a fixed centre of mass?
Should man-made satellites feature an intelligent inverted "cow catcher"?
Did pre-Columbian Americans know the spherical shape of the Earth?
Simple Line in LaTeX Help!
How to make triangles with rounded sides and corners? (squircle with 3 sides)
My mentor says to set image to Fine instead of RAW — how is this different from JPG?
Was the pager message from Nick Fury to Captain Marvel unnecessary?
How do I create a shipment via REST API?
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Magento 2 Cannot create shipment Rest Apiv1.6.0 - CreateShipment SOAP v2 call ships all itemsHow to create new shipment using Magento REST API?REST API create simple productMagento 2 Custom Web Api callMagento's REST API responses claiming oauth_callback param is emptyMagento 2: How to create new customer cart via rest API?Checkout experience via REST API Magento2 - how to setup quote_currencyMagento 2 : Custom model with EAV attributes. PUT is not workingMagento 2 REST API -> PUT example (PHP)GET products for my cart with customer token
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to create a shipment via the REST API
. I'm able to edit existing shipments via /rest/V1/shipment
, but I can't seem to figure out how to add one. I consistently get a "Could not save shipment"
response from the API
.
Here are the parameters I'm posting to the endpoint:
$post = ['entity' => ['customerId' => 3,
'billingAddressId' => 16,
'orderId' => 8,
'shippingAddressId' => 15,
'storeId' => 5,
'totalQty' => 1,
'packages' => [],
'items' => [],
'tracks' => [],
'comments' => [],
]
];
For this given order, those are definitely the right address entity_id
's, the order_id
is correct, etc, etc. If I post similar parameters to another order and include that order's shipment's entity_id
, I can update that existing shipment. I just can't seem to create a new shipment for an order that doesn't have a shipment yet.
Help! :-)
Thanks....
magento2 api rest
add a comment |
I'm trying to create a shipment via the REST API
. I'm able to edit existing shipments via /rest/V1/shipment
, but I can't seem to figure out how to add one. I consistently get a "Could not save shipment"
response from the API
.
Here are the parameters I'm posting to the endpoint:
$post = ['entity' => ['customerId' => 3,
'billingAddressId' => 16,
'orderId' => 8,
'shippingAddressId' => 15,
'storeId' => 5,
'totalQty' => 1,
'packages' => [],
'items' => [],
'tracks' => [],
'comments' => [],
]
];
For this given order, those are definitely the right address entity_id
's, the order_id
is correct, etc, etc. If I post similar parameters to another order and include that order's shipment's entity_id
, I can update that existing shipment. I just can't seem to create a new shipment for an order that doesn't have a shipment yet.
Help! :-)
Thanks....
magento2 api rest
add a comment |
I'm trying to create a shipment via the REST API
. I'm able to edit existing shipments via /rest/V1/shipment
, but I can't seem to figure out how to add one. I consistently get a "Could not save shipment"
response from the API
.
Here are the parameters I'm posting to the endpoint:
$post = ['entity' => ['customerId' => 3,
'billingAddressId' => 16,
'orderId' => 8,
'shippingAddressId' => 15,
'storeId' => 5,
'totalQty' => 1,
'packages' => [],
'items' => [],
'tracks' => [],
'comments' => [],
]
];
For this given order, those are definitely the right address entity_id
's, the order_id
is correct, etc, etc. If I post similar parameters to another order and include that order's shipment's entity_id
, I can update that existing shipment. I just can't seem to create a new shipment for an order that doesn't have a shipment yet.
Help! :-)
Thanks....
magento2 api rest
I'm trying to create a shipment via the REST API
. I'm able to edit existing shipments via /rest/V1/shipment
, but I can't seem to figure out how to add one. I consistently get a "Could not save shipment"
response from the API
.
Here are the parameters I'm posting to the endpoint:
$post = ['entity' => ['customerId' => 3,
'billingAddressId' => 16,
'orderId' => 8,
'shippingAddressId' => 15,
'storeId' => 5,
'totalQty' => 1,
'packages' => [],
'items' => [],
'tracks' => [],
'comments' => [],
]
];
For this given order, those are definitely the right address entity_id
's, the order_id
is correct, etc, etc. If I post similar parameters to another order and include that order's shipment's entity_id
, I can update that existing shipment. I just can't seem to create a new shipment for an order that doesn't have a shipment yet.
Help! :-)
Thanks....
magento2 api rest
magento2 api rest
edited Apr 7 '16 at 5:46
Abdul
8,23111136
8,23111136
asked Apr 7 '16 at 1:40
Tim TrampedachTim Trampedach
100128
100128
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
It seems that you are not passing any items. While creating shipment you must mark atleast one item as shipped.
"entity":
"order_id": 8,
"items": [
"order_item_id": 123,
"qty": 1
]
An extra note that you can only pass items as of now. Comments and tracks are not working due a Magento bug. Have a look at git issue.
Thanks, that helped a ton. I can now create a shipment and then I separately add tracking for it. Is there any way to move the order to the shipped status and thus generate an email to the customer or is this bug the root of that problem: github.com/magento/magento2/issues/3307?
– Tim Trampedach
Apr 8 '16 at 1:32
Cool. Unfortunately, order status is also a bug which recently got resolved, but I guess its not released yet, you have got the right bug. I think triggering email is done via comment api, by setting "isCustomerNotified": ` [ "entityId" : 2, "isCustomerNotified" : 1, "parentId" : 1 ]`
– Mujtaba Ahmad
Apr 8 '16 at 7:15
OK, thanks for all your help. Hopefully the next release has some presents in it!
– Tim Trampedach
Apr 8 '16 at 18:38
1
Can you guide me how to get order_item_id from the order? I am always getting the message 'You can't create a shipment without products.'
– Nishad Up
Dec 21 '17 at 4:50
To ship all items, there is no need to include any items, just the tracking JSON
– KolonUK
Apr 17 at 13:08
add a comment |
I know the answer has been given, but I'd like to suggest to all future people to not create a shipment yourself, but to ship an order using:
http://devdocs.magento.com/swagger/#!/salesShipOrderV1
Benefit? You do not provide the store id, billing address, etc. etc. This will all be handled by Magento, as the information is on the order. I had a ton of problems to solve when I created shipments myself; when I used the /V1/order/orderId/ship
method, everything worked out of the box.
can you please provide more info (JSON Payload of a working request), because i'm using this method and struggling with "You can't create a shipment without products" error
– domi27
Aug 10 '17 at 16:51
@domi27 - see my answer where you don't have to include all the items to create a shipment
– KolonUK
Apr 17 at 13:02
add a comment |
If you are shipping all items in the order, there is no need to actually include the items:
"tracks": [
"track_number": "1Y-9876543210",
"title": "Custom",
"carrier_code": "SomeCarrierCode"
]
As long as you have the Magento order ID in the URL rest/V1/order/10/ship
, this will work. Plus, the carrier_code
can be anything if you haven't got real carriers setup...
This took me hours to find out, as Magento's documentation and API is shocking!
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f109844%2fhow-do-i-create-a-shipment-via-rest-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
It seems that you are not passing any items. While creating shipment you must mark atleast one item as shipped.
"entity":
"order_id": 8,
"items": [
"order_item_id": 123,
"qty": 1
]
An extra note that you can only pass items as of now. Comments and tracks are not working due a Magento bug. Have a look at git issue.
Thanks, that helped a ton. I can now create a shipment and then I separately add tracking for it. Is there any way to move the order to the shipped status and thus generate an email to the customer or is this bug the root of that problem: github.com/magento/magento2/issues/3307?
– Tim Trampedach
Apr 8 '16 at 1:32
Cool. Unfortunately, order status is also a bug which recently got resolved, but I guess its not released yet, you have got the right bug. I think triggering email is done via comment api, by setting "isCustomerNotified": ` [ "entityId" : 2, "isCustomerNotified" : 1, "parentId" : 1 ]`
– Mujtaba Ahmad
Apr 8 '16 at 7:15
OK, thanks for all your help. Hopefully the next release has some presents in it!
– Tim Trampedach
Apr 8 '16 at 18:38
1
Can you guide me how to get order_item_id from the order? I am always getting the message 'You can't create a shipment without products.'
– Nishad Up
Dec 21 '17 at 4:50
To ship all items, there is no need to include any items, just the tracking JSON
– KolonUK
Apr 17 at 13:08
add a comment |
It seems that you are not passing any items. While creating shipment you must mark atleast one item as shipped.
"entity":
"order_id": 8,
"items": [
"order_item_id": 123,
"qty": 1
]
An extra note that you can only pass items as of now. Comments and tracks are not working due a Magento bug. Have a look at git issue.
Thanks, that helped a ton. I can now create a shipment and then I separately add tracking for it. Is there any way to move the order to the shipped status and thus generate an email to the customer or is this bug the root of that problem: github.com/magento/magento2/issues/3307?
– Tim Trampedach
Apr 8 '16 at 1:32
Cool. Unfortunately, order status is also a bug which recently got resolved, but I guess its not released yet, you have got the right bug. I think triggering email is done via comment api, by setting "isCustomerNotified": ` [ "entityId" : 2, "isCustomerNotified" : 1, "parentId" : 1 ]`
– Mujtaba Ahmad
Apr 8 '16 at 7:15
OK, thanks for all your help. Hopefully the next release has some presents in it!
– Tim Trampedach
Apr 8 '16 at 18:38
1
Can you guide me how to get order_item_id from the order? I am always getting the message 'You can't create a shipment without products.'
– Nishad Up
Dec 21 '17 at 4:50
To ship all items, there is no need to include any items, just the tracking JSON
– KolonUK
Apr 17 at 13:08
add a comment |
It seems that you are not passing any items. While creating shipment you must mark atleast one item as shipped.
"entity":
"order_id": 8,
"items": [
"order_item_id": 123,
"qty": 1
]
An extra note that you can only pass items as of now. Comments and tracks are not working due a Magento bug. Have a look at git issue.
It seems that you are not passing any items. While creating shipment you must mark atleast one item as shipped.
"entity":
"order_id": 8,
"items": [
"order_item_id": 123,
"qty": 1
]
An extra note that you can only pass items as of now. Comments and tracks are not working due a Magento bug. Have a look at git issue.
answered Apr 7 '16 at 15:04
Mujtaba AhmadMujtaba Ahmad
461
461
Thanks, that helped a ton. I can now create a shipment and then I separately add tracking for it. Is there any way to move the order to the shipped status and thus generate an email to the customer or is this bug the root of that problem: github.com/magento/magento2/issues/3307?
– Tim Trampedach
Apr 8 '16 at 1:32
Cool. Unfortunately, order status is also a bug which recently got resolved, but I guess its not released yet, you have got the right bug. I think triggering email is done via comment api, by setting "isCustomerNotified": ` [ "entityId" : 2, "isCustomerNotified" : 1, "parentId" : 1 ]`
– Mujtaba Ahmad
Apr 8 '16 at 7:15
OK, thanks for all your help. Hopefully the next release has some presents in it!
– Tim Trampedach
Apr 8 '16 at 18:38
1
Can you guide me how to get order_item_id from the order? I am always getting the message 'You can't create a shipment without products.'
– Nishad Up
Dec 21 '17 at 4:50
To ship all items, there is no need to include any items, just the tracking JSON
– KolonUK
Apr 17 at 13:08
add a comment |
Thanks, that helped a ton. I can now create a shipment and then I separately add tracking for it. Is there any way to move the order to the shipped status and thus generate an email to the customer or is this bug the root of that problem: github.com/magento/magento2/issues/3307?
– Tim Trampedach
Apr 8 '16 at 1:32
Cool. Unfortunately, order status is also a bug which recently got resolved, but I guess its not released yet, you have got the right bug. I think triggering email is done via comment api, by setting "isCustomerNotified": ` [ "entityId" : 2, "isCustomerNotified" : 1, "parentId" : 1 ]`
– Mujtaba Ahmad
Apr 8 '16 at 7:15
OK, thanks for all your help. Hopefully the next release has some presents in it!
– Tim Trampedach
Apr 8 '16 at 18:38
1
Can you guide me how to get order_item_id from the order? I am always getting the message 'You can't create a shipment without products.'
– Nishad Up
Dec 21 '17 at 4:50
To ship all items, there is no need to include any items, just the tracking JSON
– KolonUK
Apr 17 at 13:08
Thanks, that helped a ton. I can now create a shipment and then I separately add tracking for it. Is there any way to move the order to the shipped status and thus generate an email to the customer or is this bug the root of that problem: github.com/magento/magento2/issues/3307?
– Tim Trampedach
Apr 8 '16 at 1:32
Thanks, that helped a ton. I can now create a shipment and then I separately add tracking for it. Is there any way to move the order to the shipped status and thus generate an email to the customer or is this bug the root of that problem: github.com/magento/magento2/issues/3307?
– Tim Trampedach
Apr 8 '16 at 1:32
Cool. Unfortunately, order status is also a bug which recently got resolved, but I guess its not released yet, you have got the right bug. I think triggering email is done via comment api, by setting "isCustomerNotified": ` [ "entityId" : 2, "isCustomerNotified" : 1, "parentId" : 1 ]`
– Mujtaba Ahmad
Apr 8 '16 at 7:15
Cool. Unfortunately, order status is also a bug which recently got resolved, but I guess its not released yet, you have got the right bug. I think triggering email is done via comment api, by setting "isCustomerNotified": ` [ "entityId" : 2, "isCustomerNotified" : 1, "parentId" : 1 ]`
– Mujtaba Ahmad
Apr 8 '16 at 7:15
OK, thanks for all your help. Hopefully the next release has some presents in it!
– Tim Trampedach
Apr 8 '16 at 18:38
OK, thanks for all your help. Hopefully the next release has some presents in it!
– Tim Trampedach
Apr 8 '16 at 18:38
1
1
Can you guide me how to get order_item_id from the order? I am always getting the message 'You can't create a shipment without products.'
– Nishad Up
Dec 21 '17 at 4:50
Can you guide me how to get order_item_id from the order? I am always getting the message 'You can't create a shipment without products.'
– Nishad Up
Dec 21 '17 at 4:50
To ship all items, there is no need to include any items, just the tracking JSON
– KolonUK
Apr 17 at 13:08
To ship all items, there is no need to include any items, just the tracking JSON
– KolonUK
Apr 17 at 13:08
add a comment |
I know the answer has been given, but I'd like to suggest to all future people to not create a shipment yourself, but to ship an order using:
http://devdocs.magento.com/swagger/#!/salesShipOrderV1
Benefit? You do not provide the store id, billing address, etc. etc. This will all be handled by Magento, as the information is on the order. I had a ton of problems to solve when I created shipments myself; when I used the /V1/order/orderId/ship
method, everything worked out of the box.
can you please provide more info (JSON Payload of a working request), because i'm using this method and struggling with "You can't create a shipment without products" error
– domi27
Aug 10 '17 at 16:51
@domi27 - see my answer where you don't have to include all the items to create a shipment
– KolonUK
Apr 17 at 13:02
add a comment |
I know the answer has been given, but I'd like to suggest to all future people to not create a shipment yourself, but to ship an order using:
http://devdocs.magento.com/swagger/#!/salesShipOrderV1
Benefit? You do not provide the store id, billing address, etc. etc. This will all be handled by Magento, as the information is on the order. I had a ton of problems to solve when I created shipments myself; when I used the /V1/order/orderId/ship
method, everything worked out of the box.
can you please provide more info (JSON Payload of a working request), because i'm using this method and struggling with "You can't create a shipment without products" error
– domi27
Aug 10 '17 at 16:51
@domi27 - see my answer where you don't have to include all the items to create a shipment
– KolonUK
Apr 17 at 13:02
add a comment |
I know the answer has been given, but I'd like to suggest to all future people to not create a shipment yourself, but to ship an order using:
http://devdocs.magento.com/swagger/#!/salesShipOrderV1
Benefit? You do not provide the store id, billing address, etc. etc. This will all be handled by Magento, as the information is on the order. I had a ton of problems to solve when I created shipments myself; when I used the /V1/order/orderId/ship
method, everything worked out of the box.
I know the answer has been given, but I'd like to suggest to all future people to not create a shipment yourself, but to ship an order using:
http://devdocs.magento.com/swagger/#!/salesShipOrderV1
Benefit? You do not provide the store id, billing address, etc. etc. This will all be handled by Magento, as the information is on the order. I had a ton of problems to solve when I created shipments myself; when I used the /V1/order/orderId/ship
method, everything worked out of the box.
answered Jun 16 '17 at 7:56
TjabTjab
113
113
can you please provide more info (JSON Payload of a working request), because i'm using this method and struggling with "You can't create a shipment without products" error
– domi27
Aug 10 '17 at 16:51
@domi27 - see my answer where you don't have to include all the items to create a shipment
– KolonUK
Apr 17 at 13:02
add a comment |
can you please provide more info (JSON Payload of a working request), because i'm using this method and struggling with "You can't create a shipment without products" error
– domi27
Aug 10 '17 at 16:51
@domi27 - see my answer where you don't have to include all the items to create a shipment
– KolonUK
Apr 17 at 13:02
can you please provide more info (JSON Payload of a working request), because i'm using this method and struggling with "You can't create a shipment without products" error
– domi27
Aug 10 '17 at 16:51
can you please provide more info (JSON Payload of a working request), because i'm using this method and struggling with "You can't create a shipment without products" error
– domi27
Aug 10 '17 at 16:51
@domi27 - see my answer where you don't have to include all the items to create a shipment
– KolonUK
Apr 17 at 13:02
@domi27 - see my answer where you don't have to include all the items to create a shipment
– KolonUK
Apr 17 at 13:02
add a comment |
If you are shipping all items in the order, there is no need to actually include the items:
"tracks": [
"track_number": "1Y-9876543210",
"title": "Custom",
"carrier_code": "SomeCarrierCode"
]
As long as you have the Magento order ID in the URL rest/V1/order/10/ship
, this will work. Plus, the carrier_code
can be anything if you haven't got real carriers setup...
This took me hours to find out, as Magento's documentation and API is shocking!
add a comment |
If you are shipping all items in the order, there is no need to actually include the items:
"tracks": [
"track_number": "1Y-9876543210",
"title": "Custom",
"carrier_code": "SomeCarrierCode"
]
As long as you have the Magento order ID in the URL rest/V1/order/10/ship
, this will work. Plus, the carrier_code
can be anything if you haven't got real carriers setup...
This took me hours to find out, as Magento's documentation and API is shocking!
add a comment |
If you are shipping all items in the order, there is no need to actually include the items:
"tracks": [
"track_number": "1Y-9876543210",
"title": "Custom",
"carrier_code": "SomeCarrierCode"
]
As long as you have the Magento order ID in the URL rest/V1/order/10/ship
, this will work. Plus, the carrier_code
can be anything if you haven't got real carriers setup...
This took me hours to find out, as Magento's documentation and API is shocking!
If you are shipping all items in the order, there is no need to actually include the items:
"tracks": [
"track_number": "1Y-9876543210",
"title": "Custom",
"carrier_code": "SomeCarrierCode"
]
As long as you have the Magento order ID in the URL rest/V1/order/10/ship
, this will work. Plus, the carrier_code
can be anything if you haven't got real carriers setup...
This took me hours to find out, as Magento's documentation and API is shocking!
answered Apr 17 at 13:01
KolonUKKolonUK
958
958
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f109844%2fhow-do-i-create-a-shipment-via-rest-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown