Authentication
Your client_id and client_secret identify a partner business. A Bearer token can access that partner’s cards. Keep both credentials and tokens on your backend; they do not belong in a browser bundle, mobile app, or client-side storage.
Token exchange
Section titled “Token exchange”POST /v1/auth/token HTTP/1.1Host: api.zwipe.coContent-Type: application/json
{"client_id":"zw_example","client_secret":"YOUR_SERVER_SIDE_SECRET"}{ "access_token": "EXAMPLE_OPAQUE_TOKEN", "token_type": "Bearer", "expires_in": 3600, "scope": "cards:issue cards:balance cardholders:verify"}Send JSON, not a form-encoded OAuth request. Do not add grant_type, scope, or refresh-token fields. The access token is opaque; do not decode it as a JWT.
Permissions
Section titled “Permissions”| Scope | Access |
|---|---|
cards:issue |
Create an order, retrieve card status and restart an eligible cashback cycle. |
cards:balance |
Read a card balance. |
cardholders:verify |
Cardholder email and phone verification. |
cards:reveal |
Chain card details and fresh Wallet links. |
venues:register |
Register an unclaimed restaurant on its first issuance; no standalone venue endpoint. |
Zwipe assigns scopes. They cannot be elevated by the token request. Account suspension prevents existing tokens from authenticating, and scope changes apply on subsequent requests.
Cache and renew
Section titled “Cache and renew”Reuse a token across requests in your backend process. Refresh roughly 60 seconds before expires_in and share a refresh already in progress. The downloadable Node.js partner client implements this. This server authentication is not part of the hosted SDK integration.
On 401 unauthorized, discard the cached token and perform one new token exchange. If authentication still fails, stop and check the account. A 403 insufficient_scope requires a permission change, not repeated refreshes.
Rotating the client secret immediately prevents the old secret from creating tokens. Existing access tokens are not revoked by secret rotation and can remain valid until their one-hour expiry. Coordinate suspension and rotation with Zwipe if immediate access blocking is needed.
Customer authorization
Section titled “Customer authorization”Your app logs the customer in using your normal session. Your backend must verify that every requested card/order belongs to that customer before calling Zwipe. Zwipe isolates partner accounts, but it does not know which customer is signed into your app. See the backend route pattern.

