API - Faktury Cykliczne

Punkt dostępowy

Punkt dostępowy znajduje się pod adresem: https://app.firmino.pl/app/services/rest/api/recurring-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)

Pola

ParametrOpisUwagiTyp danych
idIdentyfikatorbraklong
idSaleDocumentIdentyfikator dokumentu sprzedaży, który ma być cyklicznie wysyłanyWymagany przy dodawaniu dokumentulong
intervalTimeTypeCzas co jaki ma być wysyłany dokument (domyślnie miesiąc).

Dostępne:
  • week, month, two months, three months, six months, year

Wymagany przy dodawaniu dokumentustring
nameNazwa dokumentu cyklicznegoWymagany przy dodawaniu dokumentustring
startDateData pierwszego wysłania (domyślnie aktualna data)brakstring(yyyy-mm-dd)
activeMożliwość ustawiania czy dokument jest aktywny czy niebrakboolean
emailAdres e-mail, na który wysyłany jest dokumentbrakstring
emailForConfirmationAdres e-mail, na który wysyłana jest kopiabrakstring
hourToSendGodzina, o której ma sie wysyłać dokumentbrakstring

Przykładowe zapytania

https://app.firmino.pl/app/services/rest/api/recurring-documents/add

Przykład CURL:

curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/recurring-documents/add -d '{"name": "Test","idSaleDocument": 19818500}'

Żądanie (JSON):

		{
			"name": "Test",
			"idSaleDocument": 19818500
		}

Odpowiedź (JSON):

		{
			"success": true,
			"response": {
				"id": 29910,
				"idSaleDocument": 19818500,
				"intervalTimeType": "month",
				"name": "CYKLICZNA - Test",
				"startDate": "2022-08-25",
				"active": "true",
				"email": null,
				"emailForConfirmation": null,
				"hourToSend": "10"
			}
		}

Przykład CURL:

curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/recurring-documents/add -d '{}'

Żądanie (JSON):

	{
	}

Odpowiedź (JSON):

	{
		"success": false,
		"response": "Brak wymaganych wartości"
	}

https://app.firmino.pl/app/services/rest/api/recurring-documents/get/{id}

Przykład CURL:

curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/recurring-documents/get/29910

Odpowiedź (JSON):

		{
			"success": true,
			"response": {
				"id": 29910,
				"idSaleDocument": 19818500,
				"intervalTimeType": "month",
				"name": "CYKLICZNA - Test",
				"startDate": "2022-08-25",
				"active": "true",
				"email": null,
				"emailForConfirmation": null,
				"hourToSend": "10"
			}
		}

https://app.firmino.pl/app/services/rest/api/recurring-documents/find

Przykład CURL:

curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/recurring-documents/find -d '{}'

Żądanie (JSON):

		{}

Odpowiedź (JSON):

		{
			"success": true,
			"response": {
				"params": {
					"total": 3,
					"page": 1,
					"size": 15,
					"sortField": null,
					"sortOrder": null,
					"text": null,
					"filters": null
				},
				"list": [
					{
						"id": 29910,
						"name": "Test",
						"saleDocumentName": "FAS 2/08/2022",
						"intervalTypeName": "Miesiąc",
						"startDate": "2022-08-25",
						"active": "true",
						"email": null,
						"emailForConfirmation": null,
						"idSaleDocument": 19818500,
						"hourToSend": "10"
					},
					{
						"id": 29900,
						"name": "Test",
						"saleDocumentName": "FAS 2/08/2022",
						"intervalTypeName": "Miesiąc",
						"startDate": "2022-08-25",
						"active": "true",
						"email": null,
						"emailForConfirmation": null,
						"idSaleDocument": 19818500,
						"hourToSend": "10"
					},
					{
						"id": 29893,
						"name": "Test",
						"saleDocumentName": "FAS 2/08/2022",
						"intervalTypeName": "Miesiąc",
						"startDate": "2022-08-24",
						"active": "true",
						"email": null,
						"emailForConfirmation": null,
						"idSaleDocument": 19818500,
						"hourToSend": "10"
					}
				]
			}
		}

https://app.firmino.pl/app/services/rest/api/recurring-documents/find

Przykład CURL:

curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/recurring-documents/find -d '{"page":1,"size":10,"text":"","filters":[{"name":"intervalTimeType","value":"week"}]}'

Żądanie (JSON):

		{
			"page" : 1,
			"size" : 10,
			"text" : "",
			"filters":
				[ 
					{
						"name": "intervalTimeType",
						"value": "week"
					}
				]
		}

Odpowiedź (JSON):

		{
			"success": true,
			"response": {
				"params": {
					"total": 1,
					"page": 1,
					"size": 10,
					"sortField": null,
					"sortOrder": null,
					"text": "",
					"filters": [
						{
							"name": "intervalTimeType",
							"value": "week"
						}
					]
				},
				"list": [
					{
						"id": 29893,
						"name": "CYKLICZNA - ZMIANA",
						"saleDocumentName": "FAS 2/08/2022",
						"intervalTypeName": "Tydzień",
						"startDate": "2022-07-24",
						"active": "false",
						"email": "zmiana@email.pl;",
						"emailForConfirmation": null,
						"idSaleDocument": 19818500,
						"hourToSend": "8"
					}
				]
			}
		}

https://app.firmino.pl/app/services/rest/api/recurring-documents/update

Przykład CURL:

		curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/recurring-documents/update -d 
		'{"id":29893, "idSaleDocument": 19818500, "intervalTimeType":"week","name":"ZMIANA","startDate": "2022-07-24","active": "true",
		"email": "zmiana@email.pl","currency":{"code":"EUR"}, "hourToSend": "8"}'

Żądanie (JSON):

		{
			"id": 29893,
			"idSaleDocument": 19818500,
			"intervalTimeType": "week",
			"name": "ZMIANA",
			"startDate": "2022-07-24",
			"active": "true",
			"email": "zmiana@email.pl",
			"hourToSend": "8"
		}

Odpowiedź (JSON)

		{
			"success": true,
			"response": {
				"id": 29893,
				"idSaleDocument": 19818500,
				"intervalTimeType": "week",
				"name": "CYKLICZNA - ZMIANA",
				"startDate": "2022-07-24",
				"active": "true",
				"email": "zmiana@email.pl;",
				"emailForConfirmation": null,
				"hourToSend": "8"
			}
		}

https://app.firmino.pl/app/services/rest/api/recurring-documents/delete/{id}

Przykład CURL:

curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/recurring-documents/delete/29892

Odpowiedź (JSON):

	{
		"success": true,
		"response": "Usunięto dokument"
	}

https://app.firmino.pl/app/services/rest/api/recurring-documents/init

Przykład CURL:

curl -POST --user login:haslo -H "Content-type: application/json" https://app.firmino.pl/app/services/rest/api/recurring-documents/init -d '{"name": "Test", "idSaleDocument": 19818500}'

Żądanie (JSON):

		{
			"name": "Test",
			"idSaleDocument": 19818500
		}

Odpowiedź (JSON)

		{ 
			"success": true,
			"response": {
				"id": null,
				"idSaleDocument": 19818500,
				"intervalTimeType": "month",
				"name": "CYKLICZNA - Test",
				"startDate": "2022-08-25",
				"active": "true",
				"email": null,
				"emailForConfirmation": null,
				"hourToSend": "10"S
			}
		}