|
1
|
{ |
|
2
|
"GET /admin/api-keys": { |
|
3
|
"js-sdk": "sdk.admin.apiKey.list()\n.then(({ api_keys, count, limit, offset }) => {\n console.log(api_keys)\n})" |
|
4
|
}, |
|
5
|
"POST /admin/api-keys": { |
|
6
|
"js-sdk": "sdk.admin.apiKey.create({\n title: \"Development\",\n type: \"publishable\"\n})\n.then(({ api_key }) => {\n console.log(api_key)\n})" |
|
7
|
}, |
|
8
|
"POST /admin/api-keys/{id}/revoke": { |
|
9
|
"js-sdk": "sdk.admin.apiKey.revoke(\"apk_123\")\n.then(({ api_key }) => {\n console.log(api_key)\n})" |
|
10
|
}, |
|
11
|
"GET /admin/api-keys/{id}": { |
|
12
|
"js-sdk": "sdk.admin.apiKey.retrieve(\"apk_123\")\n.then(({ api_key }) => {\n console.log(api_key)\n})" |
|
13
|
}, |
|
14
|
"POST /admin/api-keys/{id}": { |
|
15
|
"js-sdk": "sdk.admin.apiKey.update(\"apk_123\", {\n title: \"Development\"\n})\n.then(({ api_key }) => {\n console.log(api_key)\n})" |
|
16
|
}, |
|
17
|
"DELETE /admin/api-keys/{id}": { |
|
18
|
"js-sdk": "sdk.admin.apiKey.delete(\"apk_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
19
|
}, |
|
20
|
"POST /admin/api-keys/{id}/sales-channels": { |
|
21
|
"js-sdk": "sdk.admin.apiKey.batchSalesChannels(\"apk_123\", {\n add: [\"sc_123\"],\n remove: [\"sc_321\"]\n})\n.then(({ api_key }) => {\n console.log(api_key)\n})" |
|
22
|
}, |
|
23
|
"GET /admin/campaigns/{id}": { |
|
24
|
"js-sdk": "sdk.admin.campaign.retrieve(\"procamp_123\")\n.then(({ campaign }) => {\n console.log(campaign)\n})" |
|
25
|
}, |
|
26
|
"GET /admin/campaigns": { |
|
27
|
"js-sdk": "sdk.admin.campaign.list()\n.then(({ campaigns, count, limit, offset }) => {\n console.log(campaigns)\n})" |
|
28
|
}, |
|
29
|
"POST /admin/campaigns": { |
|
30
|
"js-sdk": "sdk.admin.campaign.create({\n name: \"Summer Campaign\"\n})\n.then(({ campaign }) => {\n console.log(campaign)\n})" |
|
31
|
}, |
|
32
|
"POST /admin/campaigns/{id}": { |
|
33
|
"js-sdk": "sdk.admin.campaign.update(\"procamp_123\", {\n name: \"Summer Campaign\"\n})\n.then(({ campaign }) => {\n console.log(campaign)\n})" |
|
34
|
}, |
|
35
|
"DELETE /admin/campaigns/{id}": { |
|
36
|
"js-sdk": "sdk.admin.campaign.delete(\"procamp_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
37
|
}, |
|
38
|
"POST /admin/campaigns/{id}/promotions": { |
|
39
|
"js-sdk": "sdk.admin.campaign.batchPromotions(\"procamp_123\", {\n add: [\"prom_123\", \"prom_456\"],\n remove: [\"prom_789\"]\n})\n.then(({ campaign }) => {\n console.log(campaign)\n})" |
|
40
|
}, |
|
41
|
"GET /admin/claims": { |
|
42
|
"js-sdk": "sdk.admin.claim.list()\n.then(({ claims, count, limit, offset }) => {\n console.log(claims)\n})" |
|
43
|
}, |
|
44
|
"GET /admin/claims/{id}": { |
|
45
|
"js-sdk": "sdk.admin.claim.retrieve(\"claim_123\")\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
46
|
}, |
|
47
|
"POST /admin/claims": { |
|
48
|
"js-sdk": "sdk.admin.claim.create({\n type: \"refund\",\n order_id: \"order_123\",\n})\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
49
|
}, |
|
50
|
"POST /admin/claims/{id}/cancel": { |
|
51
|
"js-sdk": "sdk.admin.claim.cancel(\"claim_123\")\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
52
|
}, |
|
53
|
"POST /admin/claims/{id}/claim-items": { |
|
54
|
"js-sdk": "sdk.admin.claim.addItems(\"claim_123\", {\n items: [\n {\n id: \"orli_123\",\n quantity: 1\n }\n ]\n})\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
55
|
}, |
|
56
|
"POST /admin/claims/{id}/claim-items/{actionid}": { |
|
57
|
"js-sdk": "sdk.admin.claim.updateItem(\n \"claim_123\", \n \"ordchact_123\",\n {\n quantity: 1\n }\n )\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
58
|
}, |
|
59
|
"DELETE /admin/claims/{id}/claim-items/{actionid}": { |
|
60
|
"js-sdk": "sdk.admin.claim.removeItem(\n \"claim_123\", \n \"ordchact_123\",\n )\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
61
|
}, |
|
62
|
"POST /admin/claims/{id}/inbound/items": { |
|
63
|
"js-sdk": "sdk.admin.claim.addInboundItems(\n \"claim_123\", \n {\n items: [\n {\n id: \"orli_123\",\n quantity: 1\n }\n ]\n },\n )\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
64
|
}, |
|
65
|
"POST /admin/claims/{id}/inbound/items/{actionid}": { |
|
66
|
"js-sdk": "sdk.admin.claim.updateInboundItem(\n \"claim_123\", \n \"ordchact_123\",\n {\n quantity: 1\n },\n )\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
67
|
}, |
|
68
|
"DELETE /admin/claims/{id}/inbound/items/{actionid}": { |
|
69
|
"js-sdk": "sdk.admin.claim.removeInboundItem(\n \"claim_123\", \n \"ordchact_123\",\n )\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
70
|
}, |
|
71
|
"POST /admin/claims/{id}/inbound/shipping-method": { |
|
72
|
"js-sdk": "sdk.admin.claim.addInboundShipping(\n \"claim_123\", \n {\n shipping_option_id: \"so_123\",\n custom_amount: 10\n },\n )\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
73
|
}, |
|
74
|
"POST /admin/claims/{id}/inbound/shipping-method/{actionid}": { |
|
75
|
"js-sdk": "sdk.admin.claim.updateInboundShipping(\n \"claim_123\", \n \"ordchact_123\",\n {\n custom_amount: 10\n },\n )\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
76
|
}, |
|
77
|
"DELETE /admin/claims/{id}/inbound/shipping-method/{actionid}": { |
|
78
|
"js-sdk": "sdk.admin.claim.deleteInboundShipping(\n \"claim_123\", \n \"ordchact_123\",\n )\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
79
|
}, |
|
80
|
"POST /admin/claims/{id}/outbound/items": { |
|
81
|
"js-sdk": "sdk.admin.claim.addOutboundItems(\n \"claim_123\", \n {\n items: [{\n id: \"orli_123\",\n quantity: 1\n }]\n },\n )\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
82
|
}, |
|
83
|
"POST /admin/claims/{id}/outbound/items/{actionid}": { |
|
84
|
"js-sdk": "sdk.admin.claim.updateOutboundItem(\n \"claim_123\", \n \"ordchact_123\",\n {\n quantity: 1\n },\n )\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
85
|
}, |
|
86
|
"DELETE /admin/claims/{id}/outbound/items/{actionid}": { |
|
87
|
"js-sdk": "sdk.admin.claim.removeOutboundItem(\n \"claim_123\", \n \"ordchact_123\",\n)\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
88
|
}, |
|
89
|
"POST /admin/claims/{id}/outbound/shipping-method": { |
|
90
|
"js-sdk": "sdk.admin.claim.addOutboundShipping(\n \"claim_123\", \n {\n shipping_option_id: \"so_123\",\n custom_amount: 10\n },\n)\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
91
|
}, |
|
92
|
"POST /admin/claims/{id}/outbound/shipping-method/{actionid}": { |
|
93
|
"js-sdk": "sdk.admin.claim.updateOutboundShipping(\n \"claim_123\", \n \"ordchact_123\",\n {\n custom_amount: 10\n },\n)\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
94
|
}, |
|
95
|
"DELETE /admin/claims/{id}/outbound/shipping-method/{actionid}": { |
|
96
|
"js-sdk": "sdk.admin.claim.deleteOutboundShipping(\n \"claim_123\", \n \"ordchact_123\",\n)\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
97
|
}, |
|
98
|
"POST /admin/claims/{id}/request": { |
|
99
|
"js-sdk": "sdk.admin.claim.request(\n \"claim_123\", \n {},\n)\n.then(({ claim }) => {\n console.log(claim)\n})" |
|
100
|
}, |
|
101
|
"DELETE /admin/claims/{id}/request": { |
|
102
|
"js-sdk": "sdk.admin.claim.cancelRequest(\n \"claim_123\", \n)\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
103
|
}, |
|
104
|
"GET /admin/currencies": { |
|
105
|
"js-sdk": "sdk.admin.currency.list()\n.then(({ currencies, count, limit, offset }) => {\n console.log(currencies)\n})" |
|
106
|
}, |
|
107
|
"GET /admin/currencies/{code}": { |
|
108
|
"js-sdk": "sdk.admin.currency.retrieve(\"usd\")\n.then(({ currency }) => {\n console.log(currency)\n})" |
|
109
|
}, |
|
110
|
"POST /admin/customers": { |
|
111
|
"js-sdk": "sdk.admin.customer.create({\n email: \"customer@gmail.com\"\n})\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
112
|
}, |
|
113
|
"POST /admin/customers/{id}": { |
|
114
|
"js-sdk": "sdk.admin.customer.update(\"cus_123\", {\n first_name: \"John\"\n})\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
115
|
}, |
|
116
|
"GET /admin/customers": { |
|
117
|
"js-sdk": "sdk.admin.customer.list()\n.then(({ customers, count, limit, offset }) => {\n console.log(customers)\n})" |
|
118
|
}, |
|
119
|
"GET /admin/customers/{id}": { |
|
120
|
"js-sdk": "sdk.admin.customer.retrieve(\"cus_123\")\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
121
|
}, |
|
122
|
"DELETE /admin/customers/{id}": { |
|
123
|
"js-sdk": "sdk.admin.customer.delete(\"cus_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
124
|
}, |
|
125
|
"POST /admin/customers/{id}/customer-groups": { |
|
126
|
"js-sdk": "sdk.admin.customer.batchCustomerGroups(\"cus_123\", {\n add: [\"cusgroup_123\"],\n remove: [\"cusgroup_321\"]\n})\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
127
|
}, |
|
128
|
"POST /admin/customers/{id}/addresses": { |
|
129
|
"js-sdk": "sdk.admin.customer.createAddress(\"cus_123\", {\n address_1: \"123 Main St\",\n city: \"Anytown\",\n country_code: \"US\",\n postal_code: \"12345\"\n})\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
130
|
}, |
|
131
|
"POST /admin/customers/{id}/addresses/{addressid}": { |
|
132
|
"js-sdk": "sdk.admin.customer.updateAddress(\"cus_123\", \"cus_addr_123\", {\n address_1: \"123 Main St\",\n city: \"Anytown\",\n country_code: \"US\",\n postal_code: \"12345\"\n})\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
133
|
}, |
|
134
|
"DELETE /admin/customers/{id}/addresses/{addressid}": { |
|
135
|
"js-sdk": "sdk.admin.customer.deleteAddress(\"cus_123\", \"cus_addr_123\")\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
136
|
}, |
|
137
|
"GET /admin/customers/{id}/addresses/{addressid}": { |
|
138
|
"js-sdk": "sdk.admin.customer.retrieveAddress(\"cus_123\", \"cus_addr_123\")\n.then(({ address }) => {\n console.log(address)\n})" |
|
139
|
}, |
|
140
|
"GET /admin/customers/{id}/addresses": { |
|
141
|
"js-sdk": "sdk.admin.customer.listAddresses(\"cus_123\")\n.then(({ addresses }) => {\n console.log(addresses)\n})" |
|
142
|
}, |
|
143
|
"GET /admin/customer-groups/{id}": { |
|
144
|
"js-sdk": "sdk.admin.customerGroup.retrieve(\"cusgroup_123\")\n.then(({ customer_group }) => {\n console.log(customer_group)\n})" |
|
145
|
}, |
|
146
|
"GET /admin/customer-groups": { |
|
147
|
"js-sdk": "sdk.admin.customerGroup.list()\n.then(({ customer_groups, count, limit, offset }) => {\n console.log(customer_groups)\n})" |
|
148
|
}, |
|
149
|
"POST /admin/customer-groups": { |
|
150
|
"js-sdk": "sdk.admin.customerGroup.create({\n name: \"VIP\"\n})\n.then(({ customer_group }) => {\n console.log(customer_group)\n})" |
|
151
|
}, |
|
152
|
"POST /admin/customer-groups/{id}": { |
|
153
|
"js-sdk": "sdk.admin.customerGroup.update(\"cusgroup_123\", {\n name: \"VIP\"\n})\n.then(({ customer_group }) => {\n console.log(customer_group)\n})" |
|
154
|
}, |
|
155
|
"DELETE /admin/customer-groups/{id}": { |
|
156
|
"js-sdk": "sdk.admin.customerGroup.delete(\"cusgroup_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
157
|
}, |
|
158
|
"POST /admin/customer-groups/{id}/customers": { |
|
159
|
"js-sdk": "sdk.admin.customerGroup.batchCustomers(\"cusgroup_123\", {\n add: [\"cus_123\"],\n remove: [\"cus_321\"]\n})\n.then(({ customer_group }) => {\n console.log(customer_group)\n})" |
|
160
|
}, |
|
161
|
"GET /admin/draft-orders/{id}": { |
|
162
|
"js-sdk": "sdk.admin.draftOrder.retrieve(\"order_123\")\n.then(({ draft_order }) => {\n console.log(draft_order)\n})" |
|
163
|
}, |
|
164
|
"GET /admin/draft-orders": { |
|
165
|
"js-sdk": "sdk.admin.draftOrder.list()\n.then(({ draft_orders, count, limit, offset }) => {\n console.log(draft_orders)\n})" |
|
166
|
}, |
|
167
|
"POST /admin/draft-orders": { |
|
168
|
"js-sdk": "sdk.admin.draftOrder.create({\n email: \"test@test.com\",\n items: [\n {\n variant_id: \"variant_123\",\n quantity: 1,\n },\n ],\n region_id: \"region_123\",\n sales_channel_id: \"sc_123\",\n})\n.then(({ draft_order }) => {\n console.log(draft_order)\n})" |
|
169
|
}, |
|
170
|
"DELETE /admin/draft-orders/{id}": { |
|
171
|
"js-sdk": "sdk.admin.draftOrder.delete(\"order_123\")\n.then(({ id, object, deleted }) => {\n console.log(id, object, deleted)\n})" |
|
172
|
}, |
|
173
|
"POST /admin/draft-orders/{id}": { |
|
174
|
"js-sdk": "sdk.admin.draftOrder.update(\"order_123\", {\n email: \"test@test.com\",\n})\n.then(({ draft_order }) => {\n console.log(draft_order)\n})" |
|
175
|
}, |
|
176
|
"POST /admin/draft-orders/{id}/convert-to-order": { |
|
177
|
"js-sdk": "sdk.admin.draftOrder.convertToOrder(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" |
|
178
|
}, |
|
179
|
"POST /admin/draft-orders/{id}/edit/items": { |
|
180
|
"js-sdk": "sdk.admin.draftOrder.addItems(\"order_123\", {\n items: [\n {\n variant_id: \"variant_123\",\n quantity: 1,\n },\n ],\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
181
|
}, |
|
182
|
"POST /admin/draft-orders/{id}/edit/items/{actionid}": { |
|
183
|
"js-sdk": "sdk.admin.draftOrder.updateActionItem(\"order_123\", \"action_123\", {\n quantity: 2,\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
184
|
}, |
|
185
|
"DELETE /admin/draft-orders/{id}/edit/items/{actionid}": { |
|
186
|
"js-sdk": "sdk.admin.draftOrder.removeActionItem(\"order_123\", \"action_123\")\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
187
|
}, |
|
188
|
"POST /admin/draft-orders/{id}/edit/items/item/{itemid}": { |
|
189
|
"js-sdk": "sdk.admin.draftOrder.updateItem(\"order_123\", \"item_123\", {\n quantity: 2,\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
190
|
}, |
|
191
|
"POST /admin/draft-orders/{id}/edit/promotions": { |
|
192
|
"js-sdk": "sdk.admin.draftOrder.addPromotions(\"order_123\", {\n promo_codes: [\"PROMO_CODE_1\", \"PROMO_CODE_2\"],\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
193
|
}, |
|
194
|
"DELETE /admin/draft-orders/{id}/edit/promotions": { |
|
195
|
"js-sdk": "sdk.admin.draftOrder.removePromotions(\"order_123\", {\n promo_codes: [\"PROMO_CODE_1\", \"PROMO_CODE_2\"],\n})" |
|
196
|
}, |
|
197
|
"POST /admin/draft-orders/{id}/edit/shipping-methods": { |
|
198
|
"js-sdk": "sdk.admin.draftOrder.addShippingMethod(\"order_123\", {\n shipping_option_id: \"shipping_option_123\",\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
199
|
}, |
|
200
|
"POST /admin/draft-orders/{id}/edit/shipping-methods/{actionid}": { |
|
201
|
"js-sdk": "sdk.admin.draftOrder.updateShippingMethod(\"order_123\", \"action_123\", {\n shipping_option_id: \"shipping_option_123\",\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
202
|
}, |
|
203
|
"DELETE /admin/draft-orders/{id}/edit/shipping-methods/{actionid}": { |
|
204
|
"js-sdk": "sdk.admin.draftOrder.removeShippingMethod(\"order_123\", \"action_123\")\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
205
|
}, |
|
206
|
"DELETE /admin/draft-orders/{id}/edit/shipping-methods/method/{shippingmethodid}": { |
|
207
|
"js-sdk": "sdk.admin.draftOrder.removeShippingMethod(\n \"order_123\", \n \"shipping_method_123\"\n)\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
208
|
}, |
|
209
|
"POST /admin/draft-orders/{id}/edit/shipping-methods/method/{methodid}": { |
|
210
|
"js-sdk": "sdk.admin.draftOrder.updateShippingMethod(\"order_123\", \"sm_123\", {\n shipping_option_id: \"so_123\",\n})\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
211
|
}, |
|
212
|
"POST /admin/draft-orders/{id}/edit": { |
|
213
|
"js-sdk": "sdk.admin.draftOrder.beginEdit(\"order_123\")\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
214
|
}, |
|
215
|
"DELETE /admin/draft-orders/{id}/edit": { |
|
216
|
"js-sdk": "sdk.admin.draftOrder.cancelEdit(\"order_123\")\n.then(({ id, object, deleted }) => {\n console.log(id, object, deleted)\n})" |
|
217
|
}, |
|
218
|
"POST /admin/draft-orders/{id}/edit/request": { |
|
219
|
"js-sdk": "sdk.admin.draftOrder.requestEdit(\"order_123\")\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
220
|
}, |
|
221
|
"POST /admin/draft-orders/{id}/edit/confirm": { |
|
222
|
"js-sdk": "sdk.admin.draftOrder.confirmEdit(\"order_123\")\n.then(({ draft_order_preview }) => {\n console.log(draft_order_preview)\n})" |
|
223
|
}, |
|
224
|
"GET /admin/exchanges": { |
|
225
|
"js-sdk": "sdk.admin.exchange.list()\n.then(({ exchanges, count, limit, offset }) => {\n console.log(exchanges)\n})" |
|
226
|
}, |
|
227
|
"GET /admin/exchanges/{id}": { |
|
228
|
"js-sdk": "sdk.admin.exchange.retrieve(\"exchange_123\")\n.then(({ exchange }) => {\n console.log(exchange)\n})" |
|
229
|
}, |
|
230
|
"POST /admin/exchanges": { |
|
231
|
"js-sdk": "sdk.admin.exchange.create({\n order_id: \"order_123\"\n})\n.then(({ exchange }) => {\n console.log(exchange)\n})" |
|
232
|
}, |
|
233
|
"POST /admin/exchanges/{id}/cancel": { |
|
234
|
"js-sdk": "sdk.admin.exchange.cancel(\"exchange_123\")\n.then(({ exchange }) => {\n console.log(exchange)\n})" |
|
235
|
}, |
|
236
|
"POST /admin/exchanges/{id}/inbound/items": { |
|
237
|
"js-sdk": "sdk.admin.exchange.addInboundItems(\"exchange_123\", {\n items: [{\n id: \"orli_123\",\n quantity: 1\n }]\n})\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
238
|
}, |
|
239
|
"POST /admin/exchanges/{id}/inbound/items/{actionid}": { |
|
240
|
"js-sdk": "sdk.admin.exchange.updateInboundItem(\n \"exchange_123\", \n \"ordchact_123\",\n {\n quantity: 1\n }\n)\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
241
|
}, |
|
242
|
"DELETE /admin/exchanges/{id}/inbound/items/{actionid}": { |
|
243
|
"js-sdk": "sdk.admin.exchange.removeInboundItem(\n \"exchange_123\", \n \"ordchact_123\",\n)\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
244
|
}, |
|
245
|
"POST /admin/exchanges/{id}/inbound/shipping-method": { |
|
246
|
"js-sdk": "sdk.admin.exchange.addInboundShipping(\"exchange_123\", {\n shipping_option_id: \"so_123\"\n})\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
247
|
}, |
|
248
|
"POST /admin/exchanges/{id}/inbound/shipping-method/{actionid}": { |
|
249
|
"js-sdk": "sdk.admin.exchange.updateInboundShipping(\n \"exchange_123\",\n \"ordchact_123\",\n {\n custom_amount: 10\n }\n)\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
250
|
}, |
|
251
|
"DELETE /admin/exchanges/{id}/inbound/shipping-method/{actionid}": { |
|
252
|
"js-sdk": "sdk.admin.exchange.deleteInboundShipping(\n \"exchange_123\",\n \"ordchact_123\",\n)\n.then(({ return: returnData }) => {\n console.log(returnData)\n})" |
|
253
|
}, |
|
254
|
"POST /admin/exchanges/{id}/outbound/items": { |
|
255
|
"js-sdk": "sdk.admin.exchange.addOutboundItems(\"exchange_123\", {\n items: [{\n id: \"variant_123\",\n quantity: 1\n }]\n})\n.then(({ exchange }) => {\n console.log(exchange)\n})" |
|
256
|
}, |
|
257
|
"POST /admin/exchanges/{id}/outbound/items/{actionid}": { |
|
258
|
"js-sdk": "sdk.admin.exchange.updateOutboundItem(\n \"exchange_123\",\n \"ordchact_123\",\n {\n quantity: 1\n }\n)\n.then(({ exchange }) => {\n console.log(exchange)\n})" |
|
259
|
}, |
|
260
|
"DELETE /admin/exchanges/{id}/outbound/items/{actionid}": { |
|
261
|
"js-sdk": "sdk.admin.exchange.removeOutboundItem(\n \"exchange_123\",\n \"ordchact_123\",\n)\n.then(({ exchange }) => {\n console.log(exchange)\n})" |
|
262
|
}, |
|
263
|
"POST /admin/exchanges/{id}/outbound/shipping-method": { |
|
264
|
"js-sdk": "sdk.admin.exchange.addOutboundShipping(\"exchange_123\", {\n shipping_option_id: \"so_123\"\n})\n.then(({ exchange }) => {\n console.log(exchange)\n})" |
|
265
|
}, |
|
266
|
"POST /admin/exchanges/{id}/outbound/shipping-method/{actionid}": { |
|
267
|
"js-sdk": "sdk.admin.exchange.updateOutboundShipping(\n \"exchange_123\",\n \"ordchact_123\",\n {\n custom_amount: 10\n }\n)\n.then(({ exchange }) => {\n console.log(exchange)\n})" |
|
268
|
}, |
|
269
|
"DELETE /admin/exchanges/{id}/outbound/shipping-method/{actionid}": { |
|
270
|
"js-sdk": "sdk.admin.exchange.deleteOutboundShipping(\n \"exchange_123\",\n \"ordchact_123\",\n)\n.then(({ exchange }) => {\n console.log(exchange)\n})" |
|
271
|
}, |
|
272
|
"POST /admin/exchanges/{id}/request": { |
|
273
|
"js-sdk": "sdk.admin.exchange.request(\"exchange_123\", {})\n.then(({ exchange }) => {\n console.log(exchange)\n})" |
|
274
|
}, |
|
275
|
"DELETE /admin/exchanges/{id}/request": { |
|
276
|
"js-sdk": "sdk.admin.exchange.cancel(\"exchange_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
277
|
}, |
|
278
|
"POST /admin/fulfillments": { |
|
279
|
"js-sdk": "sdk.admin.fulfillment.create({\n location_id: \"sloc_123\",\n provider_id: \"my_fulfillment\",\n delivery_address: {\n country_code: \"us\"\n },\n items: [\n {\n title: \"Shirt\",\n sku: \"SHIRT\",\n quantity: 1,\n barcode: \"123\"\n }\n ],\n labels: [],\n order: {},\n order_id: \"order_123\"\n})\n.then(({ fulfillment }) => {\n console.log(fulfillment)\n})" |
|
280
|
}, |
|
281
|
"POST /admin/fulfillments/{id}/cancel": { |
|
282
|
"js-sdk": "sdk.admin.fulfillment.cancel(\"ful_123\")\n.then(({ fulfillment }) => {\n console.log(fulfillment)\n})" |
|
283
|
}, |
|
284
|
"POST /admin/fulfillments/{id}/shipment": { |
|
285
|
"js-sdk": "sdk.admin.fulfillment.createShipment(\"ful_123\", {\n labels: [\n {\n tracking_number: \"123\",\n tracking_url: \"example.com\",\n label_url: \"example.com\"\n }\n ]\n})\n.then(({ fulfillment }) => {\n console.log(fulfillment)\n})" |
|
286
|
}, |
|
287
|
"GET /admin/fulfillment-providers": { |
|
288
|
"js-sdk": "sdk.admin.fulfillmentProvider.list()\n.then(({ fulfillment_providers, count, limit, offset }) => {\n console.log(fulfillment_providers)\n})" |
|
289
|
}, |
|
290
|
"GET /admin/fulfillment-providers/{id}/options": { |
|
291
|
"js-sdk": "sdk.admin.fulfillmentProvider.listFulfillmentOptions(\"fp_123\")\n.then(({ fulfillment_options }) => {\n console.log(fulfillment_options)\n})" |
|
292
|
}, |
|
293
|
"DELETE /admin/fulfillment-sets/{id}": { |
|
294
|
"js-sdk": "sdk.admin.fulfillmentSet.delete(\"fset_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
295
|
}, |
|
296
|
"POST /admin/fulfillment-sets/{id}/service-zones": { |
|
297
|
"js-sdk": "sdk.admin.fulfillmentSet.createServiceZone(\"fset_123\", {\n name: \"Europe Service Zone\",\n geo_zones: [{\n type: \"country\",\n country_code: \"us\"\n }]\n})\n.then(({ fulfillment_set }) => {\n console.log(fulfillment_set)\n})" |
|
298
|
}, |
|
299
|
"GET /admin/fulfillment-sets/{fulfillmentsetid}/service-zones/{servicezoneid}": { |
|
300
|
"js-sdk": "sdk.admin.fulfillmentSet.retrieveServiceZone(\n \"fset_123\",\n \"serzo_123\"\n)\n.then(({ service_zone }) => {\n console.log(service_zone)\n})" |
|
301
|
}, |
|
302
|
"POST /admin/fulfillment-sets/{fulfillmentsetid}/service-zones/{servicezoneid}": { |
|
303
|
"js-sdk": "sdk.admin.fulfillmentSet.updateServiceZone(\n \"fset_123\", \n \"serzo_123\",\n {\n name: \"Europe Service Zone\",\n }\n)\n.then(({ fulfillment_set }) => {\n console.log(fulfillment_set)\n})" |
|
304
|
}, |
|
305
|
"DELETE /admin/fulfillment-sets/{fulfillmentsetid}/service-zones/{servicezoneid}": { |
|
306
|
"js-sdk": "sdk.admin.fulfillmentSet.deleteServiceZone(\n \"fset_123\", \n \"serzo_123\",\n)\n.then(({ deleted, parent: fulfillmentSet }) => {\n console.log(deleted, fulfillmentSet)\n})" |
|
307
|
}, |
|
308
|
"POST /admin/inventory-items": { |
|
309
|
"js-sdk": "sdk.admin.inventoryItem.create({\n sku: \"SHIRT\"\n})\n.then(({ inventory_item }) => {\n console.log(inventory_item)\n})" |
|
310
|
}, |
|
311
|
"POST /admin/inventory-items/{id}": { |
|
312
|
"js-sdk": "sdk.admin.inventoryItem.update(\"iitem_123\", {\n sku: \"SHIRT\"\n})\n.then(({ inventory_item }) => {\n console.log(inventory_item)\n})" |
|
313
|
}, |
|
314
|
"POST /admin/inventory-items/export": { |
|
315
|
"js-sdk": "sdk.admin.inventoryItem.export({})\n.then(({ transaction_id }) => {\n console.log(transaction_id)\n})" |
|
316
|
}, |
|
317
|
"GET /admin/inventory-items": { |
|
318
|
"js-sdk": "sdk.admin.inventoryItem.list()\n.then(({ inventory_items, count, limit, offset }) => {\n console.log(inventory_items)\n})" |
|
319
|
}, |
|
320
|
"GET /admin/inventory-items/{id}": { |
|
321
|
"js-sdk": "sdk.admin.inventoryItem.retrieve(\"iitem_123\")\n.then(({ inventory_item }) => {\n console.log(inventory_item)\n})" |
|
322
|
}, |
|
323
|
"DELETE /admin/inventory-items/{id}": { |
|
324
|
"js-sdk": "sdk.admin.inventoryItem.delete(\"iitem_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
325
|
}, |
|
326
|
"GET /admin/inventory-items/{id}/location-levels": { |
|
327
|
"js-sdk": "sdk.admin.inventoryItem.listLevels(\"iitem_123\")\n.then(({ inventory_levels, count, limit, offset }) => {\n console.log(inventory_levels)\n})" |
|
328
|
}, |
|
329
|
"POST /admin/inventory-items/{id}/location-levels/{locationid}": { |
|
330
|
"js-sdk": "sdk.admin.inventoryItem.updateLevel(\n \"iitem_123\",\n \"sloc_123\",\n {\n stocked_quantity: 10\n }\n)\n.then(({ inventory_item }) => {\n console.log(inventory_item)\n})" |
|
331
|
}, |
|
332
|
"DELETE /admin/inventory-items/{id}/location-levels/{locationid}": { |
|
333
|
"js-sdk": "sdk.admin.inventoryItem.deleteLevel(\n \"iitem_123\",\n \"sloc_123\",\n)\n.then(({ deleted, parent: inventoryItem }) => {\n console.log(deleted, inventoryItem)\n})" |
|
334
|
}, |
|
335
|
"POST /admin/inventory-items/{id}/location-levels/batch": { |
|
336
|
"js-sdk": "sdk.admin.inventoryItem.batchInventoryItemLocationLevels(\"iitem_123\", {\n create: [{\n location_id: \"sloc_123\",\n stocked_quantity: 10\n }],\n delete: [\"ilvl_123\"]\n})\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})" |
|
337
|
}, |
|
338
|
"POST /admin/inventory-items/location-levels/batch": { |
|
339
|
"js-sdk": "sdk.admin.inventoryItem.batchInventoryItemsLocationLevels({\n create: [{\n inventory_item_id: \"iitem_123\",\n location_id: \"sloc_123\",\n stocked_quantity: 10\n }],\n delete: [\"ilvl_123\"]\n})\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})" |
|
340
|
}, |
|
341
|
"POST /admin/invites/accept": { |
|
342
|
"js-sdk": "await sdk.auth.register(\"user\", \"emailpass\", {\n email: \"user@gmail.com\",\n password: \"supersecret\"\n})\n\n// all subsequent requests will use the token in the header\nconst { user } = await sdk.admin.invite.accept(\n {\n email: \"user@gmail.com\",\n first_name: \"John\",\n last_name: \"Smith\",\n invite_token: \"12345...\"\n },\n)" |
|
343
|
}, |
|
344
|
"POST /admin/invites": { |
|
345
|
"js-sdk": "sdk.admin.invite.create({\n email: \"user@gmail.com\",\n})\n.then(({ invite }) => {\n console.log(invite)\n})" |
|
346
|
}, |
|
347
|
"GET /admin/invites/{id}": { |
|
348
|
"js-sdk": "sdk.admin.invite.retrieve(\"invite_123\")\n.then(({ invite }) => {\n console.log(invite)\n})" |
|
349
|
}, |
|
350
|
"GET /admin/invites": { |
|
351
|
"js-sdk": "sdk.admin.invite.list()\n.then(({ invites, count, limit, offset }) => {\n console.log(invites)\n})" |
|
352
|
}, |
|
353
|
"POST /admin/invites/{id}/resend": { |
|
354
|
"js-sdk": "sdk.admin.invite.resend(\"invite_123\")\n.then(({ invite }) => {\n console.log(invite)\n})" |
|
355
|
}, |
|
356
|
"DELETE /admin/invites/{id}": { |
|
357
|
"js-sdk": "sdk.admin.invite.delete(\"invite_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
358
|
}, |
|
359
|
"GET /admin/notifications/{id}": { |
|
360
|
"js-sdk": "sdk.admin.notification.retrieve(\"notif_123\")\n.then(({ notification }) => {\n console.log(notification)\n})" |
|
361
|
}, |
|
362
|
"GET /admin/notifications": { |
|
363
|
"js-sdk": "sdk.admin.notification.list()\n.then(({ notifications, count, limit, offset }) => {\n console.log(notifications)\n})" |
|
364
|
}, |
|
365
|
"GET /admin/orders/{id}": { |
|
366
|
"js-sdk": "sdk.admin.order.retrieve(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" |
|
367
|
}, |
|
368
|
"POST /admin/orders/{id}": { |
|
369
|
"js-sdk": "sdk.admin.order.update(\n \"order_123\",\n {\n email: \"new_email@example.com\",\n shipping_address: {\n first_name: \"John\",\n last_name: \"Doe\",\n address_1: \"123 Main St\",\n }\n }\n)\n.then(({ order }) => {\n console.log(order)\n})" |
|
370
|
}, |
|
371
|
"GET /admin/orders/{id}/preview": { |
|
372
|
"js-sdk": "sdk.admin.order.retrievePreview(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" |
|
373
|
}, |
|
374
|
"GET /admin/orders": { |
|
375
|
"js-sdk": "sdk.admin.order.list()\n.then(({ orders, count, limit, offset }) => {\n console.log(orders)\n})" |
|
376
|
}, |
|
377
|
"POST /admin/orders/{id}/archive": { |
|
378
|
"js-sdk": "sdk.admin.order.archive(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" |
|
379
|
}, |
|
380
|
"POST /admin/orders/{id}/cancel": { |
|
381
|
"js-sdk": "sdk.admin.order.cancel(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" |
|
382
|
}, |
|
383
|
"POST /admin/orders/{id}/complete": { |
|
384
|
"js-sdk": "sdk.admin.order.complete(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" |
|
385
|
}, |
|
386
|
"POST /admin/orders/{id}/transfer": { |
|
387
|
"js-sdk": "sdk.admin.order.requestTransfer(\"order_123\", {\n customer_id: \"cus_123\",\n internal_note: \"Internal note\",\n})\n.then(({ order }) => {\n console.log(order)\n})" |
|
388
|
}, |
|
389
|
"POST /admin/orders/{id}/transfer/guest": { |
|
390
|
"js-sdk": "sdk.admin.order.transferToGuest(\"order_123\", {\n email: \"customer@example.com\",\n internal_note: \"Internal note\",\n})\n.then(({ order }) => {\n console.log(order)\n})" |
|
391
|
}, |
|
392
|
"POST /admin/orders/{id}/transfer/cancel": { |
|
393
|
"js-sdk": "sdk.admin.order.cancelTransfer(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" |
|
394
|
}, |
|
395
|
"POST /admin/orders/{id}/fulfillments": { |
|
396
|
"js-sdk": "sdk.admin.order.createFulfillment(\"order_123\", {\n items: [\n {\n id: \"orli_123\",\n quantity: 1\n }\n ]\n})\n.then(({ order }) => {\n console.log(order)\n})" |
|
397
|
}, |
|
398
|
"POST /admin/orders/{id}/fulfillments/{fulfillmentid}/cancel": { |
|
399
|
"js-sdk": "sdk.admin.order.cancelFulfillment(\n \"order_123\",\n \"ful_123\",\n {\n no_notification: false\n }\n)\n.then(({ order }) => {\n console.log(order)\n})" |
|
400
|
}, |
|
401
|
"POST /admin/orders/{id}/fulfillments/{fulfillmentid}/shipments": { |
|
402
|
"js-sdk": "sdk.admin.order.createShipment(\n \"order_123\",\n \"ful_123\",\n {\n items: [\n {\n id: \"fulit_123\",\n quantity: 1\n }\n ]\n }\n)\n.then(({ order }) => {\n console.log(order)\n})" |
|
403
|
}, |
|
404
|
"POST /admin/orders/{id}/fulfillments/{fulfillmentid}/mark-as-delivered": { |
|
405
|
"js-sdk": "sdk.admin.order.markAsDelivered(\n \"order_123\",\n \"ful_123\",\n)\n.then(({ order }) => {\n console.log(order)\n})" |
|
406
|
}, |
|
407
|
"GET /admin/orders/{id}/shipping-options": { |
|
408
|
"js-sdk": "sdk.admin.order.listShippingOptions(\"order_123\")\n.then(({ shipping_options }) => {\n console.log(shipping_options)\n})" |
|
409
|
}, |
|
410
|
"GET /admin/orders/{id}/changes": { |
|
411
|
"js-sdk": "sdk.admin.order.listChanges(\"order_123\")\n.then(({ order_changes }) => {\n console.log(order_changes)\n})" |
|
412
|
}, |
|
413
|
"GET /admin/orders/{id}/line-items": { |
|
414
|
"js-sdk": "sdk.admin.order.listLineItems(\"order_123\")\n.then(({ order_items }) => {\n console.log(order_items)\n})" |
|
415
|
}, |
|
416
|
"POST /admin/orders/{orderid}/credit-lines": { |
|
417
|
"js-sdk": "sdk.admin.order.createCreditLine(\n \"order_123\",\n {\n amount: 100,\n reference: \"order\",\n reference_id: \"order_123\",\n }\n)\n.then(({ order }) => {\n console.log(order)\n})" |
|
418
|
}, |
|
419
|
"POST /admin/orders/{id}/payment-sessions/authorize": { |
|
420
|
"js-sdk": "sdk.admin.order.authorizePaymentSession(\"order_123\", \"payses_123\")\n.then(({ order, is_authorized }) => {\n console.log(order, is_authorized)\n})" |
|
421
|
}, |
|
422
|
"POST /admin/order-changes/{id}": { |
|
423
|
"js-sdk": "sdk.admin.order.updateOrderChange(\n \"ordch_123\",\n {\n carry_over_promotions: true\n }\n)\n.then(({ order_change }) => {\n console.log(order_change)\n})" |
|
424
|
}, |
|
425
|
"POST /admin/orders/export": { |
|
426
|
"js-sdk": "sdk.admin.order.export()\n.then(({ transaction_id }) => {\n console.log(transaction_id)\n})" |
|
427
|
}, |
|
428
|
"POST /admin/order-edits": { |
|
429
|
"js-sdk": "sdk.admin.orderEdit.initiateRequest({\n order_id: \"order_123\"\n})\n.then(({ order_change }) => {\n console.log(order_change)\n})" |
|
430
|
}, |
|
431
|
"POST /admin/order-edits/{id}/request": { |
|
432
|
"js-sdk": "sdk.admin.orderEdit.request(\"order_123\", {\n no_notification: false\n})\n.then(({ order_preview }) => {\n console.log(order_preview)\n})" |
|
433
|
}, |
|
434
|
"POST /admin/order-edits/{id}/confirm": { |
|
435
|
"js-sdk": "sdk.admin.orderEdit.confirm(\"order_123\")\n.then(({ order_preview }) => {\n console.log(order_preview)\n})" |
|
436
|
}, |
|
437
|
"DELETE /admin/order-edits/{id}": { |
|
438
|
"js-sdk": "sdk.admin.orderEdit.cancelRequest(\"order_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
439
|
}, |
|
440
|
"POST /admin/order-edits/{id}/items": { |
|
441
|
"js-sdk": "sdk.admin.orderEdit.addItems(\"order_123\", {\n items: [\n {\n variant_id: \"variant_123\",\n quantity: 1\n }\n ]\n})\n.then(({ order_preview }) => {\n console.log(order_preview)\n})" |
|
442
|
}, |
|
443
|
"POST /admin/order-edits/{id}/items/item/{itemid}": { |
|
444
|
"js-sdk": "sdk.admin.orderEdit.updateOriginalItem(\n \"order_123\",\n \"orli_123\",\n {\n quantity: 1\n }\n)\n.then(({ order_preview }) => {\n console.log(order_preview)\n})" |
|
445
|
}, |
|
446
|
"POST /admin/order-edits/{id}/items/{actionid}": { |
|
447
|
"js-sdk": "sdk.admin.orderEdit.updateAddedItem(\n \"order_123\",\n \"orli_123\",\n {\n quantity: 1\n }\n)\n.then(({ order_preview }) => {\n console.log(order_preview)\n})" |
|
448
|
}, |
|
449
|
"DELETE /admin/order-edits/{id}/items/{actionid}": { |
|
450
|
"js-sdk": "sdk.admin.orderEdit.removeAddedItem(\n \"order_123\",\n \"orli_123\",\n)\n.then(({ order_preview }) => {\n console.log(order_preview)\n})" |
|
451
|
}, |
|
452
|
"GET /admin/payments": { |
|
453
|
"js-sdk": "sdk.admin.payment.list()\n.then(({ payments, count, limit, offset }) => {\n console.log(payments)\n})" |
|
454
|
}, |
|
455
|
"GET /admin/payments/payment-providers": { |
|
456
|
"js-sdk": "sdk.admin.payment.listPaymentProviders()\n.then(({ payment_providers, count, limit, offset }) => {\n console.log(payment_providers)\n})" |
|
457
|
}, |
|
458
|
"GET /admin/payments/{id}": { |
|
459
|
"js-sdk": "sdk.admin.payment.retrieve(\"pay_123\")\n.then(({ payment }) => {\n console.log(payment)\n})" |
|
460
|
}, |
|
461
|
"POST /admin/payments/{id}/capture": { |
|
462
|
"js-sdk": "sdk.admin.payment.capture(\"paycol_123\", {})\n.then(({ payment }) => {\n console.log(payment)\n})" |
|
463
|
}, |
|
464
|
"POST /admin/payments/{id}/refund": { |
|
465
|
"js-sdk": "sdk.admin.payment.refund(\"paycol_123\", {})\n.then(({ payment }) => {\n console.log(payment)\n})" |
|
466
|
}, |
|
467
|
"POST /admin/payment-collections": { |
|
468
|
"js-sdk": "sdk.admin.paymentCollection.create({\n order_id: \"order_123\"\n})\n.then(({ payment_collection }) => {\n console.log(payment_collection)\n})" |
|
469
|
}, |
|
470
|
"DELETE /admin/payment-collections/{id}": { |
|
471
|
"js-sdk": "sdk.admin.paymentCollection.delete(\"paycol_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
472
|
}, |
|
473
|
"POST /admin/payment-collections/{id}/mark-as-paid": { |
|
474
|
"js-sdk": "sdk.admin.paymentCollection.markAsPaid(\"paycol_123\", {\n order_id: \"order_123\",\n // optional: record the payment under a specific provider\n provider_id: \"pp_system_default\"\n})\n.then(({ payment_collection }) => {\n console.log(payment_collection)\n})" |
|
475
|
}, |
|
476
|
"POST /admin/payment-collections/{id}/payment-sessions": { |
|
477
|
"js-sdk": "sdk.admin.paymentCollection.createPaymentSession(\"paycol_123\", {\n provider_id: \"pp_stripe_stripe\"\n})\n.then(({ payment_collection }) => {\n console.log(payment_collection)\n})" |
|
478
|
}, |
|
479
|
"GET /admin/plugins": { |
|
480
|
"js-sdk": "sdk.admin.plugin.list()\n.then(({ plugins }) => {\n console.log(plugins)\n})" |
|
481
|
}, |
|
482
|
"GET /admin/price-lists/{id}": { |
|
483
|
"js-sdk": "sdk.admin.priceList.retrieve(\"plist_123\")\n.then(({ price_list }) => {\n console.log(price_list)\n})" |
|
484
|
}, |
|
485
|
"GET /admin/price-lists": { |
|
486
|
"js-sdk": "sdk.admin.priceList.list()\n.then(({ price_lists, count, limit, offset }) => {\n console.log(price_lists)\n})" |
|
487
|
}, |
|
488
|
"POST /admin/price-lists": { |
|
489
|
"js-sdk": "sdk.admin.priceList.create({\n title: \"My Price List\",\n status: \"active\",\n type: \"sale\",\n prices: [\n {\n variant_id: \"variant_123\",\n amount: 10,\n currency_code: \"usd\",\n rules: {\n region_id: \"reg_123\"\n }\n }\n ]\n})\n.then(({ price_list }) => {\n console.log(price_list)\n})" |
|
490
|
}, |
|
491
|
"POST /admin/price-lists/{id}": { |
|
492
|
"js-sdk": "sdk.admin.priceList.update(\"plist_123\", {\n title: \"My Price List\",\n})\n.then(({ price_list }) => {\n console.log(price_list)\n})" |
|
493
|
}, |
|
494
|
"DELETE /admin/price-lists/{id}": { |
|
495
|
"js-sdk": "sdk.admin.priceList.delete(\"plist_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
496
|
}, |
|
497
|
"POST /admin/price-lists/{id}/prices/batch": { |
|
498
|
"js-sdk": "sdk.admin.priceList.batchPrices(\"plist_123\", {\n create: [{\n variant_id: \"variant_123\",\n currency_code: \"usd\",\n amount: 10,\n rules: {\n region_id: \"reg_123\"\n }\n }],\n update: [{\n id: \"price_123\",\n variant_id: \"variant_123\",\n amount: 20,\n }],\n delete: [\"price_123\"]\n})\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})" |
|
499
|
}, |
|
500
|
"GET /admin/price-lists/{id}/prices": { |
|
501
|
"js-sdk": "sdk.admin.priceList.prices(\"plist_123\")\n.then(({ prices }) => {\n console.log(prices)\n})" |
|
502
|
}, |
|
503
|
"POST /admin/price-lists/{id}/products": { |
|
504
|
"js-sdk": "sdk.admin.priceList.linkProducts(\"plist_123\", {\n remove: [\"prod_123\"]\n})\n.then(({ price_list }) => {\n console.log(price_list)\n})" |
|
505
|
}, |
|
506
|
"GET /admin/price-preferences/{id}": { |
|
507
|
"js-sdk": "sdk.admin.pricePreference.retrieve(\"prpref_123\")\n.then(({ price_preference }) => {\n console.log(price_preference)\n})" |
|
508
|
}, |
|
509
|
"GET /admin/price-preferences": { |
|
510
|
"js-sdk": "sdk.admin.pricePreference.list()\n.then(({ price_preferences, count, limit, offset }) => {\n console.log(price_preferences)\n})" |
|
511
|
}, |
|
512
|
"POST /admin/price-preferences": { |
|
513
|
"js-sdk": "sdk.admin.pricePreference.create({\n attribute: \"region_id\",\n value: \"region_123\",\n is_tax_inclusive: true\n})\n.then(({ price_preference }) => {\n console.log(price_preference)\n})" |
|
514
|
}, |
|
515
|
"POST /admin/price-preferences/{id}": { |
|
516
|
"js-sdk": "sdk.admin.pricePreference.update(\"prpref_123\", {\n is_tax_inclusive: true\n})\n.then(({ price_preference }) => {\n console.log(price_preference)\n})" |
|
517
|
}, |
|
518
|
"DELETE /admin/price-preferences/{id}": { |
|
519
|
"js-sdk": "sdk.admin.pricePreference.delete(\"prpref_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
520
|
}, |
|
521
|
"POST /admin/products/import": { |
|
522
|
"js-sdk": "sdk.admin.product.import({\n file // uploaded File instance\n})\n.then(({ transaction_id }) => {\n console.log(transaction_id)\n})" |
|
523
|
}, |
|
524
|
"POST /admin/products/imports": { |
|
525
|
"js-sdk": "sdk.admin.product.createImport({\n file // uploaded File instance\n})\n.then(({ transaction_id }) => {\n console.log(transaction_id)\n})" |
|
526
|
}, |
|
527
|
"POST /admin/products/imports/{transactionid}/confirm": { |
|
528
|
"js-sdk": "sdk.admin.product.confirmImport(\"transaction_123\")\n.then(() => {\n console.log(\"Import confirmed\")\n})" |
|
529
|
}, |
|
530
|
"POST /admin/products/export": { |
|
531
|
"js-sdk": "sdk.admin.product.export({})\n.then(({ transaction_id }) => {\n console.log(transaction_id)\n})" |
|
532
|
}, |
|
533
|
"POST /admin/products/batch": { |
|
534
|
"js-sdk": "sdk.admin.product.batch({\n create: [\n {\n title: \"Shirt\",\n options: [{\n title: \"Default\",\n values: [\"Default Option\"]\n }],\n variants: [\n {\n title: \"Default\",\n options: {\n Default: \"Default Option\"\n },\n prices: []\n }\n ]\n }\n ],\n update: [{\n id: \"prod_123\",\n title: \"Pants\"\n }],\n delete: [\"prod_321\"]\n})\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})" |
|
535
|
}, |
|
536
|
"POST /admin/products": { |
|
537
|
"js-sdk": "sdk.admin.product.create({\n title: \"Shirt\",\n options: [{\n title: \"Default\",\n values: [\"Default Option\"]\n }],\n variants: [\n {\n title: \"Default\",\n options: {\n Default: \"Default Option\"\n },\n prices: []\n }\n ],\n shipping_profile_id: \"sp_123\"\n})\n.then(({ product }) => {\n console.log(product)\n})" |
|
538
|
}, |
|
539
|
"POST /admin/products/{id}": { |
|
540
|
"js-sdk": "sdk.admin.product.update(\"prod_123\", {\n title: \"Shirt\",\n})\n.then(({ product }) => {\n console.log(product)\n})" |
|
541
|
}, |
|
542
|
"GET /admin/products": { |
|
543
|
"js-sdk": "sdk.admin.product.list()\n.then(({ products, count, limit, offset }) => {\n console.log(products)\n})" |
|
544
|
}, |
|
545
|
"GET /admin/products/{id}": { |
|
546
|
"js-sdk": "sdk.admin.product.retrieve(\"prod_123\")\n.then(({ product }) => {\n console.log(product)\n})" |
|
547
|
}, |
|
548
|
"DELETE /admin/products/{id}": { |
|
549
|
"js-sdk": "sdk.admin.product.delete(\"prod_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
550
|
}, |
|
551
|
"POST /admin/products/{productid}/variants/batch": { |
|
552
|
"js-sdk": "sdk.admin.product.batchVariants(\"prod_123\", {\n create: [\n {\n title: \"Blue Shirt\",\n options: {\n Color: \"Blue\"\n },\n prices: []\n }\n ],\n update: [\n {\n id: \"variant_123\",\n title: \"Pants\"\n }\n ],\n delete: [\"variant_123\"]\n})\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})" |
|
553
|
}, |
|
554
|
"POST /admin/products/{productid}/variants": { |
|
555
|
"js-sdk": "sdk.admin.product.createVariant(\"prod_123\", {\n title: \"Blue Shirt\",\n options: {\n Color: \"Blue\"\n },\n prices: [\n {\n amount: 10,\n currency_code: \"usd\"\n }\n ]\n})\n.then(({ product }) => {\n console.log(product)\n})" |
|
556
|
}, |
|
557
|
"POST /admin/products/{productid}/variants/{id}": { |
|
558
|
"js-sdk": "sdk.admin.product.updateVariant(\n \"prod_123\",\n \"variant_123\",\n {\n title: \"Blue Shirt\",\n }\n)\n.then(({ product }) => {\n console.log(product)\n})" |
|
559
|
}, |
|
560
|
"GET /admin/products/{productid}/variants": { |
|
561
|
"js-sdk": "sdk.admin.product.listVariants(\"prod_123\")\n.then(({ variants, count, limit, offset }) => {\n console.log(variants)\n})" |
|
562
|
}, |
|
563
|
"GET /admin/products/{productid}/variants/{id}": { |
|
564
|
"js-sdk": "sdk.admin.product.retrieveVariant(\n \"prod_123\",\n \"variant_123\"\n)\n.then(({ variant }) => {\n console.log(variant)\n})" |
|
565
|
}, |
|
566
|
"DELETE /admin/products/{productid}/variants/{id}": { |
|
567
|
"js-sdk": "sdk.admin.product.deleteVariant(\"prod_123\", \"variant_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
568
|
}, |
|
569
|
"POST /admin/products/{productid}/variants/inventory-items/batch": { |
|
570
|
"js-sdk": "sdk.admin.product.batchVariantInventoryItems(\n \"prod_123\",\n {\n create: [\n {\n inventory_item_id: \"iitem_123\",\n variant_id: \"variant_123\",\n required_quantity: 10\n }\n ],\n update: [\n {\n inventory_item_id: \"iitem_1234\",\n variant_id: \"variant_1234\",\n required_quantity: 20\n }\n ],\n delete: [\n {\n inventory_item_id: \"iitem_321\",\n variant_id: \"variant_321\"\n }\n ]\n }\n)\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})" |
|
571
|
}, |
|
572
|
"GET /admin/products/{productid}/options": { |
|
573
|
"js-sdk": "sdk.admin.product.listOptions(\"prod_123\")\n.then(({ product_options, count, limit, offset }) => {\n console.log(product_options)\n})" |
|
574
|
}, |
|
575
|
"POST /admin/products/{productid}/images/{imageid}/variants/batch": { |
|
576
|
"js-sdk": "sdk.admin.product.batchImageVariants(\"prod_123\", \"img_123\", {\n add: [\"variant_123\", \"variant_456\"],\n remove: [\"variant_789\"]\n})\n.then(({ added, removed }) => {\n console.log(added, removed)\n})" |
|
577
|
}, |
|
578
|
"POST /admin/products/{productid}/variants/{variantid}/images/batch": { |
|
579
|
"js-sdk": "sdk.admin.product.batchVariantImages(\"prod_123\", \"variant_123\", {\n add: [\"img_123\", \"img_456\"],\n remove: [\"img_789\"]\n})\n.then(({ added, removed }) => {\n console.log(added, removed)\n})" |
|
580
|
}, |
|
581
|
"POST /admin/products/{productid}/options/batch": { |
|
582
|
"js-sdk": "sdk.admin.product.linkOptions(\"prod_123\", {\n add: [\n \"opt_123\",\n {\n id: \"opt_123\",\n value_ids: [\"optval_1\", \"optval_2\"]\n }\n ],\n remove: [\"opt_456\"]\n})\n.then(({ product }) => {\n console.log(product)\n})" |
|
583
|
}, |
|
584
|
"POST /admin/product-categories": { |
|
585
|
"js-sdk": "sdk.admin.productCategory.create({\n name: \"Shirts\"\n})\n.then(({ product_category }) => {\n console.log(product_category)\n})" |
|
586
|
}, |
|
587
|
"POST /admin/product-categories/{id}": { |
|
588
|
"js-sdk": "sdk.admin.productCategory.update(\"pcat_123\", {\n name: \"Shirts\"\n})\n.then(({ product_category }) => {\n console.log(product_category)\n})" |
|
589
|
}, |
|
590
|
"GET /admin/product-categories": { |
|
591
|
"js-sdk": "sdk.admin.productCategory.list()\n.then(({ product_categories, count, limit, offset }) => {\n console.log(product_categories)\n})" |
|
592
|
}, |
|
593
|
"GET /admin/product-categories/{id}": { |
|
594
|
"js-sdk": "sdk.admin.productCategory.retrieve(\"pcat_123\")\n.then(({ product_category }) => {\n console.log(product_category)\n})" |
|
595
|
}, |
|
596
|
"DELETE /admin/product-categories/{id}": { |
|
597
|
"js-sdk": "sdk.admin.productCategory.delete(\"pcat_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
598
|
}, |
|
599
|
"POST /admin/product-categories/{id}/products": { |
|
600
|
"js-sdk": "sdk.admin.productCategory.updateProducts(\"pcat_123\", {\n add: [\"prod_123\"],\n remove: [\"prod_321\"]\n})\n.then(({ product_category }) => {\n console.log(product_category)\n})" |
|
601
|
}, |
|
602
|
"POST /admin/collections": { |
|
603
|
"js-sdk": "sdk.admin.productCollection.create({\n title: \"Summer Collection\"\n})\n.then(({ collection }) => {\n console.log(collection)\n})" |
|
604
|
}, |
|
605
|
"POST /admin/collections/{id}": { |
|
606
|
"js-sdk": "sdk.admin.productCollection.update(\"pcol_123\", {\n title: \"Summer Collection\"\n})\n.then(({ collection }) => {\n console.log(collection)\n})" |
|
607
|
}, |
|
608
|
"GET /admin/collections": { |
|
609
|
"js-sdk": "sdk.admin.productCollection.list()\n.then(({ collections, count, limit, offset }) => {\n console.log(collections)\n})" |
|
610
|
}, |
|
611
|
"GET /admin/collections/{id}": { |
|
612
|
"js-sdk": "sdk.admin.productCollection.retrieve(\"pcol_123\")\n.then(({ collection }) => {\n console.log(collection)\n})" |
|
613
|
}, |
|
614
|
"DELETE /admin/collections/{id}": { |
|
615
|
"js-sdk": "sdk.admin.productCollection.delete(\"pcol_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
616
|
}, |
|
617
|
"POST /admin/collections/{id}/products": { |
|
618
|
"js-sdk": "sdk.admin.productCollection.updateProducts(\"pcol_123\", {\n add: [\"prod_123\"],\n remove: [\"prod_321\"]\n})\n.then(({ collection }) => {\n console.log(collection)\n})" |
|
619
|
}, |
|
620
|
"POST /admin/product-tags": { |
|
621
|
"js-sdk": "sdk.admin.productTag.create({\n value: \"shirt\"\n})\n.then(({ product_tag }) => {\n console.log(product_tag)\n})" |
|
622
|
}, |
|
623
|
"POST /admin/product-tags/{id}": { |
|
624
|
"js-sdk": "sdk.admin.productTag.update(\"ptag_123\", {\n value: \"shirt\"\n})\n.then(({ product_tag }) => {\n console.log(product_tag)\n})" |
|
625
|
}, |
|
626
|
"GET /admin/product-tags": { |
|
627
|
"js-sdk": "sdk.admin.productTag.list()\n.then(({ product_tags, count, limit, offset }) => {\n console.log(product_tags)\n})" |
|
628
|
}, |
|
629
|
"GET /admin/product-tags/{id}": { |
|
630
|
"js-sdk": "sdk.admin.productTag.retrieve(\"ptag_123\")\n.then(({ product_tag }) => {\n console.log(product_tag)\n})" |
|
631
|
}, |
|
632
|
"DELETE /admin/product-tags/{id}": { |
|
633
|
"js-sdk": "sdk.admin.productTag.delete(\"ptag_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
634
|
}, |
|
635
|
"POST /admin/product-types": { |
|
636
|
"js-sdk": "sdk.admin.productType.create({\n value: \"Clothes\"\n})\n.then(({ product_type }) => {\n console.log(product_type)\n})" |
|
637
|
}, |
|
638
|
"POST /admin/product-types/{id}": { |
|
639
|
"js-sdk": "sdk.admin.productType.update(\"ptyp_123\", {\n value: \"Clothes\"\n})\n.then(({ product_type }) => {\n console.log(product_type)\n})" |
|
640
|
}, |
|
641
|
"GET /admin/product-types": { |
|
642
|
"js-sdk": "sdk.admin.productType.list()\n.then(({ product_types, count, limit, offset }) => {\n console.log(product_types)\n})" |
|
643
|
}, |
|
644
|
"GET /admin/product-types/{id}": { |
|
645
|
"js-sdk": "sdk.admin.productType.retrieve(\"ptyp_123\")\n.then(({ product_type }) => {\n console.log(product_type)\n})" |
|
646
|
}, |
|
647
|
"DELETE /admin/product-types/{id}": { |
|
648
|
"js-sdk": "sdk.admin.productType.delete(\"ptyp_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
649
|
}, |
|
650
|
"GET /admin/product-variants": { |
|
651
|
"js-sdk": "sdk.admin.productVariant.list()\n.then(({ variants, count, limit, offset }) => {\n console.log(variants)\n})" |
|
652
|
}, |
|
653
|
"GET /admin/promotions/{id}": { |
|
654
|
"js-sdk": "sdk.admin.promotion.retrieve(\"promo_123\")\n.then(({ promotion }) => {\n console.log(promotion)\n})" |
|
655
|
}, |
|
656
|
"GET /admin/promotions": { |
|
657
|
"js-sdk": "sdk.admin.promotion.list()\n.then(({ promotions, count, limit, offset }) => {\n console.log(promotions)\n})" |
|
658
|
}, |
|
659
|
"POST /admin/promotions": { |
|
660
|
"js-sdk": "sdk.admin.promotion.create({\n name: \"My Promotion\",\n description: \"This is a test promotion\",\n code: \"PROMO123\",\n starts_at: \"2021-01-01\",\n ends_at: \"2021-01-01\",\n})\n.then(({ promotion }) => {\n console.log(promotion)\n})" |
|
661
|
}, |
|
662
|
"POST /admin/promotions/{id}": { |
|
663
|
"js-sdk": "sdk.admin.promotion.update(\"promo_123\", {\n code: \"PROMO123\",\n})\n.then(({ promotion }) => {\n console.log(promotion)\n})" |
|
664
|
}, |
|
665
|
"DELETE /admin/promotions/{id}": { |
|
666
|
"js-sdk": "sdk.admin.promotion.delete(\"promo_123\")\n.then(({ promotion }) => {\n console.log(promotion)\n})" |
|
667
|
}, |
|
668
|
"POST /admin/promotions/{id}/{ruletype}/batch": { |
|
669
|
"js-sdk": "sdk.admin.promotion.removeRules(\"promo_123\", \"rules\", {\n rule_ids: [\"rule_123\"]\n})\n.then(({ promotion }) => {\n console.log(promotion)\n})" |
|
670
|
}, |
|
671
|
"GET /admin/promotions/{id}/{ruletype}": { |
|
672
|
"js-sdk": "sdk.admin.promotion.listRules(\"promo_123\", \"rules\")\n.then(({ rules }) => {\n console.log(rules)\n})" |
|
673
|
}, |
|
674
|
"GET /admin/promotions/rule-attribute-options/{ruletype}": { |
|
675
|
"js-sdk": "sdk.admin.promotion.listRuleAttributes(\"rules\", \"standard\")\n.then(({ attributes }) => {\n console.log(attributes)\n})" |
|
676
|
}, |
|
677
|
"GET /admin/promotions/rule-value-options/{ruletype}/{rulevalue}": { |
|
678
|
"js-sdk": "sdk.admin.promotion.listRuleValues(\"rules\", \"attr_123\")\n.then(({ values }) => {\n console.log(values)\n})" |
|
679
|
}, |
|
680
|
"GET /admin/refund-reasons": { |
|
681
|
"js-sdk": "sdk.admin.refundReason.list()\n.then(({ refund_reasons, count, limit, offset }) => {\n console.log(refund_reasons)\n})" |
|
682
|
}, |
|
683
|
"GET /admin/refund-reasons/{id}": { |
|
684
|
"js-sdk": "sdk.admin.refundReason.retrieve(\"refr_123\")\n.then(({ refund_reason }) => {\n console.log(refund_reason)\n})" |
|
685
|
}, |
|
686
|
"POST /admin/refund-reasons": { |
|
687
|
"js-sdk": "sdk.admin.refundReason.create({\n code: \"refund\",\n label: \"Refund\",\n})\n.then(({ refund_reason }) => {\n console.log(refund_reason)\n})" |
|
688
|
}, |
|
689
|
"POST /admin/refund-reasons/{id}": { |
|
690
|
"js-sdk": "sdk.admin.refundReason.update(\"ret_123\", {\n code: \"refund\",\n label: \"Refund\",\n})\n.then(({ refund_reason }) => {\n console.log(refund_reason)\n})" |
|
691
|
}, |
|
692
|
"DELETE /admin/refund-reasons/{id}": { |
|
693
|
"js-sdk": "sdk.admin.refundReason.delete(\"ret_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
694
|
}, |
|
695
|
"POST /admin/regions": { |
|
696
|
"js-sdk": "sdk.admin.region.create({\n name: \"United States\",\n currency_code: \"usd\",\n})\n.then(({ region }) => {\n console.log(region)\n})" |
|
697
|
}, |
|
698
|
"POST /admin/regions/{id}": { |
|
699
|
"js-sdk": "sdk.admin.region.update(\"region_123\", {\n name: \"United States\",\n})\n.then(({ region }) => {\n console.log(region)\n})" |
|
700
|
}, |
|
701
|
"GET /admin/regions": { |
|
702
|
"js-sdk": "sdk.admin.region.list()\n.then(({ regions, count, limit, offset }) => {\n console.log(regions)\n})" |
|
703
|
}, |
|
704
|
"GET /admin/regions/{id}": { |
|
705
|
"js-sdk": "sdk.admin.region.retrieve(\"region_123\")\n.then(({ region }) => {\n console.log(region)\n})" |
|
706
|
}, |
|
707
|
"DELETE /admin/regions/{id}": { |
|
708
|
"js-sdk": "sdk.admin.region.delete(\"region_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
709
|
}, |
|
710
|
"GET /admin/reservations/{id}": { |
|
711
|
"js-sdk": "sdk.admin.reservation.retrieve(\"res_123\")\n.then(({ reservation }) => {\n console.log(reservation)\n})" |
|
712
|
}, |
|
713
|
"GET /admin/reservations": { |
|
714
|
"js-sdk": "sdk.admin.reservation.list()\n.then(({ reservations, count, limit, offset }) => {\n console.log(reservations)\n})" |
|
715
|
}, |
|
716
|
"POST /admin/reservations": { |
|
717
|
"js-sdk": "sdk.admin.reservation.create({\n inventory_item_id: \"iitem_123\",\n location_id: \"sloc_123\",\n quantity: 10,\n})\n.then(({ reservation }) => {\n console.log(reservation)\n})" |
|
718
|
}, |
|
719
|
"POST /admin/reservations/{id}": { |
|
720
|
"js-sdk": "sdk.admin.reservation.update(\"res_123\", {\n quantity: 20,\n})\n.then(({ reservation }) => {\n console.log(reservation)\n})" |
|
721
|
}, |
|
722
|
"DELETE /admin/reservations/{id}": { |
|
723
|
"js-sdk": "sdk.admin.reservation.delete(\"res_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
724
|
}, |
|
725
|
"GET /admin/returns": { |
|
726
|
"js-sdk": "sdk.admin.return.list()\n.then(({ returns, count, limit, offset }) => {\n console.log(returns)\n})" |
|
727
|
}, |
|
728
|
"GET /admin/returns/{id}": { |
|
729
|
"js-sdk": "sdk.admin.return.retrieve(\"return_123\")\n.then(({ return }) => {\n console.log(return)\n})" |
|
730
|
}, |
|
731
|
"POST /admin/returns": { |
|
732
|
"js-sdk": "sdk.admin.return.initiateRequest({\n order_id: \"order_123\",\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
733
|
}, |
|
734
|
"POST /admin/returns/{id}/cancel": { |
|
735
|
"js-sdk": "sdk.admin.return.cancel(\"return_123\")\n.then(({ return }) => {\n console.log(return)\n})" |
|
736
|
}, |
|
737
|
"DELETE /admin/returns/{id}/request": { |
|
738
|
"js-sdk": "sdk.admin.return.cancelRequest(\"return_123\")\n.then(({ return }) => {\n console.log(return)\n})" |
|
739
|
}, |
|
740
|
"POST /admin/returns/{id}/request-items": { |
|
741
|
"js-sdk": "sdk.admin.return.addReturnItem(\"return_123\", {\n id: \"orlitem_123\",\n quantity: 1,\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
742
|
}, |
|
743
|
"POST /admin/returns/{id}/request-items/{actionid}": { |
|
744
|
"js-sdk": "sdk.admin.return.updateReturnItem(\"return_123\", \"orchach_123\", {\n quantity: 2,\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
745
|
}, |
|
746
|
"DELETE /admin/returns/{id}/request-items/{actionid}": { |
|
747
|
"js-sdk": "sdk.admin.return.removeReturnItem(\"return_123\", \"orchach_123\")\n.then(({ return }) => {\n console.log(return)\n})" |
|
748
|
}, |
|
749
|
"POST /admin/returns/{id}/shipping-method": { |
|
750
|
"js-sdk": "sdk.admin.return.addReturnShipping(\"return_123\", {\n shipping_option_id: \"so_123\",\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
751
|
}, |
|
752
|
"POST /admin/returns/{id}/shipping-method/{actionid}": { |
|
753
|
"js-sdk": "sdk.admin.return.updateReturnShipping(\"return_123\", \"orchach_123\", {\n custom_amount: 100,\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
754
|
}, |
|
755
|
"DELETE /admin/returns/{id}/shipping-method/{actionid}": { |
|
756
|
"js-sdk": "sdk.admin.return.deleteReturnShipping(\"return_123\", \"orchach_123\")\n.then(({ return }) => {\n console.log(return)\n})" |
|
757
|
}, |
|
758
|
"POST /admin/returns/{id}": { |
|
759
|
"js-sdk": "sdk.admin.return.updateRequest(\"return_123\", {\n location_id: \"sloc_123\",\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
760
|
}, |
|
761
|
"POST /admin/returns/{id}/request": { |
|
762
|
"js-sdk": "sdk.admin.return.confirmRequest(\"return_123\", {\n no_notification: true,\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
763
|
}, |
|
764
|
"POST /admin/returns/{id}/receive": { |
|
765
|
"js-sdk": "sdk.admin.return.initiateReceive(\"return_123\", {\n internal_note: \"Return received by the customer\",\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
766
|
}, |
|
767
|
"POST /admin/returns/{id}/receive-items": { |
|
768
|
"js-sdk": "sdk.admin.return.receiveItems(\"return_123\", {\n items: [\n { id: \"item_123\", quantity: 1 },\n ],\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
769
|
}, |
|
770
|
"POST /admin/returns/{id}/receive-items/{actionid}": { |
|
771
|
"js-sdk": "sdk.admin.return.updateReceiveItem(\"return_123\", \"orchach_123\", {\n quantity: 2,\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
772
|
}, |
|
773
|
"DELETE /admin/returns/{id}/receive-items/{actionid}": { |
|
774
|
"js-sdk": "sdk.admin.return.removeReceiveItem(\"return_123\", \"orchach_123\")\n.then(({ return }) => {\n console.log(return)\n})" |
|
775
|
}, |
|
776
|
"POST /admin/returns/{id}/dismiss-items": { |
|
777
|
"js-sdk": "sdk.admin.return.dismissItems(\"return_123\", {\n items: [\n { id: \"orli_123\", quantity: 1 },\n ],\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
778
|
}, |
|
779
|
"POST /admin/returns/{id}/dismiss-items/{actionid}": { |
|
780
|
"js-sdk": "sdk.admin.return.updateDismissItem(\"return_123\", \"orchach_123\", {\n quantity: 2,\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
781
|
}, |
|
782
|
"DELETE /admin/returns/{id}/dismiss-items/{actionid}": { |
|
783
|
"js-sdk": "sdk.admin.return.removeDismissItem(\"return_123\", \"orchach_123\")\n.then(({ return }) => {\n console.log(return)\n})" |
|
784
|
}, |
|
785
|
"POST /admin/returns/{id}/receive/confirm": { |
|
786
|
"js-sdk": "sdk.admin.return.confirmReceive(\"return_123\", {\n no_notification: true,\n})\n.then(({ return }) => {\n console.log(return)\n})" |
|
787
|
}, |
|
788
|
"DELETE /admin/returns/{id}/receive": { |
|
789
|
"js-sdk": "sdk.admin.return.cancelReceive(\"return_123\")\n.then(({ return }) => {\n console.log(return)\n})" |
|
790
|
}, |
|
791
|
"GET /admin/return-reasons": { |
|
792
|
"js-sdk": "sdk.admin.returnReason.list()\n.then(({ return_reasons, count, limit, offset }) => {\n console.log(return_reasons)\n})" |
|
793
|
}, |
|
794
|
"GET /admin/return-reasons/{id}": { |
|
795
|
"js-sdk": "sdk.admin.returnReason.retrieve(\"ret_123\")\n.then(({ return_reason }) => {\n console.log(return_reason)\n})" |
|
796
|
}, |
|
797
|
"POST /admin/return-reasons": { |
|
798
|
"js-sdk": "sdk.admin.returnReason.create({\n value: \"refund\",\n label: \"Refund\",\n})\n.then(({ return_reason }) => {\n console.log(return_reason)\n})" |
|
799
|
}, |
|
800
|
"POST /admin/return-reasons/{id}": { |
|
801
|
"js-sdk": "sdk.admin.returnReason.update(\"ret_123\", {\n value: \"refund\",\n label: \"Refund\",\n})\n.then(({ return_reason }) => {\n console.log(return_reason)\n})" |
|
802
|
}, |
|
803
|
"DELETE /admin/return-reasons/{id}": { |
|
804
|
"js-sdk": "sdk.admin.returnReason.delete(\"ret_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
805
|
}, |
|
806
|
"POST /admin/sales-channels": { |
|
807
|
"js-sdk": "sdk.admin.salesChannel.create({\n name: \"Storefront\",\n})\n.then(({ salesChannel }) => {\n console.log(salesChannel)\n})" |
|
808
|
}, |
|
809
|
"POST /admin/sales-channels/{id}": { |
|
810
|
"js-sdk": "sdk.admin.salesChannel.update(\n \"sc_123\",\n {\n name: \"Storefront\",\n }\n)\n.then(({ salesChannel }) => {\n console.log(salesChannel)\n})" |
|
811
|
}, |
|
812
|
"DELETE /admin/sales-channels/{id}": { |
|
813
|
"js-sdk": "sdk.admin.salesChannel.delete(\"sc_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
814
|
}, |
|
815
|
"GET /admin/sales-channels/{id}": { |
|
816
|
"js-sdk": "sdk.admin.salesChannel.retrieve(\"sc_123\")\n.then(({ sales_channel }) => {\n console.log(sales_channel)\n})" |
|
817
|
}, |
|
818
|
"GET /admin/sales-channels": { |
|
819
|
"js-sdk": "sdk.admin.salesChannel.list()\n.then(({ sales_channels, count, limit, offset }) => {\n console.log(sales_channels)\n})" |
|
820
|
}, |
|
821
|
"POST /admin/sales-channels/{id}/products": { |
|
822
|
"js-sdk": "sdk.admin.salesChannel.batchProducts(\"sc_123\", {\n add: [\"prod_123\", \"prod_456\"],\n remove: [\"prod_789\"]\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel)\n})" |
|
823
|
}, |
|
824
|
"GET /admin/search": { |
|
825
|
"js-sdk": "sdk.admin.search.list({ q: \"shirt\", limit: 5 })\n.then(({ results }) => {\n console.log(results)\n})" |
|
826
|
}, |
|
827
|
"GET /admin/search-indexes": { |
|
828
|
"js-sdk": "sdk.admin.search.listIndexes()\n.then(({ search_indexes, enabled }) => {\n console.log(search_indexes, enabled)\n})" |
|
829
|
}, |
|
830
|
"DELETE /admin/search-indexes/{id}": { |
|
831
|
"js-sdk": "sdk.admin.search.deleteIndex(\"product\")\n.then(({ deleted, deleted_versions }) => {\n console.log(deleted, deleted_versions)\n})" |
|
832
|
}, |
|
833
|
"POST /admin/search-indexes/{id}/reindex": { |
|
834
|
"js-sdk": "sdk.admin.search.reindex(\"product\")\n.then(({ job_id, indexes }) => {\n console.log(job_id, indexes)\n})" |
|
835
|
}, |
|
836
|
"POST /admin/shipping-options": { |
|
837
|
"js-sdk": "sdk.admin.shippingOption.create({\n name: \"Standard Shipping\",\n profile_id: \"shp_123\",\n})\n.then(({ shipping_option }) => {\n console.log(shipping_option)\n})" |
|
838
|
}, |
|
839
|
"GET /admin/shipping-options/{id}": { |
|
840
|
"js-sdk": "sdk.admin.shippingOption.retrieve(\"so_123\")\n.then(({ shipping_option }) => {\n console.log(shipping_option)\n})" |
|
841
|
}, |
|
842
|
"POST /admin/shipping-options/{id}": { |
|
843
|
"js-sdk": "sdk.admin.shippingOption.update(\"so_123\", {\n name: \"Standard Shipping\",\n})\n.then(({ shipping_option }) => {\n console.log(shipping_option)\n})" |
|
844
|
}, |
|
845
|
"DELETE /admin/shipping-options/{id}": { |
|
846
|
"js-sdk": "sdk.admin.shippingOption.delete(\"so_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
847
|
}, |
|
848
|
"GET /admin/shipping-options": { |
|
849
|
"js-sdk": "sdk.admin.shippingOption.list()\n.then(({ shipping_options, count, limit, offset }) => {\n console.log(shipping_options)\n})" |
|
850
|
}, |
|
851
|
"POST /admin/shipping-options/{id}/rules/batch": { |
|
852
|
"js-sdk": "sdk.admin.shippingOption.updateRules(\"so_123\", {\n create: [{ attribute: \"enabled_in_store\", operator: \"eq\", value: \"true\" }],\n})\n.then(({ shipping_option }) => {\n console.log(shipping_option)\n})" |
|
853
|
}, |
|
854
|
"POST /admin/shipping-profiles": { |
|
855
|
"js-sdk": "sdk.admin.shippingProfile.create({\n name: \"Default Shipping Profile\",\n})\n.then(({ shipping_profile }) => {\n console.log(shipping_profile)\n})" |
|
856
|
}, |
|
857
|
"POST /admin/shipping-profiles/{id}": { |
|
858
|
"js-sdk": "sdk.admin.shippingProfile.update(\"sp_123\", {\n name: \"Updated Shipping Profile\",\n})\n.then(({ shipping_profile }) => {\n console.log(shipping_profile)\n})" |
|
859
|
}, |
|
860
|
"DELETE /admin/shipping-profiles/{id}": { |
|
861
|
"js-sdk": "sdk.admin.shippingProfile.delete(\"sp_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
862
|
}, |
|
863
|
"GET /admin/shipping-profiles": { |
|
864
|
"js-sdk": "sdk.admin.shippingProfile.list()\n.then(({ shipping_profiles, count, limit, offset }) => {\n console.log(shipping_profiles)\n})" |
|
865
|
}, |
|
866
|
"GET /admin/shipping-profiles/{id}": { |
|
867
|
"js-sdk": "sdk.admin.shippingProfile.retrieve(\"sp_123\")\n.then(({ shipping_profile }) => {\n console.log(shipping_profile)\n})" |
|
868
|
}, |
|
869
|
"POST /admin/stock-locations": { |
|
870
|
"js-sdk": "sdk.admin.stockLocation.create({\n name: \"Main Warehouse\",\n address_id: \"addr_123\",\n})\n.then(({ stock_location }) => {\n console.log(stock_location)\n})" |
|
871
|
}, |
|
872
|
"POST /admin/stock-locations/{id}": { |
|
873
|
"js-sdk": "sdk.admin.stockLocation.update(\"sloc_123\", {\n name: \"European Warehouse\",\n})\n.then(({ stock_location }) => {\n console.log(stock_location)\n})" |
|
874
|
}, |
|
875
|
"DELETE /admin/stock-locations/{id}": { |
|
876
|
"js-sdk": "sdk.admin.stockLocation.delete(\"sloc_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
877
|
}, |
|
878
|
"GET /admin/stock-locations/{id}": { |
|
879
|
"js-sdk": "sdk.admin.stockLocation.retrieve(\"sloc_123\")\n.then(({ stock_location }) => {\n console.log(stock_location)\n})" |
|
880
|
}, |
|
881
|
"GET /admin/stock-locations": { |
|
882
|
"js-sdk": "sdk.admin.stockLocation.list()\n.then(({ stock_locations, count, limit, offset }) => {\n console.log(stock_locations)\n})" |
|
883
|
}, |
|
884
|
"POST /admin/stock-locations/{id}/sales-channels": { |
|
885
|
"js-sdk": "sdk.admin.stockLocation.updateSalesChannels(\"sloc_123\", {\n add: [\"sc_123\"],\n remove: [\"sc_456\"],\n})\n.then(({ stock_location }) => {\n console.log(stock_location)\n})" |
|
886
|
}, |
|
887
|
"POST /admin/stock-locations/{id}/fulfillment-sets": { |
|
888
|
"js-sdk": "sdk.admin.stockLocation.createFulfillmentSet(\"sloc_123\", {\n name: \"Shipping\",\n type: \"shipping\",\n})\n.then(({ stock_location }) => {\n console.log(stock_location)\n})" |
|
889
|
}, |
|
890
|
"POST /admin/stock-locations/{id}/fulfillment-providers": { |
|
891
|
"js-sdk": "sdk.admin.stockLocation.updateFulfillmentProviders(\"sloc_123\", {\n add: [\"fp_manual_manual\"],\n remove: [\"fp_shipstation_shipstation\"],\n})\n.then(({ stock_location }) => {\n console.log(stock_location)\n})" |
|
892
|
}, |
|
893
|
"GET /admin/stores/{id}": { |
|
894
|
"js-sdk": "sdk.admin.store.retrieve(\"store_123\")\n.then(({ store }) => {\n console.log(store)\n})" |
|
895
|
}, |
|
896
|
"GET /admin/stores": { |
|
897
|
"js-sdk": "sdk.admin.store.list()\n.then(({ stores, count, limit, offset }) => {\n console.log(stores)\n})" |
|
898
|
}, |
|
899
|
"POST /admin/stores/{id}": { |
|
900
|
"js-sdk": "sdk.admin.store.update(\"store_123\", {\n name: \"My Store\",\n})\n.then(({ store }) => {\n console.log(store)\n})" |
|
901
|
}, |
|
902
|
"GET /admin/tax-providers": { |
|
903
|
"js-sdk": "sdk.admin.taxProvider.list()\n.then(({ tax_providers, count, limit, offset }) => {\n console.log(tax_providers)\n})" |
|
904
|
}, |
|
905
|
"POST /admin/tax-rates": { |
|
906
|
"js-sdk": "sdk.admin.taxRate.create({\n name: \"VAT\",\n tax_region_id: \"txreg_123\",\n code: \"VAT\",\n rate: 2, // 2%\n})\n.then(({ tax_rate }) => {\n console.log(tax_rate)\n})" |
|
907
|
}, |
|
908
|
"POST /admin/tax-rates/{id}": { |
|
909
|
"js-sdk": "sdk.admin.taxRate.update(\"txrat_123\", {\n name: \"VAT\",\n code: \"VAT\",\n})\n.then(({ tax_rate }) => {\n console.log(tax_rate)\n})" |
|
910
|
}, |
|
911
|
"DELETE /admin/tax-rates/{id}": { |
|
912
|
"js-sdk": "sdk.admin.taxRate.delete(\"txrat_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
913
|
}, |
|
914
|
"GET /admin/tax-rates/{id}": { |
|
915
|
"js-sdk": "sdk.admin.taxRate.retrieve(\"txrat_123\")\n.then(({ tax_rate }) => {\n console.log(tax_rate)\n})" |
|
916
|
}, |
|
917
|
"GET /admin/tax-rates": { |
|
918
|
"js-sdk": "sdk.admin.taxRate.list()\n.then(({ tax_rates, count, limit, offset }) => {\n console.log(tax_rates)\n})" |
|
919
|
}, |
|
920
|
"POST /admin/tax-regions": { |
|
921
|
"js-sdk": "sdk.admin.taxRegion.create({\n country_code: \"us\",\n province_code: \"ca\",\n default_tax_rate: {\n code: \"VAT\",\n name: \"VAT\",\n rate: 20, // 20%\n is_combinable: true,\n },\n})\n.then(({ tax_region }) => {\n console.log(tax_region)\n})" |
|
922
|
}, |
|
923
|
"POST /admin/tax-regions/{id}": { |
|
924
|
"js-sdk": "sdk.admin.taxRegion.update(\"txreg_123\", {\n province_code: \"ca\",\n})\n.then(({ tax_region }) => {\n console.log(tax_region)\n})" |
|
925
|
}, |
|
926
|
"DELETE /admin/tax-regions/{id}": { |
|
927
|
"js-sdk": "sdk.admin.taxRegion.delete(\"txreg_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
928
|
}, |
|
929
|
"GET /admin/tax-regions/{id}": { |
|
930
|
"js-sdk": "sdk.admin.taxRegion.retrieve(\"txreg_123\")\n.then(({ tax_region }) => {\n console.log(tax_region)\n})" |
|
931
|
}, |
|
932
|
"GET /admin/tax-regions": { |
|
933
|
"js-sdk": "sdk.admin.taxRegion.list()\n.then(({ tax_regions, count, limit, offset }) => {\n console.log(tax_regions)\n})" |
|
934
|
}, |
|
935
|
"POST /admin/uploads": { |
|
936
|
"js-sdk": "sdk.admin.upload.create(\n {\n files: [\n // file uploaded as a binary string\n {\n name: \"test.txt\",\n content: \"test\", // Should be the binary string of the file\n },\n // file uploaded as a File object\n new File([\"test\"], \"test.txt\", { type: \"text/plain\" })\n ],\n }\n)\n.then(({ files }) => {\n console.log(files)\n})" |
|
937
|
}, |
|
938
|
"GET /admin/uploads/{id}": { |
|
939
|
"js-sdk": "sdk.admin.upload.retrieve(\"test.txt\")\n.then(({ file }) => {\n console.log(file)\n})" |
|
940
|
}, |
|
941
|
"DELETE /admin/uploads/{id}": { |
|
942
|
"js-sdk": "sdk.admin.upload.delete(\"test.txt\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
943
|
}, |
|
944
|
"POST /admin/uploads/presigned-urls": { |
|
945
|
"js-sdk": "sdk.admin.upload.presignedUrl({\n name: \"test.txt\",\n size: 1000,\n type: \"text/plain\",\n}))" |
|
946
|
}, |
|
947
|
"POST /admin/users/{id}": { |
|
948
|
"js-sdk": "sdk.admin.user.update(\"user_123\", {\n first_name: \"John\",\n last_name: \"Doe\",\n})\n.then(({ user }) => {\n console.log(user)\n})" |
|
949
|
}, |
|
950
|
"GET /admin/users": { |
|
951
|
"js-sdk": "sdk.admin.user.list()\n.then(({ users, count, limit, offset }) => {\n console.log(users)\n})" |
|
952
|
}, |
|
953
|
"GET /admin/users/{id}": { |
|
954
|
"js-sdk": "sdk.admin.user.retrieve(\"user_123\")\n.then(({ user }) => {\n console.log(user)\n})" |
|
955
|
}, |
|
956
|
"GET /admin/users/{id}/auth-providers": { |
|
957
|
"js-sdk": "sdk.admin.user.listAuthProviders(\"user_123\")\n.then(({ providers }) => {\n console.log(providers)\n})" |
|
958
|
}, |
|
959
|
"POST /admin/users/{id}/reset-password": { |
|
960
|
"js-sdk": "sdk.admin.user.generateResetPasswordToken(\"user_123\")\n.then(({ token }) => {\n console.log(token)\n})" |
|
961
|
}, |
|
962
|
"GET /admin/users/{id}/roles": { |
|
963
|
"js-sdk": "sdk.admin.user.listRoles(\"user_123\")\n.then(({ roles, count, limit, offset }) => {\n console.log(roles)\n})" |
|
964
|
}, |
|
965
|
"POST /admin/users/{id}/roles": { |
|
966
|
"js-sdk": "sdk.admin.user.addRoles(\"user_123\", {\n roles: [\"role_123\"]\n})\n.then(({ roles }) => {\n console.log(roles)\n})" |
|
967
|
}, |
|
968
|
"DELETE /admin/users/{id}/roles/{roleid}": { |
|
969
|
"js-sdk": "sdk.admin.user.removeRole(\"user_123\", \"role_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
970
|
}, |
|
971
|
"DELETE /admin/users/{id}/roles": { |
|
972
|
"js-sdk": "sdk.admin.user.removeRoles(\"user_123\", {\n roles: [\"role_123\"]\n})\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
973
|
}, |
|
974
|
"DELETE /admin/users/{id}": { |
|
975
|
"js-sdk": "sdk.admin.user.delete(\"user_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
976
|
}, |
|
977
|
"GET /admin/users/me": { |
|
978
|
"js-sdk": "sdk.admin.user.me()\n.then(({ user }) => {\n console.log(user)\n})" |
|
979
|
}, |
|
980
|
"GET /admin/views/entities": { |
|
981
|
"js-sdk": "sdk.admin.views.listEntities()\n.then(({ entities }) => {\n console.log(entities)\n})" |
|
982
|
}, |
|
983
|
"GET /admin/views/{entity}/columns": { |
|
984
|
"js-sdk": "const { columns } = await sdk.admin.views.columns(\"orders\")" |
|
985
|
}, |
|
986
|
"GET /admin/views/{entity}/configurations": { |
|
987
|
"js-sdk": "sdk.admin.views.listConfigurations(\"orders\")\n.then(({ view_configurations, count, limit, offset }) => {\n console.log(view_configurations)\n})" |
|
988
|
}, |
|
989
|
"POST /admin/views/{entity}/configurations": { |
|
990
|
"js-sdk": "const { view_configuration } = await sdk.admin.views.createConfiguration(\n \"orders\",\n {\n name: \"My Orders View\",\n configuration: {\n visible_columns: [\"display_id\", \"status\"],\n column_order: [\"display_id\", \"status\"],\n },\n }\n)" |
|
991
|
}, |
|
992
|
"GET /admin/views/{entity}/configurations/{id}": { |
|
993
|
"js-sdk": "sdk.admin.views.retrieveConfiguration(\"orders\", \"viewconfig_123\")\n.then(({ view_configuration }) => {\n console.log(view_configuration)\n})" |
|
994
|
}, |
|
995
|
"POST /admin/views/{entity}/configurations/{id}": { |
|
996
|
"js-sdk": "const { view_configuration } = await sdk.admin.views.updateConfiguration(\n \"orders\",\n \"viewconfig_123\",\n {\n name: \"Updated View\",\n }\n)" |
|
997
|
}, |
|
998
|
"DELETE /admin/views/{entity}/configurations/{id}": { |
|
999
|
"js-sdk": "const { id, object, deleted } = await sdk.admin.views.deleteConfiguration(\n \"orders\",\n \"viewconfig_123\"\n)" |
|
1000
|
}, |
|
1001
|
"GET /admin/views/{entity}/configurations/active": { |
|
1002
|
"js-sdk": "sdk.admin.views.retrieveActiveConfiguration(\"orders\")\n.then(({ view_configuration, active_view_configuration_id }) => {\n console.log(view_configuration)\n})" |
|
1003
|
}, |
|
1004
|
"POST /admin/views/{entity}/configurations/active": { |
|
1005
|
"js-sdk": "await sdk.admin.views.setActiveConfiguration(\"orders\", {\n view_configuration_id: \"viewconfig_123\",\n})" |
|
1006
|
}, |
|
1007
|
"GET /admin/layouts/configurations": { |
|
1008
|
"js-sdk": "const { layout_configurations } = await sdk.admin.layouts.listConfigurations()" |
|
1009
|
}, |
|
1010
|
"GET /admin/workflows-executions": { |
|
1011
|
"js-sdk": "sdk.admin.workflowExecution.list()\n.then(({ workflow_executions, count, limit, offset }) => {\n console.log(workflow_executions)\n})" |
|
1012
|
}, |
|
1013
|
"GET /admin/workflows-executions/{id}": { |
|
1014
|
"js-sdk": "sdk.admin.workflowExecution.retrieve(\"wrk_123\")\n.then(({ workflow_execution }) => {\n console.log(workflow_execution)\n})" |
|
1015
|
}, |
|
1016
|
"POST /admin/shipping-option-types": { |
|
1017
|
"js-sdk": "sdk.admin.shippingOptionType.create({\n label: \"Standard\",\n code: \"standard\",\n description: \"Ship in 2-3 days.\"\n})\n.then(({ shipping_option_type }) => {\n console.log(shipping_option_type)\n})" |
|
1018
|
}, |
|
1019
|
"POST /admin/shipping-option-types/{id}": { |
|
1020
|
"js-sdk": "sdk.admin.shippingOptionType.update(\"sotype_123\", {\n code: \"express\"\n})\n.then(({ shipping_option_type }) => {\n console.log(shipping_option_type)\n})" |
|
1021
|
}, |
|
1022
|
"GET /admin/shipping-option-types": { |
|
1023
|
"js-sdk": "sdk.admin.shippingOptionType.list()\n.then(({ shipping_option_types, count, limit, offset }) => {\n console.log(shipping_option_types)\n})" |
|
1024
|
}, |
|
1025
|
"GET /admin/shipping-option-types/{id}": { |
|
1026
|
"js-sdk": "sdk.admin.shippingOptionType.retrieve(\"sotype_123\")\n.then(({ shipping_option_type }) => {\n console.log(shipping_option_type)\n})" |
|
1027
|
}, |
|
1028
|
"DELETE /admin/shipping-option-types/{id}": { |
|
1029
|
"js-sdk": "sdk.admin.shippingOptionType.delete(\"sotype_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
1030
|
}, |
|
1031
|
"GET /admin/locales": { |
|
1032
|
"js-sdk": "sdk.admin.locale.list()\n.then(({ locales, count, limit, offset }) => {\n console.log(locales)\n})" |
|
1033
|
}, |
|
1034
|
"GET /admin/locales/{code}": { |
|
1035
|
"js-sdk": "sdk.admin.locale.retrieve(\"en-US\")\n.then(({ locale }) => {\n console.log(locale)\n})" |
|
1036
|
}, |
|
1037
|
"GET /admin/translations": { |
|
1038
|
"js-sdk": "sdk.admin.translation.list()\n.then(({ translations, count, limit, offset }) => {\n console.log(translations)\n})" |
|
1039
|
}, |
|
1040
|
"POST /admin/translations/batch": { |
|
1041
|
"js-sdk": "sdk.admin.translation.batch({\n create: [\n {\n reference_id: \"prod_123\",\n reference: \"product\",\n locale_code: \"en-US\",\n translations: { title: \"Shirt\" }\n }\n ],\n update: [\n {\n id: \"trans_123\",\n translations: { title: \"Pants\" }\n }\n ],\n delete: [\"trans_321\"]\n})\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})" |
|
1042
|
}, |
|
1043
|
"GET /admin/translations/settings": { |
|
1044
|
"js-sdk": "sdk.admin.translation.settings({\n entity_type: \"product\"\n})\n.then(({ translation_settings }) => {\n console.log(translation_settings)\n})" |
|
1045
|
}, |
|
1046
|
"POST /admin/translations/settings/batch": { |
|
1047
|
"js-sdk": "sdk.admin.translation.batchSettings({\n create: [\n {\n entity_type: \"product\",\n fields: [\"title\", \"description\"],\n is_active: true\n }\n ],\n update: [\n {\n id: \"trset_123\",\n fields: [\"title\", \"description\", \"subtitle\"],\n is_active: true\n }\n ],\n delete: [\"trset_456\"]\n})\n.then(({ created, updated, deleted }) => {\n console.log(created, updated, deleted)\n})" |
|
1048
|
}, |
|
1049
|
"GET /admin/translations/entities": { |
|
1050
|
"js-sdk": "sdk.admin.translation.entities({\n type: \"product\"\n})\n.then(({ data, count, offset, limit }) => {\n console.log(data)\n})" |
|
1051
|
}, |
|
1052
|
"GET /admin/translations/statistics": { |
|
1053
|
"js-sdk": "sdk.admin.translation.statistics({\n entity_type: \"product\"\n})\n.then(({ statistics }) => {\n console.log(statistics)\n})" |
|
1054
|
}, |
|
1055
|
"POST /admin/product-options": { |
|
1056
|
"js-sdk": "sdk.admin.productOption.create({\n title: \"Size\",\n values: [\"S\", \"M\"]\n})\n.then(({ product_option }) => {\n console.log(product_option)\n})" |
|
1057
|
}, |
|
1058
|
"POST /admin/product-options/{id}": { |
|
1059
|
"js-sdk": "sdk.admin.productOption.update(\"opt_123\", {\n title: \"Size\"\n})\n.then(({ product_option }) => {\n console.log(product_option)\n})" |
|
1060
|
}, |
|
1061
|
"GET /admin/product-options": { |
|
1062
|
"js-sdk": "sdk.admin.productOption.list()\n.then(({ product_options, count, limit, offset }) => {\n console.log(product_options)\n})" |
|
1063
|
}, |
|
1064
|
"GET /admin/product-options/{id}": { |
|
1065
|
"js-sdk": "sdk.admin.productOption.retrieve(\"opt_123\")\n.then(({ product_option }) => {\n console.log(product_option)\n})" |
|
1066
|
}, |
|
1067
|
"DELETE /admin/product-options/{id}": { |
|
1068
|
"js-sdk": "sdk.admin.productOption.delete(\"opt_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
1069
|
}, |
|
1070
|
"GET /admin/product-options/{optionid}/values": { |
|
1071
|
"js-sdk": "sdk.admin.productOption.listValues(\"opt_123\", { q: \"red\" })\n.then(({ product_option_values, count, limit, offset }) => {\n console.log(product_option_values)\n})" |
|
1072
|
}, |
|
1073
|
"GET /admin/product-options/{optionid}/values/{valueid}": { |
|
1074
|
"js-sdk": "sdk.admin.productOption.retrieveValue(\"opt_123\", \"optval_123\")\n.then(({ product_option_value }) => {\n console.log(product_option_value)\n})" |
|
1075
|
}, |
|
1076
|
"POST /admin/product-options/{optionid}/values/{valueid}": { |
|
1077
|
"js-sdk": "sdk.admin.productOption.updateValue(\"opt_123\", \"optval_123\", {\n metadata: { is_default: true }\n})\n.then(({ product_option_value }) => {\n console.log(product_option_value)\n})" |
|
1078
|
}, |
|
1079
|
"DELETE /admin/product-options/{optionid}/values/{valueid}": { |
|
1080
|
"js-sdk": "sdk.admin.productOption.deleteValue(\"opt_123\", \"optval_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
1081
|
}, |
|
1082
|
"GET /admin/rbac/roles": { |
|
1083
|
"js-sdk": "sdk.admin.rbacRole.list()\n.then(({ roles, count, limit, offset }) => {\n console.log(roles)\n})" |
|
1084
|
}, |
|
1085
|
"GET /admin/rbac/roles/{id}": { |
|
1086
|
"js-sdk": "sdk.admin.rbacRole.retrieve(\"role_123\")\n.then(({ role }) => {\n console.log(role)\n})" |
|
1087
|
}, |
|
1088
|
"POST /admin/rbac/roles": { |
|
1089
|
"js-sdk": "sdk.admin.rbacRole.create({\n name: \"Editor\",\n description: \"Can edit content\"\n})\n.then(({ role }) => {\n console.log(role)\n})" |
|
1090
|
}, |
|
1091
|
"POST /admin/rbac/roles/{id}": { |
|
1092
|
"js-sdk": "sdk.admin.rbacRole.update(\"role_123\", {\n name: \"Senior Editor\"\n})\n.then(({ role }) => {\n console.log(role)\n})" |
|
1093
|
}, |
|
1094
|
"DELETE /admin/rbac/roles/{id}": { |
|
1095
|
"js-sdk": "sdk.admin.rbacRole.delete(\"role_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
1096
|
}, |
|
1097
|
"GET /admin/rbac/roles/{roleid}/policies": { |
|
1098
|
"js-sdk": "sdk.admin.rbacRole.listPolicies(\"role_123\")\n.then(({ policies, count, limit, offset }) => {\n console.log(policies)\n})" |
|
1099
|
}, |
|
1100
|
"GET /admin/rbac/roles/{roleid}/users": { |
|
1101
|
"js-sdk": "sdk.admin.rbacRole.listUsers(\"role_123\")\n.then(({ users, count, limit, offset }) => {\n console.log(users)\n})" |
|
1102
|
}, |
|
1103
|
"POST /admin/rbac/roles/{roleid}/users": { |
|
1104
|
"js-sdk": "sdk.admin.rbacRole.addUsers(\"role_123\", {\n users: [\"user_123\"]\n})\n.then(({ users }) => {\n console.log(users)\n})" |
|
1105
|
}, |
|
1106
|
"DELETE /admin/rbac/roles/{roleid}/users": { |
|
1107
|
"js-sdk": "sdk.admin.rbacRole.removeUsers(\"role_123\", {\n users: [\"user_123\"]\n})\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
1108
|
}, |
|
1109
|
"POST /admin/rbac/roles/{roleid}/policies": { |
|
1110
|
"js-sdk": "sdk.admin.rbacRole.addPolicies(\"role_123\", {\n policies: [\"policy_123\", \"policy_456\"]\n})\n.then(({ policies }) => {\n console.log(policies)\n})" |
|
1111
|
}, |
|
1112
|
"DELETE /admin/rbac/roles/{roleid}/policies/{policyid}": { |
|
1113
|
"js-sdk": "sdk.admin.rbacRole.removePolicy(\"role_123\", \"policy_456\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
1114
|
}, |
|
1115
|
"GET /admin/rbac/me/permissions": { |
|
1116
|
"js-sdk": "sdk.admin.rbacRole.mePermissions().then(({ permissions }) => {\n console.log(permissions) // [\"product:read\", \"customer:read\", ...]\n})" |
|
1117
|
}, |
|
1118
|
"GET /admin/rbac/policies": { |
|
1119
|
"js-sdk": "sdk.admin.rbacPolicy.list()\n.then(({ policies, count, limit, offset }) => {\n console.log(policies)\n})" |
|
1120
|
}, |
|
1121
|
"GET /admin/rbac/policies/{id}": { |
|
1122
|
"js-sdk": "sdk.admin.rbacPolicy.retrieve(\"policy_123\")\n.then(({ policy }) => {\n console.log(policy)\n})" |
|
1123
|
}, |
|
1124
|
"POST /admin/rbac/policies": { |
|
1125
|
"js-sdk": "sdk.admin.rbacPolicy.create({\n key: \"product.read\",\n resource: \"product\",\n operation: \"read\"\n})\n.then(({ policy }) => {\n console.log(policy)\n})" |
|
1126
|
}, |
|
1127
|
"POST /admin/rbac/policies/{id}": { |
|
1128
|
"js-sdk": "sdk.admin.rbacPolicy.update(\"policy_123\", {\n name: \"Read Products\",\n description: \"Allows reading product information\"\n})\n.then(({ policy }) => {\n console.log(policy)\n})" |
|
1129
|
}, |
|
1130
|
"DELETE /admin/rbac/policies/{id}": { |
|
1131
|
"js-sdk": "sdk.admin.rbacPolicy.delete(\"policy_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" |
|
1132
|
}, |
|
1133
|
"GET /auth/mfa/factors": { |
|
1134
|
"js-sdk": "const { mfa_factors } = await sdk.auth.mfa.list()" |
|
1135
|
}, |
|
1136
|
"POST /auth/mfa/factors": { |
|
1137
|
"js-sdk": "const setup = await sdk.auth.mfa.start({\n provider: \"totp\",\n label: \"Authenticator app\"\n})\n\n// Render setup.otpauth_url as a QR code or show setup.secret manually." |
|
1138
|
}, |
|
1139
|
"POST /auth/mfa/factors/{id}/verify": { |
|
1140
|
"js-sdk": "const { mfa_factor } = await sdk.auth.mfa.verify(\"authmfa_123\", {\n code: \"123456\"\n})" |
|
1141
|
}, |
|
1142
|
"DELETE /auth/mfa/factors/{id}": { |
|
1143
|
"js-sdk": "const { mfa_factor } = await sdk.auth.mfa.disable(\"authmfa_123\")" |
|
1144
|
}, |
|
1145
|
"POST /auth/mfa/recovery-codes": { |
|
1146
|
"js-sdk": "const { recovery_codes } = await sdk.auth.mfa.generateRecoveryCodes()" |
|
1147
|
}, |
|
1148
|
"POST /auth/mfa/challenges/{id}/verify": { |
|
1149
|
"js-sdk": "const result = await sdk.auth.login(\"user\", \"emailpass\", {\n email: \"user@example.com\",\n password: \"secret\"\n})\n\nif (typeof result === \"object\" && \"mfa_challenge\" in result) {\n await sdk.auth.mfa.verifyChallenge(result.mfa_challenge.id, {\n method: \"totp\",\n code: \"123456\"\n })\n}" |
|
1150
|
}, |
|
1151
|
"POST /auth/{actor}/{method}/register": { |
|
1152
|
"js-sdk": "await sdk.auth.register(\n \"customer\",\n \"emailpass\",\n {\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n }\n)\n\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.create({\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n})" |
|
1153
|
}, |
|
1154
|
"POST /auth/{actor}/{method}": { |
|
1155
|
"js-sdk": "const result = await sdk.auth.login(\n \"customer\",\n \"emailpass\",\n {\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n }\n)\n\nif (typeof result !== \"string\") {\n alert(\"Authentication requires additional steps\")\n // replace with the redirect logic of your application\n window.location.href = result.location\n return\n}\n\n// customer is now authenticated\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.retrieve()" |
|
1156
|
}, |
|
1157
|
"GET /auth/{actor}/{method}/callback": { |
|
1158
|
"js-sdk": "await sdk.auth.callback(\n \"customer\",\n \"google\",\n {\n code: \"123\",\n state: \"456\"\n }\n)\n\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.create({\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n})" |
|
1159
|
}, |
|
1160
|
"POST /auth/token/refresh": { |
|
1161
|
"js-sdk": "const token = await sdk.auth.refresh()\n\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.retrieve()" |
|
1162
|
}, |
|
1163
|
"DELETE /auth/session": { |
|
1164
|
"js-sdk": "await sdk.auth.logout()\n\n// user is now logged out\n// you can't send any requests that require authentication" |
|
1165
|
}, |
|
1166
|
"POST /auth/{actor}/{provider}/reset-password": { |
|
1167
|
"js-sdk": "sdk.auth.resetPassword(\n \"customer\",\n \"emailpass\",\n {\n identifier: \"customer@gmail.com\"\n }\n)\n.then(() => {\n // user receives token\n})" |
|
1168
|
}, |
|
1169
|
"POST /auth/{actor}/{provider}/update": { |
|
1170
|
"js-sdk": "sdk.auth.updateProvider(\n \"customer\",\n \"emailpass\",\n {\n password: \"supersecret\"\n },\n token\n)\n.then(() => {\n // password updated\n})" |
|
1171
|
}, |
|
1172
|
"GET /auth/{actor}/providers": { |
|
1173
|
"js-sdk": "const { providers } = await sdk.auth.listProviders(\"user\")" |
|
1174
|
}, |
|
1175
|
"POST /auth/{provider}/user": { |
|
1176
|
"js-sdk": "const token = await sdk.auth.callback(\"user\", \"okta\", queryParams)\nawait sdk.auth.createUser(\"okta\", { Authorization: `Bearer ${token}` })\nawait sdk.auth.refresh()" |
|
1177
|
}, |
|
1178
|
"GET /store/regions": { |
|
1179
|
"js-sdk": "sdk.store.region.list()\n.then(({ regions, count, limit, offset }) => {\n console.log(regions)\n})" |
|
1180
|
}, |
|
1181
|
"GET /store/regions/{id}": { |
|
1182
|
"js-sdk": "sdk.store.region.retrieve(\"reg_123\")\n.then(({ region }) => {\n console.log(region)\n})" |
|
1183
|
}, |
|
1184
|
"GET /store/collections": { |
|
1185
|
"js-sdk": "sdk.store.collection.list()\n.then(({ collections, count, limit, offset }) => {\n console.log(collections)\n})" |
|
1186
|
}, |
|
1187
|
"GET /store/collections/{id}": { |
|
1188
|
"js-sdk": "sdk.store.collection.retrieve(\"pcol_123\")\n.then(({ collection }) => {\n console.log(collection)\n})" |
|
1189
|
}, |
|
1190
|
"GET /store/product-categories": { |
|
1191
|
"js-sdk": "sdk.store.category.list()\n.then(({ product_categories, count, offset, limit }) => {\n console.log(product_categories)\n})" |
|
1192
|
}, |
|
1193
|
"GET /store/product-categories/{id}": { |
|
1194
|
"js-sdk": "sdk.store.category.retrieve(\"pcat_123\")\n.then(({ product_category }) => {\n console.log(product_category)\n})" |
|
1195
|
}, |
|
1196
|
"GET /store/product-options": { |
|
1197
|
"js-sdk": "sdk.store.productOption.list()\n.then(({ product_options, count, offset, limit }) => {\n console.log(product_options)\n})" |
|
1198
|
}, |
|
1199
|
"GET /store/product-options/{id}": { |
|
1200
|
"js-sdk": "sdk.store.productOption.retrieve(\"opt_123\")\n.then(({ product_option }) => {\n console.log(product_option)\n})" |
|
1201
|
}, |
|
1202
|
"GET /store/products": { |
|
1203
|
"js-sdk": "sdk.store.product.list()\n.then(({ products, count, offset, limit }) => {\n console.log(products)\n})" |
|
1204
|
}, |
|
1205
|
"GET /store/products/{id}": { |
|
1206
|
"js-sdk": "sdk.store.product.retrieve(\"prod_123\")\n.then(({ product }) => {\n console.log(product)\n})" |
|
1207
|
}, |
|
1208
|
"POST /store/carts": { |
|
1209
|
"js-sdk": "sdk.store.cart.create({\n region_id: \"reg_123\"\n})\n.then(({ cart }) => {\n console.log(cart)\n})" |
|
1210
|
}, |
|
1211
|
"POST /store/carts/{id}": { |
|
1212
|
"js-sdk": "sdk.store.cart.update(\"cart_123\", {\n region_id: \"reg_123\"\n})\n.then(({ cart }) => {\n console.log(cart)\n})" |
|
1213
|
}, |
|
1214
|
"GET /store/carts/{id}": { |
|
1215
|
"js-sdk": "sdk.store.cart.retrieve(\"cart_123\")\n.then(({ cart }) => {\n console.log(cart)\n})" |
|
1216
|
}, |
|
1217
|
"POST /store/carts/{cartid}/line-items": { |
|
1218
|
"js-sdk": "sdk.store.cart.createLineItem(\"cart_123\", {\n variant_id: \"variant_123\",\n quantity: 1\n})\n.then(({ cart }) => {\n console.log(cart)\n})" |
|
1219
|
}, |
|
1220
|
"POST /store/carts/{cartid}/line-items/{lineitemid}": { |
|
1221
|
"js-sdk": "sdk.store.cart.updateLineItem(\n \"cart_123\",\n \"li_123\",\n {\n quantity: 1\n }\n)\n.then(({ cart }) => {\n console.log(cart)\n})" |
|
1222
|
}, |
|
1223
|
"DELETE /store/carts/{cartid}/line-items/{lineitemid}": { |
|
1224
|
"js-sdk": "sdk.store.cart.deleteLineItem(\n \"cart_123\",\n \"li_123\"\n)\n.then(({ deleted, parent: cart }) => {\n console.log(deleted, cart)\n})" |
|
1225
|
}, |
|
1226
|
"POST /store/carts/{cartid}/shipping-methods": { |
|
1227
|
"js-sdk": "sdk.store.cart.addShippingMethod(\"cart_123\", {\n option_id: \"so_123\",\n data: {\n // custom data for fulfillment provider.\n }\n})\n.then(({ cart }) => {\n console.log(cart)\n})" |
|
1228
|
}, |
|
1229
|
"POST /store/carts/{cartid}/promotions": { |
|
1230
|
"js-sdk": "sdk.store.cart.addPromotions(\"cart_123\", {\n promo_codes: [\"20OFF\"]\n})\n.then(({ cart }) => {\n console.log(cart)\n})" |
|
1231
|
}, |
|
1232
|
"DELETE /store/carts/{cartid}/promotions": { |
|
1233
|
"js-sdk": "sdk.store.cart.removePromotions(\"cart_123\", {\n promo_codes: [\"20OFF\"]\n})\n.then(({ cart }) => {\n console.log(cart)\n})" |
|
1234
|
}, |
|
1235
|
"POST /store/carts/{cartid}/complete": { |
|
1236
|
"js-sdk": "sdk.store.cart.complete(\"cart_123\")\n.then((data) => {\n if(data.type === \"cart\") {\n // an error occurred\n console.log(data.error, data.cart)\n } else {\n // order placed successfully\n console.log(data.order)\n }\n})" |
|
1237
|
}, |
|
1238
|
"POST /store/carts/{id}/customer": { |
|
1239
|
"js-sdk": "// TODO must be authenticated as the customer to set the cart's customer\nsdk.store.cart.transferCart(\"cart_123\")\n.then(({ cart }) => {\n console.log(cart)\n})" |
|
1240
|
}, |
|
1241
|
"GET /store/shipping-options": { |
|
1242
|
"js-sdk": "sdk.store.fulfillment.listCartOptions({\n cart_id: \"cart_123\"\n})\n.then(({ shipping_options }) => {\n console.log(shipping_options)\n})" |
|
1243
|
}, |
|
1244
|
"POST /store/shipping-options/{id}/calculate": { |
|
1245
|
"js-sdk": "sdk.store.fulfillment.calculate(\"so_123\", {\n cart_id: \"cart_123\"\n})\n.then(({ shipping_option }) => {\n console.log(shipping_option)\n})" |
|
1246
|
}, |
|
1247
|
"GET /store/payment-providers": { |
|
1248
|
"js-sdk": "sdk.store.payment.listPaymentProviders({\n region_id: \"reg_123\"\n})\n.then(({ payment_providers, count, offset, limit }) => {\n console.log(payment_providers)\n})" |
|
1249
|
}, |
|
1250
|
"POST /store/payment-collections": { |
|
1251
|
"js-sdk": "sdk.store.payment.initiatePaymentSession(\n cart, // assuming you already have the cart object.\n {\n provider_id: \"pp_stripe_stripe\",\n data: {\n // any data relevant for the provider.\n }\n }\n)\n.then(({ payment_collection }) => {\n console.log(payment_collection)\n})" |
|
1252
|
}, |
|
1253
|
"GET /store/orders": { |
|
1254
|
"js-sdk": "// TODO must be authenticated as the customer to list their orders\nsdk.store.order.list()\n.then(({ orders, count, offset, limit }) => {\n console.log(orders)\n})" |
|
1255
|
}, |
|
1256
|
"GET /store/orders/{id}": { |
|
1257
|
"js-sdk": "sdk.store.order.retrieve(\"order_123\")\n.then(({ order }) => {\n console.log(order)\n})" |
|
1258
|
}, |
|
1259
|
"POST /store/orders/{id}/transfer/request": { |
|
1260
|
"js-sdk": "// TODO must be authenticated as the customer to request the order transfer\nsdk.store.order.requestTransfer(\n \"order_123\",\n {\n description: \"I want to transfer this order to my friend.\"\n },\n {},\n {\n Authorization: `Bearer ${token}`\n }\n)\n.then(({ order }) => {\n console.log(order)\n})" |
|
1261
|
}, |
|
1262
|
"POST /store/orders/{id}/transfer/cancel": { |
|
1263
|
"js-sdk": "// TODO must be authenticated as the customer to cancel the order transfer\nsdk.store.order.cancelTransfer(\n \"order_123\",\n {},\n {\n Authorization: `Bearer ${token}`\n }\n)\n.then(({ order }) => {\n console.log(order)\n})" |
|
1264
|
}, |
|
1265
|
"POST /store/orders/{id}/transfer/accept": { |
|
1266
|
"js-sdk": "sdk.store.order.acceptTransfer(\n \"order_123\",\n {\n token: \"transfer_token\"\n },\n {\n Authorization: `Bearer ${token}`\n }\n)\n.then(({ order }) => {\n console.log(order)\n})" |
|
1267
|
}, |
|
1268
|
"POST /store/orders/{id}/transfer/decline": { |
|
1269
|
"js-sdk": "sdk.store.order.declineTransfer(\n \"order_123\",\n {\n token: \"transfer_token\"\n },\n {\n Authorization: `Bearer ${token}`\n }\n)\n.then(({ order }) => {\n console.log(order)\n})" |
|
1270
|
}, |
|
1271
|
"POST /store/customers": { |
|
1272
|
"js-sdk": "const token = await sdk.auth.register(\"customer\", \"emailpass\", {\n \"email\": \"customer@gmail.com\",\n \"password\": \"supersecret\"\n})\n\nsdk.store.customer.create(\n {\n \"email\": \"customer@gmail.com\"\n },\n {},\n {\n Authorization: `Bearer ${token}`\n }\n)\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
1273
|
}, |
|
1274
|
"POST /store/customers/me": { |
|
1275
|
"js-sdk": "// TODO must be authenticated as the customer to update their details\nsdk.store.customer.update({\n first_name: \"John\"\n})\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
1276
|
}, |
|
1277
|
"GET /store/customers/me": { |
|
1278
|
"js-sdk": "// TODO must be authenticated as the customer to retrieve their details\nsdk.store.customer.retrieve()\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
1279
|
}, |
|
1280
|
"POST /store/customers/me/addresses": { |
|
1281
|
"js-sdk": "// TODO must be authenticated as the customer to create an address\nsdk.store.customer.createAddress({\n country_code: \"us\"\n})\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
1282
|
}, |
|
1283
|
"POST /store/customers/me/addresses/{addressid}": { |
|
1284
|
"js-sdk": "// TODO must be authenticated as the customer to update their address\nsdk.store.customer.updateAddress(\n \"caddr_123\",\n {\n country_code: \"us\"\n }\n)\n.then(({ customer }) => {\n console.log(customer)\n})" |
|
1285
|
}, |
|
1286
|
"GET /store/customers/me/addresses": { |
|
1287
|
"js-sdk": "// TODO must be authenticated as the customer to list their addresses\nsdk.store.customer.listAddress()\n.then(({ addresses, count, offset, limit }) => {\n console.log(addresses)\n})" |
|
1288
|
}, |
|
1289
|
"GET /store/customers/me/addresses/{addressid}": { |
|
1290
|
"js-sdk": "// TODO must be authenticated as the customer to retrieve their address\nsdk.store.customer.retrieveAddress(\n \"caddr_123\"\n)\n.then(({ address }) => {\n console.log(address)\n})" |
|
1291
|
}, |
|
1292
|
"DELETE /store/customers/me/addresses/{addressid}": { |
|
1293
|
"js-sdk": "// TODO must be authenticated as the customer to delete their address\nsdk.store.customer.deleteAddress(\"caddr_123\")\n.then(({ deleted, parent: customer }) => {\n console.log(customer)\n})" |
|
1294
|
}, |
|
1295
|
"GET /store/locales": { |
|
1296
|
"js-sdk": "sdk.store.locale.list()\n.then(({ locales }) => {\n console.log(locales)\n})" |
|
1297
|
} |
|
1298
|
} |