1 get:
2 operationId: GetDraftOrdersId
3 summary: Get a Draft Order
4 description: >-
5 Retrieve a draft order by its ID. You can expand the draft order's relations
6 or select the fields that should be returned using the query parameters.
7 x-authenticated: true
8 parameters:
9 - name: id
10 in: path
11 description: The draft order's ID.
12 required: true
13 schema:
14 type: string
15 - name: fields
16 in: query
17 description: >-
18 Comma-separated fields that should be included in the returned data.
19
20 if a field is prefixed with `+` it will be added to the default fields,
21 using `-` will remove it from the default fields.
22
23 without prefix it will replace the entire default fields.
24 required: false
25 schema:
26 type: string
27 title: fields
28 description: >-
29 Comma-separated fields that should be included in the returned data.
30 If a field is prefixed with `+` it will be added to the default
31 fields, using `-` will remove it from the default fields. Without
32 prefix it will replace the entire default fields.
33 externalDocs:
34 url: '#select-fields-and-relations'
35 security:
36 - api_token: []
37 - cookie_auth: []
38 - jwt_token: []
39 x-codeSamples:
40 - lang: JavaScript
41 label: JS SDK
42 source:
43 $ref: ../code_samples/JavaScript/admin_draft-orders_{id}/get.js
44 - lang: Shell
45 label: cURL
46 source:
47 $ref: ../code_samples/Shell/admin_draft-orders_{id}/get.sh
48 tags:
49 - Draft Orders
50 responses:
51 '200':
52 description: OK
53 content:
54 application/json:
55 schema:
56 $ref: ../components/schemas/AdminDraftOrderResponse.yaml
57 '400':
58 $ref: ../components/responses/400_error.yaml
59 '401':
60 $ref: ../components/responses/unauthorized.yaml
61 '404':
62 $ref: ../components/responses/not_found_error.yaml
63 '409':
64 $ref: ../components/responses/invalid_state_error.yaml
65 '422':
66 $ref: ../components/responses/invalid_request_error.yaml
67 '500':
68 $ref: ../components/responses/500_error.yaml
69 x-workflow: getOrderDetailWorkflow
70 x-events: []
71 post:
72 operationId: PostDraftOrdersId
73 summary: Update a Draft Order
74 description: >-
75 Update a draft order's details. This doesn't include updating the draft
76 order's items, shipping methods, or promotions. To update those, you need to
77 create an edit that you can later request or confirm.
78 x-authenticated: true
79 parameters:
80 - name: id
81 in: path
82 description: The draft order's ID.
83 required: true
84 schema:
85 type: string
86 - name: fields
87 in: query
88 description: >-
89 Comma-separated fields that should be included in the returned data.
90
91 if a field is prefixed with `+` it will be added to the default fields,
92 using `-` will remove it from the default fields.
93
94 without prefix it will replace the entire default fields.
95 required: false
96 schema:
97 type: string
98 title: fields
99 description: >-
100 Comma-separated fields that should be included in the returned data.
101 If a field is prefixed with `+` it will be added to the default
102 fields, using `-` will remove it from the default fields. Without
103 prefix it will replace the entire default fields.
104 externalDocs:
105 url: '#select-fields-and-relations'
106 security:
107 - api_token: []
108 - cookie_auth: []
109 - jwt_token: []
110 requestBody:
111 content:
112 application/json:
113 schema:
114 $ref: ../components/schemas/AdminUpdateDraftOrder.yaml
115 x-codeSamples:
116 - lang: JavaScript
117 label: JS SDK
118 source:
119 $ref: ../code_samples/JavaScript/admin_draft-orders_{id}/post.js
120 - lang: Shell
121 label: cURL
122 source:
123 $ref: ../code_samples/Shell/admin_draft-orders_{id}/post.sh
124 tags:
125 - Draft Orders
126 responses:
127 '200':
128 description: OK
129 content:
130 application/json:
131 schema:
132 $ref: ../components/schemas/AdminDraftOrderResponse.yaml
133 '400':
134 $ref: ../components/responses/400_error.yaml
135 '401':
136 $ref: ../components/responses/unauthorized.yaml
137 '404':
138 $ref: ../components/responses/not_found_error.yaml
139 '409':
140 $ref: ../components/responses/invalid_state_error.yaml
141 '422':
142 $ref: ../components/responses/invalid_request_error.yaml
143 '500':
144 $ref: ../components/responses/500_error.yaml
145 x-workflow: updateDraftOrderWorkflow
146 x-events:
147 - name: order.updated
148 payload: |-
149 ```ts
150 {
151 id, // The ID of the order
152 }
153 ```
154 description: |-
155 Emitted when the details of an order or draft order is updated. This
156 doesn't include updates made by an edit.
157 deprecated: false
158 delete:
159 operationId: DeleteDraftOrdersId
160 summary: Delete a Draft Order
161 description: Delete a draft order.
162 x-authenticated: true
163 parameters:
164 - name: id
165 in: path
166 description: The draft order's ID.
167 required: true
168 schema:
169 type: string
170 security:
171 - api_token: []
172 - cookie_auth: []
173 - jwt_token: []
174 x-codeSamples:
175 - lang: JavaScript
176 label: JS SDK
177 source:
178 $ref: ../code_samples/JavaScript/admin_draft-orders_{id}/delete.js
179 - lang: Shell
180 label: cURL
181 source:
182 $ref: ../code_samples/Shell/admin_draft-orders_{id}/delete.sh
183 tags:
184 - Draft Orders
185 responses:
186 '200':
187 description: OK
188 '400':
189 $ref: ../components/responses/400_error.yaml
190 '401':
191 $ref: ../components/responses/unauthorized.yaml
192 '404':
193 $ref: ../components/responses/not_found_error.yaml
194 '409':
195 $ref: ../components/responses/invalid_state_error.yaml
196 '422':
197 $ref: ../components/responses/invalid_request_error.yaml
198 '500':
199 $ref: ../components/responses/500_error.yaml
200 x-workflow: deleteDraftOrdersWorkflow
201 x-events: []
202 x-since: 2.8.4