fbpx
3.21. Documents list


Connection URL

TEST URL  http://nap.dev.icash.bg/clientapi/v1/documents-list
( AL ) PRODUCTION URL https://v1.icash.al/clientapi/v1/documents-list
( BG ) PRODUCTION URL https://v5.icash.bg/clientapi/v1/documents-list

 

POST REQUEST

Param Description Field type Required
api_key API Key String YES
nonce Nonce Integer YES
signature Signature String YES

ses

Session  String YES
DocumentID Document ID Integer No/YES
DocumentStoreID Store ID Integer No/YES
DocumentType Document type –

INVOICE, PROFORMA 

SET(INVOICE,PROFORMA)

Default INVOICE

No/YES
DocumentNum Document number Integer No/YES
DocumentStatus Status SET(NORMAL,DELETED)

Default  NORMAL

No/YES
DocumentOperationType Operation type SET(NORMAL,FINANCIAL)

Default  NORMAL

No/YES
DocumentOperationID Operation ID Integer No/YES
DocumentSubType Sub type of document SET(NORMAL,CREDIT,DEBIT,ADVANCE)

Default NORMAL

No/YES
DocumentContragentID Customer ID Integer No/YES
DocumentDateFrom Document date from STRING(YYYY-MM-DD) No/YES
DocumentDateTo Document date to STRING(YYYY-MM-DD) No/YES
DocumentPayTypeID Pay type ID Integer No/YES
DocumentBankAccountID Bank account ID Integer No/YES
ImportSource External system name String No
ImportRefID External system referal ID Integer No
sort Sort by String No
order Order ENUM(ASC,DESC)

Default ASC

No
offset Offset Integer

Default 0

No
count Count Integer(MAX 100)

Default 10

No

 

JSON response on success

Param Description Field type Required
nonce Nonce from request Integer YES
status Request status Integer

1 – successful

YES
data Result result YES

 

Structure of type “result”

Param Description Field type Required
TotalRecords Count of total records Integer YES
Data Array of items Array of document YES

 

Structure of type “document

Param Description Field type Required
DocumentID Document ID Integer YES
DocumentStatus Document status ENUM(NORMAL,DELETED)

Default  NORMAL

YES
DocumentNum Number of document Integer YES
DocumentType Document type

INVOICE – 

PROFORMA –

ENUM(INVOICE,PROFORMA) YES
DocumentStoreID Store ID Integer YES
DocumentOperationID Operation ID Integer YES
DocumentOperationType Operation type ENUM(NORMAL,FINANCIAL) YES
DocumentSubType Sub type of document ENUM(NORMAL,CREDIT,DEBIT) YES
DocumentDate Document date STRING(YYYY-MM-DD) YES
DocumentFirmName Company name String YES

DocumentFirmAddress

Company address String YES
DocumentFirmMOL Company manager name String YES
DocumentFirmEIK Company number String YES
DocumentContragentID Customer document ID Integer YES
DocumentContragentName Customer name String YES
DocumentContragentAddress Customer address String YES
DocumentContragentMOL Customer manager name String YES
DocumentContragentTaxNum Customer company ID String YES
DocumentContragentTaxNumVatReg Tax number String YES
DocumentToDocumentID Refferal document ID (Credit/Debit) Integer YES
DocumentToDocumentDate Refferal document date (Credit/Debit) String

(YYYY-MM-DD)

YES
DocumentPriceBase Base price DECIMAL(15,2) YES
DocumentDiscount Discount % DECIMAL(7,5) YES
DocumentTotalPrice Total Price DECIMAL(15,2) YES
DocumentTotalPriceTxt Total price in text String YES
DocumentCurrencyCode Currency String YES
DocumentPayTypeID Pay type ID Integer YES
DocumentPayDate Pay date String

(YYYY-MM-DD)

YES
DocumentBankAccountID Bank account ID Integer YES
DocumentBankAccountBankName Bank name String YES
DocumentBankAccountIBAN IBAN  String YES
DocumentBankAccountBIC BIC  String YES
DocumentBankAccountCurrencyCode Currency of bank account String YES
DocumentAcceptedBy Accepted by String YES
DocumentCreatedBy Created by String YES
DocumentCreateUserID Document ID Integer YES
DocumentCreateDate Document create date String

(YYYY-MM-DD)

YES
DocumentVatReason Tax condition  String YES
DocumentComment Comment String YES

 

Example:

{
    „nonce“: „1553250985“,
    „status“: 1,
    „data“: {
        „TotalRecords“: 543,
        „Data“: [
            {
                „DocumentID“: 1,
                „DocumentStatus“: „NORMAL“,
                „DocumentNum“: 1,
                „DocumentType“: „INVOICE“,
                „DocumentStoreID“: null,
                „DocumentOperationID“: 34314,
                „DocumentOperationType“: „NORMAL“,
                „DocumentSubType“: „NORMAL“,
                „DocumentDate“: „2016-09-26“,
                „DocumentFirmName“: „Concord Company Ltd.“,
                „DocumentFirmAddress“: „Address line 1“,
                „DocumentFirmMOL“: „Jonatan Van“,
                „DocumentFirmEIK“: „1234567890“,
                „DocumentContragentID“: 25,
                „DocumentContragentName“: „INVEST HOLDING LTD“,
                „DocumentContragentAddress“: „Address line 1“,
                „DocumentContragentMOL“: „John Smith“,
                „DocumentContragentTaxNum“: „115825956“,
                „DocumentContragentTaxNumVatReg“: „BG115825956“,
                „DocumentToDocumentID“: 0,
                „DocumentToDocumentDate“: „0000-00-00“,
                „DocumentPriceBase“: „20.00“,
                „DocumentDiscount“: „0.00000“,
                „DocumentTotalPrice“: „24.00“,
                „DocumentTotalPriceTxt“: „amount with text
                „DocumentCurrencyCode“: „EUR“,
                „DocumentPayTypeID“: 1,
                „DocumentPayDate“: „2016-09-17“,
  „DocumentBankAccountID“: 0,
                „DocumentBankAccountBankName“: „“,
                „DocumentBankAccountIBAN“: „“,
                „DocumentBankAccountBIC“: „“,
                „DocumentBankAccountCurrencyCode“: „EUR“,
                „DocumentAcceptedBy“: „“,
                „DocumentCreatedBy“: „John Smith“,
                „DocumentCreateUserID“: 1,
                „DocumentCreateDate“: „2016-09-26 12:02:32“,
                „DocumentVatReason“: „Осн 1“,
                „DocumentComment“: „“
            },
            {
                „DocumentID“: 2,
                „DocumentStatus“: „NORMAL“,
                „DocumentNum“: 2,
                „DocumentType“: „INVOICE“,
                „DocumentStoreID“: null,
                „DocumentOperationID“: 34329,
                „DocumentOperationType“: „NORMAL“,
                „DocumentSubType“: „NORMAL“,
                „DocumentDate“: „2016-10-07“,
                „DocumentFirmName“: „Concord Company Ltd.“,
                „DocumentFirmAddress“: „Address line 1“,
                „DocumentFirmMOL“: „Jonatan Van“,
                „DocumentFirmEIK“: „1234567890“,
                „DocumentContragentID“: 25,
                „DocumentContragentName“: „INVEST HOLDING LTD“,
                „DocumentContragentAddress“: „Address line 1“,
                „DocumentContragentMOL“: „John Smith“,
                „DocumentContragentTaxNum“: „115825956“,
                „DocumentContragentTaxNumVatReg“: „BG115825956“,
                „DocumentToDocumentID“: 0,
                „DocumentToDocumentDate“: „0000-00-00“,
                „DocumentPriceBase“: „87.91“,
                „DocumentDiscount“: „0.00000“,
                „DocumentTotalPrice“: „87.91“,
                „DocumentTotalPriceTxt“: „text amount“,
                „DocumentCurrencyCode“: „EUR“,
                „DocumentPayTypeID“: 1,
                „DocumentPayDate“: „2016-10-04“,
  „DocumentBankAccountID“: 0,
                „DocumentBankAccountBankName“: „“,
                „DocumentBankAccountIBAN“: „“,
                „DocumentBankAccountBIC“: „“,
                „DocumentBankAccountCurrencyCode“: „EUR“,
                „DocumentAcceptedBy“: „“,
                „DocumentCreatedBy“: „John Smith“,
                „DocumentCreateUserID“: 1,
                „DocumentCreateDate“: „2016-10-07 10:31:56“,
                „DocumentVatReason“: „“,
                „DocumentComment“: „“
            }
        ]
    }
}

 

JSON response on unsuccess

Param Description Field type Required
nonce Nonce from request Integer YES
status Request status Integer

0 – unsuccess request

YES
error_message Error Description String YES

 

Example:

{
    „nonce“: „1552990901“,
    „status“: 0,
    „error_message“: „Session expired“
}

 

Live example:

In this example, 3 methods of API are used
1. login – to authorise in API
2. documents-list – to take a list of documents from the last 30 days. Pay attention to the attributes DocumentDateFrom, DocumentDateTo – limiting the search period.
3. get-document – with which the detailed information about the document is taken
function 3 is executed in a loop as long as there are documents from the period.Click here to view example in new tab

Безплатна консултация



Безплатна консултация



Безплатна консултация




Безплатна консултация




Безплатна консултация




Безплатна консултация