Orders - JSON API
Table of Contents
Introduction
1.0 GET /orders
Retrieves a list of orders
Request
GET /orders?filters[statuses]=700,900&filters[invoicedFrom]=20200101&filters[invoicedTo]=20200101&page[number]=1
Filter | Description | Example |
---|---|---|
filter[statuses] | CSV of statuses | 700,900 |
filter[invoicedFrom] | Invoiced Date Range (Ymd) | 20200101 |
filter[invoicedTo] | Invoiced Date Range (Ymd) | 20200101 |
filter[createdFrom] | Record Created Date Range (Ymd) | 20200101 |
filter[createdTo[] | Record Created Date Range (Ymd) | 20200101 |
page[number] | page of results | 1 |
Response
- An array of 'order' resource will be returned.
- DateTime is represented as
YmdHis
- Orders can exist with being invoiced
[
{
"id": 123,
"description": "ABC LTD",
"created_at": 20200101095500,
"updated_at": 20200103123518,
"invoiced_at": 20200101101836,
"cancelled_at": "",
"status": 700,
"mlc_status": 700,
"net": 17.98,
"gross": 19.58
},
]
2.0 GET /orders/[order-id]/orderlines
Retrieves a list of order contents
Request
GET /orders/123/orderlines
Response
An array of 'orderline' resource will be returned
[
{
"order_id": 123,
"description": "",
"quantity": 1,
"price": 2.00,
"tax": 1.00,
"product": {
"name": "Limited Company Formation",
"is_service": 0,
"is_incorporation": 1,
"taxable": 1
},
"package": {
"name": "Bronze Package"
},
"incorporation": {
"incorporation_id": 456,
"company_name": "ABC LTD"
},
"officer": {
"company_name": null,
"first_name": null,
"last_name": null
}
},
{
"order_id": 123,
"description": "",
"quantity": 1,
"price": 2.00,
"tax": 1.00,
"product": {
"name": "Service Address",
"is_service": 1,
"is_incorporation": 0,
"taxable": 1
},
"package": {
"name": "Bronze Package"
},
"incorporation": {
"incorporation_id": 456,
"company_name": "ABC LTD"
},
"officer": {
"company_name": null,
"first_name": 'Joe',
"last_name": 'Bloggs'
}
},
]