Get terms and conditions status
Returns accepted: true when the account has an accepted, still unused terms and conditions acceptance for the given plan.
note
Acceptance is per plan and per subscription: each new subscription needs its own acceptance, made after the last one was used. Once a subscription is created, this endpoint returns false again.
GET
/v1/savings/terms-and-conditions/{account_number}/{plan_id}Request
Headers
| Field | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Access token in Bearer ACCESS_TOKEN format |
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
account_number | number | Yes | Account number to query. |
plan_id | number | Yes | ID of the savings plan the client is about to subscribe to. |
Not applicable: Query Parameters, Body.
Response
2XX Success
| Field | Type | Description |
|---|---|---|
accepted | boolean | true only if the latest acceptance for this account and plan is for the current terms version and has not been used by a subscription yet. |
Error Codes
| Status | Condition |
|---|---|
403 | The token does not have access to the specified account. |
Code Example
- cURL
- JavaScript
- Python
- Node.js
curl -X GET https://b2b.allaria.dev/v1/savings/terms-and-conditions/12345678/10 \
-H "Authorization: Bearer ACCESS_TOKEN"
const accountNumber = 12345678;
const planId = 10;
const response = await fetch(
`https://b2b.allaria.dev/v1/savings/terms-and-conditions/${accountNumber}/${planId}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer ACCESS_TOKEN'
}
}
);
const data = await response.json();
console.log(data);
import requests
account_number = 12345678
plan_id = 10
response = requests.get(
f'https://b2b.allaria.dev/v1/savings/terms-and-conditions/{account_number}/{plan_id}',
headers={
'Authorization': 'Bearer ACCESS_TOKEN'
}
)
data = response.json()
print(data)
const axios = require('axios');
const accountNumber = 12345678;
const planId = 10;
const response = await axios.get(
`https://b2b.allaria.dev/v1/savings/terms-and-conditions/${accountNumber}/${planId}`,
{
headers: {
Authorization: 'Bearer ACCESS_TOKEN'
}
}
);
console.log(response.data);
2XX Success
{
"accepted": true
}