> 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-info.md).

# Getting Information About Subscription

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

method         = getSubscription
subscriptionId = 123456789
secretKey      = key
```

#### Path Parameters

<table><thead><tr><th width="192.33331298828125">Name</th><th width="119.22216796875">Type</th><th>Description</th></tr></thead><tbody><tr><td>subscriptionId</td><td>number</td><td>Subscription ID in the UnitPay system</td></tr><tr><td>secretKey</td><td>string</td><td>Secret key, available in 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="180.44447835286456">name</th><th width="111.888916015625">type</th><th>description</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>Subscription status:<br><code>new</code> - subscription created, no attempts to debit the subscription yet;<br><code>active</code> - subscription active;<br><code>close</code> - subscription closed.</td></tr><tr><td><strong>startDate</strong> </td><td>string</td><td>Subscription creation date in the format yyyy-mm-dd hh:ii:ss (e.g. 2023-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>Date of last subscription payment in yyyy-mm-dd hh:ii:ss format (e.g. 2022-10-01 12:32:00)</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 charged to the payer under the subscription</td></tr><tr><td><strong>closeType</strong></td><td>string</td><td>Reason for subscription closure (transmitted only in case of <code>status=close</code>):<br><code>api</code> - subscription closed by API partner<br><code>error</code> - subscription closed due to reaching the limit on the number of errors when attempting to debit<br><code>abuse</code> - subscription closed due to subscriber's complaint.</td></tr></tbody></table>

#### Incorrect response

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

<table data-header-hidden><thead><tr><th width="180.44447835286456">name</th><th width="115.5555419921875">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>

{% hint style="warning" %}
The request can be made in test mode. [Learn more.](/en/book-of-reference/test-api.md)
{% endhint %}
