Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Selecting alternative delivery when creating orders through Magento API #339

Closed
ThomasMW opened this issue Nov 9, 2022 · 10 comments

Comments

@ThomasMW
Copy link

ThomasMW commented Nov 9, 2022

In our Magento instance we have the setting for the alternative delivery 'Extra cover' when an order is above a specific amount. This works fine when using the store-front checkout. However I would like to be able to also use this alternative delivery when creating orders through the Magento API.

When adding the shipping information to an order using the Magento API you add to the following to the payload;

"shipping_method_code": "regular",
"shipping_carrier_code": "tig_postnl"

When creating orders through the API which have an amount higher than the threshold the alternative delivery isn't applied to the order.

Is it possible to simply replace the shipping_method_code with the alternative delivery and if so where can I find all available shipping method codes? I tried accessing the documentation but as of yet I haven't been granted access.

@tig-jeffreybranderhorst
Copy link
Contributor

Hey @ThomasMW ,

The shipping_method_codes that there are available are: pakjegemak, extra@home, regular, letterbox_package. Via the API you can also send along product codes, Product code 3087 is for extra cover.

That the documentation is not available right now is correct, we are aware of this and working on it. You can see all the API call in swagger if you want.

Have a great day,
Jeffrey

@ThomasMW
Copy link
Author

ThomasMW commented Nov 10, 2022

Hi @tig-jeffreybranderhorst

I used swagger to inspect the /shipping-information endpoint but I can't quite make out where the product code would go in the payload. Is it supposed to be added as a custom attribute?

    "custom_attributes": [
      {
        "attribute_code": "string",
        "value": "string"
      }

@tig-jeffreybranderhorst
Copy link
Contributor

Hi @ThomasMW ,

When creating a Magento Shipment you also need to create a PostNL shipment.
This is done after the shipment has been created.

Once using an API key in swagger that has rights to see everything.
You can see the tIGPostNLShipmentManagementV1
In here you have the /v1/postnl/shipment/{shipmentId}/createShipment
here you van give { ‘productCode’: 0, ‘colliAmount’: 0 }
In here you van add the correct product code that you want to use and also the colli amount
In your case you would use 3087 as the product code. This is the code for Extra Cover.

Hope the explanation of my colleague helps you further!

Have a great day,
Jeffrey

@ThomasMW
Copy link
Author

ThomasMW commented Nov 11, 2022

Are we talking about the same type of shipment?

Perhaps it wasn't clear I was referring to /rest/V1/guest-carts/cartid/shipping-information, which is used to add the shipping information during the order creation.

I assume I need to create, or perhaps edit, a PostNL order which is stored in the table tig_postnl_order. I see these orders can be accessed at /V1/postnl/orders. Is this what you are referring to?

@tig-jeffreybranderhorst
Copy link
Contributor

Hi @ThomasMW ,

I have placed this on our backlog because we found out that there is an issue with an after method on the save. Because of this issue, the methods like extra cover won't be passed on to the backend.

We are going to investigate this further and make a fix in a future release, thank you for submitting this.

Have a great day,
Jeffrey

@ThomasMW
Copy link
Author

Hi @tig-jeffreybranderhorst

Any progress regarding this issue?

@tig-vincentthart
Copy link
Contributor

Hi @ThomasMW,

It is on our backlog to be picked up, but it hasn't been resolved yet.

When we have a solution, we will check if we can share a patch with you before the release.

Have a nice day,
Vincent

@ThomasMW
Copy link
Author

ThomasMW commented Sep 12, 2023

@tig-vincentthart @tig-jeffreybranderhorst So we're closing in on this issue being almost a year old. Is there any progress or eta available for when this will be resolved?

@JorisPostNL JorisPostNL closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
@JorisPostNL
Copy link

Hi @ThomasMW, unfortunately we do not have the space to include this feature on our roadmap at this moment due to ongoing development in other areas. We will keep this on our backlog for future development once there is more room on our roadmaps.

Kind regards
Joris
PostNL Support

@ThomasMW
Copy link
Author

ThomasMW commented Apr 11, 2024

Understood, thanks for getting back to me @JorisPostNL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants