JSON API » invoices » invoices/get

Gets the fields of an invoice.

Input parameters

Requires authentication and the callshop or reports role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
customerIntegerID of customer to get last invoice for.Yes, unless id is specified.
idIntegerID of invoice to get.Yes, unless customer is specified.
encodingString"base64" to return file base64 encoded, "raw" to return raw data.No"raw"
fileInteger1 to include invoice file, 0 not to. Has a modest performance impact.No0

Specify customer or id, but not both.

Responses

CodeDescription
200Success.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.
404The invoice does not exist, or you do not have permission to view it.

Data returned

Fields of invoice. Note that the invoice ID is not the same as in the invoice number, as the ID is unique throughout the system, and the number is unique to the customer.

Example: With id

http://enswitch.example.com/api/json/invoices/get/?auth_username=user;auth_password=password;id=123

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

Change history

VersionChanges
3.13Function added.