Swipelux

Embedded Checkout for Digital Goods

Implement in-app modal checkout for digital purchases with saved KYC/payment data to reduce drop-off rates

Summary

Offer a modal/inline on-ramp inside your app. Users complete KYC once; returning users reuse stored details. You get REST-verifiable transfer IDs to drive entitlement.

Problem → Solution mapping

PainCapabilityMechanism
Redirect frictionEmbedded widgetWeb SDK + apiKey
Entitlement gatingTransfer IDsCreate first, verify on webhook then unlock
ComplianceKYC handledPOST /v1/customers with identifying documents

Architecture

Implementation steps

Server: create customer + transfer

curl https://wallet.swipelux.com/v1/transfers \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: sk_test_1234567890abcdef' \
  --data '{"onBehalfOf":"cus_cK69MttD5nAUAbud1B","amount":"9.99","source":{"paymentRail":"card","currency":"USD"},"destination":{"currency":"USDC"}}'
<button id="buy">Buy</button>
<script>
  const settings = { apiKey: "pk_test_abc123" };
  const url = `https://track.swipelux.com/?specificSettings=${encodeURIComponent(JSON.stringify(settings))}`;
  document.getElementById('buy').onclick = () => window.open(url, '_blank', 'noopener');
</script>

Verify and grant access

curl https://wallet.swipelux.com/v1/transfers/tr_nEZHWur1pBSAKY7NlV \
  --header 'X-API-Key: sk_test_1234567890abcdef'

Check balance (optional "wallet credit" view)

curl https://wallet.swipelux.com/v1/customers/cus_cK69MttD5nAUAbud1B/balances \
  --header 'X-API-Key: sk_test_1234567890abcdef'

Webhooks (subscribe, validate, verify)

app.post('/webhook', express.raw({type:'application/json'}), (req, res) => {
  const sig = req.header('X-Webhook-Signature') || '';
  if (!verify(sig, req.body)) return res.status(401).end();
  const evt = JSON.parse(req.body.toString('utf8'));
  if (evt.type === 'transfer.completed') { /* fetch & unlock */ }
  res.sendStatus(200);
});

UX choices

Embed for minimal context switch; Payment Link OK for MVP. Apple Pay where available.

KPIs

Checkout start→complete; time to unlock.

Limits & caveats

USD→USDC only. Do not unlock on webhook alone; REST verify.

Troubleshooting

If failed, inspect failureReason from webhook; allow retry.