Documentation Index
Fetch the complete documentation index at: https://docs.gosurge.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Step 1 — Get your credentials
- Sign up at merchant.gosurge.xyz/register.
- After your account is approved, log in and navigate to Settings → API Keys.
- Note your Merchant ID (
mer_...) shown on that page. - Your credentials for calling the API are your merchant email and password — you exchange them for a JWT token at login (see Step 2).
Step 2 — Create a checkout session (backend)
Your server logs in to get a JWT, then calls Surge to create a short-lived checkout session tied to the order. The session token is sent 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
| Step | What you built |
|---|---|
| Step 1 | Merchant account + credentials |
| Step 2 | Server endpoint that logs in and creates a checkout session |
| Step 3 | Frontend button that opens the Surge widget |
| Step 4 | Webhook handler to fulfill orders after payment |
- Check customer eligibility before showing the button
- Create payment links for WhatsApp / social selling
- Handle payment methods for returning customers