Approvals
The people of the account, and the approval or the refusal of a payment proposal.
On this page
List people
GET /banking/v1/people
Returns the people of the account who prepare or approve payments, with the authority each holds: accountant, director or none.
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
limit | query | integer | Nooptional | Records per page, from 1 to 500. Default 100 Range 1 – 500 |
cursor | query | string | Nooptional | The nextCursor of the previous page. |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | A page of people. | PersonPage |
401 | The token is missing, has expired or is not ours. | Error |
403 | The token does not give access to this company or operation. | Error |
429 | There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. | Error |
503 | Treasury cannot answer now. | Error |
Request
curl
curl "$RDC_BASE_URL/banking/v1/people?limit=20" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/banking/v1/people?limit=20`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/banking/v1/people?limit=20',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/banking/v1/people?limit=20');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/banking/v1/people?limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 200
{
"items": [
{
"id": "5e843f89-6c35-4a03-95a4-9f380ce14cd6",
"name": "Sorin Avram",
"role": "Purchasing",
"authority": null
},
{
"id": "6322f7eb-b43b-4189-afad-17c3c5cd4f73",
"name": "Ioana Marin",
"role": "Chief accountant",
"authority": "accountant"
},
{
"id": "f7508e58-7ea4-45a9-8d98-c77694cf1c40",
"name": "Ana Rusu",
"role": "Finance director",
"authority": "director"
}
],
"nextCursor": null
} Approve a payment
POST /banking/v1/payment-proposals/{paymentId}/approve
Approves a proposal that awaits approval. The approver holds the authority the amount requires (requiredAuthority) and did not prepare the proposal.
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
paymentId | path | string (uuid) | Yesrequired | The payment proposal. |
Request body
| Field | Type | Required | Meaning |
|---|---|---|---|
operationId | string (uuid) | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
expectedRevision | integer | Yesrequired | The revision of the payment proposal you read. |
personId | string (uuid) | Yesrequired | The person who makes the change, one of the people of the account. |
Responses
| Status | Meaning | Body |
|---|---|---|
202 | The change was accepted. The body is the operation result: aggregateId is the record that was created or changed. | OperationResult |
401 | The token is missing, has expired or is not ours. | Error |
403 | The token does not give access to this company or operation. | Error |
404 | The payment proposal does not exist. | Error |
409 | revision_conflict: The record changed since the revision you sent. Nothing was applied. operation_reused: The operationId was already used with a different request. | Error |
422 | not_an_approver: The person named in personId does not approve payments in this account. invalid_payment_status: The payment proposal is not in a status that allows this. self_approval: The person who prepared a payment proposal does not approve or decline it. insufficient_authority: The amount needs a higher approval than the approver holds. | Error |
429 | There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. | Error |
503 | Treasury cannot answer now. | Error |
Request
curl
curl -X POST "$RDC_BASE_URL/banking/v1/payment-proposals/21de0aa9-20d9-48af-87d7-c24c5a5dde5d/approve" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "3d3dd267-c436-4673-8c78-0c49cfbcbf5e",
"expectedRevision": 2,
"personId": "6322f7eb-b43b-4189-afad-17c3c5cd4f73"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/banking/v1/payment-proposals/21de0aa9-20d9-48af-87d7-c24c5a5dde5d/approve`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "3d3dd267-c436-4673-8c78-0c49cfbcbf5e",
"expectedRevision": 2,
"personId": "6322f7eb-b43b-4189-afad-17c3c5cd4f73"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/banking/v1/payment-proposals/21de0aa9-20d9-48af-87d7-c24c5a5dde5d/approve',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '3d3dd267-c436-4673-8c78-0c49cfbcbf5e',
'expectedRevision': 2,
'personId': '6322f7eb-b43b-4189-afad-17c3c5cd4f73',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "3d3dd267-c436-4673-8c78-0c49cfbcbf5e",
"expectedRevision": 2,
"personId": "6322f7eb-b43b-4189-afad-17c3c5cd4f73"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/banking/v1/payment-proposals/21de0aa9-20d9-48af-87d7-c24c5a5dde5d/approve');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/banking/v1/payment-proposals/21de0aa9-20d9-48af-87d7-c24c5a5dde5d/approve");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "3d3dd267-c436-4673-8c78-0c49cfbcbf5e",
"expectedRevision": 2,
"personId": "6322f7eb-b43b-4189-afad-17c3c5cd4f73"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 202
{
"operationId": "3d3dd267-c436-4673-8c78-0c49cfbcbf5e",
"status": "accepted",
"aggregateId": "21de0aa9-20d9-48af-87d7-c24c5a5dde5d",
"aggregateRevision": 3
} Decline a payment
POST /banking/v1/payment-proposals/{paymentId}/decline
Sends a proposal that awaits approval back to draft with the reason, which stays on the proposal.
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
paymentId | path | string (uuid) | Yesrequired | The payment proposal. |
Request body
| Field | Type | Required | Meaning |
|---|---|---|---|
operationId | string (uuid) | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
expectedRevision | integer | Yesrequired | The revision of the payment proposal you read. |
personId | string (uuid) | Yesrequired | The person who makes the change, one of the people of the account. |
reason | string | Yesrequired | Why the payment is declined. |
Responses
| Status | Meaning | Body |
|---|---|---|
202 | The change was accepted. The body is the operation result: aggregateId is the record that was created or changed. | OperationResult |
401 | The token is missing, has expired or is not ours. | Error |
403 | The token does not give access to this company or operation. | Error |
404 | The payment proposal does not exist. | Error |
409 | revision_conflict: The record changed since the revision you sent. Nothing was applied. operation_reused: The operationId was already used with a different request. | Error |
422 | not_an_approver: The person named in personId does not approve payments in this account. invalid_payment_status: The payment proposal is not in a status that allows this. self_approval: The person who prepared a payment proposal does not approve or decline it. reason_required: Declining a proposal needs a reason. | Error |
429 | There were too many requests. Nothing was processed. The header Retry-After gives the seconds to wait. | Error |
503 | Treasury cannot answer now. | Error |
Request
curl
curl -X POST "$RDC_BASE_URL/banking/v1/payment-proposals/08315cbe-013e-4a7d-8f68-81c554b8ef67/decline" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "d775457d-2215-4365-9fc4-5af1e0e50b1d",
"expectedRevision": 2,
"personId": "f7508e58-7ea4-45a9-8d98-c77694cf1c40",
"reason": "Ask for the credit note first"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/banking/v1/payment-proposals/08315cbe-013e-4a7d-8f68-81c554b8ef67/decline`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "d775457d-2215-4365-9fc4-5af1e0e50b1d",
"expectedRevision": 2,
"personId": "f7508e58-7ea4-45a9-8d98-c77694cf1c40",
"reason": "Ask for the credit note first"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/banking/v1/payment-proposals/08315cbe-013e-4a7d-8f68-81c554b8ef67/decline',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': 'd775457d-2215-4365-9fc4-5af1e0e50b1d',
'expectedRevision': 2,
'personId': 'f7508e58-7ea4-45a9-8d98-c77694cf1c40',
'reason': 'Ask for the credit note first',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "d775457d-2215-4365-9fc4-5af1e0e50b1d",
"expectedRevision": 2,
"personId": "f7508e58-7ea4-45a9-8d98-c77694cf1c40",
"reason": "Ask for the credit note first"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/banking/v1/payment-proposals/08315cbe-013e-4a7d-8f68-81c554b8ef67/decline');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/banking/v1/payment-proposals/08315cbe-013e-4a7d-8f68-81c554b8ef67/decline");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "d775457d-2215-4365-9fc4-5af1e0e50b1d",
"expectedRevision": 2,
"personId": "f7508e58-7ea4-45a9-8d98-c77694cf1c40",
"reason": "Ask for the credit note first"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 202
{
"operationId": "d775457d-2215-4365-9fc4-5af1e0e50b1d",
"status": "accepted",
"aggregateId": "08315cbe-013e-4a7d-8f68-81c554b8ef67",
"aggregateRevision": 3
}