Create a subscription
The method allows you to connect a subscription
Header parameters
x-api-public-keystringOptional
Public API-key
x-api-signaturestringOptional
Signing the request body with a private API-key
Content-typestringOptionalExample:
Request content type
application/jsonBody
Subscription request body
merchantIdstringRequiredExample:
Merchant ID in the system
386fc09d-b4b8-4081-ae99-bf9710e80239billingLinkIdstringRequiredExample:
Payment link identifier (coins will be debited from the linked address)
1db0ec64-8a2e-4bec-810a-be4bde21c412titlestringRequiredExample:
Subscription name
PremiumdescriptionstringOptionalExample:
Subscription Description
Premium subscription. With premium subscription u can use premium functionsspendIntervalintegerRequiredExample:
Write-off period in minutes. For convenience, you can specify: -1 - daily write-off; -2 - weekly write-off; -3 - monthly write-off;
-1currencystringRequiredExample:
Payment currency. You can specify a fiat currency or any other, the amount will be automatically converted to the currency of the payment link
USDamountstringRequiredExample:
Payment amount in the specified currency
7.99webhookUrlstringOptionalExample:
Subscription charge notification URL
https://merchant.domain/webhooks/subscriptionResponses
200Success
application/json
Successful response
successbooleanRequired
Request success indicator
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