EasyParcel (Singapore) Help Centre

Login Sign Up
Welcome
Login

How do I get webhook updates from EasyParcel?

Quick Summary

Webhooks send updates to your server when something changes, so you do not need to keep asking. Add an endpoint URL in the Developer Hub and choose the topics you want.

We'll Cover:

  • Subscribe
  • Topics
  • Delivery and retries
  • Check the signature

Subscribe

You need a developer account, an app and a web address on your server that accepts POST requests.

  1. In the EasyParcel Developer Hub, click Apps and open Settings for your app.
  2. In the left menu, click Webhook.
  3. Click Add Endpoint.
  4. Enter the URL and choose the Topic.
  5. Click Submit. EasyParcel checks your endpoint.

Open Webhook and click Add Endpoint (red boxes).

Enter the URL and choose a topic.


Topics

TopicValue in the payloadWhen it is sent
Shipment Status Updateshipment.status.updateA shipment status changes
Shipment AWB Updateshipment.awb.updateAn AWB is created or updated
Tracking Status Updateshipment.tracking.updateTracking is updated
Shipment Createdshipment.createA new shipment is created
On-Demand Order Status Updateondemand.status.updateAn On-Demand order status changes

Every payload has a topic field, so one endpoint can receive several topics.


Delivery and retries

  • EasyParcel waits 3 seconds for your reply. Reply fast and do slow work afterwards.
  • Only HTTP 200 counts as delivered. Any other code, a timeout or a connection error is a failure.
  • A failed delivery is tried again up to 3 times, about 5, 10 and 20 minutes after the first try.
  • The same event can arrive twice, and events can arrive out of order. Use the Easyparcel-Webhook-Id header to skip an event you already handled, and compare event_date to ignore older updates.

Check the signature

Every webhook is signed with your app's client secret, so you can check it really came from EasyParcel.

  1. Read the raw request body exactly as it arrived, before you parse it.
  2. Take t and v1 from the Easyparcel-Signature header (it looks like t=...,v1=...).
  3. Work out the HMAC-SHA256 of t, a dot, and the raw body, using your client secret as the key. Write it in hex.
  4. Compare it with v1 using a constant-time comparison. If they differ, reject the request.
  5. Reject the request if t is more than 5 minutes away from your own clock.

The Easyparcel-Client-Id header tells you which app the webhook belongs to, if one endpoint serves several apps.


Still need help?
Our team is happy to help. ? Live Chat  |  ✉️ Contact Us

E
EasyParcel is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.