Skip to content
MothershipDevelopers

GuidesBooking a shipment

Setting up authentication

Create a sandbox token and send it with every request in this guide.

1 min read

As outlined in the authentication reference docs, the Mothership API handles authenticating requests via a Bearer token in the request's Authorization header.

For the purposes of this guide, use a sandbox token so nothing you book is real. Create one on the API settings page in the dashboard, then put it in an environment variable. The examples in this guide read it from there.

export MOTHERSHIP_API_TOKEN="your sandbox token"

Every request you make in the sandbox environment must include this token in the Authorization header.

Authorization: Bearer {API_TOKEN_GOES_HERE}

For production requests, create a production token on the same API settings page.