Getting Information About Subscription
GET
https://unitpay.ru/api?
method=getSubscription
params[subscriptionId]=123456789
params[secretKey]=key
Path Parameters
subscriptionId
number
Subscription ID in the UnitPay system
secretKey
string
Secret key, available in project settings
Successful response
{
"result": {
"subscriptionId": 123456,
"description": "test_description",
"status": "active",
"startDate": "2024-09-01 09:00:00",
"successPayments": 4,
"failPayments": 0,
"lastPaymentId": 12345678911,
"lastDateUpdate": "2024-09-15 19:30:00",
"parentPaymentId": 12345678910,
"totalSum": 50
}
}
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 yet;
active
- subscription active;
close
- subscription closed.
startDate
string
Subscription creation date in the format yyyy-mm-dd hh:ii:ss (e.g. 2023-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
Date of last subscription payment in yyyy-mm-dd hh:ii:ss format (e.g. 2022-10-01 12:32:00)
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 subscription closure (transmitted only in case of status=close
):
api
- subscription closed by API partner
error
- subscription closed due to reaching the limit on the number of errors when attempting to debit
abuse
- subscription closed due to subscriber's complaint.
Incorrect response
{
"error": {
"message": "test_description
"
}
}
message
string
Information with error description
Запрос можно выполнить в тестовом режиме. Узнать подробнее.
Last updated
Was this helpful?