Отключение подписки

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

Отключение подписки

POSThttps://ocp.payonchain.org/api-gateway/recurrents/cancel-subscription
Header parameters
Body
id*string

Идентификатор подписки

merchantId*string

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

Response
Body
success*boolean

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

response*SubscriptionResponse (object)

Тело ответа подписки

Request
const response = await fetch('https://ocp.payonchain.org/api-gateway/recurrents/cancel-subscription', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "id": "be1179ff-36a5-4fee-8e5a-7e11a93bb99f",
      "merchantId": "672c1e2d-354f-49a1-8a5b-75af87e92f0a"
    }),
});
const data = await response.json();
Response
{
  "success": false,
  "response": {
    "id": "be1179ff-36a5-4fee-8e5a-7e11a93bb99f",
    "merchantId": "672c1e2d-354f-49a1-8a5b-75af87e92f0a",
    "billingLinkId": "2bfbdf44-fb5b-4e75-9962-f28c0594e483",
    "title": "Premium",
    "description": "Premium subscription. With premium subscription u can use premium functions",
    "spendInterval": "-1",
    "status": "PENDING",
    "currency": "USD",
    "amount": "7.99",
    "webhookUrl": "https://merchant.domain/webhooks/subscription",
    "createdAt": "2024-04-15T10:50:48.518Z",
    "updatedAt": "2024-04-15T10:50:48.518Z"
  }
}

Last updated