📦 Update orders with current delivery status by Shippo
Asynchronous microservice that is triggered by Shippo webhooks. Built with Micro 🤩
Both a moltin and Shippo account are needed for this to function.
Create a .env
at the project root with the following credentials.
MOLTIN_CLIENT_ID=
MOLTIN_CLIENT_SECRET=
npm install
npm run dev
Once you have the function deployed, take a note of the immutable now.sh
url.
Next head over to the Shippo API Settings area, add a new webhook with the following details:
Event Type | Mode | URL |
---|---|---|
Track Updated | Live |
URL provided by now.sh |
Finally you'll need to extend the moltin Orders resource with Flows. Head over to the moltin dashboard and create a new Flow.
Name | Slug | Description | Enabled |
---|---|---|---|
Orders | orders |
Anything you want | true |
Next, edit the Flow and add the following fields:
Field Type | Slug | Name | Description | Enabled |
---|---|---|---|---|
string |
delivery_date |
Delivery status (managed by Shippo) | Anything you want | true |
string |
delivery_details |
Delivery details (managed by Shippo) | Anything you want | true |
string |
delivery_date |
Delivery date (managed by Shippo) | Anything you want | true |
order_status
is set to DELIVERED
this function will no longer update your order.
You can easily deploy this function to now.