Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Is it possible to add shipping cost to the order via API after the order has been made?

Is it possible to add shipping cost to the order via API after the order has been made?

martabel
Shopify Partner
72 1 7

The payment gateway I use, there is a shipping integration with local services in the payment page which will change the endprice (different prices). 

Is it possible to alter the order after shipping has also been chosen?

 

Let's say order was $79.00

Shipping in the payment gateway chosen was $5.00

 

Would it be possible to add this to the $79 order?

 

Another way around it if its not possible, is to create manual order which succeeded for me, added notes to both orders. The problem with this is when clicking on the "Refund" button on the order which was created manually via API, it does not come to the right endpoint (I don't know where that request goes to.)

 

 

Any help with any of these?

Replies 2 (2)

Alex_Beacon
Shopify Partner
26 0 3

Hi 

 

There is Checkout API that can help you with updating a checkout with final price, including shipping price.
https://help.shopify.com/en/api/reference/sales-channels/checkout

Field shipping_line I guess. 

"shipping_line": {
  "handle": "shopify-Standard-10.00",
  "price": "10.00",
  "title": "Standard"
}

The selected shipping rate. A new shipping rate can be selected by updating the value for handle. A shipping line is required when requires_shipping is true. Learn more about selecting shipping rates.

Decrease fraudulent orders, stop chargebacks and expand globally with Beacon. https://apps.shopify.com/beacon

vix
Shopify Staff
541 103 122

 

Hi @martabel 

 

Keep in mind with the checkout API your app will need to be a sales channel and have proper payment processing permissions. You may be interested in the order edit API to add a new line_item when that is fully released. More information here: https://help.shopify.com/en/api/guides/editing-orders

 

When you say the refund is not going to the correct endpoint, can you elaborate? When you refund a manual order there will not be any transactional changes as the order was created manually and set to "paid" status without a transaction. It will, however, update the status. 

 

 

To learn more visit the Shopify Help Center or the Community Blog.