Send Pay Links
API Reference

API Overview

Complete Send Pay Links API reference documentation

API Reference

The Send Pay Links API allows you to programmatically create checkouts, process payments, manage users, and configure your account.

Base URL

All API requests should be made to:

https://sendpaylinks.com/api

Authentication Methods

Checkout APIs (JWT Tokens)

Checkout APIs use JWT tokens embedded in the request body. Generate tokens server-side using your CHECKOUT_TOKEN_SECRET:

import { SignJWT } from 'jose';

const secret = new TextEncoder().encode(process.env.CHECKOUT_TOKEN_SECRET);
const token = await new SignJWT(payload)
  .setProtectedHeader({ alg: 'HS256' })
  .setExpirationTime('1h')
  .sign(secret);

See Authentication for complete details.

Admin APIs (Session Cookies)

Admin APIs use session cookies set after login via POST /api/admin/auth. Include cookies in requests automatically using your HTTP client.

DocumentationDescription
AuthenticationJWT token creation and verification
User AuthenticationRegistration, OAuth, Magic Links, 2FA
Checkout APIInitialize and complete checkouts
Payment ProvidersStripe, NMI, Sticky.io, Konnektive, UltraCart, EPD
Upsell APIPost-purchase upsell flows
Admin APIUser, organization, and brand management
WebhooksWebhook configuration and events
DomainsCustom domain configuration
SalespersonSalesperson authentication
IntegrationsKlaviyo, Maropost, Attentive

API Categories

Core Checkout

MethodEndpointDescription
POST/api/checkout/initializeInitialize checkout with payment provider
POST/api/checkout/completeComplete checkout after payment
POST/api/checkout/get-payment-tokenGet token for upsell charges
POST/api/token/generateGenerate checkout token (dev/testing)

Upsell Flow

MethodEndpointDescription
POST/api/upsell/create-sessionCreate upsell session with offers
POST/api/upsell/acceptAccept upsell and charge payment
POST/api/upsell/declineDecline current offer
GET/api/upsell/session/[id]Get session status

Payment Providers

MethodEndpointDescription
POST/api/providers/stripe/create-intentCreate Stripe PaymentIntent
POST/api/providers/stripe/confirmConfirm Stripe payment
POST/api/providers/nmi/process-paymentProcess NMI payment
POST/api/providers/nmi/process-upsellProcess NMI upsell
POST/api/providers/sticky/create-orderCreate Sticky.io order
POST/api/providers/sticky/process-paymentProcess Sticky.io payment
POST/api/providers/konnektive/process-paymentProcess Konnektive payment
POST/api/providers/ultracart/create-cartCreate UltraCart cart
POST/api/providers/ultracart/process-paymentProcess UltraCart payment
POST/api/providers/epd/process-paymentProcess EPD payment
POST/api/providers/shopify/create-checkoutCreate Shopify checkout

User Authentication

MethodEndpointDescription
POST/api/auth/registerRegister new user
POST/api/auth/magic-linkRequest magic link
GET/api/auth/magic-link/verifyVerify magic link
GET/api/auth/googleInitiate Google OAuth
GET/api/auth/facebookInitiate Facebook OAuth
GET/api/auth/2fa/setupGet 2FA setup info
POST/api/auth/2fa/confirmEnable 2FA
POST/api/auth/2fa/verifyVerify 2FA code

Admin Authentication

MethodEndpointDescription
POST/api/admin/authLogin
GET/api/admin/authCheck auth status
DELETE/api/admin/authLogout
POST/api/admin/auth/switch-orgSwitch organization
POST/api/admin/auth/switch-brandSwitch brand

User & Organization Management

MethodEndpointDescription
GET/api/admin/usersList users
POST/api/admin/usersCreate/invite user
GET/api/admin/organizationsList organizations
POST/api/admin/organizationsCreate organization
GET/api/admin/brandsList brands
POST/api/admin/brandsCreate brand

Settings & Configuration

MethodEndpointDescription
GET/api/admin/settingsGet all settings
POST/api/admin/settingsUpdate provider settings
GET/api/admin/webhooksList webhook endpoints
POST/api/admin/webhooksCreate webhook endpoint
GET/api/admin/domainsList custom domains
POST/api/admin/domainsAdd custom domain

Marketing Integrations

MethodEndpointDescription
GET/api/admin/klaviyo/listsGet Klaviyo lists
PUT/api/admin/klaviyo/listsUpdate Klaviyo list names
GET/api/admin/maropost/listsGet Maropost lists
PUT/api/admin/maropost/listsUpdate Maropost list names
GET/api/admin/attentive/listsGet Attentive segments
PUT/api/admin/attentive/listsUpdate Attentive segment names

Salesperson Portal

MethodEndpointDescription
POST/api/salesperson/authSalesperson login
GET/api/salesperson/authGet current salesperson
DELETE/api/salesperson/authSalesperson logout

Incoming Webhooks

MethodEndpointDescription
POST/api/webhooks/stripeStripe event handler
POST/api/webhooks/stickySticky.io event handler
POST/api/webhooks/shopifyShopify event handler
POST/api/webhooks/konnektiveKonnektive event handler
POST/api/webhooks/nmiNMI event handler
POST/api/webhooks/ultracartUltraCart event handler

Response Format

Success Response

{
  "success": true,
  "data": {
    // Response data
  }
}

Error Response

{
  "error": "Error message",
  "details": "Additional context",
  "status": 400
}

Pagination

{
  "data": [...],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 127,
    "totalPages": 3
  }
}

Rate Limiting

API requests are rate limited to:

  • 100 requests per minute for authenticated requests
  • 20 requests per minute for unauthenticated requests

Rate limit headers are included in all responses:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640000000

Postman Collection

Download our complete Postman collection for easy API testing:

Download Postman Collection

The collection includes:

  • All endpoints with example requests
  • Environment variables for easy configuration
  • Example responses for each endpoint
  • Automatic response tests

Demo Mode

Payment providers run in demo mode when credentials are not configured. Demo mode returns mock responses that simulate successful transactions, making it easy to test your integration without real payment credentials.

Common Query Parameters

ParameterUsageType
pagePagination (1-based)number
limit / pageSizeItems per pagenumber
searchFull-text searchstring
startDate / endDateDate range (Unix timestamp ms)number

SDK Support

Official SDKs are coming soon for:

  • JavaScript/TypeScript
  • Python
  • PHP
  • Ruby

In the meantime, you can use any HTTP client to interact with the API.

On this page