Update Investor Risk Profile (PRI)
Updates the Investor Risk Profile (PRI) and the terms and conditions acceptance date for one or more accounts. Up to 1000 accounts can be updated in a single request.
PATCH
/v1/aperturas/cuentas/priRequest
Headers
| Field | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Access token in Bearer ACCESS_TOKEN format |
Content-Type | string | Yes | Must be application/json |
Not applicable: Path Parameters, Query Parameters.
Body
| Field | Type | Required | Description |
|---|---|---|---|
cuentas | array | Yes | List of accounts to update. Maximum 1000 items. |
cuentas[].comitente | integer | Yes | Account identifier (comitente number). |
cuentas[].pri | string | Yes | Investor Risk Profile. Accepted values: Bajo, Medio, Alto — without the Riesgo prefix that the account-opening endpoints use. |
cuentas[].terminos_condiciones | string | Yes | Date and time the account holder accepted the PRI terms and conditions. Format: YYYY-MM-DD HH:MM:SS. |
Response
2XX Success
Status: 200 OK
The response always returns 200. Check the error field to determine if any accounts failed to update. Accounts not found in the system are listed in error_details.
All accounts updated successfully:
Partial failure — some accounts not found:
{
"error": true,
"error_details": [
{
"comitente": 123456,
"errorMessage": "La cuenta no se encuentra en la base de datos.",
"error": "NOT_FOUND"
}
]
}
| Field | Type | Description |
|---|---|---|
error | boolean | true if one or more accounts could not be updated. |
error_details | array | object | List of errors per account, or an empty object {} when there are none. |
error_details[].comitente | integer | null | Comitente number of the account that failed. null on internal server error. |
error_details[].errorMessage | string | Human-readable error description. |
error_details[].error | string | Error code. Possible values: NOT_FOUND, SERVER_ERROR. |
Error Codes
| Status | Description |
|---|---|
400 | Bad Request — invalid or missing parameters |
401 | Unauthorized — invalid or missing access token |
403 | Forbidden — the token does not have permission to perform this operation |
422 | Unprocessable Entity — validation failed (e.g. invalid pri value or date format) |
500 | Internal Server Error |
Code Example
- cURL
- JavaScript
- Python
- Node.js
curl -X PATCH "https://b2b.allaria.cloud/v1/aperturas/cuentas/pri" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cuentas": [
{
"comitente": 123456,
"pri": "Bajo",
"terminos_condiciones": "2024-01-15 22:00:00"
}
]
}'
const response = await fetch('https://b2b.allaria.cloud/v1/aperturas/cuentas/pri', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cuentas: [
{
comitente: 123456,
pri: 'Bajo',
terminos_condiciones: '2024-01-15 22:00:00'
}
]
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.patch(
'https://b2b.allaria.cloud/v1/aperturas/cuentas/pri',
headers={
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
},
json={
'cuentas': [
{
'comitente': 123456,
'pri': 'Bajo',
'terminos_condiciones': '2024-01-15 22:00:00'
}
]
}
)
data = response.json()
print(data)
const axios = require('axios');
const response = await axios.patch('https://b2b.allaria.cloud/v1/aperturas/cuentas/pri', {
cuentas: [
{
comitente: 123456,
pri: 'Bajo',
terminos_condiciones: '2024-01-15 22:00:00'
}
]
}, {
headers: {
Authorization: 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json'
}
});
console.log(response.data);
2XX Success
{
"error": false,
"error_details": {}
}