1 get:
2 operationId: GetOrdersId
3 summary: Get an Order
4 description: >-
5 Retrieve an order by its ID. You can expand the order's relations or select
6 the fields that should be returned.
7 x-authenticated: true
8 parameters:
9 - name: id
10 in: path
11 description: The 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. if
19 a field is prefixed with `+` it will be added to the default fields,
20 using `-` will remove it from the default fields. without prefix it will
21 replace the entire default fields.
22 required: false
23 schema:
24 type: string
25 title: fields
26 description: >-
27 Comma-separated fields that should be included in the returned data.
28 if a field is prefixed with `+` it will be added to the default
29 fields, using `-` will remove it from the default fields. without
30 prefix it will replace the entire default fields.
31 externalDocs:
32 url: '#select-fields-and-relations'
33 - name: version
34 in: query
35 description: The order's version.
36 required: false
37 schema:
38 type: number
39 title: version
40 description: The order's version.
41 security:
42 - api_token: []
43 - cookie_auth: []
44 - jwt_token: []
45 x-codeSamples:
46 - lang: JavaScript
47 label: JS SDK
48 source:
49 $ref: ../code_samples/JavaScript/admin_orders_{id}/get.js
50 - lang: Shell
51 label: cURL
52 source:
53 $ref: ../code_samples/Shell/admin_orders_{id}/get.sh
54 tags:
55 - Orders
56 responses:
57 '200':
58 description: OK
59 content:
60 application/json:
61 schema:
62 $ref: ../components/schemas/AdminOrderResponse.yaml
63 '400':
64 $ref: ../components/responses/400_error.yaml
65 '401':
66 $ref: ../components/responses/unauthorized.yaml
67 '404':
68 $ref: ../components/responses/not_found_error.yaml
69 '409':
70 $ref: ../components/responses/invalid_state_error.yaml
71 '422':
72 $ref: ../components/responses/invalid_request_error.yaml
73 '500':
74 $ref: ../components/responses/500_error.yaml
75 x-workflow: getOrderDetailWorkflow
76 x-events: []
77 post:
78 operationId: PostOrdersId
79 summary: Update Order
80 description: >-
81 Update an order's details.
82
83
84 Updating the order's shipping or billing address doesn't recalculate the
85 order's taxes or totals; the existing tax lines are preserved as-is. You
86 also can't change the address's `country_code`.
87 x-authenticated: true
88 parameters:
89 - name: id
90 in: path
91 description: The order's ID.
92 required: true
93 schema:
94 type: string
95 - name: version
96 in: query
97 description: >-
98 Retrieve a specific version of the order. If no version is provided, the
99 latest version will be retrieved.
100 required: false
101 schema:
102 type: number
103 title: version
104 description: The order's version.
105 - name: fields
106 in: query
107 description: >-
108 Comma-separated fields that should be included in the returned data. If
109 a field is prefixed with `+` it will be added to the default fields,
110 using `-` will remove it from the default fields. Without prefix it will
111 replace the entire default fields.
112 required: false
113 schema:
114 type: string
115 title: fields
116 description: >-
117 Comma-separated fields that should be included in the returned data.
118 If a field is prefixed with `+` it will be added to the default
119 fields, using `-` will remove it from the default fields. Without
120 prefix it will replace the entire default fields.
121 externalDocs:
122 url: '#select-fields-and-relations'
123 security:
124 - api_token: []
125 - cookie_auth: []
126 - jwt_token: []
127 requestBody:
128 content:
129 application/json:
130 schema:
131 $ref: ../components/schemas/AdminUpdateOrder.yaml
132 x-codeSamples:
133 - lang: JavaScript
134 label: JS SDK
135 source:
136 $ref: ../code_samples/JavaScript/admin_orders_{id}/post.js
137 - lang: Shell
138 label: cURL
139 source:
140 $ref: ../code_samples/Shell/admin_orders_{id}/post.sh
141 tags:
142 - Orders
143 responses:
144 '200':
145 description: OK
146 content:
147 application/json:
148 schema:
149 $ref: ../components/schemas/AdminOrderResponse.yaml
150 '400':
151 $ref: ../components/responses/400_error.yaml
152 '401':
153 $ref: ../components/responses/unauthorized.yaml
154 '404':
155 $ref: ../components/responses/not_found_error.yaml
156 '409':
157 $ref: ../components/responses/invalid_state_error.yaml
158 '422':
159 $ref: ../components/responses/invalid_request_error.yaml
160 '500':
161 $ref: ../components/responses/500_error.yaml
162 x-workflow: updateOrderWorkflow
163 x-events:
164 - name: order.updated
165 payload: |-
166 ```ts
167 {
168 id, // The ID of the order
169 }
170 ```
171 description: |-
172 Emitted when the details of an order or draft order is updated. This
173 doesn't include updates made by an edit.
174 deprecated: false