Authentication
Outpost uses OAuth2 client_credentials for server-to-server calls. Your backend exchanges a client_id and api_token for an access_token, then sends it as a Bearer token on every API request.
Create and manage your API credentials in the Outpost merchant portal. Your credentials are scoped to your own merchant account.
Need a client_id and api_token first? Complete Account setup in the app portal.
Flow
- Request an
access_tokenwith yourclient_idandapi_token - Read
access_tokenandexpires_infrom the response - Cache the token server-side with TTL
expires_in - 300s - Refresh on expiry or on a 401, then retry the request once
- Send
Authorization: Bearer <access_token>on every API call
Get access token
POST/oauth2/tokenHost: https://access.outpostanywhere.com
Do not send token requests to the API host (https://api.outpostanywhere.com).
Send your api_token as the OAuth client_secret form field - that is the wire name for this grant.
Request
curl -X POST \
"https://access.outpostanywhere.com/oauth2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=$OUTPOST_API_TOKEN" | jqResponse
{
"access_token": "<JWT>",
"expires_in": 86400,
"token_type": "Bearer"
}Run from your server. Never expose your api_token in the browser.