For the complete documentation index, see llms.txt. This page is also available as Markdown.

Создание подписки

Метод позволяет подключить подписку

Создание подписки

post
Header parameters
x-api-public-keystringOptional

Публичный API-ключ

x-api-signaturestringOptional

Подпись тела запроса приватным API-ключем

Content-typestringOptional

Тип тела запроса

Example: application/json
Body

Тело запроса создания подписки

merchantIdstringRequired

Идентификатор мерчанта в системе

Example: 386fc09d-b4b8-4081-ae99-bf9710e80239
billingLinkIdstringRequired

Идентификатор платежной связки (с привязанного адреса будут списываться монеты)

Example: 1db0ec64-8a2e-4bec-810a-be4bde21c412
titlestringRequired

Имя подписки

Example: Premium
descriptionstringOptional

Описание подписки

Example: Premium subscription. With premium subscription u can use premium functions
spendIntervalintegerRequired

Период списаний в минутах. Для удобства можно указывать: -1 - ежедневное списание; -2 - еженедельное списание; -3 - ежемесячное списание;

Example: -1
currencystringRequired

Валюта списания. Можно указать фиатную валюту или любую другую, сумма будет автоматически пересчтана в валюту платежной связки

Example: USD
amountstringRequired

Сумма списания в указанной валюте

Example: 7.99
webhookUrlstringOptional

URL для уведомления о списаниях по подписке

Example: https://merchant.domain/webhooks/subscription
Responses
200Success
application/json

Успешный ответ

successbooleanRequired

Признак успешности запроса

post/api-gateway/recurrents/create-subscription
POST /api-gateway/recurrents/create-subscription HTTP/1.1
Host: ocp.onchainpay.io
Content-Type: application/json
Accept: */*
Content-Length: 333

{
  "merchantId": "386fc09d-b4b8-4081-ae99-bf9710e80239",
  "billingLinkId": "1db0ec64-8a2e-4bec-810a-be4bde21c412",
  "title": "Premium",
  "description": "Premium subscription. With premium subscription u can use premium functions",
  "spendInterval": "-1",
  "currency": "USD",
  "amount": "7.99",
  "webhookUrl": "https://merchant.domain/webhooks/subscription"
}
200Success
{
  "success": true,
  "response": {
    "id": "d75a2ecd-ed6b-480a-a337-5836ad64acf7",
    "merchantId": "386fc09d-b4b8-4081-ae99-bf9710e80239",
    "billingLinkId": "1db0ec64-8a2e-4bec-810a-be4bde21c412",
    "title": "Premium",
    "description": "Premium subscription. With premium subscription u can use premium functions",
    "spendInterval": "-1",
    "status": "PENDING",
    "message": null,
    "currency": "USD",
    "amount": "7.99",
    "webhookUrl": "https://merchant.domain/webhooks/subscription",
    "createdAt": "2026-01-29T11:14:13.711Z",
    "updatedAt": "2026-01-29T11:14:13.711Z"
  }
}

Last updated