Closed memen45 closed 11 months ago
Hi @memen45
Does this issue only happen with orders via the API or do you also encounter it when you create an order via the frontend of the webshop?
Greetings
Vincent
When creating a shipment through the magento admin frontend, a dropdown list of allowed shipment types is given. Therefore, after creating the shipment, a label can also be generated. From the rest API however, one can create a shipment with incorrect product code successfully, but then the label generation will fail (both from api and admin frontend).
To Reproduce Steps to reproduce the behavior:
POST /V1/order/:id/ship
to create the magento shipmentPOST /V1/postnl/shipments/:id/createShipment
with empty body to create a postnl shipmentGET /V1/postnl/shipments/getByFieldWithValue?field=shipment_id&value=:shipment_id
to obtain the resulting postnl shipmentExpected result The postnl shipment
product_code
attribute has an allowable product code and/V1/postnl/shipments/:shipmentId/generateLabel
returns true.Actual result The postnl shipment seems to be created always with
product_code: 2928
(Letterbox Package) and a label cannot be generated anymore.Workaround In the magento admin interface, during shipment creation a list of allowable product codes is given. The label can therefore be generated correctly after creating the shipment through the magento admin interface.
Possible solutions / suggestions
product_code
, one could retry the shipment with a different product_code. However, after the shipment is created, there is no way to change theproduct_code
, and no way to generate a label.GET /V1/postnl/shipments/:id/options
to expose the logic to api clients? This way the client can make sure the right product code is chosen and provided during createShipmentSoftware versions
Possibly related: #311