Skip to content
ajar.Book a demo

Connection

Start email sign-in

Send your Amazon email and password transiently. Amazon may ask for a phone code. Keep the returned attempt_ref for the next step; it expires after five minutes.

Request

POST https://api.useajar.com/v1/connections/amazon/email/start
Authorization: Bearer YOUR_AJAR_API_KEY
Content-Type: application/json

JSON body

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

Complete phone verification

If the first response has status verification_required, send its attempt_ref and the new phone code. A successful response has status ready, amazon_token and expires_at_epoch_s. If Amazon does not require a code, the first response already contains the token.

Request

POST https://api.useajar.com/v1/connections/amazon/email/complete
Authorization: Bearer YOUR_AJAR_API_KEY
Content-Type: application/json

JSON body

{
  "attempt_ref": "RETURNED_ATTEMPT_REF",
  "code": "FRESH_PHONE_CODE"
}

Use your caller-held token

Store amazon_token securely on your device. Send it as x-amazon-token alongside your ajar bearer for each operation. The token is bound to your ajar account, GB region and app profile; ajar does not store the provider session. Prices are GBP pence.

Request

POST https://api.useajar.com/v1/operations/amazon.search
Authorization: Bearer YOUR_AJAR_API_KEY
x-amazon-token: YOUR_AMAZON_TOKEN
Content-Type: application/json

JSON body

{
  "query": "lighter",
  "prime": true,
  "price_min_minor": 100,
  "price_max_minor": 500
}

Change your basket and checkout

For each cart, wishlist, payment-default or checkout selection change, send a new x-idempotency-key. If the response is uncertain, read the basket or checkout state before deciding what to do next. cart.get returns active items and marks which are selected for checkout. checkout.start needs a selected item; checkout.get returns the current total, address and payment choices. Card registration and order placement are not currently available.

Request

POST https://api.useajar.com/v1/operations/amazon.cart.add
Authorization: Bearer YOUR_AJAR_API_KEY
x-amazon-token: YOUR_AMAZON_TOKEN
x-idempotency-key: UNIQUE_KEY_FOR_THIS_ACTION
Content-Type: application/json

JSON body

{
  "asin": "B012345678"
}

Refresh without signing in again

POST an empty body and replace your saved amazon_token with the response. expires_at_epoch_s is the access deadline. Refresh before it when possible; the endpoint can recover an expired access lease for up to 30 days if Amazon still accepts its refresh credential. Reads reject expired access tokens. This is an explicit call, not background refresh.

Request

POST https://api.useajar.com/v1/connections/amazon/refresh
Authorization: Bearer YOUR_AJAR_API_KEY
x-amazon-token: YOUR_AMAZON_TOKEN

Sign out and limits

Discard your local token to sign out. A saved copy may still be usable by the same account until its access or refresh deadline. Losing the token or an Amazon-revoked refresh credential requires a new email sign-in.

Authentication guide