frequently asked questions

All your questions in one place.

Documents

This method returns some details on a list of Documents.

BODY - RAW

{
      "Method": "Documents",
      "Parameters": [
            [<nLastItemId>],
            [<nDocumentType>],
            [<dEndDate>],
            [<dStartDate>],
            [<nAddressId>],
            [<cExternalReferences>],
            [<cOpenAmount>],
            [<nIsPaid>]
      ]
}

PARAMETERS

PropertyDescription
nLastItemId

ID of the first item to be returned. You'll typically parse the results of a call, and then pass as a parameter the biggest (last) ID received, in order to obtain the next 100 documents.

If the method returns less than 100 doucments, that means that it has returned everything (according to the parameters used)

nDocumentType

Allows to return results only amongst a certain Document type. The accepted values are

Sales documents

10 Offer

12 Order confirmation

14 Worksheet

16 Delivery slip

17 Debtor starting balance

18 Cash sale

20 Debtor Invoice

22 Debtor credit note

24 Debtor Payments

Purchase documents

40 Supplier order

41 Call for tender

42 Reception of goods

43 Creditor starting balance

44 Creditor invoice

46 Creditor payment

47 Creditor credit note

50 Return of goods 

dEndDateThe recordings up to this date are considered. This parameter is optional. If the parameter is omitted, the recordings up to the end of the fiscal year are considered.
dStartDateThe recordings starting from this date are considered. The parameter is optional. If the parameter is omitted, the recordings starting from the beginning of the fiscal year are considered.
nAddressIdId of the address
cExternalReferences

A list of ID, separated by semi-columns to use as a filter.

The filter acts on contents of the field do_ref6

cOpenAmountFilter the documents which (no matter their status) have an open amount (in local currency) < > = to a given amount.
nIsPaid

The possible values are:

0 – Not paid

1 – Paid

 

EXAMPLE

*/ Return the next 100 documents starting from the documentwith id = 236707 

{
      "Method": "Documents",
      "Parameters": [
            236707
       ]
}

*/ Return the next 100 debtor invoices starting from the documentwith id = 236707

{
      "Method": "Documents",
      "Parameters": [
            236707,
            20
       ]
}

*/ Return the first 100 debtor invoices created between the 01.06.2018 and the 31.12.2018

{
      "Method": "Documents",
      "Parameters": [
            ,
            20,
            "2018-12-31",
            "2018-06-01"
      ]
}

*/ Return the first 100 documents for the Address with the ID (ad_numero)  equal to 284.

{
      "Method": "Documents",
      "Parameters": [
            ,
            ,
            ,
            ,
            284
      ]
}

*/ Return the 3 documents with an External reference that contains one of the values passed as parameter.

{
      "Method": "Documents",
      "Parameters": [
            ,
            ,
            ,
            ,
            ,
            "236798; 236812; 236857"
      ]
}

*/ Return the debtor invoices with an unpaid amount equal or bigger than 100 chf.

{
      "Method": "Documents",
      "Parameters": [
            ,
            20,
            ,
            ,
            ,
            ,
            ">=100",
      ]
}

*/ Return the unpaid creditor invoices.

{
      "Method": "Documents",
      "Parameters": [
            ,
            44,
            ,
            ,
            ,
            ,
            ,
            1
      ]
}

 

CLASS RETURNED

PropertyDescription
Id

Id of the document

 

TypeDocument type
NumberDocument number
DateDate of the document
AddressIdId of the Address of the document
AddressShort description of the address of the document (company name, last name, first name, zip code, city)
TotalAmountTotal amount of the document in the local currency
OpenAmountAopen amount of the document in the local currency
OurReferenceReference of the document at the winbiz user
YourReferenceReference of the document at the document recipient
IsPaidThe document is paid or not
PaidAmountPaid amount in local currency

Did you find this article useful?

1 out of 2 found this helpful