Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.payments.sardine.ai/llms.txt

Use this file to discover all available pages before exploring further.

1. Get your credentials

Contact your Sardine integration contact to receive a clientId and clientSecret for the sandbox environment. All API calls use HTTP Basic Auth with these credentials.
Never expose your clientSecret in frontend code. All calls to api.sardine.ai must be made from your backend.

2. Create a customer

Register the user in the Sardine system using their phone number. Store the returned customerId against your own user record.
curl -X POST https://api.sandbox.sardine.ai/v1/identity/entities \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{ "phoneNumber": "+14155551234" }'
{
  "customerId": "3f8c1a22-1234-4abc-9def-000000000001",
  "createdAt": "2026-05-01T10:00:00Z"
}

3. Generate a widget URL and redirect the user

Request a widget URL from your backend, then redirect the user to it. The widget handles all verification steps.
curl -X POST https://api.sandbox.sardine.ai/v1/identity/consents/widget \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": "3f8c1a22-1234-4abc-9def-000000000001",
    "successUrl": "https://yourapp.com/kyc/success",
    "scope": ["profile", "doc_kyc"],
    "flow": "kyc_input"
  }'
{
  "widgetUrl": "https://identity.sardine.ai/?client_token=abc123&consent_id=xyz789&success_url=..."
}
Redirect the user to the widgetUrl. When they finish, Sardine redirects them back to your successUrl.

4. Retrieve the verified identity

Once the user returns to your successUrl, fetch their verified data from your backend.
curl https://api.sandbox.sardine.ai/v1/identity/entities/3f8c1a22-1234-4abc-9def-000000000001 \
  -u "$CLIENT_ID:$CLIENT_SECRET"
{
  "profile": {
    "userId": "3f8c1a22-1234-4abc-9def-000000000001",
    "fullName": "Jane Smith",
    "dateOfBirth": "1990-06-15",
    "emailAddress": "jane@example.com",
    "phoneNumber": "+14155551234",
    "address": {
      "street": "123 Main St",
      "city": "San Francisco",
      "region": "CA",
      "postalCode": "94105"
    }
  },
  "documentData": {
    "documentType": "DRIVERS_LICENSE",
    "documentNumber": "D1234567",
    "issuingCountry": "US"
  },
  "documentKyc": {
    "front": "<base64>",
    "back": "<base64>",
    "selfie": "<base64>"
  }
}

Once you’ve completed a successful end-to-end test in sandbox, reach out to your Sardine contact to complete the integration review and receive production credentials. For a full implementation reference see the API Integration guide.