Skip to main content
GET
/
api
/
v2
/
customers
/
check
curl -X GET "https://loveandpay.io/api/v2/customers/check?phone=%2B79991234567" \
  -H "x-api-key: pk_live_xxx" \
  -H "x-timestamp: 1706012345678" \
  -H "x-signature: a1b2c3d4e5f6..."
{
  "success": true,
  "exists": true,
  "kycVerified": true,
  "customer": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "fullName": "Иван Иванов",
    "kycStatus": "VERIFIED",
    "trustLevel": "LEVEL_2",
    "totalPayments": 5
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.loveandpay.io/llms.txt

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

Заголовки

x-api-key
string
required
Ваш API ключ
x-timestamp
string
required
Unix timestamp в миллисекундах
x-signature
string
required
HMAC-SHA256 подпись

Query параметры

phone
string
Телефон клиента в формате +7XXXXXXXXXX
email
string
Email клиента
Необходимо указать хотя бы один параметр: phone или email
{
  "success": true,
  "exists": true,
  "kycVerified": true,
  "customer": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "fullName": "Иван Иванов",
    "kycStatus": "VERIFIED",
    "trustLevel": "LEVEL_2",
    "totalPayments": 5
  }
}
curl -X GET "https://loveandpay.io/api/v2/customers/check?phone=%2B79991234567" \
  -H "x-api-key: pk_live_xxx" \
  -H "x-timestamp: 1706012345678" \
  -H "x-signature: a1b2c3d4e5f6..."

Примеры использования

Проверка перед созданием счёта

async function createInvoiceWithKycCheck(customerPhone, amount) {
  // 1. Проверяем клиента
  const checkResult = await checkCustomer(customerPhone);

  if (!checkResult.exists) {
    // Новый клиент — создаём счёт с KYC
    return createInvoice({
      amount,
      customerPhone,
      kycRequired: true
    });
  }

  if (!checkResult.kycVerified) {
    // Клиент есть, но не верифицирован
    return createInvoice({
      amount,
      customerPhone,
      kycRequired: true
    });
  }

  // Клиент верифицирован — счёт без KYC
  return createInvoice({
    amount,
    customerPhone,
    kycRequired: false
  });
}