When developing a Webshipper shipping module, you need to consider how much functionality you are going to support. In short a normal Webshipper module covers the following steps.
- Quoting shipping rates in checkout
- Letting the customer select a drop point in checkout when such is required by the selected shipping rate.
- Saving the selected shipping rate and the optional drop point on the order.
- Once the order is placed and any desired status is met, the order will be transferred to Webshipper.
- When the order is reaching "dispatched" status in Webshipper, the order status in the e-commerce store should change accordingly. You might also want to save tracking information in the e-commerce store.
To better understand the possible workflows, please have a look at the illustration below:
As you might have noticed, you can either build the module with Webshipper rate quoting, or alternatively use the built-in shipping rate system, which your e-commerce platform probably already has.
The difference between these two options is that Webshipper can make very advanced shipping quoting, and in some cases live quoting directly towards the carrier. So you can make much more advanced shipping options than without Webshipper rate quoting. Another benefit is that when you are sending the order back to Webshipper along with the Webshipper shipping rate, you are going to eliminate any errors, such as sending with the wrong carrier or service.
Webshipper rate quoting is also required in cases where you want to enable drop points in your checkout - like UPS Access Points or DHL Express service points.
Settings in the module
In the module you need a settings section with the following attributes
- API Token from Webshipper
- Tenant name
- Transfer status
Which API calls should I use?
All API calls, how to authenticate etc. is documented at https://docs.webshipper.io
For now, lets assume that you are going to implement Rate quotes, Drop points, Order transfer and Close order.
When the customer is at checkout and you are going to present possible shipping options to the customer - you must use "Rate quotes", found at:
Note! In case the customer selects a shipping rate from the rate quote, which requires a drop point, you must locate possible drop points using the "drop point locator" call.
Once the checkout is complete, its important that you save the shipping rate id for the chosen shipping rate. This must be used when you create the order in Webshipper later.
To locate drop points near the customer, you must use "Drop point locator" from the Webshipper API. The call is documented at: http://docs.webshipper.io/#drop_point_locators
It is important that you save the following information about the drop point:
These informations must be included in the create order call you are going to make later.
Most e-commerce owners wants their order to be transferred to the Webshipper platform when it reaches a specific status. So to prevent the need of future customisations, you want to create a setting for this status.
To create the order in Webshipper, please use the Order endpoint, found at:
When creating the order ensure that the following information is present
- Delivery address
- Drop point ( Only if the rate requires a drop point )
- Order lines
- Original shipping ( Only necessary when not using rate quoting )
- External comment
- Visible ref
- Ext ref
- A relation to the selected shipping rate ( If rate quoting is used )
To close the order in for platform, you need to create a shipment/created webhook to an endpoint in your e-commerce platform.
This can be done either from the interface or from the Webshipper API.
Read more about webhooks here: