Skip to navigation

Make your first request

Get a token, check connectivity and read a list with curl.

Set API_HOST to the API domain assigned to your integration and API_KEY to a key enabled for v2. These examples use jq to read the token.

1

Get an access token

TOKEN=$(curl -s -X POST "https://$API_HOST/api/v2/access-token" \
-H "Authorization: Bearer $API_KEY" | jq -r .token)
2

Check connectivity

GET /ping confirms that the token is valid, that its key still allows calls from your address, and which environment answered. It has no side effects and every enabled key can call it.

curl "https://$API_HOST/api/v2/ping" \
-H "Authorization: Bearer $TOKEN"
{ "message": "pong", "livemode": false, "apiVersion": "2.0" }

A platform key can add Account-Holder to confirm that it can act on that account holder.

3

Read a list

With a platform key that holds accountHolders:read, list your account holders. Do not send Account-Holder on this call.

curl "https://$API_HOST/api/v2/accountHolders?limit=10" \
-H "Authorization: Bearer $TOKEN"
{
"data": [
{
"id": "2b1f8f53-5d0e-4c0f-9a51-1d3b8c2e4f10",
"object": "accountHolder",
"livemode": false,
"type": "BUSINESS",
"name": "Atlas Travel LLC",
"status": "ACTIVE"
}
],
"pageInfo": { "hasNextPage": false, "endCursor": null }
}

With a company key that holds cards:read, list the cards of your own account holder instead:

curl "https://$API_HOST/api/v2/cards?limit=10" \
-H "Authorization: Bearer $TOKEN"

Next steps