WhatsApp bots, storefront builders and PSPs can let their vendors sell with escrow protection — and can query any seller's reputation — without sending buyers to a separate app.
Step 1
Call the SDK with your secret API key when a buyer checks out. You get back a one-time token — every order is attributed to you.
import { TrustLayerClient } from '@trust-layer/sdk';
const tl = new TrustLayerClient({
apiKey: process.env.TRUSTLAYER_API_KEY, // server-side only
baseUrl: 'https://trustlayer.africa',
});
// When your buyer checks out, mint a protected checkout:
const { token } = await tl.createCheckout({
sellerId, buyerPhone, amountKobo, itemTitle,
});
// → pass `token` to the browserStep 2
Drop in our script and hand it the token. The protected checkout opens in a modal and streams events back to you — no redirect, no separate app.
<script src="https://trustlayer.africa/embed/checkout.js"></script>
<button data-trustlayer-token="THE_TOKEN">
Pay protected with Trust Layer
</button>
<!-- or programmatically -->
<script>
TrustLayerCheckout.open({
token: 'THE_TOKEN',
onEvent: (e) => console.log(e.type), // trustlayer:paid, trustlayer:released …
});
</script>Look up a seller by handle or id and get a risk-banded trust profile — for ranking listings, screening applicants, or rendering a verified badge.
const rep = await tl.getReputation('oge-ventures');
// → { score: 588, tier: 'NEW', riskBand: 'LOW',
// completedSales: 0, ... }
// Or score a whole catalog in one call:
const many = await tl.getReputationBatch(['oge-ventures', 'seller-2', 'seller-3']);Risk bands
Every profile resolves to LOW / MEDIUM / HIGH so you can act without interpreting raw scores.
Batch up to 50
Score a whole catalogue or search page in a single call.
Scoped & metered
Requires the reputation:read scope; lookups are metered for billing.
Try it live
Create a payment link in your dashboard, paste its token here, and open the real protected checkout in a modal — exactly what your buyers would see. Events stream in below.
Get an API key and embed protected checkout and reputation into your product in an afternoon.
Request partner access