Skip to main content

Deductible Amounts - REST API

How to retrieve remaining deductible document amounts and documents that can be deducted from a given invoice via API?

Written by Petr Pech

As of version 2024.3, new sub-records/relations for deducting advance payments from invoices are available in the API.

  1. Advances for deduction

    • Returns a list of tax documents for advance payments (ZDD) and non-accounting advances that can be deducted from the given invoice

  2. Amounts for deduction

    • Returns the amounts that can still be deducted from this advance payment / ZDD. The response structure is similar to that of the advance for deduction

Calling method

You can use the HTTP method: GET

The sub-records are available at the following URLs:

1. Advances for deduction

https://demo.flexibee.eu/c/{firma}/faktura-vydana/{ID}/zalohy-k-odpoctu.xml, where {firma} is the database identifier of the company and {ID} is the identifier of the selected invoice.

2. Amounts for deduction

https://demo.flexibee.eu/c/{firma}/faktura-vydana/{ID}/castky-k-odpoctu.xml, where {firma} is the database identifier of the company and {ID} is the identifier of the selected advance invoice or ZDD.

The following output formats are supported: XML or JSON, and others.

Parameters

No parameters are required to generate the output.

Example calls

1. List of advances for deduction for a selected invoice.

GET

Output:

<winstrom>
<zaloha-k-odpoctu>
<zaloha ref="/c/demo/faktura-vydana/126.xml" showAs="VF1-0005/2024">code:VF1-0005/2024</zaloha>
<ucetni>true</ucetni>
<sumOsv>0.0</sumOsv>
<sumZklZakl>3305.79</sumZklZakl>
<sumZklSniz>0.0</sumZklSniz>
<sumZklSniz2>0.0</sumZklSniz2>
<sumDphZakl>694.22</sumDphZakl>
<sumDphSniz>0.0</sumDphSniz>
<sumDphSniz2>0.0</sumDphSniz2>
<sumCelkZakl>4000.01</sumCelkZakl>
<sumCelkSniz>0.0</sumCelkSniz>
<sumCelkSniz2>0.0</sumCelkSniz2>
</zaloha-k-odpoctu>
<zaloha-k-odpoctu>
<zaloha ref="/c/demo/faktura-vydana/127.xml" showAs="VF2-0003/2024">code:VF2-0003/2024</zaloha>
<ucetni>false</ucetni>
<sumOsv>9500.0</sumOsv>
<sumZklZakl>0.0</sumZklZakl>
<sumZklSniz>0.0</sumZklSniz>
<sumZklSniz2>0.0</sumZklSniz2>
<sumDphZakl>0.0</sumDphZakl>
<sumDphSniz>0.0</sumDphSniz>
<sumDphSniz2>0.0</sumDphSniz2>
<sumCelkZakl>0.0</sumCelkZakl>
<sumCelkSniz>0.0</sumCelkSniz>
<sumCelkSniz2>0.0</sumCelkSniz2>
</zaloha-k-odpoctu>
</winstrom>

Output properties

The ucetni property indicates how the document will be accounted for when deducted:

  • true - the document would be deducted as a ZDD,

  • false - the document would be deducted as a non-accounting advance

The amounts shown are in the document's currency. Non-accounting advances have an amount only in the sumOsv field.

2. List of amounts for deduction for a given advance

GET

Output

{
"winstrom": {
"@version": "1.0",
"castky-k-odpoctu": [
{
"zaloha": "code:VF1-0005/2024",
"zaloha@ref": "/c/demo/faktura-vydana/126.json",
"zaloha@showAs": "VF1-0005/2024",
"ucetni": "true",
"sumOsv": "0.0",
"sumZklZakl": "3305.79",
"sumZklSniz": "0.0",
"sumZklSniz2": "0.0",
"sumDphZakl": "694.22",
"sumDphSniz": "0.0",
"sumDphSniz2": "0.0",
"sumCelkZakl": "4000.01",
"sumCelkSniz": "0.0",
"sumCelkSniz2": "0.0"
}
]
}
}

3. List of amounts for deduction for a given advance as a relation

GET

Output:

{
"winstrom": {
"faktura-vydana": [
{
"id": "126",
"kod": "VF1-0005/2024",
.....
"odpocAuto": "true",
"typDoklSkl": "code:STANDARD",
"castky-k-odpoctu": [
{
"zaloha": "code:VF1-0005/2024",
"zaloha@ref": "/c/demo/faktura-vydana/126.json",
"zaloha@showAs": "VF1-0005/2024",
"ucetni": "true",
"sumOsv": "0.0",
"sumZklZakl": "3305.79",
"sumZklSniz": "0.0",
"sumZklSniz2": "0.0",
"sumDphZakl": "694.22",
"sumDphSniz": "0.0",
"sumDphSniz2": "0.0",
"sumCelkZakl": "4000.01",
"sumCelkSniz": "0.0",
"sumCelkSniz2": "0.0"
}
]
}
]
}
}

Call result

To determine whether the API request was executed successfully, you can check the HTTP response status.

If the service executes successfully, an HTTP status 200 is returned along with a document in the selected XML or PDF format.

In case of failure, a 4xx/5xx status is returned along with a message describing the reason for the failure.

In case of invalid calls, the response body contains an error description. An empty output is valid. If no documents can be deducted from the invoice, the response will be empty (the same applies to amounts for deduction):

{
"winstrom": {
"@version": "1.0",
"zaloha-k-odpoctu": []
}
}

FAQ


Need help?

If you have any questions about the application, please contact us at podporaflexi@abra.eu or via the chat window in the bottom right corner.


Did this answer your question?