Skip to main content
This guide takes you from zero to a working checkout link. You’ll register an account, verify your email, obtain an access token, create an API key, and make your first checkout request.
All examples use the base URL https://api.syncgrampay.com. Replace this with your actual API base URL if different.
1

Create an account

Register by sending your name, email, password, and country.Before registering, you must first obtain a short-lived signup token:
curl -X POST https://api.syncgrampay.com/api/v1/auth/signup/init
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_at": "2024-01-15T10:03:00Z"
}
Then pass that token in your registration request:
curl -X POST https://api.syncgrampay.com/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "password": "yourpassword",
    "full_name": "Ada Lovelace",
    "country": "NG",
    "signup_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }'
Expected response:
{
  "success": true,
  "data": {
    "message": "Verification code sent to your email. Please verify to activate your account.",
    "user": {
      "id": "usr_01j...",
      "email": "you@example.com",
      "full_name": "Ada Lovelace"
    }
  }
}
2

Verify your email

Check your inbox for a 6-digit OTP and verify your email address. Verification activates your account and returns your first set of tokens.
curl -X POST https://api.syncgrampay.com/api/v1/auth/verify-email \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "otp": "847291"
  }'
Expected response:
{
  "success": true,
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refresh_token": "rt_01j...",
    "user": {
      "id": "usr_01j...",
      "email": "you@example.com",
      "full_name": "Ada Lovelace"
    }
  }
}
Store the access_token — you’ll need it to create an API key in the next step.
3

Get an access token (subsequent logins)

On future logins, authentication is a two-step process: submit your credentials to receive a 2FA challenge, then verify the challenge to get tokens.Step 3a — Initialize and submit credentials:
# Get a login token first
curl -X POST https://api.syncgrampay.com/api/v1/auth/login/init
# Submit credentials with the login token
curl -X POST https://api.syncgrampay.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "password": "yourpassword",
    "login_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }'
Expected response:
{
  "success": true,
  "data": {
    "challenge_id": "ch_01j...",
    "method": "email_otp",
    "expires_at": "2024-01-15T10:15:00Z",
    "backup_code_allowed": false
  }
}
Step 3b — Verify the 2FA challenge:
curl -X POST https://api.syncgrampay.com/api/v1/auth/login/2fa/verify \
  -H "Content-Type: application/json" \
  -d '{
    "challenge_id": "ch_01j...",
    "code": "847291",
    "code_type": "primary"
  }'
Expected response:
{
  "success": true,
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refresh_token": "rt_01j...",
    "user": {
      "id": "usr_01j...",
      "email": "you@example.com"
    }
  }
}
4

Create an API key

API keys are the recommended way to authenticate server-to-server requests. Use the access_token from the previous step to create one.
curl -X POST https://api.syncgrampay.com/api/v1/auth/api-keys \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -d '{
    "key_name": "Production Server",
    "env": "live"
  }'
Expected response:
{
  "success": true,
  "data": {
    "api_key_id": "ak_01j...",
    "key": "sk_live_01j...",
    "key_name": "Production Server",
    "created_at": "2024-01-15T10:00:00Z",
    "expires_at": null
  }
}
The key value is shown only once. Copy it and store it securely (for example, in an environment variable or secrets manager). You cannot retrieve it again.
Your API key starts with sk_ — use it as a Bearer token for all subsequent API requests.
5

Create your first checkout

With your API key, you can now create a checkout and get a hosted payment URL to share with your customer.
curl -X POST https://api.syncgrampay.com/api/v1/payments/checkouts \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk_live_01j..." \
  -d '{
    "pricing": {
      "base_currency": "USD",
      "amount": "50.00"
    },
    "customer_email": "customer@example.com",
    "customer_first_name": "Jane",
    "customer_last_name": "Doe",
    "success_url": "https://yourapp.com/success",
    "cancel_url": "https://yourapp.com/cancel",
    "metadata": {
      "order_id": "1234"
    }
  }'
Expected response:
{
  "success": true,
  "data": {
    "checkout_id": "co_01j...",
    "organization_id": "org_01j...",
    "checkout_url": "https://pay.syncgrampay.com/c/eyJhbGciOiJIUzI1NiJ9...",
    "status": "OPEN",
    "expires_at": "2024-01-15T11:00:00Z",
    "created_at": "2024-01-15T10:00:00Z"
  }
}
Redirect your customer to checkout_url. When they complete payment, Syncgram Pay sends a webhook event to your configured endpoint.

What’s next

Authentication

Learn about API keys, JWT tokens, and security best practices

Payments overview

Explore payment channels, charge retrieval, and refunds

Webhooks

Set up real-time event notifications for your integration

Payouts

Send funds to recipients via bank transfer, mobile money, or crypto