How shipping method works
1. User configures app settings in settings tab
After the installation, user would need a page where they can configure it: provide their account details, set up dimensions, etc. We recommend using Native apps feature to provide this functionality. To manage and store those settings, see the Merchant app settings section.
2. Ecwid sends order data to app request URL
The request to your app URL can be triggered by a customer in storefront or by an API request to order details calculation endpoint.
To show new shipping methods in storefront, Ecwid will send a POST request to your endpoint with order details: items, customer address, merchant app settings, etc. That endpoint must respond to the request with the shipping rates for this configuration.
In the case of an API request for calculating order details, the products and cart information itself can be different from what the store has. For example, some other application can create a custom storefront where it requests order calculation with items that are not present in the store. For these cases, your application should also provide correct discount calculations for the amount of cart information available.
3. Application returns the rates in a specific format
Ecwid will expect a response from your service within 10 second interval to display additional shipping methods for customers. In the response, provide shipping method name, rate and estimated delivery time. See the response format in the Request and response section.
4. Ecwid displays the rates at checkout
Based on the response from your app, Ecwid will display the shipping methods for customers at the checkout. Customer can select them just like any other shipping method in that Ecwid store and it will be shown in the order details. Shipping methods from the application will be added to any currently enabled shipping methods a store has enabled.
Q: What happens, if my URL responds with an error?
In case if your app responds with an error or in an incorrect format, then the shipping methods from your app will not be shown to customer at checkout stage. If your store has applicable shipping methods set up using the default means of creating shipping methods in Ecwid, then they will be shown to customer.