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/apiAuthentication 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.
Quick Links
| Documentation | Description |
|---|---|
| Authentication | JWT token creation and verification |
| User Authentication | Registration, OAuth, Magic Links, 2FA |
| Checkout API | Initialize and complete checkouts |
| Payment Providers | Stripe, NMI, Sticky.io, Konnektive, UltraCart, EPD |
| Upsell API | Post-purchase upsell flows |
| Admin API | User, organization, and brand management |
| Webhooks | Webhook configuration and events |
| Domains | Custom domain configuration |
| Salesperson | Salesperson authentication |
| Integrations | Klaviyo, Maropost, Attentive |
API Categories
Core Checkout
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/checkout/initialize | Initialize checkout with payment provider |
| POST | /api/checkout/complete | Complete checkout after payment |
| POST | /api/checkout/get-payment-token | Get token for upsell charges |
| POST | /api/token/generate | Generate checkout token (dev/testing) |
Upsell Flow
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/upsell/create-session | Create upsell session with offers |
| POST | /api/upsell/accept | Accept upsell and charge payment |
| POST | /api/upsell/decline | Decline current offer |
| GET | /api/upsell/session/[id] | Get session status |
Payment Providers
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/providers/stripe/create-intent | Create Stripe PaymentIntent |
| POST | /api/providers/stripe/confirm | Confirm Stripe payment |
| POST | /api/providers/nmi/process-payment | Process NMI payment |
| POST | /api/providers/nmi/process-upsell | Process NMI upsell |
| POST | /api/providers/sticky/create-order | Create Sticky.io order |
| POST | /api/providers/sticky/process-payment | Process Sticky.io payment |
| POST | /api/providers/konnektive/process-payment | Process Konnektive payment |
| POST | /api/providers/ultracart/create-cart | Create UltraCart cart |
| POST | /api/providers/ultracart/process-payment | Process UltraCart payment |
| POST | /api/providers/epd/process-payment | Process EPD payment |
| POST | /api/providers/shopify/create-checkout | Create Shopify checkout |
User Authentication
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register | Register new user |
| POST | /api/auth/magic-link | Request magic link |
| GET | /api/auth/magic-link/verify | Verify magic link |
| GET | /api/auth/google | Initiate Google OAuth |
| GET | /api/auth/facebook | Initiate Facebook OAuth |
| GET | /api/auth/2fa/setup | Get 2FA setup info |
| POST | /api/auth/2fa/confirm | Enable 2FA |
| POST | /api/auth/2fa/verify | Verify 2FA code |
Admin Authentication
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/admin/auth | Login |
| GET | /api/admin/auth | Check auth status |
| DELETE | /api/admin/auth | Logout |
| POST | /api/admin/auth/switch-org | Switch organization |
| POST | /api/admin/auth/switch-brand | Switch brand |
User & Organization Management
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/users | List users |
| POST | /api/admin/users | Create/invite user |
| GET | /api/admin/organizations | List organizations |
| POST | /api/admin/organizations | Create organization |
| GET | /api/admin/brands | List brands |
| POST | /api/admin/brands | Create brand |
Settings & Configuration
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/settings | Get all settings |
| POST | /api/admin/settings | Update provider settings |
| GET | /api/admin/webhooks | List webhook endpoints |
| POST | /api/admin/webhooks | Create webhook endpoint |
| GET | /api/admin/domains | List custom domains |
| POST | /api/admin/domains | Add custom domain |
Marketing Integrations
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/klaviyo/lists | Get Klaviyo lists |
| PUT | /api/admin/klaviyo/lists | Update Klaviyo list names |
| GET | /api/admin/maropost/lists | Get Maropost lists |
| PUT | /api/admin/maropost/lists | Update Maropost list names |
| GET | /api/admin/attentive/lists | Get Attentive segments |
| PUT | /api/admin/attentive/lists | Update Attentive segment names |
Salesperson Portal
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/salesperson/auth | Salesperson login |
| GET | /api/salesperson/auth | Get current salesperson |
| DELETE | /api/salesperson/auth | Salesperson logout |
Incoming Webhooks
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/webhooks/stripe | Stripe event handler |
| POST | /api/webhooks/sticky | Sticky.io event handler |
| POST | /api/webhooks/shopify | Shopify event handler |
| POST | /api/webhooks/konnektive | Konnektive event handler |
| POST | /api/webhooks/nmi | NMI event handler |
| POST | /api/webhooks/ultracart | UltraCart 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: 1640000000Postman 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
| Parameter | Usage | Type |
|---|---|---|
page | Pagination (1-based) | number |
limit / pageSize | Items per page | number |
search | Full-text search | string |
startDate / endDate | Date 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.