JSON API » transactions » transactions/list
Gets the fields of transactions in the given customer.
Input parameters
Requires authentication and the reports role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
start | Integer | Start Unix timestamp. | Recommended | 0 |
end | Integer | End Unix timestamp. | Recommended | Now. |
customer | Integer | ID of customer to get transactions for. | No | Customer of authentication user. |
invoice | Integer | ID of invoice to return transactions for. 0 for all. | No | 0 |
sort | String | Field to sort by. "amount", "description", "id", "person", "reference", "time", or "type". | No | "time" |
descending | Integer | 1 to sort descending, 0 not to. | No | 0 |
Failure to specify the start and end may put a heavy load on the database.
Responses
Code | Description |
---|---|
200 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your rate plan does not allow this. |
Data returned
An array of fields, corresponding to the rows of the transactions table in the database.
Example: With required and recommended parameters
http://enswitch.example.com/api/json/transactions/list/?auth_username=user;auth_password=password;start=1230000000;end=1240000000{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "amount":"1.00", ... }, { "id":2, "amount":"2.00", ... } ] }
Change history
Version | Changes |
---|---|
3.14 | end input parameter changed to return data < value instead of <= value. |
3.13 | Function added. |