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 Sprintcheckeckout API follow this 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

Webhooks

On the Notifications section, you can set up the endpoint to receive the order confirmation. You can optionally secure your endpoint accepting call with the webhook API key on the header that is shown on your dashboard.

The payment notification message will be a .json with this format:

{
  "orderId": "woo-12334",
  "amount": 1.00,
  "currency": "GBP",
  "successUrl": "https://alice-flowers.com/checkout",
  "failUrl": "https://alice-flowers.com/payment-error",
  "cancelUrl": "https://alice-flowers.com/checkout",
  "paymentSessionId": "NjQyYWRiN6Y0NTZiZjAzNDIxMWQxY2Vi",
  "status": "SUCCESS",
  "chain": "zksync-era-mainnet",
  "receipts": [
    "https://explorer.zksync.io/tx/0x84f7a7ff460422462daaf4543db5ddb038c73c63b56349b428aeffff52bb633a",
  ]
}

Dashboard

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