SyncPay API Documentation

Welcome to the SyncPay API documentation. This guide will help you integrate payments into your application.


Base URL

All API requests should be made to:

https://api.usesyncpay.com

Quick Start

1. Get Your API Key

Follow this guide to obtain your API key from the dashboard.

2. Make Your First Request

curl https://api.usesyncpay.com/api/v1/accounts/balances \
  -H "Authorization: Bearer sk_test_abc123xyz..."

3. Create a Checkout

curl -X POST https://api.usesyncpay.com/api/v1/payments/checkouts \
  -H "Authorization: Bearer sk_test_abc123xyz..." \
  -H "Content-Type: application/json" \
  -d '{
    "pricing": {
      "base_currency": "USD",
      "amount": "50.00"
    },
    "customer_email": "customer@example.com"
  }'

Documentation Structure

Authentication


Payments

Accept payments from customers:


Accounts

Manage your balances:


Payouts

Withdraw funds to external accounts:


Organizations

Manage your organization settings:


Webhooks

Receive real-time notifications:


Common Integration Patterns

Standard Checkout Flow

  1. Create Checkout with amount and customer email
  2. Redirect customer to checkout URL
  3. Customer completes payment
  4. Receive webhook notification
  5. Fulfill order

Recommended for: Most integrations, e-commerce, SaaS, digital products


Custom Checkout Flow (Whitelabel)

  1. List Payment Methods to show options
  2. Create Quote to get pricing
  3. Collect payment details in your UI
  4. Create Whitelabel Checkout
  5. Display payment instructions
  6. Monitor via webhooks

Recommended for: Mobile apps, embedded payments, custom UI requirements


Payout Flow

  1. Check Balances
  2. Create Payout Destination (one-time)
  3. Create Withdrawal
  4. Monitor status via polling or webhooks

Recommended for: Marketplace payouts, affiliate payments, vendor payments


Test vs Live Mode

SyncPay provides two environments:

Environment API Key Prefix Purpose
Test sk_test_... Development & testing
Live sk_live_... Production
  • Test mode uses simulated payments
  • No real money moves in test mode
  • All features work the same in both modes
  • Data is completely isolated between modes

Learn more about environments


Rate Limits

  • Standard: 100 requests per minute per API key
  • Exceeded limit returns 429 Too Many Requests
  • Contact support for higher limits

Error Handling

All errors follow this format:

{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable message",
    "details": {
      // Additional context
    }
  }
}

Common error codes:

  • 400 - Bad Request (validation error)
  • 401 - Unauthorized (invalid API key)
  • 403 - Forbidden (no permission)
  • 404 - Not Found
  • 429 - Too Many Requests (rate limit)
  • 500 - Internal Server Error

Best Practices

1. Always Use HTTPS

Never send API keys over HTTP in production.

2. Use Webhooks

Webhooks are more reliable than polling for payment status updates.

3. Implement Idempotency

Use idempotency keys for critical operations like withdrawals.

4. Validate Webhook Signatures

Always verify webhooks came from SyncPay to prevent fraud.

5. Handle Errors Gracefully

Implement retry logic with exponential backoff for transient errors.

6. Store Settlement Amounts

Use settlement_amount, not amount, for revenue calculations.


Support

Need help?


Changelog

Check the dashboard or contact support for API updates and new features.


SDKs and Libraries

Official SDKs coming soon. For now, use standard HTTP clients:

  • Node.js: fetch, axios
  • Python: requests, httpx
  • PHP: curl, guzzle
  • Ruby: httparty, faraday

Next Steps

  1. Get your API key
  2. Create your first checkout
  3. Set up webhooks
  4. Start accepting payments