Get an API key & authenticate

The developer API authenticates with an API key (Authorization: Bearer <API key>); console and wallet APIs use a JWT access token plus a refresh token.

View as Markdown

Create an API key

  1. 1Log into the merchant dashboard, go to Developers → API Keys.
  2. 2Click "Create key" and check the scopes this key needs.
  3. 3The full secret (rbp_test_...) is shown exactly once — copy it immediately into a secret manager. After that, only the prefix is ever shown again.
The key belongs in your backend's environment variables only — never in frontend code or sent to the browser. If it leaks, revoke it from the dashboard immediately (revocation takes effect instantly).

Sending the key with a request

curl -sS "$BASE/api/Product" \
  -H "Authorization: Bearer $API_KEY"

Signed-in APIs: JWT + refresh token

ReBate Pay's own platform console (Admin*), merchant console (Merchant*) and consumer wallet (Member*) APIs don't use API keys — you sign in first and get tokens. Use the same flow when your app acts on behalf of a signed-in person.

WhoSign inRefreshSign out
Platform adminPOST /api/AdminAuth/Login { name, password }POST /api/AdminAuth/RefreshPOST /api/AdminAuth/Logout
Business or individual sellerPOST /api/MerchantAuth/Login { email, password, accountType }POST /api/MerchantAuth/RefreshPOST /api/MerchantAuth/Logout
Consumer walletPOST /api/MemberAuth/Login { email } sends a sign-in link → POST /api/MemberAuth/Verify { loginToken }POST /api/MemberAuth/RefreshPOST /api/MemberAuth/Logout
curl -sS -X POST "$BASE/api/MerchantAuth/Login" -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"…","accountType":"Business"}'
  • accessToken is a JWT that expires after 15 minutes (expiresIn seconds); send it as Authorization: Bearer on every request.
  • When it expires the API returns 401 TOKEN_EXPIRED — call the matching */Refresh with your refreshToken for a new pair. Refresh tokens rotate on every refresh and the old one stops working at once; using the same refresh token twice returns 401 INVALID_REFRESH_TOKEN, so sign in again.
  • Signing out revokes the refresh token; old tokens then get 401.
  • GET /api/Auth/Identity returns who the current token belongs to (userType is Admin, Merchant or Member).
  • A token of the wrong kind (e.g. a merchant token on Admin*) gets 403 WRONG_TOKEN_TYPE; API keys can't call signed-in APIs and JWTs can't call the developer API.
  • Treat the refresh token like a password: keep it in secure storage (e.g. the app's secure store), never in URLs or logs.

Common scopes

A key only has the scopes you checked; write implies read. Grant only what you actually need. Full list at API Keys & Security.

ScopeGrants
products:read / products:writeProduct catalog
customers:read / customers:writeCustomer data
subscriptions:read / subscriptions:writeSubscriptions
payments:writeCreate/attempt payments (high-risk: moves money)
refunds:writeRefunds (high-risk: moves money)
webhooks:writeRegister webhook endpoints