JSON API » invoices » invoices/get
Gets the fields of an invoice.
Input parameters
Requires authentication and the callshop or reports role privileges.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
customer | Integer | ID of customer to get last invoice for. | Yes, unless id is specified. | |
id | Integer | ID of invoice to get. | Yes, unless customer is specified. | |
encoding | String | "base64" to return file base64 encoded, "raw" to return raw data. | No | "raw" |
file | Integer | 1 to include invoice file, 0 not to. Has a modest performance impact. | No | 0 |
Specify customer or id, but not both.
Responses
Code | Description |
---|---|
200 | Success. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your rate plan does not allow this. |
404 | The 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
Version | Changes |
---|---|
3.13 | Function added. |