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/jsonJSON 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/jsonJSON 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/jsonJSON 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 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 GBP total, address and payment choices.
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/jsonJSON body
{
"asin": "B012345678"
}Place a confirmed order
Use the exact pipeline, item ASINs, total, delivery address and payment method returned by checkout.get. Set confirm_purchase to true and provide a fresh x-idempotency-key. The connector checks the quote again and submits once; after an uncertain result, inspect order history before taking another action. Orders are capped at £50 each and £50 per caller per day. Adding a new card is not currently available.
Request
POST https://api.useajar.com/v1/operations/amazon.checkout.place
Authorization: Bearer YOUR_AJAR_API_KEY
x-amazon-token: YOUR_AMAZON_TOKEN
x-idempotency-key: UNIQUE_KEY_FOR_THIS_ORDER
Content-Type: application/jsonJSON body
{
"pipeline_id": "p-000-0000000-0000000",
"expected_address_id": "ADDRESS_ID_FROM_CHECKOUT",
"expected_payment_method_id": "METHOD_ID_FROM_CHECKOUT",
"expected_total_minor": 500,
"expected_asins": [
"B012345678"
],
"confirm_purchase": true
}Track or cancel an order
Use orders.track to read delivery progress. Call orders.cancel.preview for the current eligible item count. To cancel the full order, send orders.cancel with that count, confirm_cancel: true and a fresh x-idempotency-key. If a cancellation response is uncertain, read tracking again before taking another action.
Request
POST https://api.useajar.com/v1/operations/amazon.orders.cancel
Authorization: Bearer YOUR_AJAR_API_KEY
x-amazon-token: YOUR_AMAZON_TOKEN
x-idempotency-key: UNIQUE_KEY_FOR_THIS_CANCELLATION
Content-Type: application/jsonJSON body
{
"order_id": "000-0000000-0000000",
"expected_item_count": 1,
"confirm_cancel": true
}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_TOKENSign 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.