@zippendo/sdk 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/apis/OrderChannelsApi.d.ts +195 -0
  2. package/dist/apis/OrderChannelsApi.js +496 -0
  3. package/dist/apis/index.d.ts +1 -0
  4. package/dist/apis/index.js +1 -0
  5. package/dist/esm/apis/OrderChannelsApi.d.ts +195 -0
  6. package/dist/esm/apis/OrderChannelsApi.js +492 -0
  7. package/dist/esm/apis/index.d.ts +1 -0
  8. package/dist/esm/apis/index.js +1 -0
  9. package/dist/esm/models/BatchSendShipments200ResponseResultsInner.d.ts +4 -0
  10. package/dist/esm/models/BatchSendShipments200ResponseResultsInner.js +4 -0
  11. package/dist/esm/models/CreateOrderChannelRequest.d.ts +65 -0
  12. package/dist/esm/models/CreateOrderChannelRequest.js +61 -0
  13. package/dist/esm/models/CreateOrderChannelRequestSettings.d.ts +105 -0
  14. package/dist/esm/models/CreateOrderChannelRequestSettings.js +66 -0
  15. package/dist/esm/models/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.d.ts +52 -0
  16. package/dist/esm/models/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.js +56 -0
  17. package/dist/esm/models/CreateOrderChannelWebhookSecret201Response.d.ts +44 -0
  18. package/dist/esm/models/CreateOrderChannelWebhookSecret201Response.js +51 -0
  19. package/dist/esm/models/CreateOrderRequest.d.ts +12 -0
  20. package/dist/esm/models/CreateOrderRequest.js +4 -0
  21. package/dist/esm/models/GetOrderChannelWebhookStatus200Response.d.ts +45 -0
  22. package/dist/esm/models/GetOrderChannelWebhookStatus200Response.js +52 -0
  23. package/dist/esm/models/GetOrderChannelWebhookStatus200ResponseWebhooksInner.d.ts +62 -0
  24. package/dist/esm/models/GetOrderChannelWebhookStatus200ResponseWebhooksInner.js +59 -0
  25. package/dist/esm/models/ListApiTokens401Response.d.ts +4 -0
  26. package/dist/esm/models/ListApiTokens401Response.js +4 -0
  27. package/dist/esm/models/ListOrderChannels200Response.d.ts +57 -0
  28. package/dist/esm/models/ListOrderChannels200Response.js +60 -0
  29. package/dist/esm/models/ListOrderChannels200ResponseDataInner.d.ts +121 -0
  30. package/dist/esm/models/ListOrderChannels200ResponseDataInner.js +97 -0
  31. package/dist/esm/models/ListOrderChannels200ResponseDataInnerSettings.d.ts +129 -0
  32. package/dist/esm/models/ListOrderChannels200ResponseDataInnerSettings.js +86 -0
  33. package/dist/esm/models/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.d.ts +52 -0
  34. package/dist/esm/models/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.js +56 -0
  35. package/dist/esm/models/ListOrders200ResponseDataInnerOrderChannel.d.ts +1 -0
  36. package/dist/esm/models/ListOrders200ResponseDataInnerOrderChannel.js +2 -1
  37. package/dist/esm/models/RevokeOrderChannelWebhookSecret200Response.d.ts +32 -0
  38. package/dist/esm/models/RevokeOrderChannelWebhookSecret200Response.js +43 -0
  39. package/dist/esm/models/SendShipment422Response.d.ts +4 -0
  40. package/dist/esm/models/SendShipment422Response.js +4 -0
  41. package/dist/esm/models/UpdateOrderChannelRequest.d.ts +65 -0
  42. package/dist/esm/models/UpdateOrderChannelRequest.js +52 -0
  43. package/dist/esm/models/UpdateOrderChannelRequestSettings.d.ts +105 -0
  44. package/dist/esm/models/UpdateOrderChannelRequestSettings.js +66 -0
  45. package/dist/esm/models/UpdateOrgRequest.d.ts +0 -6
  46. package/dist/esm/models/UpdateOrgRequest.js +0 -2
  47. package/dist/esm/models/index.d.ts +13 -0
  48. package/dist/esm/models/index.js +13 -0
  49. package/dist/models/BatchSendShipments200ResponseResultsInner.d.ts +4 -0
  50. package/dist/models/BatchSendShipments200ResponseResultsInner.js +4 -0
  51. package/dist/models/CreateOrderChannelRequest.d.ts +65 -0
  52. package/dist/models/CreateOrderChannelRequest.js +69 -0
  53. package/dist/models/CreateOrderChannelRequestSettings.d.ts +105 -0
  54. package/dist/models/CreateOrderChannelRequestSettings.js +73 -0
  55. package/dist/models/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.d.ts +52 -0
  56. package/dist/models/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.js +64 -0
  57. package/dist/models/CreateOrderChannelWebhookSecret201Response.d.ts +44 -0
  58. package/dist/models/CreateOrderChannelWebhookSecret201Response.js +58 -0
  59. package/dist/models/CreateOrderRequest.d.ts +12 -0
  60. package/dist/models/CreateOrderRequest.js +4 -0
  61. package/dist/models/GetOrderChannelWebhookStatus200Response.d.ts +45 -0
  62. package/dist/models/GetOrderChannelWebhookStatus200Response.js +59 -0
  63. package/dist/models/GetOrderChannelWebhookStatus200ResponseWebhooksInner.d.ts +62 -0
  64. package/dist/models/GetOrderChannelWebhookStatus200ResponseWebhooksInner.js +66 -0
  65. package/dist/models/ListApiTokens401Response.d.ts +4 -0
  66. package/dist/models/ListApiTokens401Response.js +4 -0
  67. package/dist/models/ListOrderChannels200Response.d.ts +57 -0
  68. package/dist/models/ListOrderChannels200Response.js +67 -0
  69. package/dist/models/ListOrderChannels200ResponseDataInner.d.ts +121 -0
  70. package/dist/models/ListOrderChannels200ResponseDataInner.js +105 -0
  71. package/dist/models/ListOrderChannels200ResponseDataInnerSettings.d.ts +129 -0
  72. package/dist/models/ListOrderChannels200ResponseDataInnerSettings.js +93 -0
  73. package/dist/models/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.d.ts +52 -0
  74. package/dist/models/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.js +64 -0
  75. package/dist/models/ListOrders200ResponseDataInnerOrderChannel.d.ts +1 -0
  76. package/dist/models/ListOrders200ResponseDataInnerOrderChannel.js +2 -1
  77. package/dist/models/RevokeOrderChannelWebhookSecret200Response.d.ts +32 -0
  78. package/dist/models/RevokeOrderChannelWebhookSecret200Response.js +50 -0
  79. package/dist/models/SendShipment422Response.d.ts +4 -0
  80. package/dist/models/SendShipment422Response.js +4 -0
  81. package/dist/models/UpdateOrderChannelRequest.d.ts +65 -0
  82. package/dist/models/UpdateOrderChannelRequest.js +59 -0
  83. package/dist/models/UpdateOrderChannelRequestSettings.d.ts +105 -0
  84. package/dist/models/UpdateOrderChannelRequestSettings.js +73 -0
  85. package/dist/models/UpdateOrgRequest.d.ts +0 -6
  86. package/dist/models/UpdateOrgRequest.js +0 -2
  87. package/dist/models/index.d.ts +13 -0
  88. package/dist/models/index.js +13 -0
  89. package/docs/CreateOrderChannelRequest.md +42 -0
  90. package/docs/CreateOrderChannelRequestSettings.md +58 -0
  91. package/docs/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.md +38 -0
  92. package/docs/CreateOrderChannelWebhookSecret201Response.md +38 -0
  93. package/docs/CreateOrderRequest.md +4 -0
  94. package/docs/GetOrderChannelWebhookStatus200Response.md +38 -0
  95. package/docs/GetOrderChannelWebhookStatus200ResponseWebhooksInner.md +44 -0
  96. package/docs/ListOrderChannels200Response.md +42 -0
  97. package/docs/ListOrderChannels200ResponseDataInner.md +60 -0
  98. package/docs/ListOrderChannels200ResponseDataInnerSettings.md +67 -0
  99. package/docs/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.md +38 -0
  100. package/docs/OrderChannelsApi.md +650 -0
  101. package/docs/OrdersApi.md +1 -0
  102. package/docs/RevokeOrderChannelWebhookSecret200Response.md +34 -0
  103. package/docs/UpdateOrderChannelRequest.md +44 -0
  104. package/docs/UpdateOrderChannelRequestSettings.md +59 -0
  105. package/docs/UpdateOrgRequest.md +0 -2
  106. package/package.json +1 -1
  107. package/src/apis/OrderChannelsApi.ts +670 -0
  108. package/src/apis/index.ts +1 -0
  109. package/src/models/BatchSendShipments200ResponseResultsInner.ts +4 -0
  110. package/src/models/CreateOrderChannelRequest.ts +118 -0
  111. package/src/models/CreateOrderChannelRequestSettings.ts +169 -0
  112. package/src/models/CreateOrderChannelRequestSettingsShippingMethodMappingsInner.ts +94 -0
  113. package/src/models/CreateOrderChannelWebhookSecret201Response.ts +84 -0
  114. package/src/models/CreateOrderRequest.ts +16 -0
  115. package/src/models/GetOrderChannelWebhookStatus200Response.ts +92 -0
  116. package/src/models/GetOrderChannelWebhookStatus200ResponseWebhooksInner.ts +109 -0
  117. package/src/models/ListApiTokens401Response.ts +4 -0
  118. package/src/models/ListOrderChannels200Response.ts +110 -0
  119. package/src/models/ListOrderChannels200ResponseDataInner.ts +200 -0
  120. package/src/models/ListOrderChannels200ResponseDataInnerSettings.ts +207 -0
  121. package/src/models/ListOrderChannels200ResponseDataInnerSettingsShippingMethodMappingsInner.ts +94 -0
  122. package/src/models/ListOrders200ResponseDataInnerOrderChannel.ts +2 -1
  123. package/src/models/RevokeOrderChannelWebhookSecret200Response.ts +66 -0
  124. package/src/models/SendShipment422Response.ts +4 -0
  125. package/src/models/UpdateOrderChannelRequest.ts +113 -0
  126. package/src/models/UpdateOrderChannelRequestSettings.ts +169 -0
  127. package/src/models/UpdateOrgRequest.ts +0 -8
  128. package/src/models/index.ts +13 -0
@@ -0,0 +1,492 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Zippendo Public API
5
+ * Public API documentation for Zippendo. Authenticate using your API token (Bearer token prefixed with zipp_). **Brands (sub-accounts).** An organization can be split into brands, each keeping its own orders, shipments and configuration separate. There are two ways to scope requests to one brand, and NEITHER changes any request body: 1. **Bind the token.** Create an API token with a `brandId` and every request it makes is confined to that brand — reads filtered, writes stamped. This is the recommended way to give a single brand\'s team its own credential. 2. **Send the `X-Zippendo-Brand` header.** An organization-wide token can scope an individual request by sending the brand\'s id or slug in this header. Most SDKs let you set it once on the client so every call inherits it. A brand-bound token that receives an `X-Zippendo-Brand` header naming a different brand is rejected with `403 BRAND_ACCESS_DENIED` — the binding is never widened. Omit both and requests cover the whole organization, which is the behaviour of every existing token. Records that belong to no brand carry `brandId: null`. Configuration (carriers, shipping rules, addresses) with a null brand is organization-wide and remains visible inside every brand; orders and shipments with a null brand are only visible organization-wide. List endpoints additionally take a `?brandScope=own|shared|both` parameter to narrow further within whichever brand context already applies. `own` returns only rows assigned to that brand, and requires a brand context — a brand-bound token, a resolved brand session, or the `X-Zippendo-Brand` header above — otherwise `400`. `shared` returns only the organization-wide rows (equivalent to filtering `brandId=none`). The default, `both`, keeps the existing behaviour: a brand context sees its own rows plus the organization-wide ones. Set `X-Zippendo-Brand-Scope` as a client default to apply the same choice to every request instead of repeating the query parameter on each call — an explicit `brandScope` query parameter always wins over the header, and a blank header value is ignored. Brands themselves are managed under the **Brands** tag. Retiring a brand is done with `POST /orgs/{orgId}/brands/{brandId}/archive` — permanent deletion is a dashboard-only action, since it is refused while any order, shipment, member or token still references the brand. Brands require a plan that includes them; creating one beyond your plan\'s limit returns `403`.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@zippendo.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { CreateOrderChannelRequestToJSON, } from '../models/CreateOrderChannelRequest';
25
+ import { CreateOrderChannelWebhookSecret201ResponseFromJSON, } from '../models/CreateOrderChannelWebhookSecret201Response';
26
+ import { GetOrderChannelWebhookStatus200ResponseFromJSON, } from '../models/GetOrderChannelWebhookStatus200Response';
27
+ import { ListOrderChannels200ResponseFromJSON, } from '../models/ListOrderChannels200Response';
28
+ import { ListOrderChannels200ResponseDataInnerFromJSON, } from '../models/ListOrderChannels200ResponseDataInner';
29
+ import { RevokeApiToken200ResponseFromJSON, } from '../models/RevokeApiToken200Response';
30
+ import { RevokeOrderChannelWebhookSecret200ResponseFromJSON, } from '../models/RevokeOrderChannelWebhookSecret200Response';
31
+ import { UpdateOrderChannelRequestToJSON, } from '../models/UpdateOrderChannelRequest';
32
+ /**
33
+ *
34
+ */
35
+ export class OrderChannelsApi extends runtime.BaseAPI {
36
+ /**
37
+ * Creates request options for createOrderChannel without sending the request
38
+ */
39
+ createOrderChannelRequestOpts(requestParameters) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ if (requestParameters['orgId'] == null) {
42
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling createOrderChannel().');
43
+ }
44
+ if (requestParameters['createOrderChannelRequest'] == null) {
45
+ throw new runtime.RequiredError('createOrderChannelRequest', 'Required parameter "createOrderChannelRequest" was null or undefined when calling createOrderChannel().');
46
+ }
47
+ const queryParameters = {};
48
+ const headerParameters = {};
49
+ headerParameters['Content-Type'] = 'application/json';
50
+ if (this.configuration && this.configuration.accessToken) {
51
+ const token = this.configuration.accessToken;
52
+ const tokenString = yield token("bearerAuth", []);
53
+ if (tokenString) {
54
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
55
+ }
56
+ }
57
+ let urlPath = `/orgs/{orgId}/order-channels`;
58
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
59
+ return {
60
+ path: urlPath,
61
+ method: 'POST',
62
+ headers: headerParameters,
63
+ query: queryParameters,
64
+ body: CreateOrderChannelRequestToJSON(requestParameters['createOrderChannelRequest']),
65
+ };
66
+ });
67
+ }
68
+ /**
69
+ * Creates a new order channel for an organization.
70
+ * Create order channel
71
+ */
72
+ createOrderChannelRaw(requestParameters, initOverrides) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const requestOptions = yield this.createOrderChannelRequestOpts(requestParameters);
75
+ const response = yield this.request(requestOptions, initOverrides);
76
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListOrderChannels200ResponseDataInnerFromJSON(jsonValue));
77
+ });
78
+ }
79
+ /**
80
+ * Creates a new order channel for an organization.
81
+ * Create order channel
82
+ */
83
+ createOrderChannel(requestParameters, initOverrides) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ const response = yield this.createOrderChannelRaw(requestParameters, initOverrides);
86
+ return yield response.value();
87
+ });
88
+ }
89
+ /**
90
+ * Creates request options for createOrderChannelWebhookSecret without sending the request
91
+ */
92
+ createOrderChannelWebhookSecretRequestOpts(requestParameters) {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ if (requestParameters['orgId'] == null) {
95
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling createOrderChannelWebhookSecret().');
96
+ }
97
+ if (requestParameters['channelId'] == null) {
98
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling createOrderChannelWebhookSecret().');
99
+ }
100
+ const queryParameters = {};
101
+ const headerParameters = {};
102
+ if (this.configuration && this.configuration.accessToken) {
103
+ const token = this.configuration.accessToken;
104
+ const tokenString = yield token("bearerAuth", []);
105
+ if (tokenString) {
106
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
107
+ }
108
+ }
109
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}/webhook-secret`;
110
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
111
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
112
+ return {
113
+ path: urlPath,
114
+ method: 'POST',
115
+ headers: headerParameters,
116
+ query: queryParameters,
117
+ };
118
+ });
119
+ }
120
+ /**
121
+ * Generates (or rotates) the custom channel\'s webhook signing secret used to authenticate order pushes to the ingest URL. The secret is returned only once. Rotating invalidates the previous secret immediately.
122
+ * Create or rotate webhook signing secret
123
+ */
124
+ createOrderChannelWebhookSecretRaw(requestParameters, initOverrides) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ const requestOptions = yield this.createOrderChannelWebhookSecretRequestOpts(requestParameters);
127
+ const response = yield this.request(requestOptions, initOverrides);
128
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateOrderChannelWebhookSecret201ResponseFromJSON(jsonValue));
129
+ });
130
+ }
131
+ /**
132
+ * Generates (or rotates) the custom channel\'s webhook signing secret used to authenticate order pushes to the ingest URL. The secret is returned only once. Rotating invalidates the previous secret immediately.
133
+ * Create or rotate webhook signing secret
134
+ */
135
+ createOrderChannelWebhookSecret(requestParameters, initOverrides) {
136
+ return __awaiter(this, void 0, void 0, function* () {
137
+ const response = yield this.createOrderChannelWebhookSecretRaw(requestParameters, initOverrides);
138
+ return yield response.value();
139
+ });
140
+ }
141
+ /**
142
+ * Creates request options for deleteOrderChannel without sending the request
143
+ */
144
+ deleteOrderChannelRequestOpts(requestParameters) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ if (requestParameters['orgId'] == null) {
147
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling deleteOrderChannel().');
148
+ }
149
+ if (requestParameters['channelId'] == null) {
150
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling deleteOrderChannel().');
151
+ }
152
+ const queryParameters = {};
153
+ const headerParameters = {};
154
+ if (this.configuration && this.configuration.accessToken) {
155
+ const token = this.configuration.accessToken;
156
+ const tokenString = yield token("bearerAuth", []);
157
+ if (tokenString) {
158
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
159
+ }
160
+ }
161
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}`;
162
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
163
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
164
+ return {
165
+ path: urlPath,
166
+ method: 'DELETE',
167
+ headers: headerParameters,
168
+ query: queryParameters,
169
+ };
170
+ });
171
+ }
172
+ /**
173
+ * Deletes an order channel and cascades deletion of its orders.
174
+ * Delete order channel
175
+ */
176
+ deleteOrderChannelRaw(requestParameters, initOverrides) {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ const requestOptions = yield this.deleteOrderChannelRequestOpts(requestParameters);
179
+ const response = yield this.request(requestOptions, initOverrides);
180
+ return new runtime.JSONApiResponse(response, (jsonValue) => RevokeApiToken200ResponseFromJSON(jsonValue));
181
+ });
182
+ }
183
+ /**
184
+ * Deletes an order channel and cascades deletion of its orders.
185
+ * Delete order channel
186
+ */
187
+ deleteOrderChannel(requestParameters, initOverrides) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ const response = yield this.deleteOrderChannelRaw(requestParameters, initOverrides);
190
+ return yield response.value();
191
+ });
192
+ }
193
+ /**
194
+ * Creates request options for getOrderChannel without sending the request
195
+ */
196
+ getOrderChannelRequestOpts(requestParameters) {
197
+ return __awaiter(this, void 0, void 0, function* () {
198
+ if (requestParameters['orgId'] == null) {
199
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling getOrderChannel().');
200
+ }
201
+ if (requestParameters['channelId'] == null) {
202
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling getOrderChannel().');
203
+ }
204
+ const queryParameters = {};
205
+ const headerParameters = {};
206
+ if (this.configuration && this.configuration.accessToken) {
207
+ const token = this.configuration.accessToken;
208
+ const tokenString = yield token("bearerAuth", []);
209
+ if (tokenString) {
210
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
211
+ }
212
+ }
213
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}`;
214
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
215
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
216
+ return {
217
+ path: urlPath,
218
+ method: 'GET',
219
+ headers: headerParameters,
220
+ query: queryParameters,
221
+ };
222
+ });
223
+ }
224
+ /**
225
+ * Returns a single order channel by ID, including its linked shipping rules.
226
+ * Get order channel
227
+ */
228
+ getOrderChannelRaw(requestParameters, initOverrides) {
229
+ return __awaiter(this, void 0, void 0, function* () {
230
+ const requestOptions = yield this.getOrderChannelRequestOpts(requestParameters);
231
+ const response = yield this.request(requestOptions, initOverrides);
232
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListOrderChannels200ResponseDataInnerFromJSON(jsonValue));
233
+ });
234
+ }
235
+ /**
236
+ * Returns a single order channel by ID, including its linked shipping rules.
237
+ * Get order channel
238
+ */
239
+ getOrderChannel(requestParameters, initOverrides) {
240
+ return __awaiter(this, void 0, void 0, function* () {
241
+ const response = yield this.getOrderChannelRaw(requestParameters, initOverrides);
242
+ return yield response.value();
243
+ });
244
+ }
245
+ /**
246
+ * Creates request options for getOrderChannelWebhookStatus without sending the request
247
+ */
248
+ getOrderChannelWebhookStatusRequestOpts(requestParameters) {
249
+ return __awaiter(this, void 0, void 0, function* () {
250
+ if (requestParameters['orgId'] == null) {
251
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling getOrderChannelWebhookStatus().');
252
+ }
253
+ if (requestParameters['channelId'] == null) {
254
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling getOrderChannelWebhookStatus().');
255
+ }
256
+ const queryParameters = {};
257
+ const headerParameters = {};
258
+ if (this.configuration && this.configuration.accessToken) {
259
+ const token = this.configuration.accessToken;
260
+ const tokenString = yield token("bearerAuth", []);
261
+ if (tokenString) {
262
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
263
+ }
264
+ }
265
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}/webhooks`;
266
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
267
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
268
+ return {
269
+ path: urlPath,
270
+ method: 'GET',
271
+ headers: headerParameters,
272
+ query: queryParameters,
273
+ };
274
+ });
275
+ }
276
+ /**
277
+ * Returns whether webhooks are enabled and lists the webhooks registered with the platform.
278
+ * Get channel webhook status
279
+ */
280
+ getOrderChannelWebhookStatusRaw(requestParameters, initOverrides) {
281
+ return __awaiter(this, void 0, void 0, function* () {
282
+ const requestOptions = yield this.getOrderChannelWebhookStatusRequestOpts(requestParameters);
283
+ const response = yield this.request(requestOptions, initOverrides);
284
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetOrderChannelWebhookStatus200ResponseFromJSON(jsonValue));
285
+ });
286
+ }
287
+ /**
288
+ * Returns whether webhooks are enabled and lists the webhooks registered with the platform.
289
+ * Get channel webhook status
290
+ */
291
+ getOrderChannelWebhookStatus(requestParameters, initOverrides) {
292
+ return __awaiter(this, void 0, void 0, function* () {
293
+ const response = yield this.getOrderChannelWebhookStatusRaw(requestParameters, initOverrides);
294
+ return yield response.value();
295
+ });
296
+ }
297
+ /**
298
+ * Creates request options for listOrderChannels without sending the request
299
+ */
300
+ listOrderChannelsRequestOpts(requestParameters) {
301
+ return __awaiter(this, void 0, void 0, function* () {
302
+ if (requestParameters['orgId'] == null) {
303
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling listOrderChannels().');
304
+ }
305
+ const queryParameters = {};
306
+ if (requestParameters['page'] != null) {
307
+ queryParameters['page'] = requestParameters['page'];
308
+ }
309
+ if (requestParameters['limit'] != null) {
310
+ queryParameters['limit'] = requestParameters['limit'];
311
+ }
312
+ if (requestParameters['brandId'] != null) {
313
+ queryParameters['brandId'] = requestParameters['brandId'];
314
+ }
315
+ if (requestParameters['brandScope'] != null) {
316
+ queryParameters['brandScope'] = requestParameters['brandScope'];
317
+ }
318
+ if (requestParameters['type'] != null) {
319
+ queryParameters['type'] = requestParameters['type'];
320
+ }
321
+ if (requestParameters['enabled'] != null) {
322
+ queryParameters['enabled'] = requestParameters['enabled'];
323
+ }
324
+ if (requestParameters['search'] != null) {
325
+ queryParameters['search'] = requestParameters['search'];
326
+ }
327
+ const headerParameters = {};
328
+ if (this.configuration && this.configuration.accessToken) {
329
+ const token = this.configuration.accessToken;
330
+ const tokenString = yield token("bearerAuth", []);
331
+ if (tokenString) {
332
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
333
+ }
334
+ }
335
+ let urlPath = `/orgs/{orgId}/order-channels`;
336
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
337
+ return {
338
+ path: urlPath,
339
+ method: 'GET',
340
+ headers: headerParameters,
341
+ query: queryParameters,
342
+ };
343
+ });
344
+ }
345
+ /**
346
+ * Returns a paginated list of order channels for an organization.
347
+ * List order channels
348
+ */
349
+ listOrderChannelsRaw(requestParameters, initOverrides) {
350
+ return __awaiter(this, void 0, void 0, function* () {
351
+ const requestOptions = yield this.listOrderChannelsRequestOpts(requestParameters);
352
+ const response = yield this.request(requestOptions, initOverrides);
353
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListOrderChannels200ResponseFromJSON(jsonValue));
354
+ });
355
+ }
356
+ /**
357
+ * Returns a paginated list of order channels for an organization.
358
+ * List order channels
359
+ */
360
+ listOrderChannels(requestParameters, initOverrides) {
361
+ return __awaiter(this, void 0, void 0, function* () {
362
+ const response = yield this.listOrderChannelsRaw(requestParameters, initOverrides);
363
+ return yield response.value();
364
+ });
365
+ }
366
+ /**
367
+ * Creates request options for revokeOrderChannelWebhookSecret without sending the request
368
+ */
369
+ revokeOrderChannelWebhookSecretRequestOpts(requestParameters) {
370
+ return __awaiter(this, void 0, void 0, function* () {
371
+ if (requestParameters['orgId'] == null) {
372
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling revokeOrderChannelWebhookSecret().');
373
+ }
374
+ if (requestParameters['channelId'] == null) {
375
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling revokeOrderChannelWebhookSecret().');
376
+ }
377
+ const queryParameters = {};
378
+ const headerParameters = {};
379
+ if (this.configuration && this.configuration.accessToken) {
380
+ const token = this.configuration.accessToken;
381
+ const tokenString = yield token("bearerAuth", []);
382
+ if (tokenString) {
383
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
384
+ }
385
+ }
386
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}/webhook-secret`;
387
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
388
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
389
+ return {
390
+ path: urlPath,
391
+ method: 'DELETE',
392
+ headers: headerParameters,
393
+ query: queryParameters,
394
+ };
395
+ });
396
+ }
397
+ /**
398
+ * Revokes the custom channel\'s webhook signing secret. All subsequent pushes to the ingest URL are rejected until a new secret is generated.
399
+ * Revoke webhook signing secret
400
+ */
401
+ revokeOrderChannelWebhookSecretRaw(requestParameters, initOverrides) {
402
+ return __awaiter(this, void 0, void 0, function* () {
403
+ const requestOptions = yield this.revokeOrderChannelWebhookSecretRequestOpts(requestParameters);
404
+ const response = yield this.request(requestOptions, initOverrides);
405
+ return new runtime.JSONApiResponse(response, (jsonValue) => RevokeOrderChannelWebhookSecret200ResponseFromJSON(jsonValue));
406
+ });
407
+ }
408
+ /**
409
+ * Revokes the custom channel\'s webhook signing secret. All subsequent pushes to the ingest URL are rejected until a new secret is generated.
410
+ * Revoke webhook signing secret
411
+ */
412
+ revokeOrderChannelWebhookSecret(requestParameters, initOverrides) {
413
+ return __awaiter(this, void 0, void 0, function* () {
414
+ const response = yield this.revokeOrderChannelWebhookSecretRaw(requestParameters, initOverrides);
415
+ return yield response.value();
416
+ });
417
+ }
418
+ /**
419
+ * Creates request options for updateOrderChannel without sending the request
420
+ */
421
+ updateOrderChannelRequestOpts(requestParameters) {
422
+ return __awaiter(this, void 0, void 0, function* () {
423
+ if (requestParameters['orgId'] == null) {
424
+ throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling updateOrderChannel().');
425
+ }
426
+ if (requestParameters['channelId'] == null) {
427
+ throw new runtime.RequiredError('channelId', 'Required parameter "channelId" was null or undefined when calling updateOrderChannel().');
428
+ }
429
+ if (requestParameters['updateOrderChannelRequest'] == null) {
430
+ throw new runtime.RequiredError('updateOrderChannelRequest', 'Required parameter "updateOrderChannelRequest" was null or undefined when calling updateOrderChannel().');
431
+ }
432
+ const queryParameters = {};
433
+ const headerParameters = {};
434
+ headerParameters['Content-Type'] = 'application/json';
435
+ if (this.configuration && this.configuration.accessToken) {
436
+ const token = this.configuration.accessToken;
437
+ const tokenString = yield token("bearerAuth", []);
438
+ if (tokenString) {
439
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
440
+ }
441
+ }
442
+ let urlPath = `/orgs/{orgId}/order-channels/{channelId}`;
443
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
444
+ urlPath = urlPath.replace('{channelId}', encodeURIComponent(String(requestParameters['channelId'])));
445
+ return {
446
+ path: urlPath,
447
+ method: 'PATCH',
448
+ headers: headerParameters,
449
+ query: queryParameters,
450
+ body: UpdateOrderChannelRequestToJSON(requestParameters['updateOrderChannelRequest']),
451
+ };
452
+ });
453
+ }
454
+ /**
455
+ * Updates an order channel and its linked shipping rules.
456
+ * Update order channel
457
+ */
458
+ updateOrderChannelRaw(requestParameters, initOverrides) {
459
+ return __awaiter(this, void 0, void 0, function* () {
460
+ const requestOptions = yield this.updateOrderChannelRequestOpts(requestParameters);
461
+ const response = yield this.request(requestOptions, initOverrides);
462
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListOrderChannels200ResponseDataInnerFromJSON(jsonValue));
463
+ });
464
+ }
465
+ /**
466
+ * Updates an order channel and its linked shipping rules.
467
+ * Update order channel
468
+ */
469
+ updateOrderChannel(requestParameters, initOverrides) {
470
+ return __awaiter(this, void 0, void 0, function* () {
471
+ const response = yield this.updateOrderChannelRaw(requestParameters, initOverrides);
472
+ return yield response.value();
473
+ });
474
+ }
475
+ }
476
+ /**
477
+ * @export
478
+ */
479
+ export const ListOrderChannelsBrandScopeEnum = {
480
+ Own: 'own',
481
+ Shared: 'shared',
482
+ Both: 'both'
483
+ };
484
+ /**
485
+ * @export
486
+ */
487
+ export const ListOrderChannelsTypeEnum = {
488
+ Shopify: 'shopify',
489
+ Woocommerce: 'woocommerce',
490
+ Manual: 'manual',
491
+ Custom: 'custom'
492
+ };
@@ -3,6 +3,7 @@ export * from './BillingApi';
3
3
  export * from './BrandsApi';
4
4
  export * from './CarrierCatalogApi';
5
5
  export * from './CarriersApi';
6
+ export * from './OrderChannelsApi';
6
7
  export * from './OrdersApi';
7
8
  export * from './OrgsApi';
8
9
  export * from './QuotesApi';
@@ -5,6 +5,7 @@ export * from './BillingApi';
5
5
  export * from './BrandsApi';
6
6
  export * from './CarrierCatalogApi';
7
7
  export * from './CarriersApi';
8
+ export * from './OrderChannelsApi';
8
9
  export * from './OrdersApi';
9
10
  export * from './OrgsApi';
10
11
  export * from './QuotesApi';
@@ -83,6 +83,9 @@ export declare const BatchSendShipments200ResponseResultsInnerCodeEnum: {
83
83
  readonly AuthMfaRequired: "AUTH_MFA_REQUIRED";
84
84
  readonly AuthMfaInvalidCode: "AUTH_MFA_INVALID_CODE";
85
85
  readonly AuthMfaAlreadyEnabled: "AUTH_MFA_ALREADY_ENABLED";
86
+ readonly CaptchaFailed: "CAPTCHA_FAILED";
87
+ readonly EmailDomainBlocked: "EMAIL_DOMAIN_BLOCKED";
88
+ readonly VatInvalid: "VAT_INVALID";
86
89
  readonly AuthMfaNotEnabled: "AUTH_MFA_NOT_ENABLED";
87
90
  readonly SessionRequired: "SESSION_REQUIRED";
88
91
  readonly OrgNotFound: "ORG_NOT_FOUND";
@@ -155,6 +158,7 @@ export declare const BatchSendShipments200ResponseResultsInnerCodeEnum: {
155
158
  readonly ShippingRuleInvalid: "SHIPPING_RULE_INVALID";
156
159
  readonly AddressNotFound: "ADDRESS_NOT_FOUND";
157
160
  readonly OrderNotFound: "ORDER_NOT_FOUND";
161
+ readonly OrderExists: "ORDER_EXISTS";
158
162
  readonly OrderChannelNotFound: "ORDER_CHANNEL_NOT_FOUND";
159
163
  readonly OrderChannelConfigInvalid: "ORDER_CHANNEL_CONFIG_INVALID";
160
164
  readonly IntegrationNotConfigured: "INTEGRATION_NOT_CONFIGURED";
@@ -47,6 +47,9 @@ export const BatchSendShipments200ResponseResultsInnerCodeEnum = {
47
47
  AuthMfaRequired: 'AUTH_MFA_REQUIRED',
48
48
  AuthMfaInvalidCode: 'AUTH_MFA_INVALID_CODE',
49
49
  AuthMfaAlreadyEnabled: 'AUTH_MFA_ALREADY_ENABLED',
50
+ CaptchaFailed: 'CAPTCHA_FAILED',
51
+ EmailDomainBlocked: 'EMAIL_DOMAIN_BLOCKED',
52
+ VatInvalid: 'VAT_INVALID',
50
53
  AuthMfaNotEnabled: 'AUTH_MFA_NOT_ENABLED',
51
54
  SessionRequired: 'SESSION_REQUIRED',
52
55
  OrgNotFound: 'ORG_NOT_FOUND',
@@ -119,6 +122,7 @@ export const BatchSendShipments200ResponseResultsInnerCodeEnum = {
119
122
  ShippingRuleInvalid: 'SHIPPING_RULE_INVALID',
120
123
  AddressNotFound: 'ADDRESS_NOT_FOUND',
121
124
  OrderNotFound: 'ORDER_NOT_FOUND',
125
+ OrderExists: 'ORDER_EXISTS',
122
126
  OrderChannelNotFound: 'ORDER_CHANNEL_NOT_FOUND',
123
127
  OrderChannelConfigInvalid: 'ORDER_CHANNEL_CONFIG_INVALID',
124
128
  IntegrationNotConfigured: 'INTEGRATION_NOT_CONFIGURED',
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Zippendo Public API
3
+ * Public API documentation for Zippendo. Authenticate using your API token (Bearer token prefixed with zipp_). **Brands (sub-accounts).** An organization can be split into brands, each keeping its own orders, shipments and configuration separate. There are two ways to scope requests to one brand, and NEITHER changes any request body: 1. **Bind the token.** Create an API token with a `brandId` and every request it makes is confined to that brand — reads filtered, writes stamped. This is the recommended way to give a single brand\'s team its own credential. 2. **Send the `X-Zippendo-Brand` header.** An organization-wide token can scope an individual request by sending the brand\'s id or slug in this header. Most SDKs let you set it once on the client so every call inherits it. A brand-bound token that receives an `X-Zippendo-Brand` header naming a different brand is rejected with `403 BRAND_ACCESS_DENIED` — the binding is never widened. Omit both and requests cover the whole organization, which is the behaviour of every existing token. Records that belong to no brand carry `brandId: null`. Configuration (carriers, shipping rules, addresses) with a null brand is organization-wide and remains visible inside every brand; orders and shipments with a null brand are only visible organization-wide. List endpoints additionally take a `?brandScope=own|shared|both` parameter to narrow further within whichever brand context already applies. `own` returns only rows assigned to that brand, and requires a brand context — a brand-bound token, a resolved brand session, or the `X-Zippendo-Brand` header above — otherwise `400`. `shared` returns only the organization-wide rows (equivalent to filtering `brandId=none`). The default, `both`, keeps the existing behaviour: a brand context sees its own rows plus the organization-wide ones. Set `X-Zippendo-Brand-Scope` as a client default to apply the same choice to every request instead of repeating the query parameter on each call — an explicit `brandScope` query parameter always wins over the header, and a blank header value is ignored. Brands themselves are managed under the **Brands** tag. Retiring a brand is done with `POST /orgs/{orgId}/brands/{brandId}/archive` — permanent deletion is a dashboard-only action, since it is refused while any order, shipment, member or token still references the brand. Brands require a plan that includes them; creating one beyond your plan\'s limit returns `403`.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@zippendo.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { CreateOrderChannelRequestSettings } from './CreateOrderChannelRequestSettings';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface CreateOrderChannelRequest
17
+ */
18
+ export interface CreateOrderChannelRequest {
19
+ /**
20
+ * Display name for the channel.
21
+ * @type {string}
22
+ * @memberof CreateOrderChannelRequest
23
+ */
24
+ name: string;
25
+ /**
26
+ * Type of the order channel. Platform channels (Shopify, WooCommerce) are created via their connect flows.
27
+ * @type {CreateOrderChannelRequestTypeEnum}
28
+ * @memberof CreateOrderChannelRequest
29
+ */
30
+ type: CreateOrderChannelRequestTypeEnum;
31
+ /**
32
+ * Brand this channel belongs to; null for organization-wide
33
+ * @type {string}
34
+ * @memberof CreateOrderChannelRequest
35
+ */
36
+ brandId?: string | null;
37
+ /**
38
+ * Whether the channel is active.
39
+ * @type {boolean}
40
+ * @memberof CreateOrderChannelRequest
41
+ */
42
+ enabled?: boolean;
43
+ /**
44
+ *
45
+ * @type {CreateOrderChannelRequestSettings}
46
+ * @memberof CreateOrderChannelRequest
47
+ */
48
+ settings?: CreateOrderChannelRequestSettings;
49
+ }
50
+ /**
51
+ * @export
52
+ */
53
+ export declare const CreateOrderChannelRequestTypeEnum: {
54
+ readonly Manual: "manual";
55
+ readonly Custom: "custom";
56
+ };
57
+ export type CreateOrderChannelRequestTypeEnum = typeof CreateOrderChannelRequestTypeEnum[keyof typeof CreateOrderChannelRequestTypeEnum];
58
+ /**
59
+ * Check if a given object implements the CreateOrderChannelRequest interface.
60
+ */
61
+ export declare function instanceOfCreateOrderChannelRequest(value: object): value is CreateOrderChannelRequest;
62
+ export declare function CreateOrderChannelRequestFromJSON(json: any): CreateOrderChannelRequest;
63
+ export declare function CreateOrderChannelRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateOrderChannelRequest;
64
+ export declare function CreateOrderChannelRequestToJSON(json: any): CreateOrderChannelRequest;
65
+ export declare function CreateOrderChannelRequestToJSONTyped(value?: CreateOrderChannelRequest | null, ignoreDiscriminator?: boolean): any;