The SuperPay Checkout API recommends the credit card that earns the most rewards on a given purchase. It powers the <script>-tag widget that turns your checkout into an instant "use this card" prompt — and it can be called server-to-server too.
Every request needs a merchant API key issued by SuperPay. Send it in either of two headers:
Authorization: Bearer sp_live_xxxxxxxx_…
X-SuperPay-Key: sp_live_xxxxxxxx_…
Keys are sp_live_ + 8 hex characters + _ + 48 hex characters. Treat keys like passwords: never commit them to client-side source control. The drop-in widget script is the one exception — it's designed to ship the key in the page so a browser can call /v1/recommend directly.
When SuperPay issues your key we register the exact origins (e.g. https://shop.example.com) you'll mount the widget on. Browser requests from any other origin are rejected with HTTP 403 ORIGIN_NOT_ALLOWED. Server-to-server calls (no Origin header) are not subject to this check — the API key alone authorizes them.
Returns the best card from our ~320-card catalog for the requested category, plus 1–2 alternates, an estimated reward in cents, and a SuperPay signup_url the shopper can tap to claim it.
| Field | Type | Required | Notes |
|---|---|---|---|
amount | number | yes | USD, e.g. 87.45 |
mcc | string | preferred | ISO 18245 4-digit code. Takes precedence over category when both are supplied. |
category | string | fallback | Used only when MCC is missing or unmapped. One of dining, groceries, gas, travel, entertainment, online_shopping, streaming, drugstores, home_improvement, transit, shopping, other |
merchant_name | string | recommended | Display name, e.g. "Whole Foods Market" |
curl -X POST https://superpayrewards.com/v1/recommend \
-H "Authorization: Bearer sp_live_…" \
-H "Content-Type: application/json" \
-d '{
"amount": 87.45,
"mcc": "5411",
"merchant_name": "Whole Foods Market"
}'
{
"recommendation_id": "9f8…",
"anonymous": true,
"category": "groceries",
"amount_cents": 8745,
"top_card": {
"source": "catalog",
"id": "amex_blue_cash_preferred",
"name": "Blue Cash Preferred® Card from American Express",
"issuer": "American Express",
"reward_rate": 6,
"reward_type": "cashback",
"estimated_reward_cents": 524,
"estimated_reward_display": "$5.24",
"reason": "6% on groceries",
"apply_url": "https://…"
},
"alternates": [ { … }, { … } ],
"signup_url": "https://superpayrewards.com/r/install/checkout_widget?utm_source=merchant&utm_medium=checkout_widget",
"display": {
"headline": "Earn ~$5.24 with SuperPay",
"subline": "Top card: Blue Cash Preferred · 6% back"
}
}
Paste this into your checkout page. Render the <div> wherever you want the recommendation pill to appear and load /v1/widget.js once, anywhere on the page:
<div data-superpay-recommend
data-amount="87.45"
data-mcc="5411"
data-merchant="Whole Foods Market"
data-theme="light"></div>
<script src="https://superpayrewards.com/v1/widget.js" data-key="sp_live_…" async></script>
The widget is ≤ 360px wide, themes light/dark via data-theme, never breaks the merchant's checkout (it silently no-ops on any error), and is CORS-allowed for browser calls. Pre-bundled SuperPay branding doubles as a sign-up CTA so anonymous shoppers can claim the recommended reward by joining SuperPay.
| Status | Code | Meaning |
|---|---|---|
| 400 | INVALID_AMOUNT | amount missing or out of range |
| 401 | MISSING_API_KEY / INVALID_API_KEY / API_KEY_REVOKED | auth failed |
| 404 | NO_RECOMMENDATION | no catalog card has a non-zero rate for this category |
| 429 | RATE_LIMITED | over 60 requests per minute on this key |
| 500 | INTERNAL_ERROR | SuperPay-side failure — safe to retry |
Rate limits are per API key. Headers X-RateLimit-Limit, X-RateLimit-Remaining, and Retry-After are set on every response.
#00C896#0A1628SuperPay issues two types of API keys:
| Key type | Prefix | How to get | Rate limit | Behavior |
|---|---|---|---|---|
| Sandbox | sp_test_ | Email hello@superpayrewards.com | 60 req/min | Returns static mock recommendations; no analytics tracked. Use for development & testing. |
| Live | sp_live_ | Apply on the Developers page | 60 req/min | Returns real catalog recommendations; usage logged and visible in your merchant dashboard. |
Sandbox keys are available immediately on request. Live keys require a brief application review (typically < 1 business day) to ensure origin allowlists and integration quality.
Ready to integrate? Apply for a live API key →
Submit your business name, contact email, store origins, and a brief description of your integration. We'll verify your email and review your application — you'll receive your sp_live_… key via email once approved, typically within 1 business day.
Need to rotate a lost key or update your allowed origins? Email hello@superpayrewards.com.