Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 2.19 KB

README.md

File metadata and controls

52 lines (32 loc) · 2.19 KB

moltin-shippo-tracking

📦 Update orders with current delivery status by Shippo

Deploy to now

Asynchronous microservice that is triggered by Shippo webhooks. Built with Micro 🤩

🛠 Setup

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

⛽️ Usage

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

⚠️ Once an order_status is set to DELIVERED this function will no longer update your order.

🚀 Deploy

You can easily deploy this function to now.