This is a server-to-server API. Your frontend calls your backend, and your backend calls HaulStow. Never put a HaulStow API key in browser JavaScript, a mobile app, or a public repository.
What you need
Before you begin, get these from the HaulStow developer portal:- A developer application.
- A test API key beginning with
hsg_test_key_. - A tool for sending HTTP requests. The quickstart uses
curl, which is already available on most macOS and Linux computers.
Base URLs
The URL and key must match. A live key cannot access sandbox data, and a test key cannot access live data. There is no
environment field to add to your JSON.
The three ideas to remember
1. Put the key in the Authorization header
Bearer is required, followed by one space and the complete API key.
2. Send an idempotency key when creating something
An idempotency key is a unique label for one action. It makes retrying safe if your network disconnects.3. Read the data field
Every response has the same outer shape, called an envelope. On success, the useful result is inside data.
Response envelope
Success
Error
error.code is the short, stable value your program should check. message is the human-readable explanation.
Every response also includes X-Request-ID. Save it in your logs. If you contact HaulStow support about a request, include this value so the request can be found quickly.
Common words
Start integrating
- Follow the 10-minute quickstart to create a simulated delivery.
- Read authentication before saving a key in your app.
- Read idempotency before creating live deliveries.
- Use webhooks for automatic updates, or polling as a simpler fallback while learning.
- Open common errors when a request does not work.
- Use the API reference when you need every field and status code.
