Orders

Create Order

POST

This endpoint is for creating orders linked to either a patient or a site, with order content specified by item or kit IDs and an association with a patient or site ID. Optional attributes offer further customization, such as tracking through external order IDs.\n\nFor a comprehensive guide on utilizing this endpoint, including examples, required and optional attributes, and additional functionalities like listing and fetching orders, visit the Order Management Guide.


For more information see the Order Model.

Request

This endpoint expects an object.
id
integerOptional
Unique identifier for the order
externalOrderIds
list of stringsOptional
An array of order ids specified by the client
patient
objectOptional
The patient receiving the order. Exactly one of patient or site must be not null.
site
objectOptional
The site receiving the order. Exactly one of patient or site must be not null.
currentStatus
enumOptional
The current status of the order
orderItems
list of objectsOptional
Array of items on the order. At least one of orderItems or orderKits must be not null.
orderKits
list of objectsOptional
Array of order kits on the order. At least one of orderItems or orderKits must be not null.
orderEvents
list of objectsOptional
Array of order events. These are the status updates for the order.
trackingNumbers
list of objectsOptional
Array of tracking numbers for the order.
devices
list of objectsOptional
The order item devices
packedKits
list of objectsOptional
The kits packed in the order

Response

This endpoint returns an object
id
integerOptional
Unique identifier for the order
externalOrderIds
list of stringsOptional
An array of order ids specified by the client
patient
objectOptional
The patient receiving the order. Exactly one of patient or site must be not null.
site
objectOptional
The site receiving the order. Exactly one of patient or site must be not null.
currentStatus
enumOptional
The current status of the order
orderItems
list of objectsOptional
Array of items on the order. At least one of orderItems or orderKits must be not null.
orderKits
list of objectsOptional
Array of order kits on the order. At least one of orderItems or orderKits must be not null.
orderEvents
list of objectsOptional
Array of order events. These are the status updates for the order.
trackingNumbers
list of objectsOptional
Array of tracking numbers for the order.
devices
list of objectsOptional
The order item devices
packedKits
list of objectsOptional
The kits packed in the order
POST
1curl -X POST https://app.impiloplatform.com/api/v3/order \
2 -H "Impilo-API-Key: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "externalOrderIds": [
6 "xyz_123_0",
7 "xyz_123_1",
8 "xyz_123_2",
9 "xyz_123_3"
10 ],
11 "patient": {
12 "id": 1234,
13 "sex": "unknown"
14 },
15 "orderItems": [
16 {
17 "item": {
18 "id": 1000
19 },
20 "count": 10
21 },
22 {
23 "item": {
24 "id": 1001
25 },
26 "count": 10
27 },
28 {
29 "item": {
30 "id": 1002
31 },
32 "count": 10
33 },
34 {
35 "item": {
36 "id": 1003
37 },
38 "count": 10
39 }
40 ],
41 "orderKits": [
42 {
43 "kit": {
44 "id": 1000
45 },
46 "count": 10
47 },
48 {
49 "kit": {
50 "id": 1001
51 },
52 "count": 10
53 },
54 {
55 "kit": {
56 "id": 1002
57 },
58 "count": 10
59 },
60 {
61 "kit": {
62 "id": 1003
63 },
64 "count": 10
65 }
66 ]
67}'
200
Successful
1{
2 "id": 1,
3 "externalOrderIds": [
4 "externalOrderIds"
5 ],
6 "patient": {
7 "id": 1,
8 "externalIdentifier": "1234abcd",
9 "firstName": "John",
10 "lastName": "Doe",
11 "dateOfBirth": "1980-01-01T00:00:00Z",
12 "email": "john.doe@example.com",
13 "phoneNumber": "+1234567890",
14 "archived": true,
15 "address": {
16 "lineOne": "lineOne",
17 "lineTwo": "lineTwo",
18 "lineThree": "lineThree",
19 "city": "city",
20 "state": "state",
21 "zipCode": "zipCode",
22 "country": "country",
23 "note": "note"
24 },
25 "site": {
26 "id": 1,
27 "name": "name",
28 "active": true
29 },
30 "enrolled": true,
31 "sex": "female"
32 },
33 "site": {
34 "id": 1,
35 "name": "name",
36 "active": true,
37 "address": {
38 "lineOne": "lineOne",
39 "lineTwo": "lineTwo",
40 "lineThree": "lineThree",
41 "city": "city",
42 "state": "state",
43 "zipCode": "zipCode",
44 "country": "country",
45 "note": "note"
46 }
47 },
48 "currentStatus": "reconfirmAddress",
49 "orderItems": [
50 {
51 "item": {
52 "id": 1
53 },
54 "count": 1
55 }
56 ],
57 "orderKits": [
58 {
59 "count": 1
60 }
61 ],
62 "orderEvents": [
63 {
64 "name": "name",
65 "eventTimestamp": "eventTimestamp"
66 }
67 ],
68 "trackingNumbers": [
69 {
70 "carrier": "carrier",
71 "value": "value"
72 }
73 ],
74 "devices": [
75 {
76 "id": 1,
77 "item": {
78 "id": 1
79 },
80 "currentStatus": "currentStatus",
81 "used": true,
82 "currentPatient": {
83 "id": 1,
84 "externalIdentifier": "1234abcd",
85 "firstName": "John",
86 "lastName": "Doe",
87 "dateOfBirth": "1980-01-01T00:00:00Z",
88 "email": "john.doe@example.com",
89 "phoneNumber": "+1234567890",
90 "archived": true,
91 "sex": "female"
92 },
93 "site": {
94 "id": 1
95 },
96 "lastHealthCheck": "lastHealthCheck",
97 "deviceIdentifiers": [
98 {}
99 ],
100 "deviceEvents": [
101 {}
102 ],
103 "externalIdentifier": "externalIdentifier"
104 }
105 ],
106 "packedKits": [
107 {
108 "devices": [
109 {
110 "id": 1
111 }
112 ]
113 }
114 ]
115}