Get subscription renewal history
GET
/user/{userId}/subscription/{subscriptionId}/history
const url = 'https://client-api.abi.ai/user/abi1234/subscription/8910zyx321cba/history';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://client-api.abi.ai/user/abi1234/subscription/8910zyx321cba/history \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”userId
required
string
The Abi identifier of the user account.
Example
abi1234subscriptionId
required
string
The Abi identifier of the subscription.
Example
8910zyx321cbaResponses
Section titled “Responses”Subscription renewal history returned. See the Subscription model for field definitions.
Media typeapplication/json
object
Example
{ "user": { "id": "abi1234", "uniqueId": "123abc789xyz", "userStatus": "activeUser", "firstName": "Jane", "lastName": "Doe", "email": "janedoe@gmail.com", "gender": "female", "phone": "+441234567890", "origin": "gb", "location": "es", "country": "it", "physicianCountry": "es", "language": "en", "dateOfBirth": "1994-10-07", "partnerName": "Abi", "associatedAccounts": 5 }, "subscriptionHistory": [ { "subscriptionId": "8910zyx321cba", "userId": "abi1234", "startSubscription": "2021-11-17T00:00:00.000Z", "endSubscription": "2022-05-31T00:00:00.000Z", "active": 0, "createdAt": "2021-11-17T00:00:00.000Z", "canceledAt": null, "shouldNotify": true, "productName": "Free trial", "renewFrom": null }, { "subscriptionId": "123abc789xyz", "userId": "abi1234", "startSubscription": "2022-05-31T00:00:00.000Z", "endSubscription": "2023-05-31T00:00:00.000Z", "active": 1, "createdAt": "2022-05-31T00:00:00.000Z", "canceledAt": null, "shouldNotify": false, "productName": "Free trial", "renewFrom": "8910zyx321cba" } ]}Request could not be completed.
Media typeapplication/json
object
code
Short machine-readable error code.
string
message
Human-readable explanation of the error.
string
Examplegenerated
{ "code": "example", "message": "example"}