Subscriptions
The Trust product lets you retrieve subscriptions of end users. Subscriptions are associated with a connection, and a connector (a provider).
API endpoints
Authentication: endpoints listed in this page require header authentication with a user token.
List subscriptions
GET
https://{domain}.biapi.pro/2.0/users/{userId}/subscriptions
Path Parameters
Name | Type | Description |
---|---|---|
userId* | Integer or "me" | ID of the related user. |
Query Parameters
Name | Type | Description |
---|---|---|
all | Value-less | Flag to access disabled subscriptions. |
Response body: SubscriptionsList object
Get a subscription
GET
https://{domain}.biapi.pro/2.0/users/{userId}/subscriptions/{subscriptionId}
Get a single subscription by ID.
Path Parameters
Name | Type | Description |
---|---|---|
subscriptionId* | Integer | ID of the subscription. |
userId* | Integer or "me" | ID of the related user. |
Response body: Subscription object
Subscription resources partially support an update operation to handle activation/deactivation:
Update a subscription
POST
https://{domain}.biapi.pro/2.0/users/{userId}/subscriptions/{subscriptionId}
Update a single subscription by ID.
Request body: SubscriptionUpdateRequest object
Path Parameters
Name | Type | Description |
---|---|---|
subscriptionId* | Integer | ID of the subscription. |
userId* | Integer | ID of the related user. |
Query Parameters
Name | Type | Description |
---|---|---|
all | Value-less | Add this flag to access a disabled subscription. |
Response body: Subscription object
Life cycle
Subscriptions can be in a disabled or enabled state.
For legal compliance, subscriptions are disabled by default. Also, disabling subscription will result in the deletion of subscription child resources (documents).
Querying
Disabled subscriptions will only appear when passing the all
parameter:
Enabling
To enable one such subscription, it is necessary to perform a POST
request on that subscription, with the all
parameter and { "disabled": false }
.
Please note that this action represents the PSU's consent.
Webhooks
Subscription synced
A SUBSCRIPTION_SYNCED
webhook is emitted during a sync after a subscription was processed, including new documents.
Webhook request: Subscription object with the following additional properties:
Property | Type | Description |
---|---|---|
| Array of Document objects | The new documents that were found. |
Subscription found
A SUBSCRIPTION_FOUND
webhook is emitted after a new subscription was discovered.
Webhook request:
Property | Type | Description |
---|---|---|
| Integer | ID of the bank account. |
| Integer | ID of the related user. |
| Integer | ID of the related connection. |
Data model
SubscriptionsList object
Property | Type | Description |
---|---|---|
| Array of Subscription objects | List of subscriptions. |
Subscription object
Property | Type | Description |
---|---|---|
| Integer | ID of the subscription. |
| Integer or null | ID of the related connection. |
| Integer or null | ID of the related user. |
| Integer or null | ID of the related connection source. |
| String or null | Subscription number. |
| String | Label of the subscription. |
| String or null | Name of the subscriber. |
| Date or null | The subscription is valid until this date, if any. |
| Date or null | Next renew date, is any. |
| DateTime or null | Last successful update of the subscription. |
| DateTime or null | If set, this subscription is not found on the website anymore. |
| DateTime or null | If set, this subscription has been disabled by user and will not be synchronized anymore. |
| String or null | If the last update has failed, the error code. |
Available expands
The following parameters can be used for response properties expansion:
Property | Type | Description |
---|---|---|
| Connection object | The connection associated with this subscription. |
SubscriptionUpdateRequest object
Property | Type | Required | Description |
---|---|---|---|
| Boolean | No | Whether the subscription must be disabled or enabled. |
Last updated