ABRA Flexi can require an invoice signature before issuing a payment order (see settings). A signed document can then be added to a payment order, while an unsigned one cannot.
The REST API allows you to sign an invoice using the action sign-for-payment. To cancel a signature, use the action unsign-for-payment. To perform the action, you need to know the specific ID (code) of the invoice, or you can use filtering to sign multiple invoices at once.
Usage examples
The request is sent using the POST method to the URL:
POST https://demo.flexibee.eu/c/demo/faktura-prijata.xml (.json)
<winstrom version="1.0">
<faktura-prijata id="123" action="sign-for-payment" />
</winstrom>
případně zápis
<winstrom version="1.0">
<faktura-prijata action="sign-for-payment">
<id>123</id>
</faktura-prijata>
</winstrom>
The request can also be sent in JSON format using the document's internal number.
Adding a payment signature:
{
"winstrom": {
"faktura-prijata": {
"id": "code:PF0015/2022",
"@action": "sign-for-payment"
}
}
}
Removing a payment signature:
{
"winstrom": {
"faktura-prijata": {
"id": "code:PF0015/2022",
"@action": "unsign-for-payment"
}
}
}
The ABRA Flexi response is then an update of the selected record:
{
"winstrom": {
"@version": "1.0",
"success": "true",
"stats": {
"created": "0",
"updated": "1",
"deleted": "0",
"skipped": "0",
"failed": "0"
},
"results": [
{
" id": "910",
"request-id": "code:PF0015/2022",
"ref": "/c/demo141020_v26/faktura-prijata/910.json"
} ] } }
Filtering invoices for signing
The request is sent using the POST method to the URL:
POST https://demo.flexibee.eu/c/demo/faktura-prijata.xml (.json)
The action can also be triggered in bulk over a group of documents using a filter:
<winstrom version="1.0">
<faktura-prijata filter="datSplat gt now()"
action="sign-for-payment" />
</winstrom>
The request can also be sent in JSON format using filtering:
{
"winstrom": {
"faktura-prijata": {
"@filter": "sumCelkem lt 100",
"@action": "unsign-for-payment"
}
}
}
Failed requests
1. The specified/filtered object (invoice) does not exist
If the object cannot be found or does not exist, the API response is:
"message": "Objekt bude teprve vytvořen, žádnou akci nelze provést."
2. The action is incorrectly specified
If you are calling an incorrect action (typo or error in the name):
<error>Atribut 'action' obsahuje špatnou hodnotu. Pro daný objekt smí obsahovat jen: [delete, lock, lock-for-ucetni, storno, sign-for-payment, uhrad-zapoctem] [PF0013/2223]</error>
3. Incorrectly specified filter
The filter does not conform to the defined filtering rules; the response indicates the approximate position of the error in the filter:
<error>Špatný formát WQL dotazu, problém na pozici 11 poblíž textu 'now()'
org.antlr.v4.runtime.misc.ParseCancellationException
org.antlr.v4.runtime.NoViableAltException</error>
4. The object (invoice) is locked
If you are trying to sign a document that is locked, the response will be a failure. The document must first be unlocked using the action action ="unlock":
"message": "Záznam je zamčený. [PF0031/2021]"

