Accounts-accountId-invoicesInfo-sorted:GET
From Hostway API Documentation
Revision as of 01:34, 8 May 2014 by Mike.robski (Talk | contribs)
GET /accounts/{accountId}/invoice?sortField={sortField}
Gets a list of account's invoices sorted by sortField
Contents |
Request
GET /accounts/{accountId}/invoices?sortField={sortField}
Parameters
- accountId - string
- The Id of the account.
- sortField - string
- sortField param. Possible value is 'status'.
- sortOrder - string
- sortOrder param. Possible values are: 'asc','desc'.
Request Headers
- Authorization - HTTP Authorization header [1]
- The Authentication credentials of the client application.
Response
Status Code
- 200 OK
- Success
- 401 Unauthorized
- The supplied credentials are invalid or do not provide permissions for this operation.
- 403 Forbidden
- The user lacks the necessary permissions to access the resource
- 404 Not Found
- The accountId was not found.
Response Body
{ { "list": [{ "status": "{status}", "currency": "{currency}", "amount": "{amount}", "amountDue": "{amountDue}", "description": "{description}", "date": "{date}", "statusName": "{statusName}", "invoiceNumber": "{invoiceNumber}" }], "links" : [{ "href" : "https://api.hostway.com/accounts/{account_id}/invoices", "rel" : "self" }] }
Parameters
- list - list
- A collection of dictionaries containing information about invoices
- status - string
- Status of invoice
- currency - string
- Currency of invoice
- ammount - string
- Amount of invoice
- amountDue - string
- Amount due of invoice
- description - string
- Description of invoice
- date - string
- Date of invoice
- statusName - string
- Status of invoice
- invoiceNumber - string
- Invoice number
- links - list
- Hypermedia for this resource. Links to self
Examples
GET paginated invoices list call sorted by status
Request
GET {{APIBaseURL}}/accounts/test731993/invoices?sortField=status&sortOrder=asc
Response
HTTP/1.1 200 OK { "list" : [ { "status": "invoice_paid", "currency": "USD", "amount": "1023.7200", "amountDue": "0.0000", "description": "Invoice #SO-360704", "date": "2011-04-19", "statusName": "Invoice Paid", "invoiceNumber": "SO-360704" }, { "status": "invoice_unpaid", "currency": "USD", "amount": "8692.6500", "amountDue": "8262.8600", "description": "Invoice #444547", "date": "2013-09-23", "statusName": "Invoice Unpaid", "invoiceNumber": "444547" }], "links" : [ { "href" : "{{APIBaseURL}}/accounts/test731993/invoices?sortField=status&sortOrder=asc", "rel" : "self" }] }
See also