Kapcsolódó információk:
Paraméterezési útmutatók

The API function can automate the creation of outgoing invoices.

Az API felület a DbConnector alkalmazás Kimenő számlák automatizált készítése funkciót teszi elérhetővé webszolgáltatásként.
The web service can be operated with XML-based REST API calls.

The API is available at the next entry point. The server name depends on the local intranet environment.

General use of REST API calls can be found on the DbConnector REST API - basic informations page.

POST | GET

http://server/dbconnector/api/v1

Header parameters: pkod, lickod parameters required for API use.

The billing API is asynchronous. Submitted requests will be placed in a queue. There is a separate API call to query the processing status. The response are in XML. The queue is processed by a timed processor. New items that are queued during processing are added to the next processing period.

Tartalom

Invoice Submission

POST

http://server/dbconnector/api/v1/postxml

The aim of the call is to make the module of the Dbconnector of the SUP System, which is based on an externally produced invoicing command in the form of the Outgoing invoices to import XML scheme, accessible on a webpage as well.

 Megjegyzés

The submitting method is asynchronous. Requests submitted in XML will be placed in a queue, the processing status should be questioned later. In case of appropriate server settings, the PDF image of the invoice will be returned to the buyer with the successful processing status.

Parameter (required)
   XML : The ivoicing request (any invoice attachments must be pre-uploaded)

Result
   XML - <Token> : In case of successful submission, the received data should be retained. The result of the processing can be requested with this ID.

Call sample
CURL.EXE    ^
  -X POST   ^
     http://server:8080/dbconnector/api/v1/postxml ^
  -H pkod:SajatSupPartnerKod  ^
  -H lickod:SajatSupLicKod    ^
  -H "Content-Type: text/html; charset=UTF-8" ^
  --data-ascii @testUpload.xml
Response sample
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DbConnectorResponse>
    <Success>true</Success>
    <StatusCode>200</StatusCode>
    <Token>7085BEEC-93B0-4FE1-88BB-F531EDAC38D6</Token>
</DbConnectorResponse>

Invoice attachment upload

POST
http://server/dbconnector/api/v1/upload

An attachment can be optionally uploaded for the invoice. The following file formats can be uploaded: JPG, PDF.  If the prepared invoice is in PDF format, the attachments are embedded in a PDF.

Attachments must be uploaded to the server before the invoice XML is submitted. The identifiers (tokens) received in response must be placed in a comma-listed list in <Elojegyzett_Szamlak><Szamlak><Szamla><Csatolmanyok> data tag.

Call sample
CURL.EXE    ^
  -X POST   ^
     http://server:8080/dbconnector/api/v1/upload ^
  -H pkod:SajatSupPartnerKod  ^
  -H lickod:SajatSupLicKod    ^
  -F file=@testupload.jpg
Response sample
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DbConnectorResponse>
    <Success>true</Success>
    <StatusCode>200</StatusCode>
    <Message>File feltöltés sikeres</Message>
    <Token>74cc7200-b9fc-4fd8-a1cf-8942c09afc35</Token>
</DbConnectorResponse>



Guery processing status

GET

http://server/dbconnector/api/v1/getstatus

The purpose of this call is to enquire about the processing status of an XML document submitted to the processing queue. To identify a request, a token that is returned in the XML should be used.

In case of successful processing, it returns the number in the SUP system (log | invoice number) as well as the PDF image of the invoice- encoded in base 64 format.

Parameter (required)
   token : The token received when submitting XML.

Result
   XML - <BizonylatAzon> : Identifier of the invoice in SUP system ( acc.group| invoice number).
   XML - <DocumentType>, <DocumentData>   : The PDF file of the completed invoice (with appropriate settings).

Call sample
CURL.EXE    ^
  -X GET    ^
     http://server:8080/dbconnector/api/v1/getstatus?token=7085BEEC-93B0-4FE1-88BB-F531EDAC38D6  ^
  -H pkod:SajatSupPartnerKod   ^
  -H lickod:SajatSupLicKod
Response sample #1
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DbConnectorResponse>
    <Success>false</Success>
    <StatusCode>290</StatusCode>
    <Message>A tetel feldolgozasra var</Message>  <!-- waiting for processing  --> 
</DbConnectorResponse>
Response sample #2
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DbConnectorResponse>
    <Success>true</Success>
    <StatusCode>200</StatusCode>
    <BizonylatAzon>411|KI-0001/22</BizonylatAzon>
</DbConnectorResponse>

Response XML

The response to the API call is generated by a <DbConnectorResponse> schema.


Data members

SuccessIn case of sucessful processing, true, otherwise false
StatusCodeIn case of failed processing, more detailed information will be returned.
MessageIn case of failed processing, text information will be returned in accordance with StatusCode response.
Token

When submitting a request, this identifier can be used to retrieve status information from queue.

BizonylatAzon

When invoice instructions are submitted, and the processing is successful, the invoice can be found on the given ID in the SUP system

DocumentType
DocumentData

When invoice instructions are submitted and the processing is successful, the completed PDF image of the invoice is encoded in base64 format. Additional settings are required on the server-side to receive the PDF image of the invoice. In absence of these, only the BizonylatAzon information is returned.

Error codes

  • 200 OK
  • 290 Not yet processed
  • 401 Unauthorized
  • 404 Not Found
  • 490 Auth param missing
  • 491 Body or param missing
  • 492 XML ERROR
  • 493 Already exist
  • 494 Too long time not processed
  • 495 Error on processing
  • 499 Other error
  • 590 INI error
  • 591 Database connect error
  • 592 Other Exception

Client Implementation

The first step in client implementation is to test the functionality of the API. The testing can be done in two modes.

  • API url availability check 
  • API full test

To test the function, the widely used CURL can be used. Different browser extensions can be also used.

Using outside of the intranet

Although API is basically used inside the intranet, it is possible to use it from the Internet by creating adequate security conditions.

To test the API, QSoft Kft. made a web-based test-interface, which is available on this site: https://dbconnector-apitest.sup.hu 

The test-API is also available on the Internet at: https://dbconnector-apitest.sup.hu/api/

Identification codes required for use and testing, will be generated after prior consultation.

Error handling

API access error

Authentication error