getBillingStatements
Retrieve all recurring billings that have been set up in Erply.
A recurring billing indicates that customer should get a monthly (yearly) invoice for the indicated services, at the indicated price.
After the billing has been set up, recurring invoices need to be manually created and sent from back office Sales → Recurring billing, at the beginning or at the end of a month, as appropriate.
Alternatively, invoices can also be created over API with the saveSalesDocument call, and associated with the billing via the "billingStatementID" field.
To get the "billed until" date for each recurring billing, see API call getBilledUntilDate.
Input parameters
Parameter name |
Description |
Possible value |
Required |
billingStatementID |
Billing statement ID. |
integer |
|
billingStatementNumber |
Billing statement number. |
integer |
|
customerID |
Customer ID. |
integer |
|
productID |
Product ID. |
integer |
|
startDateFrom |
|
ISO date (yyyy-mm-dd) |
|
startDateTo |
|
ISO date (yyyy-mm-dd) |
|
endDateFrom |
|
ISO date (yyyy-mm-dd) |
|
endDateTo |
|
ISO date (yyyy-mm-dd) |
|
active |
0 or 1. |
integer |
|
dueForBilling |
Retrieve only active and due billings. |
Integer(0/1) |
|
billingStatementPeriod |
Period of billing statement. Possible values: "MONTH", "QUARTER", "HALFYEAR", "YEAR", "3MONTHS", "4MONTHS". |
string |
|
billingStatementTime |
Time of billing statement. Possible values: "WHEN_PERIOD_STARTS", "WHEN_PERIOD_ENDS", "BASED_ON_METERED_READINGS". |
string |
|
customerName |
Retrieve by customer name that starts with the provided value. For company, search by company name. For persons, search by person full name - first name, space and last name, eg. "John Smith" |
string |
|
customerAccount |
|
string |
|
productNameOrCode |
|
string |
|
getStatementsWithDefinedCustomerSpecialPrice |
|
Integer(0/1) |
|
getStatementsWithUndefinedCustomerSpecialPrice |
|
Integer(0/1) |
|
searchAttributeName |
Name of attribute to search from. Both "searchAttributeName" and "searchAttributeValue" have to be specified. Error 1030 will be returned if value is an array. |
string |
|
searchAttributeValue |
Attribute value to search for. Error 1030 will be returned if value is an array. |
string |
|
changedSince |
Retrieve only items that have been added or modified since the specified timestamp. Use it to keep a local database in sync with Erply. |
Integer (Unix timestamp) |
|
recordsOnPage |
Number of records API should return. By default 20, at most 100. |
integer |
|
pageNo |
API returns at most recordsOnPage items at a time. To retrieve the next recordsOnPage items, send a new request with pageNo incremented by one. By default, API returns "page 1". |
integer |
|
Response
Field name |
Type |
Description |
billingStatementID |
integer |
ID of billing statement. |
billingStatementNumber |
integer |
Number of billing statement. |
customerID |
integer |
Customer ID. |
customerName |
string |
Customer name. |
customerAddressID |
integer |
Customer address ID. |
payerID |
integer |
Payer ID. |
payerName |
string |
Payer name. |
payerAddressID |
integer |
Payer address ID. |
startDate |
ISO date (yyyy-mm-dd) |
|
endDate |
ISO date (yyyy-mm-dd) |
|
paymentDays |
integer |
Payment period. |
productID |
integer |
ID of the product. |
productName |
string |
Name of the product. |
serviceID |
integer |
ID of the service. |
serviceNameOnInvoices |
string |
Service name as displayed on invoices. |
active |
integer |
|
currencyCode |
string |
Currency code. |
vatrateID |
integer |
ID of VAT rate. |
customerSpecialPrice |
number |
Customer special price. |
employeeID |
integer |
ID of the employee, who is set as the creator of the billing statement. |
warehouseID |
integer |
Warehouse ID. |
sendByEmail |
integer |
|
makeSeparateInvoice |
integer |
|
additionalInvoiceNotes |
string |
Additional text printed on invoices. |
notes |
string |
Notes. |
billingStatementPeriod |
string |
Period of billing statement. Possible values: "MONTH", "QUARTER", "HALFYEAR", "YEAR", "3MONTHS", "4MONTHS". |
billingStatementTime |
string |
Time of billing statement. Possible values: "WHEN_PERIOD_STARTS", "WHEN_PERIOD_ENDS", "BASED_ON_METERED_READINGS". |
lastReading |
number |
Last reading. |
lastReadingDate |
ISO date (yyyy-mm-dd) |
Date of last reading. |
lastModified |
Unix timestamp. |
|
accounts |
array |
Customer accounts. Each item looks like this:
Field name | Type | Description |
---|
recordID | Integer | Record ID | account | String | Account | added | Integer | Creation time | addedByID | Integer | Creator ID |
|
tokens |
array |
Tokens. Each item looks like this:
Field name | Type | Description |
---|
recordID | Integer | Record ID | token | String | Token | source | String | Source | added | Integer | Creation time | addedByID | Integer | Creator ID |
|
attributes |
array |
Additional attributes. Each item looks like this:
Field name | Type | Description |
---|
attributeName | String | Attribute name | attributeType | String | Attribute type | attributeValue | String | Attribute value |
|