Skip to content
ajar.Book a demo

Connection

Sign in to Starbucks

Request

POST https://api.useajar.com/v1/connections/starbucks/sign-in
Authorization: Bearer YOUR_AJAR_API_KEY
Content-Type: application/json

JSON body

{
  "email": "you@example.com",
  "password": "YOUR_STARBUCKS_PASSWORD"
}

Response — your tokens

{
  "access_token": "YOUR_STARBUCKS_ACCESS_TOKEN",
  "refresh_token": "YOUR_STARBUCKS_REFRESH_TOKEN",
  "token_type": "Bearer",
  "expires_in": 1740,
  "expires_at_epoch_s": 1790761740
}

Sign-in returns your Starbucks bearer and refresh token. Store them on your device; ajar does not save them. Send the access token in x-starbucks-token. Authorization identifies your ajar workspace.

Example Starbucks request

POST https://api.useajar.com/v1/operations/starbucks.rewards.summary.get
Authorization: Bearer YOUR_AJAR_API_KEY
x-starbucks-token: YOUR_STARBUCKS_ACCESS_TOKEN
Content-Type: application/json

{}

Refresh your tokens

When the access token expires, send your refresh token. Replace both saved tokens with the response. Prepare a new order after refreshing.

Request

POST https://api.useajar.com/v1/connections/starbucks/refresh
Authorization: Bearer YOUR_AJAR_API_KEY
Content-Type: application/json

JSON body

{
  "refresh_token": "YOUR_STARBUCKS_REFRESH_TOKEN"
}
Authentication guide