Add shipping costs


#1

@drew Is it possible to add shipping costs via the api?

It is only a flat rate per cart, not per item.


#2

Hi @handre

At the moment shipping is handled by adding a custom-cart-item to the cart.

As per the documentation:

Custom Cart Items are available via implicit authentication . You should always check each order has the correct details for each item, most importantly, price.

Hope this helps,

Drew


#3

hey @handre we have a guide here that may help

https://developers.moltin.com/guides/working-with-custom-cart#scenario-2-add-shipping-fees-to-a-product

We also have a code playground at https://moltin-cart-example.herokuapp.com/index.html

Would be great to get some feedback from you on the article and the playground :slight_smile:

Thanks

Drew


#4

hi @drew
I was able to get it working, I had to hack it basically, as I had to add the shipping later after checkout. The reason was that its a flat rate, no matter how many items. So I could not have added it when adding to the cart, as it would’ve added every time a products it added to a cart.

I would be very nice if you incorporate that into moltin, as it is the norm to add shipping costs these days.