> For the complete documentation index, see [llms.txt](https://help.unitpay.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.unitpay.ru/en/payments/recurring-payments/close-subscription.md).

# Closing a Subscription

&#x20;

```bash
GET https://unitpay.ru/api

method         = closeSubscription
subscriptionId = 123456789
secretKey      = key
```

#### Required parameters

<table><thead><tr><th width="169">Name</th><th width="113.4444580078125">Type</th><th>Description</th></tr></thead><tbody><tr><td>subscriptionId</td><td>integer</td><td>Subscription ID in the UnitPay system</td></tr><tr><td>secretKey</td><td>string</td><td>Secret key, available in the project settings</td></tr></tbody></table>

#### Examples of responses to a request

{% tabs %}
{% tab title="successful response" %}

```json
{
   "result": {
      "message": "Subscription successfully closed"
   }
}
```

{% endtab %}

{% tab title="error response" %}

```json
{
   "error": {
      "message": "Error description"
   }
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
The request can be executed in test mode. [Learn more](https://help.unitpay.ru/en/other/using-the-test-api)
{% endhint %}
