unPLUGDevelopers

App API

Member tokens

Give your app a token that works for one member for 15 minutes, so it can read that member's balance and wallet without ever holding your secret key.

Available at launch

Your server creates the token after the guest signs in with your own login, then hands it to the app. The app sends it as Authorization: Bearer mt_.... There is no refresh token: when a call returns 401 token_expired, the app asks your server for a new one. The Authentication guide walks through the full flow. Every endpoint can also return the common errors listed on Errors.

What a member token can call#

A member token acts for one member only. Anything that moves money or points directly, or reads other members, needs your secret key on your server.

EndpointMember tokenNotes
GET /v1/programYes
GET /v1/locationsYes
GET /v1/rewards, GET /v1/rewards/{id}Yes
GET, PATCH, DELETE /v1/members/meYesCan't change phone. Can set birthday once.
GET /v1/members/me/activityYes
GET /v1/members/me/walletYes
GET, PATCH /v1/members/me/communication_preferencesYes
Devices and messages under /v1/members/me/...YesSee Devices and messages.
POST /v1/checkouts/previewYesFor the token's own member only.
POST /v1/redemptionsYesFor the token's own member only.
GET /v1/redemptions/{id}, POST /v1/redemptions/{id}/cancelYesOnly redemptions of the token's own member. Lets the app release a hold when the guest leaves checkout.
POST /v1/app_eventsYes
POST /v1/members, GET /v1/membersNoCreate and look up members from your server.
Anything under /v1/members/{id}/...NoIncludes other members and points adjustments.
POST /v1/orders, refunds, GET /v1/ordersNoOnly your server knows an order was paid.
POST /v1/member_tokensNo
Webhook endpoints and eventsNo

A token used on an endpoint it can't call gets 403 missing_scope.

Coming soon unPLUG-hosted sign-in for brands without their own login: phone number and SMS code on an unPLUG page, returning a member token and a refresh token. See the Authentication guide.