Step 1 — Get your API key
- Sign up at merchant.gosurge.xyz/register.
- After your account is approved, the Surge team enables API access for your account.
- Log in to your merchant dashboard, go to Settings → API Keys, and click Generate API Key.
- Copy the key immediately — it is shown once. Note your Merchant ID (
mer_...) on the same page.
Step 2 — Create a checkout session (backend)
Your server calls Surge to create a short-lived checkout session tied to the order. Pass the session token to your frontend to open the widget..env
All amounts are in kobo (Nigerian lowest denomination). ₦1,200.00 =
120000 kobo. Never pass naira values directly — divide by 100 to display to the customer.Step 3 — Open the widget (frontend)
Once your server returns thesessionToken, open the Surge checkout modal.
Step 4 — Listen for webhooks
Surge sends apayment.success event to your configured webhook URL after the deposit is collected and the plan is activated.
Configure your webhook URL
In your merchant dashboard go to Settings → Webhooks and enter your endpoint URL. Set a strong random string as your Webhook Secret and save it to yourSURGE_WEBHOOK_SECRET env var.
Handle the event
Node.js
Surge signs outbound webhooks with HMAC-SHA256 using your
webhook_secret. The header is X-Surge-Signature. Return 200 OK immediately and process fulfillment asynchronously to avoid retry storms.You’re done
Next steps:
- Check customer eligibility before showing the button
- Create payment links for WhatsApp / social selling
- Handle payment methods for returning customers