Webhook
The webhook data exchange format is used in the Orchestro network for Orders/Manifest, Tracking and Errors. All manifests and events inbound to Orchestro are transmitted via webhooks. Data integrity and security is ensured by HMAC.
All outgoing webhook subscriptions are distributed via Amazon SNS. For the webhook endpoint, data is delivered without API authorization via POST to the URL supplied by the carrier. It is advised that carriers configure their endpoint with a portion of the URL randomly generated and treat the entire URL with the same level of confidentiality as a password.
Subscription: SNS requires an HTTPS endpoint to authorize a subscription on first initialization. Follow the steps below:
- Initialize subscription with carrier specified endpoint.
- SNS transmits a JSON object containing a subscribe URL string.
- Authorize the subscription with the subscribe URL string by initiating a GET on the URL.
- SNS Queue is now ready for use.
Here is a sample object for subscription in step 2
Recommendation: A practical approach to capture the data involves dumping the content of the POST request into a logfile, then reading the subscription URL from this logfile. Since the subscription confirmation happens only once, this method provides a straightforward way to set up the subscription.
Standard Webhook Specification
This section outlines detailed information about the platform standards and formats for webhook submission.
Webhook Headers
Each webhook that is sent to Orchestro should be Content-Type = application/json
headers. The HMAC authentication hash should be transmitted in the headers with the name Orchestro-Auth.
Outgoing Webhook Authentications
To provide verification of authenticity of the origin, webhooks transmitted outbound from Orchestro are encapsulated and included as a base64 body field in the transmission. The same HMAC shared with the partner is used to sign the payload. Partners are encouraged to verify the HMAC signature before opening the payload.
Account Number and Carrier Code
The account number is part of the Orchestro system’s carrier profile. This value will be generated by Orchestro and provided via administration portal or during onboarding.
The Carrier code is a short, unique, and all-capital code that is specific to a carrier. Packages traveling through the system are tagged with the anticipated carriers using carrier codes. Fields for the origin and destination may be included.
Service Types and Service Attributes
See Network Codes and Network Service Attributes for the complete list of supported codes.
Dates
All dates should be sent in ISO 8601 format with time zone offset or Zulu time:
2024-02-20T23:38:22+07:00
2024-02-20T16:38:22Z
A timestamp with no offset is not acceptable.
HMAC Specification
Orchestro uses HMAC authentication to verify the integrity and authenticity of the transmitted data. To secure data with HMAC, the carrier should create a secret and share it with Orchestro in a secure manner. During transmission time, the HMAC should be computed on the final UTF-8 encoded and serialized payload.
For the HMAC computation use an HMAC library with the following parameters:
- SHA256
- Hex Encoded String
The addition of HMAC to an existing webhook integration is fairly simple due to ubiquitous support for HMAC signing in all major languages. The following code examples show how HMAC is added and implemented:
Most programming languages offer HMAC library functions for HMAC implementation. If you have trouble finding a suitable library, contact Orchestro at partner.integration@orchestro.ai for assistance.
Webhook Endpoints
Upon signup, Orchestro will provide the carrier with webhook endpoints for Manifest and Event submissions. A status code 200
return indicates the webhook was successfully received. Any other return value indicates that the data transmission was incomplete and must be retried.