API and integrations
A webhook sends a POST request to your HTTPS address when something happens to your shipments, so your system doesn't need to keep asking the API. You add endpoints in Settings → Integrations, in the Webhooks card.
Events
- Status changed: a shipment changed status.
- Delivered and Returned to sender.
- Cancelled: a shipment was cancelled.
- Refund made: a refund for a shipment went through.
- Batch completed: a bulk shipment was paid and its labels were processed.
Add an endpoint
- Choose Add endpoint.
- Enter the Endpoint URL and tick at least one event under Events.
- Confirm with your current password and, if it is on, your two-factor code.
- Copy the Signing secret (it starts with whsec_). It is shown only once.
- Choose Send test event and check the result in Deliveries.
You and your company owner get an email when an endpoint is added.
Check that a request came from LogiRates
Each request has a LogiRates-Signature header with a timestamp and an HMAC-SHA256 signature of the timestamp and body, made with your signing secret. Compute the signature on your side and compare. We recommend rejecting requests older than 5 minutes. The API documentation has the exact format.
Retries and automatic turn-off
- Your server must answer with a 2xx code within 10 seconds. Redirects are not followed.
- A failed delivery gets up to 7 more attempts over about 22 hours, 8 in all: after 1 minute, 5 minutes, 30 minutes, then 1, 3, 6 and 12 hours. A test event is sent once.
- If deliveries keep failing for 3 days, the endpoint is turned off and shows Turned off after errors. The user who added it gets an email.
- Turn it back on with the switch next to the endpoint. The same switch pauses an endpoint, and the trash icon deletes it.
Recent deliveries
Choose Deliveries to see the last 20 deliveries with Delivered, Waiting or Failed, the number of attempts and the reason for a failure. Resend sends a delivery again. Deliveries older than 30 days are deleted.
Rules
- You can have up to 5 endpoints.
- The address must be public HTTPS on port 443 or 8443.
- Endpoints are personal. You need access to Packages to receive events, and you get events for all shipments you can see, including your colleagues'.
- If your user is deactivated, or the API key that created an endpoint is revoked, the endpoint is turned off.
If something goes wrong
- No answer in 10 seconds: respond first, then do the slow work.
- Couldn't connect, Host not found or Port not allowed: check the URL, DNS and port.
- Endpoint was off: turn it on, then choose Resend.
- No longer has access: your access to the shipment or to Packages has changed.
