Skip to Content
The AKIN Travel developer platform is in beta — APIs may change. Get started →
Server-to-server reads

Server-to-server reads

Some integrations never put a member through AKIN Travel’s sign-in. If your backend already authenticates users (your own identity stack — Supabase, Auth0, a session cookie, anything), you can read a member’s loyalty standing server-to-server, keyed by email, authorized on your partner API key alone.

No member token required. Unlike the member-scoped API, this path does not use Firebase / GIP ID tokens. There is no requestMagicLink, no signInWithCustomToken, no Authorization: Bearer header. Your x-partner-api-key is the only credential. That’s the whole point — your users never touch AKIN auth.

This is the right tool when your backend needs a member’s tier to render your own UI, gate a benefit, or sync state — and you already know who the user is. It does not return points, travel credit or stays: those belong to the member, and only a token the member obtained can read them (see Confirm a member from a bot below). For your arrivals, sign-ups and headline figures, including the points balance of your own enrolled members, use the Partner Reporting API with a reporting:read key.

On Node? The typed Server SDK wraps these reads (and enrollment) with a method per operation, structured errors, and rate-limit handling — so you don’t hand-roll the requests below.

Authentication

Send only your partner API key. No bearer token.

HeaderValue
content-typeapplication/json
x-partner-api-keyyour secret sk_test_* / sk_live_* key

The key identifies your partner. Every server-to-server read is scoped to members enrolled with your partner — you can never read a member who isn’t yours. The partner is derived from the key; there is no partnerId argument to pass (or spoof).

memberByEmail

Resolve a member by email and get their identity plus current loyalty standing.

curl https://sandbox.akintravel.com/graphql \ -H 'content-type: application/json' \ -H 'x-partner-api-key: sk_test_...' \ -d '{"query":"query($email:String!){ memberByEmail(email:$email){ memberId email firstName lastName tier } }","variables":{"email":"guest@example.com"}}'
{ "data": { "memberByEmail": { "memberId": "8f3c…", "email": "guest@example.com", "firstName": "Ada", "lastName": "Lovelace", "tier": "TIER3" } } }
FieldMeaning
memberIdAKIN member ID — stable, safe to persist as a foreign key on your side
emailMember’s primary email
firstName / lastNameMember identity (may be null)
tierCurrent calculated tier with your partner for the current membership year

There is no points field on this lookup. A points balance, travel credit, stays and perks are the member’s own data: read them with a member token, either the member’s own sign-in through the SDK or the read-only token a bot obtains below.

Email matching is case-insensitive, and historical emails are matched too — if a member changed their email after you first saw them, the old address still resolves.

memberByExternalId

If you key members by your own loyalty identifier rather than email, resolve them by that identifier instead. The external_id is the value you supplied when you enrolled the member server-to-server — AKIN stores it against the enrollment so you don’t have to persist the AKIN member ID everywhere.

curl https://sandbox.akintravel.com/graphql \ -H 'content-type: application/json' \ -H 'x-partner-api-key: sk_test_...' \ -d '{"query":"query($externalId:String!){ memberByExternalId(externalId:$externalId){ memberId email firstName lastName tier } }","variables":{"externalId":"your-loyalty-key-9001"}}'
{ "data": { "memberByExternalId": { "memberId": "8f3c…", "email": "guest@example.com", "firstName": "Ada", "lastName": "Lovelace", "tier": "TIER3" } } }

The response is the identical PartnerMemberRead shape as memberByEmail — same fields, same meanings (see the table above). The only difference is the lookup key.

External IDs are scoped to your partner. The same string can belong to a different member under a different partner; this lookup only ever resolves the enrollment you set, so it can never reach another partner’s members. Only active enrollments resolve.

Not found

A lookup that doesn’t resolve to one of your enrolled members returns a MEMBER_NOT_FOUND error (not an auth error):

{ "errors": [{ "message": "member not found", "extensions": { "code": "MEMBER_NOT_FOUND" } }] }

This is deliberately indistinguishable between “no such member anywhere” and “this member exists but isn’t enrolled with you” — so neither endpoint can be used to probe whether an arbitrary email or external ID belongs to the AKIN network under a different partner. Branch on extensions.code, never the message. See Error handling.

Confirm a member from a bot (emailed code)

A chatbot or support tool that talks to your guests can read a member’s own standing — points, travel credit, stays, rewards, history, profile — once the member proves who they are. Typing an email address is not proof: anyone can type someone else’s. So the bot asks AKIN to email the member a 6-digit code, and swaps the right code for a read-only token for that member. Two mutations, both authorized by your secret partner key alone:

1. Send the code. An address with an account gets the log-in email, branded for your partner, with a 6-digit code. An address AKIN does not know gets nothing — no account, no join email — and the same answer, so the bot cannot tell the two apart.

curl https://sandbox.akintravel.com/graphql \ -H 'content-type: application/json' \ -H 'x-partner-api-key: sk_test_...' \ -d '{"query":"mutation($email:String!,$locale:String){ requestPartnerBotSignInCode(email:$email, locale:$locale){ success error } }","variables":{"email":"guest@example.com","locale":"en"}}'

2. Check the code. The code and the link in the same email are one credential: whichever is used first, the other is refused. A code works once, expires with its email (1 hour), is dead after five wrong tries, and works only for the partner whose key asked for it.

curl https://sandbox.akintravel.com/graphql \ -H 'content-type: application/json' \ -H 'x-partner-api-key: sk_test_...' \ -d '{"query":"mutation($email:String!,$code:String!){ verifyPartnerBotSignInCode(email:$email, code:$code){ success token expiresInSeconds refusal error } }","variables":{"email":"guest@example.com","code":"482913"}}'
{ "data": { "verifyPartnerBotSignInCode": { "success": true, "token": "eyJhbGciOi…", "expiresInSeconds": 3600, "refusal": null, "error": null } } }

token is an AKIN-signed bearer, not a Firebase token: there is nothing to exchange. Send it as Authorization: Bearer … to /mcp (tools getMyLoyaltyStatus, getMyBookings, getMyAvailableRewards, getMyLoyaltyHistory, getMyProfile) or to /graphql. Keep it for the conversation only, never across conversations. It expires after expiresInSeconds and cannot be refreshed: ask for a new code.

The token is read-only, on the server. It carries a partner-bot scope that every write refuses: /mcp answers READ_ONLY_REFUSED on any tool that makes a change (cancel, redeem, profile edit) and lists none of them, and /graphql answers READ_ONLY_TOKEN (HTTP 403) on every mutation. It is not an Identity Platform credential, so it cannot be used to change the account’s password or email, and it carries no staff access: a staff account confirmed this way gets a member token. Every other AKIN endpoint refuses it.

refusalMeaningWhat the bot does
CODE_REFUSEDNot a code that works: wrong, expired, locked after too many tries, or never sent. It never says whether the address has an accountAsk the member to check the code and try again; after a few tries, send a new code
CODE_DAILY_LIMITToo many tries for this address todayTry again tomorrow
LINK_ALREADY_USEDThe code, or the link in its email, was already usedSend a new code
SIGN_IN_ON_WEBSITEThe code was right, but this sign-in needs a step a chat cannot finish: the AKIN terms, your Program Terms, a passkey, or an account the app must set up firstAsk the member to sign in on your site or in the app, then come back
CANNOT_SIGN_INThis address cannot sign in through a bot (for example a closed account)Show error; do not send another code

requestPartnerBotSignInCode never creates an account. A code from AKIN’s own join email (the app’s one sign-in screen) is refused here with SIGN_IN_ON_WEBSITE, and nothing is created.

Rate limits

Server-to-server reads count against the same per-key budget as the rest of the API and report RateLimit-* headers. See Rate limits. A read-only bot token is limited on /mcp to 30 requests a minute per signed-in member; on HTTP 429, wait for Retry-After. Each address may be sent at most 10 sign-in emails a day, across every surface.

Last updated on