End-to-end example
A minimal but complete partner integration. Three files: a signup script, a server route, and a browser page. Together they exercise the entire S2S flow.Payfac partners. This example uses
tpas.create(). CRM-only partners should create the merchant, then submit applications (or embed) — see Accounts.Want the full working repo? The same flow as a runnable boilerplate — Node CLI for sub-merchant provisioning + Express checkout with card / Apple Pay / Klarna — lives at github.com/TagadaPay/partners-examples. Clone, fill in
.env, and ship it.File 1 — Signup script (run once per merchant)
File 2 — Charging server (Express / Next.js / Hono / whatever)
File 3 — Browser checkout page
Same flow for Klarna (redirect APM)
The browser doesn’t do anything other than the click + final redirect:Webhook handler (settle status server-side)
File 4 — read a merchant’s transactions, orders & customers
Onboarding and charging is only half the job — your merchants also want to see their own activity inside your product. You read it back with the same two keys you stored in File 1, on behalf of one merchant at a time. Two layers are available, depending on what you need:- CRM layer (CRM Key,
sk_crm_…) — the merchant’s business objects: orders, payments (with their transactions), customers, subscriptions. This is what you render in a merchant-facing dashboard. - Processing layer (Processing Key,
tp_sk_…) — the raw acquirer-side charges/transactions for the merchant’s TPA: scheme, 3DS outcome, auth code, BIN intelligence, refunds, disputes. This is what you use for reconciliation and risk.
{ data, total, page, pageSize, totalPages, hasMore } — and every processing listing is cursor-paginated ({ data, hasMore, nextCursor }). Retrieve single records with orders.retrieve(id), payments.retrieve(id), customers.retrieve(id) on the CRM side, and charges.retrieve(id, { account }) on the processing side.
Which key for which read? Use the CRM Key for the merchant-facing view (orders, payments, customers, subscriptions) and the Processing Key for acquirer-level charges, refunds, disputes and payouts. Full method lists: CRM provisioning → Query the merchant’s data and Reporting, refunds & disputes.
What you have now
A complete embedded-payments integration:
No checkout sessions, no funnels, no Tagada-hosted UI. Your platform, your brand, our payments.
