Getting a List of Active Subscriptions

GET

https://unitpay.ru/api?
    method=listSubscriptions
    params[projectId]=123456789
    params[secretKey]=key

Path Parameters

Name
Type
Description

projectId

integer

Your project ID in the UnitPay system

secretKey

string

Secret key, available in the project settings

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"
        }

subscriptionId

number

Subscription ID in the Unitpay system

description

string

Subscription text description

status

string

Subscription status:

  • new - subscription created, no attempts to debit the subscription have been made yet;

  • active - subscription active;

  • close - subscription closed.

startDate

string

Subscription creation date in YYYY-mm-dd HH:ii:ss format (e.g., 2024-10-01 12:32:00)

successPayments

number

Number of successful subscription payments

failPayments

number

Number of unsuccessful subscription debit attempts

lastPaymentId

number

ID of the last subscription payment

lastUpdateDate

string

Last subscription payment date in dd.mm.yyyy hh:ii:ss format

parentPaymentId

number

The ID of the parent payment that initiated the subscription

totalSum

number

Total amount debited to the payer under subscription

closeType

string

Reason for closing the subscription (only transmitted if status=close): api — subscription closed by you via API; error — subscription closed due to reaching the error limit when attempting to debit funds; abuse — subscription closed due to a subscriber complaint.

Incorrect response

{
   "error": {
      "message": "description"
   }
}

message

string

Information with error description

Last updated

Was this helpful?