API - Pozostałe Przychody
Punkt dostępowy
Punkt dostępowy znajduje się pod adresem: https://app.firmino.pl/app/services/rest/api/income-documents/
Metody
- add – dodawanie nowego dokumentu
- get – pobieranie danych dokumentu (wymagany id)
- find – pobieranie listy dokumentów
- update – aktualizowanie danych dokumentu (wymagany id)
- delete – usuwanie dokumentu (wymagany id)
- init – inicjalizowanie pustego dokumentu (zwraca dostępny numer porządkowy i domyślne ustawienia)
- payoff – spłacanie dokumentu (wymagany id)
Pola
| Parametr | Opis | Uwagi | Typ danych |
|---|---|---|---|
| id | Identyfikator | brak | long |
| externalDocument | Nazwa dokumentu zewnętrznego | Wymagany przy dodawaniu dokumentu | string |
| documentDate | Data wystawienia dokumentu (domyślnie aktualna data) | brak | string(yyyy-mm-dd) |
| saleDate | Data sprzedaży (domyślnie aktualna data) | brak | string(yyyy-mm-dd) |
| salePlace | Miejsce sprzedaży (domyślnie miejsce prowadzenia firmy) | brak | string(60) |
| documentState | Status dokumentu Dostępne:
| Tylko do odczytu | string |
| priceType | Dokument liczony od Netto lub Brutto (domyślnie "net") Dostępne:
| brak | string |
| vatCountedManually | Informacja czy stawki vat mają być przeliczone przez system(domyślne, false), czy wprowadzone przez użytkownika(true) | brak | boolean |
| quotaVats | Stawki vat wraz z wartościami ceny netto, ceny vat oraz ceny brutto | Trzeba podać stawkę Vat oraz cenę netto lub brutto | object |
Pozostałe pola
- kontrahent (customer)
- waluta + kurs (currency)
- rozliczenie dokumentu (payment)
Filtry
Obiekt filtrów
{
"sortField": "fieldName",
"sortOrder": "desc",
"text": "searchText",
"filters": [
{
"name": "filterName",
"value": "filterValue"
}
]
}
Dostępne filtry
| Opis | Nazwa filtru | Dostępne wartości |
|---|---|---|
| Od daty | „fromDate” | wartości daty w formacie "RRRR-MM-DD" |
| Do daty | „toDate” | wartości daty w formacie "RRRR-MM-DD" |
| Po roku | „year” | dostępne wartości integer |
| Po miesiącu | „month” | dostępne wartości integer |
| Stan dokumentu | „documentState” | dostępne wartości: unpaid, partpaid, paid |
Przykładowe zapytania
https://app.firmino.pl/app/services/rest/api/income-documents/add
Przykład CURL:
curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/income-documents/add -d '{"externalDocument": "Nazwa dokumentu", "customer":{"id":4635600}}'
Żądanie (JSON):
{
"externalDocument": "Nazwa dokumentu",
"customer" : {
"id": 4635600
}
Odpowiedź (JSON):
{
"success": true,
"response": {
"id": 3380,
"externalDocument": "Nazwa dokumentu",
"documentDate": "2022-08-08",
"saleDate": "2022-08-08",
"salePlace": "Zielona Góra",
"priceType": "net",
"documentState": "paid",
"customer": {
"id": 4635600,
"fullName": "KONTRAHENT TESTOWY",
"shortName": "TEST KONTRAH",
"countryCode": "PL",
"locality": "Zielona Góra",
"tin": "1111111111",
"regon": null,
"street": "Testowa",
"houseNo": "2",
"flatNo": "1",
"postCode": "65-140",
"post": "Zielona Góra",
"phone": null,
"email": null,
"bankAccount": null,
"fax": null,
"website": null,
"note": null
},
"currency": {
"code": "PLN",
"rate": "1.000000",
"date": null,
"table": null
},
"payment": {
"method": "transfer",
"paymentDate": null,
"termDate": "2022-08-22",
"total": "0",
"paid": "0.00",
"ramain": "0.00"
},
"vatCountedManually": false,
"quotaVats": []
}
}
https://app.firmino.pl/app/services/rest/api/income-documents/add
Przykład CURL:
curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/income-documents/add -d '{"externalDocument": "Pozostały przychód2", "customer":{"id":4195100}, "quotaVats": [{"vatRate": "23", "valueNet": "100.00"}]}'
Żądanie (JSON):
{
"externalDocument": "Nazwa dokumentu",
"customer" : {
"id": 4635600
},
"quotaVats": [
{
"vatRate": "23",
"valueNet": "100.00"
}
]
}
Odpowiedź (JSON):
{
"success": true,
"response": {
"id": 3382,
"externalDocument": "Nazwa dokumentu",
"documentDate": "2022-08-08",
"saleDate": "2022-08-08",
"salePlace": "Zielona Góra",
"priceType": "net",
"documentState": "unpaid",
"customer": {
"id": 4635600,
"fullName": "KONTRAHENT TESTOWY",
"shortName": "TEST KONTRAH",
"countryCode": "PL",
"locality": "Zielona Góra",
"tin": "1111111111",
"regon": null,
"street": "Testowa",
"houseNo": "2",
"flatNo": "1",
"postCode": "65-140",
"post": "Zielona Góra",
"phone": null,
"email": null,
"bankAccount": null,
"fax": null,
"website": null,
"note": null
},
"currency": {
"code": "PLN",
"rate": "1.000000",
"date": null,
"table": null
},
"payment": {
"method": "transfer",
"paymentDate": null,
"termDate": "2022-08-22",
"total": "123.00",
"paid": "0.00",
"ramain": "123.00"
},
"vatCountedManually": false,
"quotaVats": [
{
"id": 3460,
"vatRate": "23",
"valueNet": "100.00",
"valueVat": "23.00",
"valueGross": "123.00"
}
]
}
}
Przykład CURL:
curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/income-documents/add -d '{"customer":{"id":4195100}}'
Żądanie (JSON):
{
"customer" : {
"id": 4195100
}
}
Odpowiedź (JSON):
{
"success": false,
"response": "Brak wymaganych wartości"
}
https://app.firmino.pl/app/services/rest/api/income-documents/get/{id}
Przykład CURL:
curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/income-documents/get/3352
Odpowiedź (JSON):
{
"success": true,
"response": {
"id": 3352,
"externalDocument": "Nazwa dokumentu",
"documentDate": "2022-07-29",
"saleDate": "2022-07-29",
"salePlace": "Zielona Góra",
"priceType": "net",
"documentState": "paid",
"customer": {
"id": 4195100,
"fullName": "KONTRAHENT TESTOWY",
"shortName": "TEST KONTRAH",
"countryCode": "PL",
"locality": "Zielona Góra",
"tin": "1111111111",
"regon": null,
"street": "Testowa",
"houseNo": "2",
"flatNo": null,
"postCode": "65-077",
"post": "Zielona Góra",
"phone": null,
"email": null,
"bankAccount": null,
"fax": null,
"website": null,
"note": null
},
"currency": {
"code": "PLN",
"rate": "1.000000",
"date": null,
"table": null
},
"payment": {
"method": "transfer",
"paymentDate": null,
"termDate": "2022-08-12",
"total": "0",
"paid": "0.00",
"ramain": "0.00"
},
"vatCountedManually": false,
"quotaVats": [
{
"id": 3460,
"vatRate": "23",
"valueNet": "100.00",
"valueVat": "23.00",
"valueGross": "123.00"
}
]
}
}
https://app.firmino.pl/app/services/rest/api/income-documents/find
Przykład CURL:
curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/income-documents/find -d '{}'
Żądanie (JSON):
{}
Odpowiedź (JSON):
{
"success": true,
"response": {
"params": {
"total": 4,
"page": 1,
"size": 15,
"sortField": null,
"sortOrder": null,
"text": null,
"filters": null
},
"list": [
{
"id": 3352,
"ordinalNumber": 4,
"externalName": "Nazwa dokumentu1",
"documentDate": "2022-07-29",
"idCustomer": 4195100,
"customerName": "KONTRAHENT TESTOWY",
"documentState": 3,
"currencyCode": "PLN",
"paymentTotal": "0.00",
"paymentPaid": "0.00",
"paymentRemain": "0.00"
},
{
"id": 3341,
"ordinalNumber": 3,
"externalName": "Nazwa dokumentu2",
"documentDate": "2022-07-25",
"idCustomer": 4195100,
"customerName": "KONTRAHENT TESTOWY",
"documentState": 1,
"currencyCode": "PLN",
"paymentTotal": "123.00",
"paymentPaid": "0.00",
"paymentRemain": "123.00"
},
{
"id": 3330,
"ordinalNumber": 2,
"externalName": "Nazwa dokumentu3",
"documentDate": "2019-06-13",
"idCustomer": 4195100,
"customerName": "KONTRAHENT TESTOWY",
"documentState": 3,
"currencyCode": "PLN",
"paymentTotal": "0.00",
"paymentPaid": "0.00",
"paymentRemain": "0.00"
},
{
"id": 3310,
"ordinalNumber": 1,
"externalName": "Nazwa dokumentu4",
"documentDate": "2021-07-21",
"idCustomer": 4195100,
"customerName": "KONTRAHENT TESTOWY",
"documentState": 1,
"currencyCode": "PLN",
"paymentTotal": "985.00",
"paymentPaid": "0.00",
"paymentRemain": "985.00"
}
]
}
}
https://app.firmino.pl/app/services/rest/api/income-documents/find
Przykład CURL:
curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/income-documents/find -d '{"page":1,"size":10,"text":"","filters":[{"name":"year","value":2022}]}'
Żądanie (JSON):
{
"page" : 1,
"size" : 10,
"text" : "",
"filters":
[
{
"name": "year",
"value": 2022
}
]
}
Odpowiedź (JSON):
{
"success": true,
"response": {
"params": {
"total": 2,
"page": 1,
"size": 15,
"sortField": null,
"sortOrder": null,
"text": null,
"filters": [
{
"name": "year",
"value": "2022"
}
]
},
"list": [
{
"id": 3352,
"ordinalNumber": 4,
"externalName": "Nazwa dokumentu1",
"documentDate": "2022-07-29",
"idCustomer": 4195100,
"customerName": "KONTRAHENT TESTOWY",
"documentState": 3,
"currencyCode": "PLN",
"paymentTotal": "0.00",
"paymentPaid": "0.00",
"paymentRemain": "0.00"
},
{
"id": 3341,
"ordinalNumber": 3,
"externalName": "Nazwa dokumentu2",
"documentDate": "2022-07-25",
"idCustomer": 4195100,
"customerName": "KONTRAHENT TESTOWY",
"documentState": 1,
"currencyCode": "PLN",
"paymentTotal": "123.00",
"paymentPaid": "0.00",
"paymentRemain": "123.00"
}
]
}
}
https://app.firmino.pl/app/services/rest/api/income-documents/update
Przykład CURL:
curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/income-documents/update -d
'{"id":3341, "externalDocument": "Zmiana nazwy", "documentDate":"2022-02-15","saleDate":"2022-02-15","salePlace":"Warszawa","priceType":"gross",
"customer":{"fullName":"KONTRAHENT NOWY","shortName":"EDYTOWANY","countryCode":"PL","locality":"Poznań","postCode":"60-001","note":"edytowany"},
"currency":{"code":"EUR"},"payment":{"method":"cash","termDate":"2022-02-22"},
"quotaVats":[{"vatRate": "8", "valueNet": "100.00"}]}'
Żądanie (JSON):
{
"id" : 3382,
"externalDocument": "Zmieniona nazwa",
"documentDate": "2022-02-15",
"saleDate": "2022-02-15",
"salePlace": "Warszawa",
"priceType": "gross",
"customer": {
"fullName": "KONTRAHENT NOWY",
"shortName": "EDYTOWANY",
"countryCode": "PL",
"locality": "Poznań",
"postCode": "60-001",
"note": "edytowany"
},
"currency": {
"code": "EUR"
},
"quotaVats": [
{
"vatRate": "8",
"valueNet": "100.00"
}
]
}
Odpowiedź (JSON)
{
"success": true,
"response": {
"id": 3382,
"externalDocument": "Zmieniona nazwa",
"documentDate": "2022-02-15",
"saleDate": "2022-02-15",
"salePlace": "Warszawa",
"priceType": "gross",
"documentState": "unpaid",
"customer": {
"id": 4635700,
"fullName": "KONTRAHENT NOWY",
"shortName": "EDYTOWANY",
"countryCode": "PL",
"locality": "Poznań",
"tin": null,
"regon": null,
"street": null,
"houseNo": null,
"flatNo": null,
"postCode": "60-001",
"post": "Poznań",
"phone": null,
"email": null,
"bankAccount": null,
"fax": null,
"website": null,
"note": "edytowany"
},
"currency": {
"code": "EUR",
"rate": "4.509100",
"date": null,
"table": null
},
"payment": {
"method": "transfer",
"paymentDate": null,
"termDate": "2022-08-22",
"total": "123.00",
"paid": "0.00",
"ramain": "123.00"
},
"quotaVats": [
{
"vatRate": "8",
"valueNet": "100.00",
"valueVat": "8.00",
"valueGross": "108.00"
}
]
}
}
https://app.firmino.pl/app/services/rest/api/income-documents/delete/{id}
Przykład CURL:
curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/income-documents/delete/3382
Odpowiedź (JSON):
{
"success": true,
"response": "Usunięto dokument"
}
https://app.firmino.pl/app/services/rest/api/income-documents/init
Przykład CURL:
curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/income-documents/init -d '{"documentDate":"2022-08-08"}'
Żądanie (JSON):
{
"documentDate" : "2022-08-08"
}
Odpowiedź (JSON)
{
"success": true,
"response": {
"id": null,
"externalDocument": null,
"documentDate": "2022-08-08",
"saleDate": "2022-08-08",
"salePlace": "Zielona Góra",
"priceType": "net",
"documentState": "unpaid",
"customer": {
"id": null,
"fullName": null,
"shortName": null,
"countryCode": "PL",
"locality": null,
"tin": null,
"regon": null,
"street": null,
"houseNo": null,
"flatNo": null,
"postCode": null,
"post": null,
"phone": null,
"email": null,
"bankAccount": null,
"fax": null,
"website": null,
"note": null
},
"currency": {
"code": "PLN",
"rate": "1.000000",
"date": null,
"table": null
},
"payment": {
"method": "transfer",
"paymentDate": null,
"termDate": "2022-08-22",
"total": "0",
"paid": "0.00",
"ramain": "0.00"
},
"vatCountedManually": false,
"quotaVats": []
}
}
https://app.firmino.pl/app/services/rest/api/income-documents/payoff/{id}
Przykład CURL:
curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/income-documents/payoff/3371
Odpowiedź (JSON)
{
"success": true,
"response": "Dokument został spłacony"
}