Sākumlapa/Api: Atšķirības starp versijām
| 109. rindiņa: | 109. rindiņa: | ||
== Authenticate == | == Authenticate == | ||
== Document == | == Document == | ||
=== 1. Dokumenta izveide (Document Store v2) === | |||
Izveido jaunu dokumentu (piemēram, pavadzīmi) ar grāmatojumiem. | |||
'''Curl:''' | |||
<pre> | |||
curl -X 'POST' \ | |||
'http://localhost:8080/ramusAccountant/service/api/v2/document/store' \ | |||
-H 'accept: application/json' \ | |||
-H 'documents: { | |||
"sessionId": "B521BFE77F1827EACE330AF1F1E26E36", | |||
"documents": [ | |||
{ | |||
"from": { "registrationNr": "99999999999" }, | |||
"to": { "registrationNr": "40002315621" }, | |||
"bookings": [ | |||
{ | |||
"bookingType": "STANDARD", | |||
"amount": 100, | |||
"note": "KOMENTARS tests", | |||
"startDate": "01-05-2024", | |||
"endDate": "30-05-2024", | |||
"valueAddedTax": { "percent": 21, "code": "42" }, | |||
"debitAccountNr": "2310", | |||
"creditAccountNr": "6110" | |||
}, | |||
{ | |||
"bookingType": "TAX", | |||
"amount": 21, | |||
"tax": { "percent": 21, "code": "42" }, | |||
"automatic": false, | |||
"debitAccountNr": "2310", | |||
"creditAccountNr": "57211" | |||
} | |||
], | |||
"nr": "234BBBG", | |||
"date": "01-05-2024", | |||
"documentType": "OUTGOING_DELIVERY_NOTE", | |||
"refresh": false, | |||
"external": false, | |||
"confirm": false | |||
} | |||
] | |||
}' \ | |||
-H 'Authorization: Ramus 8e2fe39d-f2f7-497c-a7b8-1acf6a451e40' \ | |||
-d '' | |||
</pre> | |||
'''Response body:''' | |||
<pre> | |||
{ | |||
"docs": [ | |||
{ | |||
"docNr": "234BBBG", | |||
"docId": 716645665283, | |||
"success": true | |||
} | |||
], | |||
"success": true | |||
} | |||
</pre> | |||
== Dokumentu tipi == | == Dokumentu tipi == | ||
Versija, kas saglabāta 2026. gada 11. marts, plkst. 10.20
Session
Šajā sadaļā ir aprakstīti soļi sesijas uzsākšanai un konfigurēšanai Ramus Accountant API.
1. Lietotāja autorizācija (Login)
Pieprasījums, lai iegūtu sesijas ID un API atslēgu.
Curl:
curl -X 'POST' \
'https://demo.ramusnet.eu/ramusAccountant/service/api/session/login/user' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{ "usernameOrEmail": "vards.uzvards@pasts.lv", "password": "?????????" }'
Request URL:
https://demo.ramusnet.eu/ramusAccountant/service/api/session/login/user
Response body:
{
"error": false,
"message": "Logged In",
"sessionId": "D821FE10B0C80B72D8A471E6C19BD18B",
"apiKey": "Ramus eyJhbGciOiJIUzM4NCJ9..."
}
---
2. Darba vides (Workspace) atrašana
Curl:
curl -X 'GET' \
'https://demo.ramusnet.eu/ramusAccountant/service/api/session/find' \
-H 'accept: application/json' \
-H 'query: { "sessionId": "D821FE10B0C80B72D8A471E6C19BD18B", "workspaceName": "PARAUGS" }' \
-H 'Authorization: Ramus eyJhbGciOiJIUzM4NCJ9...'
Response body:
{
"workspaces": [
{
"serverDataSourceId": 1001,
"name": "demo.ramusnet.lv",
"data": {
"total": 1,
"rows": [
{
"userId": 144332002024,
"workspace": "PARAUGS",
"workspaceId": 150734769495
}
]
}
}
]
}
---
3. Finanšu periodu atrašana
Curl:
curl -X 'GET' \
'https://demo.ramusnet.eu/ramusAccountant/service/api/session/find/periods' \
-H 'accept: application/json' \
-H 'query: { "sessionId": "D821FE10B0C80B72D8A471E6C19BD18B", "serverDataSourceId": "1001" }'
---
4. Sesijas saglabāšana (Store)
Curl:
curl -X 'POST' \
'https://demo.ramusnet.eu/ramusAccountant/service/api/session/store' \
-H 'accept: application/json' \
-H 'query: {
"sessionId": "D821FE10B0C80B72D8A471E6C19BD18B",
"serverDataSourceId": "1001",
"workspaceId": "150734769495",
"financialPeriodId": "641738108062"
}' \
-d ''
Response body:
{
"success": true,
"subject": {
"userId": "144332002024",
"workspaceId": "150734769495",
"financialPeriodId": "641738108062",
"sesionId": "D821FE10B0C80B72D8A471E6C19BD18B"
}
}
Stock
Tax
Authenticate
Document
1. Dokumenta izveide (Document Store v2)
Izveido jaunu dokumentu (piemēram, pavadzīmi) ar grāmatojumiem.
Curl:
curl -X 'POST' \
'http://localhost:8080/ramusAccountant/service/api/v2/document/store' \
-H 'accept: application/json' \
-H 'documents: {
"sessionId": "B521BFE77F1827EACE330AF1F1E26E36",
"documents": [
{
"from": { "registrationNr": "99999999999" },
"to": { "registrationNr": "40002315621" },
"bookings": [
{
"bookingType": "STANDARD",
"amount": 100,
"note": "KOMENTARS tests",
"startDate": "01-05-2024",
"endDate": "30-05-2024",
"valueAddedTax": { "percent": 21, "code": "42" },
"debitAccountNr": "2310",
"creditAccountNr": "6110"
},
{
"bookingType": "TAX",
"amount": 21,
"tax": { "percent": 21, "code": "42" },
"automatic": false,
"debitAccountNr": "2310",
"creditAccountNr": "57211"
}
],
"nr": "234BBBG",
"date": "01-05-2024",
"documentType": "OUTGOING_DELIVERY_NOTE",
"refresh": false,
"external": false,
"confirm": false
}
]
}' \
-H 'Authorization: Ramus 8e2fe39d-f2f7-497c-a7b8-1acf6a451e40' \
-d ''
Response body:
{
"docs": [
{
"docNr": "234BBBG",
"docId": 716645665283,
"success": true
}
],
"success": true
}
Dokumentu tipi
Šis pieprasījums atgriež informāciju par dokumentu veidiem (piemēram, rēķiniem vai pavadzīmēm) un tiem piesaistītajām atskaišu formām.
Curl:
curl -X 'GET' \
'https://demo.ramusnet.eu/ramusAccountant/service/api/document/type' \
-H 'accept: application/json' \
-H 'query: {
"sessionId": "D821FE10B0C80B72D8A471E6C19BD18B",
"query": {
"documentTypes": ["OUTGOING_INVOICE", "OUTGOING_DELIVERY_NOTE"]
},
"start": 0,
"length": 20
}' \
-H 'Authorization: Ramus eyJhbGciOiJIUzM4NCJ9...'
Response body (saīsināts):
{
"total": 2,
"rows": [
{
"code": "OUTGOING_INVOICE",
"shortCode": "REK/IZE",
"name": "Izrakstītais rēķins",
"report": [
{
"reportViewId": 178367942516,
"label": "01.Rekins (LAT) (PARAUGS)",
"language": "lv"
}
]
}
]
}
---
Dokumentu meklēšana
Pieprasījums, lai atrastu konkrētus dokumentus (piemēram, pēc numura) un iegūtu detalizētu informāciju par grāmatojumiem un saistītajiem maksājumiem.
Curl:
curl -X 'GET' \
'https://demo.ramusnet.eu/ramusAccountant/service/api/document/find' \
-H 'accept: application/json' \
-H 'query: {
"sessionId": "D821FE10B0C80B72D8A471E6C19BD18B",
"query": {
"nrs": "1",
"documentTypes": ["OUTGOING_INVOICE", "OUTGOING_DELIVERY_NOTE"]
},
"start": 0,
"length": 20
}' \
-H 'Authorization: Ramus eyJhbGciOiJIUzM4NCJ9...'
Response body (detalizēts):
{
"hasDocuments": true,
"total": 1,
"rows": [
{
"id": 641738183089,
"date": "03.05.2022",
"nr": " 1",
"documentType": "OUTGOING_INVOICE",
"partner": "Apgāds Zvaigzne ABC SIA",
"amount": "24.20",
"currencyCode": "EUR",
"bookings": [
{
"id": 641738183145,
"bookingType": "STANDARD",
"note": "Test",
"amountAndTax": "24.20"
},
{
"id": 641738183193,
"bookingType": "TAX",
"label": "Pievienotās vērtības nodoklis [LV] (21.00%)"
}
],
"links": [
{
"label": "Apmaksas dokumenti",
"link": [
{
"documentType": "MAK/IEN",
"amount": "24.20",
"date": "03.05.2022"
}
]
}
]
}
]
}
Sesijas un dokumentu pārvaldība
Comment
Imports
Link
Person
3. Personu meklēšana
Šis pieprasījums ļauj meklēt personas pēc nosaukuma.
Curl:
curl -X 'GET' \
'https://demo.ramusnet.eu/ramusAccountant/service/api/person/find' \
-H 'accept: application/json' \
-H 'query: {
"sessionId": "D821FE10B0C80B72D8A471E6C19BD18B",
"query": { "name": "%ABC%" },
"start": 0,
"length": 20
}' \
-H 'Authorization: Ramus eyJhbGciOiJIUzM4NCJ9...'
Response body:
{
"total": 1,
"rows": [
{
"id": 183982797927,
"code": "40003154167",
"name": "Apgāds Zvaigzne ABC",
"adress": "Krišjāņa Valdemāra iela 6, Rīga, LV-1010"
}
]
}