How to Track Shipping Costs in Shopify for Accurate Reporting via the REST API?

I'm relatively new to Shopify and I'm trying to find a way to accurately track the internal shipping costs we incur, especially when offering free shipping on orders above $40. While customers don't pay for shipping in these cases, the shop does, and I want to reflect these costs in our reports. Problem: Free Shipping Over $40: We offer free shipping on orders above $40, but obviously, the shipping isn't truly free—we, as the shop owners, bear this cost. Accurate Reporting: I need a way to record these shipping costs for reporting purposes without including them in the unit costs of the products. The reasons are: Variable Costs: Shipping costs vary based on the number of items and the size of the package required. Conditional Customer Payments: Sometimes the customer pays for shipping (when the order is below $40), and sometimes we cover it. Means, it is impossible to add the shipping cost to the unit costs. Question: Is there a way to add these internal shipping costs directly in Shopify to ensure accurate reporting? If possible, how can this be achieved using the Shopify REST API? I've come across this update regarding the Order Editing API, which allows adding and removing shipping lines. Could this be a solution to my problem? If so, how would I implement it? Any guidance would be appreciated! Thanks in advance!

Comment (1)

Jese Leos

August 28, 2024

Verified user

Adding and removing shipping lines using the Shopify REST API can help you accurately track internal shipping costs, even when offering free shipping to customers. By so doing, you have to remove the use of order editing API, add shipping line for free shipping. I hope you understand? If you don't kindly let me know.

You’ll be in good company