Skip to main content
If you’re looking for a no code implementation, head over to Payment Links.

How to integrate Sprintcheckout payments API

On this guide you can learn how to create a payment session and get notification on to your backend via webhooks. Below you can see a typical integration flow between an ecommerce and a payment gateway. To integrate with Sprintcheckout API follow these two steps:

A. Create payment session and receive a redirect url

Go to create a payment session for full API reference.

Example request

cURL
  curl --request POST \
  --url https://api.sprintcheckout.com/api/checkout/v2/payment_session \
  --header 'Content-Type: application/json' \
  --header 'X-SC-ApiKey: <x-sc-apikey>' \
  --data '{
  "orderType": "STATIC",
  "amount": 100.5,
  "minAmount": 100.5,
  "editable": true,
  "currency": "USD",
  "orderId": "inv-00010",
  "successUrl": "<string>",
  "cancelUrl": "<string>"
}'

Example response

You will receive a json like this:
  {
    "sessionId": "NjVkY2MzNTI3N2YxZjEwYmE0OWVjN2M2",
    "redirectUrl": "https://app.sprintcheckout.com/?uid=NjVkY2MzNTI3N2YxZjEwYmE0OWVjN2M2"
  }
For some use cases a payment session can accept multiple payments (for example donation links). In that case you can do updates to the payment session, check full API reference on update a payment session.

B. Get payment updates via webhook

Received automatically when a payment status changes.

1. Endpoint Setup

On the Notifications section, you can set up the endpoint to receive the order confirmation. Set your webhook URL in the Notifications section.

2. Security

Requests include the header X-Webhook-Api-Key (or the key shown on your dashboard). You should verify this matches your secret key to ensure the request is genuine.

3. Payload Format

The payment notification message will be a JSON POST request with this format:
{
  "event": "payment.succeeded",
  "timestamp": 1769339152,
  "orderId": "static-id-123",
  "amount": 100.5,
  "currency": "USD",
  "token": "USDC",
  "successUrl": "http://successurl.example",
  "failUrl": "http://failurl.example",
  "cancelUrl": "http://cancelurl.example",
  "paymentSessionId": "0a77a733-4323-482c-b646-91cafd48ef6a",
  "status": "SUCCESS",
  "chain": "polygon",
  "receipts": [
    "https://polygonscan.com/tx/0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  ]
}

4. Status Values

Possible values for status include:
  • PENDING: Payment initiated but not yet settled.
  • SUCCESS: Payment successfully settled.
  • FAILED: Payment failed or was rejected.
  • EXPIRED: The session time limit was reached.

5. Retry Policy & Idempotency

  • Retries: If your server does not return a 200 OK status, we will retry the notification multiple times (exponential backoff).
  • Idempotency: Webhooks may be delivered more than once. Use the paymentSessionId or orderId to ensure you process each Event only once.

Dashboard Orders

On the Dashboard > Notifications section you can also find a table where you will find every order you receive via API.