Merchant Registration
Before integrating, you need a Surge merchant account. You can register via the dashboard or the API.Via Dashboard (Recommended)
Sign up at merchant.gosurge.xyz/register. Once approved, log in to find your Merchant ID under Settings → API Keys.1
Register
Go to merchant.gosurge.xyz/register and fill in your business details.
2
Wait for approval
New accounts are reviewed within 24 hours. You’ll receive an email when approved.
3
Generate your API key
Once approved, the Surge team enables API access for your account. Log in to the merchant dashboard, go to Settings → API Keys, and click Generate API Key. Copy the key immediately — it is only shown once. Your Merchant ID (
mer_...) is shown on the same page.Via API
New merchant accounts require approval before they can create live checkout sessions. You will be notified by email once your account is activated.
Creating a Checkout Session
Before rendering the checkout widget, your backend must initialize a transaction by creating a Checkout Session. This session is short-lived (30 minutes) and secures the transaction details server-side.Endpoint
POST /api/v1/checkout/sessions
Authentication
Authenticate with your API key on every request:Request Headers
Payload Parameters
Request Example
Response — Success
Error Responses
Previewing a Payment Plan
Before completing checkout, you can preview what the installment schedule will look like for a given amount and plan configuration. This is useful for showing customers a breakdown before they confirm.Endpoint
POST /api/v1/checkout/preview
Request
Response
Idempotency
ThePOST /checkout/sessions endpoint supports the Idempotency-Key header to protect against duplicate requests caused by network timeouts, client retries, or double-clicks.
How it works
- Generate a UUID v4 and attach it as the
Idempotency-Keyheader on your request. - If your request times out or fails at the network layer, re-send the exact same request with the same
Idempotency-Key. - Surge will return the original session — no duplicate session or double-charge will occur.
- Keys expire after 24 hours. After expiry, the same key will create a fresh session.
Payment Links
Payment links are reusable, shareable URLs that let customers check out without needing a server-side session. Ideal for sharing via WhatsApp, Instagram, or email.Create a Payment Link
All fields in the payment link response use camelCase (
redirectUrl, isActive, createdAt, merchantId, publicUrl). The response schema uses Pydantic’s alias_generator=to_camel.redirectUrl is set, the customer is redirected there after a successful checkout instead of their Surge dashboard.