Orders
When a Cart has undergone checkout, it will be treated as an Order.
Schema
An order that has been placed.
Orders are a collection record for requests, a means by which requests are grouped together.
Orders themselves do nothing after their checkout.
Type Object
| Name | Type | Description |
|---|---|---|
error_code |
OrderErrorCode | |
id |
String(format:ulid) | Desc. id |
inserted_at |
String(format:date-time) | An ISO8601 formatted timestamp |
name |
String(3..255) | Desc. name |
notes |
String(0..65535) | Desc. notes |
status |
OrderStatus | |
updated_at |
String(format:date-time) | An ISO8601 formatted timestamp |
Desc. id
Another format for UUID, used primarily for tasks, requests and messages.
Desc. name
Display name for Order.
Desc. notes
Any additional text about the order, useful for informing someone about the order's purpose.
Example
{
"error_code": "OK",
"id": "01EH2Y28M6KXG14QMPM3HSP1Y0",
"inserted_at": "2021-08-13T04:08:44.762841Z",
"name": "Add Messaging to 10 Numbers",
"notes": "Order for Client XYZ\n",
"status": "NEW",
"updated_at": "2021-08-13T04:08:44.762841Z"
}
API
Updating An Existing Order
PATCH /api/v1/orders/{id} HTTP/1.1
Update an existing order.
Only the name and notes can be updated on the order once it has been checked out.
Path Parameters
| Name | Type | Description |
|---|---|---|
| id | String! | Order ID |
Request application/json
PATCH /api/v1/orders/{id} HTTP/1.1
Accept: application/json
Content-Type: application/json
Content-Length: 119
{
"data": {
"name": "Add Messaging to 10 Numbers",
"notes": "Order for Client XYZ\n"
},
"type": "order"
}
Response 200
application/json
HTTP/1.1 200
Content-Type: application/json
Content-Length: 303
{
"data": {
"error_code": "OK",
"id": "01EH2Y28M6KXG14QMPM3HSP1Y0",
"inserted_at": "2021-08-13T04:08:44.762841Z",
"name": "Add Messaging to 10 Numbers",
"notes": "Order for Client XYZ\n",
"status": "NEW",
"updated_at": "2021-08-13T04:08:44.762841Z"
},
"type": "order"
}
Response 403
application/json
HTTP/1.1 403
Content-Type: application/json
Content-Length: 312
{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "No scope available to user role",
"params": {
"action": "index",
"level": "guest",
"resource": "resource"
},
"sub_code": "none",
"title": "Access Denied, no scope available"
}
]
}
Response 404
application/json
HTTP/1.1 404
Content-Type: application/json
Content-Length: 314
{
"errors": [
{
"code": "not_found",
"detail": "The specified resource could not be found",
"params": {
"resource": {
"id": "3fbb573a-6049-44a0-a12c-d3a1ffae0b69",
"type": "user"
}
},
"sub_code": "none",
"title": "Not Found"
}
]
}
List Existing Orders
GET /api/v1/orders HTTP/1.1
Retrieve a list of orders, ordered by descending order by inserted_at (i.e. most recent is first)
Query Parameters
| Name | Type | Description |
|---|---|---|
| first | Integer | Query Desc. first |
| last | Integer | Query Desc. last |
| after | String | Query Desc. after |
| before | String | Query Desc. before |
Query Desc. first
The number of items to return starting from the 'after' cursor
Query Desc. last
The number of items to return behind the 'before' cursor
Query Desc. after
The cursor representing the starting point of a 'first' based paging
Query Desc. before
The cursor representing the starting point of a 'last' based paging
Request
GET /api/v1/orders HTTP/1.1
Accept: application/json
Response 200
application/json
HTTP/1.1 200
Content-Type: application/json
Content-Length: 512
{
"count": 1,
"page_info": {
"first": "string",
"has_next_page": true,
"has_previous_page": true,
"last": "string"
},
"results": [
{
"data": {
"error_code": "OK",
"id": "01EH2Y28M6KXG14QMPM3HSP1Y0",
"inserted_at": "2021-08-13T04:08:44.762841Z",
"name": "Add Messaging to 10 Numbers",
"notes": "Order for Client XYZ\n",
"status": "NEW",
"updated_at": "2021-08-13T04:08:44.762841Z"
},
"type": "order"
}
]
}
Response 403
application/json
HTTP/1.1 403
Content-Type: application/json
Content-Length: 312
{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "No scope available to user role",
"params": {
"action": "index",
"level": "guest",
"resource": "resource"
},
"sub_code": "none",
"title": "Access Denied, no scope available"
}
]
}
Get Order
GET /api/v1/orders/{id} HTTP/1.1
Lookup an order by ID
Path Parameters
| Name | Type | Description |
|---|---|---|
| id | String! | Order ID |
Request
GET /api/v1/orders/{id} HTTP/1.1
Accept: application/json
Response 200
application/json
HTTP/1.1 200
Content-Type: application/json
Content-Length: 303
{
"data": {
"error_code": "OK",
"id": "01EH2Y28M6KXG14QMPM3HSP1Y0",
"inserted_at": "2021-08-13T04:08:44.762841Z",
"name": "Add Messaging to 10 Numbers",
"notes": "Order for Client XYZ\n",
"status": "NEW",
"updated_at": "2021-08-13T04:08:44.762841Z"
},
"type": "order"
}
Response 403
application/json
HTTP/1.1 403
Content-Type: application/json
Content-Length: 312
{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "No scope available to user role",
"params": {
"action": "index",
"level": "guest",
"resource": "resource"
},
"sub_code": "none",
"title": "Access Denied, no scope available"
}
]
}
Response 404
application/json
HTTP/1.1 404
Content-Type: application/json
Content-Length: 314
{
"errors": [
{
"code": "not_found",
"detail": "The specified resource could not be found",
"params": {
"resource": {
"id": "3fbb573a-6049-44a0-a12c-d3a1ffae0b69",
"type": "user"
}
},
"sub_code": "none",
"title": "Not Found"
}
]
}