> 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/subscription-list.md).

# Getting a List of Active Subscriptions

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

method    = listSubscriptions
projectId = 123456789
secretKey = key
```

#### Path Parameters

<table><thead><tr><th width="171.22222900390625">Name</th><th width="132.4444580078125">Type</th><th>Description</th></tr></thead><tbody><tr><td>projectId</td><td>integer</td><td>Your project 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>

#### Successful response

```
"result": [
        {
            "subscriptionId": 5961196,
            "description": "test_unitpay",
            "status": "active",
            "startDate": "2025-03-19 15:23:35",
            "successPayments": 1,
            "failPayments": 0,
            "lastPaymentId": null,
            "lastUpdateDate": null,
            "parentPaymentId": "2181234567",
            "totalSum": "50.00"
        },
        {
            "subscriptionId": 5961466,
            "description": "test_unitpay",
            "status": "active",
            "startDate": "2025-03-20 15:13:38",
            "successPayments": 2,
            "failPayments": 0,
            "lastPaymentId": null,
            "lastUpdateDate": null,
            "parentPaymentId": "2187654321",
            "totalSum": "100.00"
        }
```

<table data-header-hidden><thead><tr><th width="192.66664632161456">name</th><th width="114.7777099609375">type</th><th>decription</th></tr></thead><tbody><tr><td><strong>subscriptionId</strong></td><td>number</td><td>Subscription ID in the Unitpay system</td></tr><tr><td><strong>description</strong></td><td>string</td><td>Subscription text description</td></tr><tr><td><strong>status</strong> </td><td>string</td><td><p>Subscription status: </p><p></p><ul><li><code>new</code> - subscription created, no attempts to debit the subscription have been made yet; </li><li><code>active</code> - subscription active; </li><li><code>close</code> - subscription closed.</li></ul></td></tr><tr><td><strong>startDate</strong> </td><td>string</td><td>Subscription creation date in YYYY-mm-dd HH:ii:ss format (e.g., 2024-10-01 12:32:00)</td></tr><tr><td><strong>successPayments</strong></td><td>number</td><td>Number of successful subscription payments</td></tr><tr><td><strong>failPayments</strong></td><td>number</td><td>Number of unsuccessful subscription debit attempts</td></tr><tr><td><strong>lastPaymentId</strong></td><td>number</td><td>ID of the last subscription payment</td></tr><tr><td><strong>lastUpdateDate</strong></td><td>string</td><td>Last subscription payment date in dd.mm.yyyy hh:ii:ss format</td></tr><tr><td><strong>parentPaymentId</strong></td><td>number</td><td>The ID of the parent payment that initiated the subscription</td></tr><tr><td><strong>totalSum</strong></td><td>number</td><td>Total amount debited to the payer under subscription</td></tr><tr><td><strong>closeType</strong></td><td>string</td><td>Reason for closing the subscription (only transmitted if <code>status=close</code>):<br><code>api</code> — subscription closed by you via API;<br><code>error</code> — subscription closed due to reaching the error limit when attempting to debit funds;<br><code>abuse</code> — subscription closed due to a subscriber complaint.</td></tr></tbody></table>

#### Incorrect response

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

<table data-header-hidden><thead><tr><th width="197.888916015625">name</th><th width="108.22212727864581">type</th><th>description</th></tr></thead><tbody><tr><td><strong>message</strong></td><td>string</td><td>Information with error description</td></tr></tbody></table>

To get a list of all subscriptions, add the parameter

<table><thead><tr><th width="197.888916015625">name</th><th width="108.22212727864581">type</th><th>description</th></tr></thead><tbody><tr><td>all</td><td>integer</td><td>1</td></tr></tbody></table>

The response will contain a list of subscriptions in all statuses: new, active, close.

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