Sign documents (bulk)
Bulk sign documents, grouped by account.
POST
/v1/broker/document/sign/bulkRequest
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
Root body is a JSON array
The request body is a JSON array of account groups. Each item groups one or more documents to sign under the same account_id.
Within each document item, description, privacy_policy, and version follow the same conditional rules as in Sign document: required/forbidden depending on document_type (AFFIDAVIT, MUTUAL_FUNDS, TERMS_AND_CONDITIONS).
| Field | Type | Required | Description |
|---|---|---|---|
account_id | string | Yes | Account identifier for this group of documents. |
documents | array | Yes | List of documents to sign for this account. Must not be empty. |
documents[].document_type | string | Yes | Type of document being signed. Allowed values: AFFIDAVIT, MUTUAL_FUNDS, TERMS_AND_CONDITIONS. |
documents[].description | string | Conditional | BUY/SELL for an affidavit, or the fund's bloomberg code for mutual funds. Must not be provided for TERMS_AND_CONDITIONS. |
documents[].privacy_policy | string | Conditional | Privacy policy version. Required only when document_type is TERMS_AND_CONDITIONS. |
documents[].version | string | Conditional | Terms and conditions version. Required only when document_type is TERMS_AND_CONDITIONS. |
Response
2XX Success
The response is a JSON array with one entry per document sent in the request, in the same order.
| Field | Type | Description |
|---|---|---|
account_id | string | Account identifier the document belongs to. |
document_type | string | Type of document that was signed. Possible values: AFFIDAVIT, MUTUAL_FUNDS, TERMS_AND_CONDITIONS. |
description | string | Description associated with the signed document (e.g. BUY/SELL or a bloomberg code). |
msg | string | Result message for this document. Indicates whether the signing was newly registered or already existed. |
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 access this resource |
500 | Internal Server Error |
Error structure:
{
"code": "invalid_request",
"description": "documents must not be empty"
}
Code Example
- cURL
- JavaScript
- Python
- Node.js
curl -X POST https://b2b.allaria.dev/v1/broker/document/sign/bulk \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '[
{
"account_id": "1234",
"documents": [
{ "document_type": "AFFIDAVIT", "description": "BUY" },
{ "document_type": "MUTUAL_FUNDS", "description": "ALDOAHOBMep" }
]
},
{
"account_id": "5678",
"documents": [
{ "document_type": "AFFIDAVIT", "description": "SELL" }
]
}
]'
const response = await fetch('https://b2b.allaria.dev/v1/broker/document/sign/bulk', {
method: 'POST',
headers: {
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify([
{
account_id: '1234',
documents: [
{ document_type: 'AFFIDAVIT', description: 'BUY' },
{ document_type: 'MUTUAL_FUNDS', description: 'ALDOAHOBMep' },
],
},
{
account_id: '5678',
documents: [
{ document_type: 'AFFIDAVIT', description: 'SELL' },
],
},
]),
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://b2b.allaria.dev/v1/broker/document/sign/bulk',
headers={
'Authorization': 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json',
},
json=[
{
'account_id': '1234',
'documents': [
{ 'document_type': 'AFFIDAVIT', 'description': 'BUY' },
{ 'document_type': 'MUTUAL_FUNDS', 'description': 'ALDOAHOBMep' },
],
},
{
'account_id': '5678',
'documents': [
{ 'document_type': 'AFFIDAVIT', 'description': 'SELL' },
],
},
]
)
data = response.json()
print(data)
const axios = require('axios');
const response = await axios.post(
'https://b2b.allaria.dev/v1/broker/document/sign/bulk',
[
{
account_id: '1234',
documents: [
{ document_type: 'AFFIDAVIT', description: 'BUY' },
{ document_type: 'MUTUAL_FUNDS', description: 'ALDOAHOBMep' },
],
},
{
account_id: '5678',
documents: [
{ document_type: 'AFFIDAVIT', description: 'SELL' },
],
},
],
{
headers: {
Authorization: 'Bearer ACCESS_TOKEN',
'Content-Type': 'application/json',
},
}
);
console.log(response.data);
2XX Success
[
{
"account_id": "1234",
"document_type": "AFFIDAVIT",
"description": "BUY",
"msg": "Document signing registered successfully"
},
{
"account_id": "1234",
"document_type": "MUTUAL_FUNDS",
"description": "ALDOAHOBMep",
"msg": "Document signing registered successfully"
},
{
"account_id": "5678",
"document_type": "AFFIDAVIT",
"description": "SELL",
"msg": "Document already signed"
}
]