Redemption of savings plan subscription
Transfers the amount in amount, in fund shares/units, from a savings plan subscription to the partner, to complete the transaction. A redemption occurs when the user decides to use their savings to purchase a good or service offered by the partner.
When the redemption is completed, Allaria sends a notification to the partner's registered URL — see Plan activity completed webhook.
A redemption can be made at any time, regardless of whether the savings target amount has been reached. The target is only a savings reference and does not condition the operation.
A redemption never incurs a penalty, whether it is made before or after reaching the target.
A USD deposit is invested in mutual funds. It can only be redeemed once its fund shares are assigned to the account: in the evening of the day the order is processed, from 9 p.m. (Argentina time).
Until then it counts in the subscription's valuation, but a request that needs it returns insufficient_settled_position. Retry once it is available.
| Deposit processed | Available to redeem |
|---|---|
| Before the funds' cut-off (4–4:30 p.m.) | That same night |
| After the cut-off | The night of the next business day |
ARS subscriptions are not affected.
- Partial: send
amount. That amount is transferred and the subscription stays active. - Total: send
finalize_plan: trueand noamount. Every fund share of the subscription is transferred to the partner and the subscription is closed. The webhook reports the amount transferred.
Perform the following request:
/v1/savings/business/account-investment-plans/{account_investment_plan_id}/claimRequest
Headers
| Field | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Access token in Bearer ACCESS_TOKEN format |
Content-Type | string | Yes | Must be application/json |
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
account_investment_plan_id | number | Yes | Subscription identifier. |
Not applicable: Query Parameters.
Body
The body must be sent in snake_case.
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Conditional | Amount to redeem. Must be greater than 0. Required unless finalize_plan is true. |
finalize_plan | boolean | No | true redeems everything and closes the subscription; amount must not be sent. |
Response
2XX Success
| Field | Type | Description |
|---|---|---|
message | string | Message confirming the result of the redemption. |
activity_id | number | Identifier of the activity created for this redemption. Store it against your own record: the Plan activity completed webhook reports the same value when the redemption settles, and it is the only field that tells one operation from another. |
Error Codes
Errors return the following body:
{
"code": "invalid_request",
"description": "Error description."
}
| Status | Code | Condition |
|---|---|---|
400 | invalid_request | The amount field is less than or equal to 0, or neither amount nor finalize_plan: true was sent. |
400 | finalize_plan_with_amount | finalize_plan: true was sent together with amount. To close the subscription, do not send amount: everything is moved. |
400 | invalid_request | The subscription is not in an active state. |
400 | insufficient_valuation | The amount field exceeds the current valuation of the subscription, or, on a total redemption, the subscription has nothing to redeem. |
400 | insufficient_settled_position | USD subscriptions only. Part of the amount corresponds to fund shares that have not been assigned to the account yet (see Availability of deposits above), or, on a total redemption, any deposit is still pending. Checked per fund of the plan. Retry once the pending deposits are available. |
403 | — | The token does not have the required role to operate this endpoint. |
Code Example
- cURL
- JavaScript
- Python
- Node.js
curl -X POST https://b2b.allaria.cloud/v1/savings/business/account-investment-plans/1/claim \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 50000.00
}'
const accountInvestmentPlanId = 1;
const response = await fetch(
`https://b2b.allaria.cloud/v1/savings/business/account-investment-plans/${accountInvestmentPlanId}/claim`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 50000.00
})
}
);
const data = await response.json();
console.log(data);
import requests
account_investment_plan_id = 1
response = requests.post(
f'https://b2b.allaria.cloud/v1/savings/business/account-investment-plans/{account_investment_plan_id}/claim',
headers={
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
json={
'amount': 50000.00
}
)
data = response.json()
print(data)
const axios = require('axios');
const accountInvestmentPlanId = 1;
const response = await axios.post(
`https://b2b.allaria.cloud/v1/savings/business/account-investment-plans/${accountInvestmentPlanId}/claim`,
{
amount: 50000.00
},
{
headers: {
Authorization: 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
}
}
);
console.log(response.data);
{
"message": "Claim created successfully",
"activity_id": 4821
}