JSON API » invoices » invoices/list

Gets the fields of invoices.

Input parameters

Requires authentication and the callshop or reports role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
startIntegerStart Unix timestamp.Recommended0
endIntegerEnd Unix timestamp.RecommendedNow.
customerString or integerCustomer to get invoices for. See below for more details.RecommendedCustomer of authentication user.
countInteger1 to return a count, 0 to return full data.No0
descendingInteger1 to sort descending, 0 not to.No0
limitIntegerThe maximum results to return. 0 for all.No0
offsetIntegerThe result to start at. 0 for the first.No0
pagesInteger1 to return a reduced set of data for generating the pages select box, 0 to return full data.No0
sortStringField to sort by. "created", "customer_name", "id", "number", or "status".No"id"
statusStringOnly return invoices with this status. "approved", "both" (which means "approved" plus "queued"), "cancelled", "due", "overdue", "paid", "payment_refused", "pending", "prepaid", "queued", "superceded", or empty string for all.NoEmpty string.

Failure to specify the start and end may put a heavy load on the database.

The customer field may have the following values:

Field valueReturns calls for
Field not setCustomer of authentication user.
ID of a customerThat customer.
"all"All customers under customer of authentication user.
"system"All customers on system.

Responses

CodeDescription
200Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.

Data returned

An array of fields, corresponding to the rows of the invoices table in the database.

Example: With required and recommended parameters

http://enswitch.example.com/api/json/invoices/list/?auth_username=user;auth_password=password;start=1230000000;end=1240000000;customer=123

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":123, "number":1, ... }, { "id":124, "number":2, ... } ] }

Change history

VersionChanges
4.4count, limit, offset, and pages parameters added.
3.14end input parameter changed to return data < value instead of <= value.
3.13Function added.