Tokenized Payment — Getting Started
Tokenized payment lets your mobile app charge a ShopBack user's linked payment method without redirecting them to a checkout page on every transaction. The user links their ShopBack account once; from then on, your backend initiates charges directly using a long-lived payment token.
How it works
The integration has two stages:
| Stage | What it does | Who initiates |
|---|---|---|
| Account Linking | User grants your app permission to charge their ShopBack payment method. You receive a paymentToken. | Merchant app (via in-app browser) |
| Payment | Your backend uses the paymentToken to charge the user — either with a hold-then-capture (pre-auth) or a one-shot charge. | Merchant backend |
Choose your payment mode
Once you have a paymentToken, you have two options for taking payment:
Pre-authorization (hold, then capture)
Place a hold on the user's funds when a service starts, then settle the exact amount once you know it. The capture amount can differ from the original hold.
Best for: ride-hailing, hotel bookings, metered services — any use case where the final amount isn't known at the start.
Flow: POST /pre-auths → (service completes) → POST /pre-auths/{id}/capture
Immediate charge (auth + capture in one step)
Charge the user's linked method in a single API call. No separate capture step.
Best for: fixed-price purchases — food delivery, top-ups, on-demand services with a known price.
Flow: POST /charge
End-to-end overview
┌─────────────────────────────────────────────────┐
│ ACCOUNT LINKING (once) │
│ Merchant App → ShopBack consent → paymentToken │
└───────────────────────┬─────────────────────────┘
│ paymentToken
┌─────────────┴─────────────┐
▼ ▼
┌─────────────────┐ ┌───────────────────┐
│ Pre-auth flow │ │ Immediate charge │
│ POST /pre-auths │ │ POST /charge │
│ ↓ │ │ ↓ │
│ POST .../capture│ │ Order created │
└─────────────────┘ └───────────────────┘
Prerequisites
Before you start:
-
Merchant credentials — You need a merchant JWT to authenticate requests. Obtain this from our integration engineer.
-
Registered callback URL — The
callbackUrlyou pass during account linking must be on the allowlist configured for your merchant channel. Contact ShopBack to add URLs. -
Mobile app with in-app browser — Account linking opens a ShopBack-hosted consent page inside your app using an in-app browser (e.g.
SFSafariViewControlleron iOS,Custom Tabson Android). -
Base URL — All endpoints below are relative to your merchant gateway base URL provided by ShopBack.
Authentication
All merchant gateway requests require a Bearer token in the Authorization header:
Authorization: Bearer <merchant_jwt>
Pages in this guide
| Page | What it covers |
|---|---|
| Account Linking | Initiate a link session, redirect the user, swap the auth code for a paymentToken |
| Pre-Authorization | Create a hold, poll for authorization, capture or void |
| Immediate Charge | Single-step auth + capture |
| Key Concepts | Idempotency, webhooks, cashback, error codes |