@zippendo/sdk 1.3.1 → 1.3.3

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.
@@ -142,6 +142,10 @@ export declare const BatchSendShipments200ResponseResultsInnerCodeEnum: {
142
142
  readonly CarrierConfigInvalid: "CARRIER_CONFIG_INVALID";
143
143
  readonly CarrierParameterInvalid: "CARRIER_PARAMETER_INVALID";
144
144
  readonly CarrierServerUnavailable: "CARRIER_SERVER_UNAVAILABLE";
145
+ readonly CarrierUnreachable: "CARRIER_UNREACHABLE";
146
+ readonly CarrierNotResponding: "CARRIER_NOT_RESPONDING";
147
+ readonly LabelDownloadFailed: "LABEL_DOWNLOAD_FAILED";
148
+ readonly CarrierDocumentIncomplete: "CARRIER_DOCUMENT_INCOMPLETE";
145
149
  readonly CarrierGlsWrongAddress: "CARRIER_GLS_WRONG_ADDRESS";
146
150
  readonly CarrierDaoInvalidPostalCode: "CARRIER_DAO_INVALID_POSTAL_CODE";
147
151
  readonly CarrierPostnordBookingFailed: "CARRIER_POSTNORD_BOOKING_FAILED";
@@ -149,6 +153,9 @@ export declare const BatchSendShipments200ResponseResultsInnerCodeEnum: {
149
153
  readonly CarrierDhlExpressBookingFailed: "CARRIER_DHL_EXPRESS_BOOKING_FAILED";
150
154
  readonly CarrierUpsBookingFailed: "CARRIER_UPS_BOOKING_FAILED";
151
155
  readonly CarrierMatkahuoltoBookingFailed: "CARRIER_MATKAHUOLTO_BOOKING_FAILED";
156
+ readonly CarrierDpdPlBookingFailed: "CARRIER_DPD_PL_BOOKING_FAILED";
157
+ readonly CarrierPostnlBookingFailed: "CARRIER_POSTNL_BOOKING_FAILED";
158
+ readonly CarrierRoyalMailBookingFailed: "CARRIER_ROYAL_MAIL_BOOKING_FAILED";
152
159
  readonly CarrierTrackingWebhookRegistrationFailed: "CARRIER_TRACKING_WEBHOOK_REGISTRATION_FAILED";
153
160
  readonly CarrierCustomsUnsupportedProduct: "CARRIER_CUSTOMS_UNSUPPORTED_PRODUCT";
154
161
  readonly CarrierCustomsIncomplete: "CARRIER_CUSTOMS_INCOMPLETE";
@@ -185,6 +192,9 @@ export declare const BatchSendShipments200ResponseResultsInnerCodeEnum: {
185
192
  readonly AutomationInvalid: "AUTOMATION_INVALID";
186
193
  readonly ZippyDisabled: "ZIPPY_DISABLED";
187
194
  readonly ConversationNotFound: "CONVERSATION_NOT_FOUND";
195
+ readonly FilterInvalid: "FILTER_INVALID";
196
+ readonly SavedViewNotFound: "SAVED_VIEW_NOT_FOUND";
197
+ readonly SavedViewLimitReached: "SAVED_VIEW_LIMIT_REACHED";
188
198
  readonly AdminForbidden: "ADMIN_FORBIDDEN";
189
199
  readonly JobHandlerNotRegistered: "JOB_HANDLER_NOT_REGISTERED";
190
200
  readonly JobQueueNotConfigured: "JOB_QUEUE_NOT_CONFIGURED";
@@ -114,6 +114,10 @@ exports.BatchSendShipments200ResponseResultsInnerCodeEnum = {
114
114
  CarrierConfigInvalid: 'CARRIER_CONFIG_INVALID',
115
115
  CarrierParameterInvalid: 'CARRIER_PARAMETER_INVALID',
116
116
  CarrierServerUnavailable: 'CARRIER_SERVER_UNAVAILABLE',
117
+ CarrierUnreachable: 'CARRIER_UNREACHABLE',
118
+ CarrierNotResponding: 'CARRIER_NOT_RESPONDING',
119
+ LabelDownloadFailed: 'LABEL_DOWNLOAD_FAILED',
120
+ CarrierDocumentIncomplete: 'CARRIER_DOCUMENT_INCOMPLETE',
117
121
  CarrierGlsWrongAddress: 'CARRIER_GLS_WRONG_ADDRESS',
118
122
  CarrierDaoInvalidPostalCode: 'CARRIER_DAO_INVALID_POSTAL_CODE',
119
123
  CarrierPostnordBookingFailed: 'CARRIER_POSTNORD_BOOKING_FAILED',
@@ -121,6 +125,9 @@ exports.BatchSendShipments200ResponseResultsInnerCodeEnum = {
121
125
  CarrierDhlExpressBookingFailed: 'CARRIER_DHL_EXPRESS_BOOKING_FAILED',
122
126
  CarrierUpsBookingFailed: 'CARRIER_UPS_BOOKING_FAILED',
123
127
  CarrierMatkahuoltoBookingFailed: 'CARRIER_MATKAHUOLTO_BOOKING_FAILED',
128
+ CarrierDpdPlBookingFailed: 'CARRIER_DPD_PL_BOOKING_FAILED',
129
+ CarrierPostnlBookingFailed: 'CARRIER_POSTNL_BOOKING_FAILED',
130
+ CarrierRoyalMailBookingFailed: 'CARRIER_ROYAL_MAIL_BOOKING_FAILED',
124
131
  CarrierTrackingWebhookRegistrationFailed: 'CARRIER_TRACKING_WEBHOOK_REGISTRATION_FAILED',
125
132
  CarrierCustomsUnsupportedProduct: 'CARRIER_CUSTOMS_UNSUPPORTED_PRODUCT',
126
133
  CarrierCustomsIncomplete: 'CARRIER_CUSTOMS_INCOMPLETE',
@@ -157,6 +164,9 @@ exports.BatchSendShipments200ResponseResultsInnerCodeEnum = {
157
164
  AutomationInvalid: 'AUTOMATION_INVALID',
158
165
  ZippyDisabled: 'ZIPPY_DISABLED',
159
166
  ConversationNotFound: 'CONVERSATION_NOT_FOUND',
167
+ FilterInvalid: 'FILTER_INVALID',
168
+ SavedViewNotFound: 'SAVED_VIEW_NOT_FOUND',
169
+ SavedViewLimitReached: 'SAVED_VIEW_LIMIT_REACHED',
160
170
  AdminForbidden: 'ADMIN_FORBIDDEN',
161
171
  JobHandlerNotRegistered: 'JOB_HANDLER_NOT_REGISTERED',
162
172
  JobQueueNotConfigured: 'JOB_QUEUE_NOT_CONFIGURED',
@@ -120,6 +120,10 @@ export declare const ListApiTokens401ResponseCodeEnum: {
120
120
  readonly CarrierConfigInvalid: "CARRIER_CONFIG_INVALID";
121
121
  readonly CarrierParameterInvalid: "CARRIER_PARAMETER_INVALID";
122
122
  readonly CarrierServerUnavailable: "CARRIER_SERVER_UNAVAILABLE";
123
+ readonly CarrierUnreachable: "CARRIER_UNREACHABLE";
124
+ readonly CarrierNotResponding: "CARRIER_NOT_RESPONDING";
125
+ readonly LabelDownloadFailed: "LABEL_DOWNLOAD_FAILED";
126
+ readonly CarrierDocumentIncomplete: "CARRIER_DOCUMENT_INCOMPLETE";
123
127
  readonly CarrierGlsWrongAddress: "CARRIER_GLS_WRONG_ADDRESS";
124
128
  readonly CarrierDaoInvalidPostalCode: "CARRIER_DAO_INVALID_POSTAL_CODE";
125
129
  readonly CarrierPostnordBookingFailed: "CARRIER_POSTNORD_BOOKING_FAILED";
@@ -127,6 +131,9 @@ export declare const ListApiTokens401ResponseCodeEnum: {
127
131
  readonly CarrierDhlExpressBookingFailed: "CARRIER_DHL_EXPRESS_BOOKING_FAILED";
128
132
  readonly CarrierUpsBookingFailed: "CARRIER_UPS_BOOKING_FAILED";
129
133
  readonly CarrierMatkahuoltoBookingFailed: "CARRIER_MATKAHUOLTO_BOOKING_FAILED";
134
+ readonly CarrierDpdPlBookingFailed: "CARRIER_DPD_PL_BOOKING_FAILED";
135
+ readonly CarrierPostnlBookingFailed: "CARRIER_POSTNL_BOOKING_FAILED";
136
+ readonly CarrierRoyalMailBookingFailed: "CARRIER_ROYAL_MAIL_BOOKING_FAILED";
130
137
  readonly CarrierTrackingWebhookRegistrationFailed: "CARRIER_TRACKING_WEBHOOK_REGISTRATION_FAILED";
131
138
  readonly CarrierCustomsUnsupportedProduct: "CARRIER_CUSTOMS_UNSUPPORTED_PRODUCT";
132
139
  readonly CarrierCustomsIncomplete: "CARRIER_CUSTOMS_INCOMPLETE";
@@ -163,6 +170,9 @@ export declare const ListApiTokens401ResponseCodeEnum: {
163
170
  readonly AutomationInvalid: "AUTOMATION_INVALID";
164
171
  readonly ZippyDisabled: "ZIPPY_DISABLED";
165
172
  readonly ConversationNotFound: "CONVERSATION_NOT_FOUND";
173
+ readonly FilterInvalid: "FILTER_INVALID";
174
+ readonly SavedViewNotFound: "SAVED_VIEW_NOT_FOUND";
175
+ readonly SavedViewLimitReached: "SAVED_VIEW_LIMIT_REACHED";
166
176
  readonly AdminForbidden: "ADMIN_FORBIDDEN";
167
177
  readonly JobHandlerNotRegistered: "JOB_HANDLER_NOT_REGISTERED";
168
178
  readonly JobQueueNotConfigured: "JOB_QUEUE_NOT_CONFIGURED";
@@ -105,6 +105,10 @@ exports.ListApiTokens401ResponseCodeEnum = {
105
105
  CarrierConfigInvalid: 'CARRIER_CONFIG_INVALID',
106
106
  CarrierParameterInvalid: 'CARRIER_PARAMETER_INVALID',
107
107
  CarrierServerUnavailable: 'CARRIER_SERVER_UNAVAILABLE',
108
+ CarrierUnreachable: 'CARRIER_UNREACHABLE',
109
+ CarrierNotResponding: 'CARRIER_NOT_RESPONDING',
110
+ LabelDownloadFailed: 'LABEL_DOWNLOAD_FAILED',
111
+ CarrierDocumentIncomplete: 'CARRIER_DOCUMENT_INCOMPLETE',
108
112
  CarrierGlsWrongAddress: 'CARRIER_GLS_WRONG_ADDRESS',
109
113
  CarrierDaoInvalidPostalCode: 'CARRIER_DAO_INVALID_POSTAL_CODE',
110
114
  CarrierPostnordBookingFailed: 'CARRIER_POSTNORD_BOOKING_FAILED',
@@ -112,6 +116,9 @@ exports.ListApiTokens401ResponseCodeEnum = {
112
116
  CarrierDhlExpressBookingFailed: 'CARRIER_DHL_EXPRESS_BOOKING_FAILED',
113
117
  CarrierUpsBookingFailed: 'CARRIER_UPS_BOOKING_FAILED',
114
118
  CarrierMatkahuoltoBookingFailed: 'CARRIER_MATKAHUOLTO_BOOKING_FAILED',
119
+ CarrierDpdPlBookingFailed: 'CARRIER_DPD_PL_BOOKING_FAILED',
120
+ CarrierPostnlBookingFailed: 'CARRIER_POSTNL_BOOKING_FAILED',
121
+ CarrierRoyalMailBookingFailed: 'CARRIER_ROYAL_MAIL_BOOKING_FAILED',
115
122
  CarrierTrackingWebhookRegistrationFailed: 'CARRIER_TRACKING_WEBHOOK_REGISTRATION_FAILED',
116
123
  CarrierCustomsUnsupportedProduct: 'CARRIER_CUSTOMS_UNSUPPORTED_PRODUCT',
117
124
  CarrierCustomsIncomplete: 'CARRIER_CUSTOMS_INCOMPLETE',
@@ -148,6 +155,9 @@ exports.ListApiTokens401ResponseCodeEnum = {
148
155
  AutomationInvalid: 'AUTOMATION_INVALID',
149
156
  ZippyDisabled: 'ZIPPY_DISABLED',
150
157
  ConversationNotFound: 'CONVERSATION_NOT_FOUND',
158
+ FilterInvalid: 'FILTER_INVALID',
159
+ SavedViewNotFound: 'SAVED_VIEW_NOT_FOUND',
160
+ SavedViewLimitReached: 'SAVED_VIEW_LIMIT_REACHED',
151
161
  AdminForbidden: 'ADMIN_FORBIDDEN',
152
162
  JobHandlerNotRegistered: 'JOB_HANDLER_NOT_REGISTERED',
153
163
  JobQueueNotConfigured: 'JOB_QUEUE_NOT_CONFIGURED',
@@ -127,6 +127,10 @@ export declare const SendShipment422ResponseCodeEnum: {
127
127
  readonly CarrierConfigInvalid: "CARRIER_CONFIG_INVALID";
128
128
  readonly CarrierParameterInvalid: "CARRIER_PARAMETER_INVALID";
129
129
  readonly CarrierServerUnavailable: "CARRIER_SERVER_UNAVAILABLE";
130
+ readonly CarrierUnreachable: "CARRIER_UNREACHABLE";
131
+ readonly CarrierNotResponding: "CARRIER_NOT_RESPONDING";
132
+ readonly LabelDownloadFailed: "LABEL_DOWNLOAD_FAILED";
133
+ readonly CarrierDocumentIncomplete: "CARRIER_DOCUMENT_INCOMPLETE";
130
134
  readonly CarrierGlsWrongAddress: "CARRIER_GLS_WRONG_ADDRESS";
131
135
  readonly CarrierDaoInvalidPostalCode: "CARRIER_DAO_INVALID_POSTAL_CODE";
132
136
  readonly CarrierPostnordBookingFailed: "CARRIER_POSTNORD_BOOKING_FAILED";
@@ -134,6 +138,9 @@ export declare const SendShipment422ResponseCodeEnum: {
134
138
  readonly CarrierDhlExpressBookingFailed: "CARRIER_DHL_EXPRESS_BOOKING_FAILED";
135
139
  readonly CarrierUpsBookingFailed: "CARRIER_UPS_BOOKING_FAILED";
136
140
  readonly CarrierMatkahuoltoBookingFailed: "CARRIER_MATKAHUOLTO_BOOKING_FAILED";
141
+ readonly CarrierDpdPlBookingFailed: "CARRIER_DPD_PL_BOOKING_FAILED";
142
+ readonly CarrierPostnlBookingFailed: "CARRIER_POSTNL_BOOKING_FAILED";
143
+ readonly CarrierRoyalMailBookingFailed: "CARRIER_ROYAL_MAIL_BOOKING_FAILED";
137
144
  readonly CarrierTrackingWebhookRegistrationFailed: "CARRIER_TRACKING_WEBHOOK_REGISTRATION_FAILED";
138
145
  readonly CarrierCustomsUnsupportedProduct: "CARRIER_CUSTOMS_UNSUPPORTED_PRODUCT";
139
146
  readonly CarrierCustomsIncomplete: "CARRIER_CUSTOMS_INCOMPLETE";
@@ -170,6 +177,9 @@ export declare const SendShipment422ResponseCodeEnum: {
170
177
  readonly AutomationInvalid: "AUTOMATION_INVALID";
171
178
  readonly ZippyDisabled: "ZIPPY_DISABLED";
172
179
  readonly ConversationNotFound: "CONVERSATION_NOT_FOUND";
180
+ readonly FilterInvalid: "FILTER_INVALID";
181
+ readonly SavedViewNotFound: "SAVED_VIEW_NOT_FOUND";
182
+ readonly SavedViewLimitReached: "SAVED_VIEW_LIMIT_REACHED";
173
183
  readonly AdminForbidden: "ADMIN_FORBIDDEN";
174
184
  readonly JobHandlerNotRegistered: "JOB_HANDLER_NOT_REGISTERED";
175
185
  readonly JobQueueNotConfigured: "JOB_QUEUE_NOT_CONFIGURED";
@@ -106,6 +106,10 @@ exports.SendShipment422ResponseCodeEnum = {
106
106
  CarrierConfigInvalid: 'CARRIER_CONFIG_INVALID',
107
107
  CarrierParameterInvalid: 'CARRIER_PARAMETER_INVALID',
108
108
  CarrierServerUnavailable: 'CARRIER_SERVER_UNAVAILABLE',
109
+ CarrierUnreachable: 'CARRIER_UNREACHABLE',
110
+ CarrierNotResponding: 'CARRIER_NOT_RESPONDING',
111
+ LabelDownloadFailed: 'LABEL_DOWNLOAD_FAILED',
112
+ CarrierDocumentIncomplete: 'CARRIER_DOCUMENT_INCOMPLETE',
109
113
  CarrierGlsWrongAddress: 'CARRIER_GLS_WRONG_ADDRESS',
110
114
  CarrierDaoInvalidPostalCode: 'CARRIER_DAO_INVALID_POSTAL_CODE',
111
115
  CarrierPostnordBookingFailed: 'CARRIER_POSTNORD_BOOKING_FAILED',
@@ -113,6 +117,9 @@ exports.SendShipment422ResponseCodeEnum = {
113
117
  CarrierDhlExpressBookingFailed: 'CARRIER_DHL_EXPRESS_BOOKING_FAILED',
114
118
  CarrierUpsBookingFailed: 'CARRIER_UPS_BOOKING_FAILED',
115
119
  CarrierMatkahuoltoBookingFailed: 'CARRIER_MATKAHUOLTO_BOOKING_FAILED',
120
+ CarrierDpdPlBookingFailed: 'CARRIER_DPD_PL_BOOKING_FAILED',
121
+ CarrierPostnlBookingFailed: 'CARRIER_POSTNL_BOOKING_FAILED',
122
+ CarrierRoyalMailBookingFailed: 'CARRIER_ROYAL_MAIL_BOOKING_FAILED',
116
123
  CarrierTrackingWebhookRegistrationFailed: 'CARRIER_TRACKING_WEBHOOK_REGISTRATION_FAILED',
117
124
  CarrierCustomsUnsupportedProduct: 'CARRIER_CUSTOMS_UNSUPPORTED_PRODUCT',
118
125
  CarrierCustomsIncomplete: 'CARRIER_CUSTOMS_INCOMPLETE',
@@ -149,6 +156,9 @@ exports.SendShipment422ResponseCodeEnum = {
149
156
  AutomationInvalid: 'AUTOMATION_INVALID',
150
157
  ZippyDisabled: 'ZIPPY_DISABLED',
151
158
  ConversationNotFound: 'CONVERSATION_NOT_FOUND',
159
+ FilterInvalid: 'FILTER_INVALID',
160
+ SavedViewNotFound: 'SAVED_VIEW_NOT_FOUND',
161
+ SavedViewLimitReached: 'SAVED_VIEW_LIMIT_REACHED',
152
162
  AdminForbidden: 'ADMIN_FORBIDDEN',
153
163
  JobHandlerNotRegistered: 'JOB_HANDLER_NOT_REGISTERED',
154
164
  JobQueueNotConfigured: 'JOB_QUEUE_NOT_CONFIGURED',
package/docs/OrdersApi.md CHANGED
@@ -245,11 +245,11 @@ example().catch(console.error);
245
245
 
246
246
  ## listOrders
247
247
 
248
- > ListOrders200Response listOrders(orgId, page, limit, brandId, brandScope, status, orderChannelId, search)
248
+ > ListOrders200Response listOrders(orgId, page, limit, brandId, brandScope, status, orderChannelId, search, filter)
249
249
 
250
250
  List orders
251
251
 
252
- Returns a paginated list of orders for an organization, filterable by status, channel, and search term.
252
+ Returns a paginated list of orders for an organization, filterable by status, channel, search term and an advanced filter definition.
253
253
 
254
254
  ### Example
255
255
 
@@ -285,6 +285,8 @@ async function example() {
285
285
  orderChannelId: clz9k2f0a0001abcd1234efgh,
286
286
  // string | Search by order number or customer name/email. (optional)
287
287
  search: Anna,
288
+ // string | Advanced filter as a JSON-encoded definition: a `conjunction` (`and`/`or`) over `conditions`, each `{ id, field, operator, value }` or a nested group. Fields and operators per list are documented under Filtering lists in the API overview. An invalid filter returns 400 `FILTER_INVALID`. (optional)
289
+ filter: {"conjunction":"and","conditions":[{"id":"c_1","field":"status","operator":"in","value":["pending","processing"]}]},
288
290
  } satisfies ListOrdersRequest;
289
291
 
290
292
  try {
@@ -312,6 +314,7 @@ example().catch(console.error);
312
314
  | **status** | `pending`, `processing`, `partially_fulfilled`, `fulfilled`, `error`, `cancelled` | Order fulfilment status derived from its shipments. | [Optional] [Defaults to `undefined`] [Enum: pending, processing, partially_fulfilled, fulfilled, error, cancelled] |
313
315
  | **orderChannelId** | `string` | Filter by order channel ID. | [Optional] [Defaults to `undefined`] |
314
316
  | **search** | `string` | Search by order number or customer name/email. | [Optional] [Defaults to `undefined`] |
317
+ | **filter** | `string` | Advanced filter as a JSON-encoded definition: a `conjunction` (`and`/`or`) over `conditions`, each `{ id, field, operator, value }` or a nested group. Fields and operators per list are documented under Filtering lists in the API overview. An invalid filter returns 400 `FILTER_INVALID`. | [Optional] [Defaults to `undefined`] |
315
318
 
316
319
  ### Return type
317
320
 
@@ -9,6 +9,7 @@ All URIs are relative to *https://api.zippendo.com*
9
9
  | [**createReturnShipment**](ShipmentsApi.md#createreturnshipment) | **POST** /orgs/{orgId}/shipments/{shipmentId}/create-return | Create return shipment |
10
10
  | [**createShipment**](ShipmentsApi.md#createshipmentoperation) | **POST** /orgs/{orgId}/shipments | Create shipment |
11
11
  | [**deleteShipment**](ShipmentsApi.md#deleteshipment) | **DELETE** /orgs/{orgId}/shipments/{shipmentId} | Delete shipment |
12
+ | [**fetchShipmentLabel**](ShipmentsApi.md#fetchshipmentlabel) | **POST** /orgs/{orgId}/shipments/{shipmentId}/fetch-label | Fetch missing label |
12
13
  | [**getShipment**](ShipmentsApi.md#getshipment) | **GET** /orgs/{orgId}/shipments/{shipmentId} | Get shipment |
13
14
  | [**getShipmentDocumentContent**](ShipmentsApi.md#getshipmentdocumentcontent) | **GET** /orgs/{orgId}/shipments/{shipmentId}/documents/{documentId}/content | Download shipment document |
14
15
  | [**listShipments**](ShipmentsApi.md#listshipments) | **GET** /orgs/{orgId}/shipments | List shipments |
@@ -182,7 +183,7 @@ example().catch(console.error);
182
183
 
183
184
  Create return shipment
184
185
 
185
- Create and auto-send a return shipment from a dispatched outbound shipment with swapped sender/receiver. Requires a configured return shipping rule.
186
+ Create and auto-send a return shipment from a dispatched outbound shipment with swapped sender/receiver. Requires a configured return shipping rule. The return is returned with its booking outcome: `dispatched`, or `error` with the carrier\'s reasons in `errors`.
186
187
 
187
188
  ### Example
188
189
 
@@ -407,6 +408,84 @@ example().catch(console.error);
407
408
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
408
409
 
409
410
 
411
+ ## fetchShipmentLabel
412
+
413
+ > CreateShipment201Response fetchShipmentLabel(orgId, shipmentId)
414
+
415
+ Fetch missing label
416
+
417
+ Ask the carrier again for the label of a dispatched shipment whose label could not be downloaded when it was sent (it carries a LABEL_DOWNLOAD_FAILED error). Stores the label, clears the error and returns the shipment.
418
+
419
+ ### Example
420
+
421
+ ```ts
422
+ import {
423
+ Configuration,
424
+ ShipmentsApi,
425
+ } from '@zippendo/sdk';
426
+ import type { FetchShipmentLabelRequest } from '@zippendo/sdk';
427
+
428
+ async function example() {
429
+ console.log("🚀 Testing @zippendo/sdk SDK...");
430
+ const config = new Configuration({
431
+ // Configure HTTP bearer authorization: bearerAuth
432
+ accessToken: "YOUR BEARER TOKEN",
433
+ });
434
+ const api = new ShipmentsApi(config);
435
+
436
+ const body = {
437
+ // string | Organization identifier.
438
+ orgId: org_1a2b3c4d,
439
+ // string | Shipment identifier.
440
+ shipmentId: shp_4d9e7a2f,
441
+ } satisfies FetchShipmentLabelRequest;
442
+
443
+ try {
444
+ const data = await api.fetchShipmentLabel(body);
445
+ console.log(data);
446
+ } catch (error) {
447
+ console.error(error);
448
+ }
449
+ }
450
+
451
+ // Run the test
452
+ example().catch(console.error);
453
+ ```
454
+
455
+ ### Parameters
456
+
457
+
458
+ | Name | Type | Description | Notes |
459
+ |------------- | ------------- | ------------- | -------------|
460
+ | **orgId** | `string` | Organization identifier. | [Defaults to `undefined`] |
461
+ | **shipmentId** | `string` | Shipment identifier. | [Defaults to `undefined`] |
462
+
463
+ ### Return type
464
+
465
+ [**CreateShipment201Response**](CreateShipment201Response.md)
466
+
467
+ ### Authorization
468
+
469
+ [bearerAuth](../README.md#bearerAuth)
470
+
471
+ ### HTTP request headers
472
+
473
+ - **Content-Type**: Not defined
474
+ - **Accept**: `application/json`
475
+
476
+
477
+ ### HTTP response details
478
+ | Status code | Description | Response headers |
479
+ |-------------|-------------|------------------|
480
+ | **200** | Default Response | - |
481
+ | **403** | Default Response | - |
482
+ | **404** | Default Response | - |
483
+ | **409** | Default Response | - |
484
+ | **422** | Default Response | - |
485
+
486
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
487
+
488
+
410
489
  ## getShipment
411
490
 
412
491
  > CreateShipment201Response getShipment(orgId, shipmentId)
@@ -568,11 +647,11 @@ example().catch(console.error);
568
647
 
569
648
  ## listShipments
570
649
 
571
- > ListShipments200Response listShipments(orgId, page, limit, brandId, brandScope, status, type, search)
650
+ > ListShipments200Response listShipments(orgId, page, limit, brandId, brandScope, status, type, search, filter)
572
651
 
573
652
  List shipments
574
653
 
575
- List all shipments for an organization, paginated and ordered by newest first.
654
+ List all shipments for an organization, paginated and ordered by newest first. Accepts an advanced filter definition.
576
655
 
577
656
  ### Example
578
657
 
@@ -608,6 +687,8 @@ async function example() {
608
687
  type: outbound,
609
688
  // string | Search by shipment reference or parcel tracking number. (optional)
610
689
  search: SHIP-1042,
690
+ // string | Advanced filter as a JSON-encoded definition: a `conjunction` (`and`/`or`) over `conditions`, each `{ id, field, operator, value }` or a nested group. Fields and operators per list are documented under Filtering lists in the API overview. An invalid filter returns 400 `FILTER_INVALID`. (optional)
691
+ filter: {"conjunction":"and","conditions":[{"id":"c_1","field":"status","operator":"in","value":["pending","processing"]}]},
611
692
  } satisfies ListShipmentsRequest;
612
693
 
613
694
  try {
@@ -635,6 +716,7 @@ example().catch(console.error);
635
716
  | **status** | `draft`, `pending`, `processing`, `dispatched`, `partly_dispatched`, `error`, `cancelled`, `on_hold` | Filter by shipment status. | [Optional] [Defaults to `undefined`] [Enum: draft, pending, processing, dispatched, partly_dispatched, error, cancelled, on_hold] |
636
717
  | **type** | `outbound`, `inbound` | Filter by direction. | [Optional] [Defaults to `undefined`] [Enum: outbound, inbound] |
637
718
  | **search** | `string` | Search by shipment reference or parcel tracking number. | [Optional] [Defaults to `undefined`] |
719
+ | **filter** | `string` | Advanced filter as a JSON-encoded definition: a `conjunction` (`and`/`or`) over `conditions`, each `{ id, field, operator, value }` or a nested group. Fields and operators per list are documented under Filtering lists in the API overview. An invalid filter returns 400 `FILTER_INVALID`. | [Optional] [Defaults to `undefined`] |
638
720
 
639
721
  ### Return type
640
722
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zippendo/sdk",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "OpenAPI client for @zippendo/sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -73,6 +73,7 @@ export interface ListOrdersRequest {
73
73
  status?: ListOrdersStatusEnum;
74
74
  orderChannelId?: string;
75
75
  search?: string;
76
+ filter?: string;
76
77
  }
77
78
 
78
79
  export interface UpdateOrderOperationRequest {
@@ -318,6 +319,10 @@ export class OrdersApi extends runtime.BaseAPI {
318
319
  queryParameters['search'] = requestParameters['search'];
319
320
  }
320
321
 
322
+ if (requestParameters['filter'] != null) {
323
+ queryParameters['filter'] = requestParameters['filter'];
324
+ }
325
+
321
326
  const headerParameters: runtime.HTTPHeaders = {};
322
327
 
323
328
  if (this.configuration && this.configuration.accessToken) {
@@ -341,7 +346,7 @@ export class OrdersApi extends runtime.BaseAPI {
341
346
  }
342
347
 
343
348
  /**
344
- * Returns a paginated list of orders for an organization, filterable by status, channel, and search term.
349
+ * Returns a paginated list of orders for an organization, filterable by status, channel, search term and an advanced filter definition.
345
350
  * List orders
346
351
  */
347
352
  async listOrdersRaw(requestParameters: ListOrdersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListOrders200Response>> {
@@ -352,7 +357,7 @@ export class OrdersApi extends runtime.BaseAPI {
352
357
  }
353
358
 
354
359
  /**
355
- * Returns a paginated list of orders for an organization, filterable by status, channel, and search term.
360
+ * Returns a paginated list of orders for an organization, filterable by status, channel, search term and an advanced filter definition.
356
361
  * List orders
357
362
  */
358
363
  async listOrders(requestParameters: ListOrdersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListOrders200Response> {
@@ -120,6 +120,11 @@ export interface DeleteShipmentRequest {
120
120
  shipmentId: string;
121
121
  }
122
122
 
123
+ export interface FetchShipmentLabelRequest {
124
+ orgId: string;
125
+ shipmentId: string;
126
+ }
127
+
123
128
  export interface GetShipmentRequest {
124
129
  orgId: string;
125
130
  shipmentId: string;
@@ -142,6 +147,7 @@ export interface ListShipmentsRequest {
142
147
  status?: ListShipmentsStatusEnum;
143
148
  type?: ListShipmentsTypeEnum;
144
149
  search?: string;
150
+ filter?: string;
145
151
  }
146
152
 
147
153
  export interface SendShipmentRequest {
@@ -359,7 +365,7 @@ export class ShipmentsApi extends runtime.BaseAPI {
359
365
  }
360
366
 
361
367
  /**
362
- * Create and auto-send a return shipment from a dispatched outbound shipment with swapped sender/receiver. Requires a configured return shipping rule.
368
+ * Create and auto-send a return shipment from a dispatched outbound shipment with swapped sender/receiver. Requires a configured return shipping rule. The return is returned with its booking outcome: `dispatched`, or `error` with the carrier\'s reasons in `errors`.
363
369
  * Create return shipment
364
370
  */
365
371
  async createReturnShipmentRaw(requestParameters: CreateReturnShipmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateShipment201Response>> {
@@ -370,7 +376,7 @@ export class ShipmentsApi extends runtime.BaseAPI {
370
376
  }
371
377
 
372
378
  /**
373
- * Create and auto-send a return shipment from a dispatched outbound shipment with swapped sender/receiver. Requires a configured return shipping rule.
379
+ * Create and auto-send a return shipment from a dispatched outbound shipment with swapped sender/receiver. Requires a configured return shipping rule. The return is returned with its booking outcome: `dispatched`, or `error` with the carrier\'s reasons in `errors`.
374
380
  * Create return shipment
375
381
  */
376
382
  async createReturnShipment(requestParameters: CreateReturnShipmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateShipment201Response> {
@@ -506,6 +512,69 @@ export class ShipmentsApi extends runtime.BaseAPI {
506
512
  return await response.value();
507
513
  }
508
514
 
515
+ /**
516
+ * Creates request options for fetchShipmentLabel without sending the request
517
+ */
518
+ async fetchShipmentLabelRequestOpts(requestParameters: FetchShipmentLabelRequest): Promise<runtime.RequestOpts> {
519
+ if (requestParameters['orgId'] == null) {
520
+ throw new runtime.RequiredError(
521
+ 'orgId',
522
+ 'Required parameter "orgId" was null or undefined when calling fetchShipmentLabel().'
523
+ );
524
+ }
525
+
526
+ if (requestParameters['shipmentId'] == null) {
527
+ throw new runtime.RequiredError(
528
+ 'shipmentId',
529
+ 'Required parameter "shipmentId" was null or undefined when calling fetchShipmentLabel().'
530
+ );
531
+ }
532
+
533
+ const queryParameters: any = {};
534
+
535
+ const headerParameters: runtime.HTTPHeaders = {};
536
+
537
+ if (this.configuration && this.configuration.accessToken) {
538
+ const token = this.configuration.accessToken;
539
+ const tokenString = await token("bearerAuth", []);
540
+
541
+ if (tokenString) {
542
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
543
+ }
544
+ }
545
+
546
+ let urlPath = `/orgs/{orgId}/shipments/{shipmentId}/fetch-label`;
547
+ urlPath = urlPath.replace('{orgId}', encodeURIComponent(String(requestParameters['orgId'])));
548
+ urlPath = urlPath.replace('{shipmentId}', encodeURIComponent(String(requestParameters['shipmentId'])));
549
+
550
+ return {
551
+ path: urlPath,
552
+ method: 'POST',
553
+ headers: headerParameters,
554
+ query: queryParameters,
555
+ };
556
+ }
557
+
558
+ /**
559
+ * Ask the carrier again for the label of a dispatched shipment whose label could not be downloaded when it was sent (it carries a LABEL_DOWNLOAD_FAILED error). Stores the label, clears the error and returns the shipment.
560
+ * Fetch missing label
561
+ */
562
+ async fetchShipmentLabelRaw(requestParameters: FetchShipmentLabelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateShipment201Response>> {
563
+ const requestOptions = await this.fetchShipmentLabelRequestOpts(requestParameters);
564
+ const response = await this.request(requestOptions, initOverrides);
565
+
566
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateShipment201ResponseFromJSON(jsonValue));
567
+ }
568
+
569
+ /**
570
+ * Ask the carrier again for the label of a dispatched shipment whose label could not be downloaded when it was sent (it carries a LABEL_DOWNLOAD_FAILED error). Stores the label, clears the error and returns the shipment.
571
+ * Fetch missing label
572
+ */
573
+ async fetchShipmentLabel(requestParameters: FetchShipmentLabelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateShipment201Response> {
574
+ const response = await this.fetchShipmentLabelRaw(requestParameters, initOverrides);
575
+ return await response.value();
576
+ }
577
+
509
578
  /**
510
579
  * Creates request options for getShipment without sending the request
511
580
  */
@@ -688,6 +757,10 @@ export class ShipmentsApi extends runtime.BaseAPI {
688
757
  queryParameters['search'] = requestParameters['search'];
689
758
  }
690
759
 
760
+ if (requestParameters['filter'] != null) {
761
+ queryParameters['filter'] = requestParameters['filter'];
762
+ }
763
+
691
764
  const headerParameters: runtime.HTTPHeaders = {};
692
765
 
693
766
  if (this.configuration && this.configuration.accessToken) {
@@ -711,7 +784,7 @@ export class ShipmentsApi extends runtime.BaseAPI {
711
784
  }
712
785
 
713
786
  /**
714
- * List all shipments for an organization, paginated and ordered by newest first.
787
+ * List all shipments for an organization, paginated and ordered by newest first. Accepts an advanced filter definition.
715
788
  * List shipments
716
789
  */
717
790
  async listShipmentsRaw(requestParameters: ListShipmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListShipments200Response>> {
@@ -722,7 +795,7 @@ export class ShipmentsApi extends runtime.BaseAPI {
722
795
  }
723
796
 
724
797
  /**
725
- * List all shipments for an organization, paginated and ordered by newest first.
798
+ * List all shipments for an organization, paginated and ordered by newest first. Accepts an advanced filter definition.
726
799
  * List shipments
727
800
  */
728
801
  async listShipments(requestParameters: ListShipmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListShipments200Response> {
@@ -156,6 +156,10 @@ export const BatchSendShipments200ResponseResultsInnerCodeEnum = {
156
156
  CarrierConfigInvalid: 'CARRIER_CONFIG_INVALID',
157
157
  CarrierParameterInvalid: 'CARRIER_PARAMETER_INVALID',
158
158
  CarrierServerUnavailable: 'CARRIER_SERVER_UNAVAILABLE',
159
+ CarrierUnreachable: 'CARRIER_UNREACHABLE',
160
+ CarrierNotResponding: 'CARRIER_NOT_RESPONDING',
161
+ LabelDownloadFailed: 'LABEL_DOWNLOAD_FAILED',
162
+ CarrierDocumentIncomplete: 'CARRIER_DOCUMENT_INCOMPLETE',
159
163
  CarrierGlsWrongAddress: 'CARRIER_GLS_WRONG_ADDRESS',
160
164
  CarrierDaoInvalidPostalCode: 'CARRIER_DAO_INVALID_POSTAL_CODE',
161
165
  CarrierPostnordBookingFailed: 'CARRIER_POSTNORD_BOOKING_FAILED',
@@ -163,6 +167,9 @@ export const BatchSendShipments200ResponseResultsInnerCodeEnum = {
163
167
  CarrierDhlExpressBookingFailed: 'CARRIER_DHL_EXPRESS_BOOKING_FAILED',
164
168
  CarrierUpsBookingFailed: 'CARRIER_UPS_BOOKING_FAILED',
165
169
  CarrierMatkahuoltoBookingFailed: 'CARRIER_MATKAHUOLTO_BOOKING_FAILED',
170
+ CarrierDpdPlBookingFailed: 'CARRIER_DPD_PL_BOOKING_FAILED',
171
+ CarrierPostnlBookingFailed: 'CARRIER_POSTNL_BOOKING_FAILED',
172
+ CarrierRoyalMailBookingFailed: 'CARRIER_ROYAL_MAIL_BOOKING_FAILED',
166
173
  CarrierTrackingWebhookRegistrationFailed: 'CARRIER_TRACKING_WEBHOOK_REGISTRATION_FAILED',
167
174
  CarrierCustomsUnsupportedProduct: 'CARRIER_CUSTOMS_UNSUPPORTED_PRODUCT',
168
175
  CarrierCustomsIncomplete: 'CARRIER_CUSTOMS_INCOMPLETE',
@@ -199,6 +206,9 @@ export const BatchSendShipments200ResponseResultsInnerCodeEnum = {
199
206
  AutomationInvalid: 'AUTOMATION_INVALID',
200
207
  ZippyDisabled: 'ZIPPY_DISABLED',
201
208
  ConversationNotFound: 'CONVERSATION_NOT_FOUND',
209
+ FilterInvalid: 'FILTER_INVALID',
210
+ SavedViewNotFound: 'SAVED_VIEW_NOT_FOUND',
211
+ SavedViewLimitReached: 'SAVED_VIEW_LIMIT_REACHED',
202
212
  AdminForbidden: 'ADMIN_FORBIDDEN',
203
213
  JobHandlerNotRegistered: 'JOB_HANDLER_NOT_REGISTERED',
204
214
  JobQueueNotConfigured: 'JOB_QUEUE_NOT_CONFIGURED',
@@ -126,6 +126,10 @@ export const ListApiTokens401ResponseCodeEnum = {
126
126
  CarrierConfigInvalid: 'CARRIER_CONFIG_INVALID',
127
127
  CarrierParameterInvalid: 'CARRIER_PARAMETER_INVALID',
128
128
  CarrierServerUnavailable: 'CARRIER_SERVER_UNAVAILABLE',
129
+ CarrierUnreachable: 'CARRIER_UNREACHABLE',
130
+ CarrierNotResponding: 'CARRIER_NOT_RESPONDING',
131
+ LabelDownloadFailed: 'LABEL_DOWNLOAD_FAILED',
132
+ CarrierDocumentIncomplete: 'CARRIER_DOCUMENT_INCOMPLETE',
129
133
  CarrierGlsWrongAddress: 'CARRIER_GLS_WRONG_ADDRESS',
130
134
  CarrierDaoInvalidPostalCode: 'CARRIER_DAO_INVALID_POSTAL_CODE',
131
135
  CarrierPostnordBookingFailed: 'CARRIER_POSTNORD_BOOKING_FAILED',
@@ -133,6 +137,9 @@ export const ListApiTokens401ResponseCodeEnum = {
133
137
  CarrierDhlExpressBookingFailed: 'CARRIER_DHL_EXPRESS_BOOKING_FAILED',
134
138
  CarrierUpsBookingFailed: 'CARRIER_UPS_BOOKING_FAILED',
135
139
  CarrierMatkahuoltoBookingFailed: 'CARRIER_MATKAHUOLTO_BOOKING_FAILED',
140
+ CarrierDpdPlBookingFailed: 'CARRIER_DPD_PL_BOOKING_FAILED',
141
+ CarrierPostnlBookingFailed: 'CARRIER_POSTNL_BOOKING_FAILED',
142
+ CarrierRoyalMailBookingFailed: 'CARRIER_ROYAL_MAIL_BOOKING_FAILED',
136
143
  CarrierTrackingWebhookRegistrationFailed: 'CARRIER_TRACKING_WEBHOOK_REGISTRATION_FAILED',
137
144
  CarrierCustomsUnsupportedProduct: 'CARRIER_CUSTOMS_UNSUPPORTED_PRODUCT',
138
145
  CarrierCustomsIncomplete: 'CARRIER_CUSTOMS_INCOMPLETE',
@@ -169,6 +176,9 @@ export const ListApiTokens401ResponseCodeEnum = {
169
176
  AutomationInvalid: 'AUTOMATION_INVALID',
170
177
  ZippyDisabled: 'ZIPPY_DISABLED',
171
178
  ConversationNotFound: 'CONVERSATION_NOT_FOUND',
179
+ FilterInvalid: 'FILTER_INVALID',
180
+ SavedViewNotFound: 'SAVED_VIEW_NOT_FOUND',
181
+ SavedViewLimitReached: 'SAVED_VIEW_LIMIT_REACHED',
172
182
  AdminForbidden: 'ADMIN_FORBIDDEN',
173
183
  JobHandlerNotRegistered: 'JOB_HANDLER_NOT_REGISTERED',
174
184
  JobQueueNotConfigured: 'JOB_QUEUE_NOT_CONFIGURED',
@@ -140,6 +140,10 @@ export const SendShipment422ResponseCodeEnum = {
140
140
  CarrierConfigInvalid: 'CARRIER_CONFIG_INVALID',
141
141
  CarrierParameterInvalid: 'CARRIER_PARAMETER_INVALID',
142
142
  CarrierServerUnavailable: 'CARRIER_SERVER_UNAVAILABLE',
143
+ CarrierUnreachable: 'CARRIER_UNREACHABLE',
144
+ CarrierNotResponding: 'CARRIER_NOT_RESPONDING',
145
+ LabelDownloadFailed: 'LABEL_DOWNLOAD_FAILED',
146
+ CarrierDocumentIncomplete: 'CARRIER_DOCUMENT_INCOMPLETE',
143
147
  CarrierGlsWrongAddress: 'CARRIER_GLS_WRONG_ADDRESS',
144
148
  CarrierDaoInvalidPostalCode: 'CARRIER_DAO_INVALID_POSTAL_CODE',
145
149
  CarrierPostnordBookingFailed: 'CARRIER_POSTNORD_BOOKING_FAILED',
@@ -147,6 +151,9 @@ export const SendShipment422ResponseCodeEnum = {
147
151
  CarrierDhlExpressBookingFailed: 'CARRIER_DHL_EXPRESS_BOOKING_FAILED',
148
152
  CarrierUpsBookingFailed: 'CARRIER_UPS_BOOKING_FAILED',
149
153
  CarrierMatkahuoltoBookingFailed: 'CARRIER_MATKAHUOLTO_BOOKING_FAILED',
154
+ CarrierDpdPlBookingFailed: 'CARRIER_DPD_PL_BOOKING_FAILED',
155
+ CarrierPostnlBookingFailed: 'CARRIER_POSTNL_BOOKING_FAILED',
156
+ CarrierRoyalMailBookingFailed: 'CARRIER_ROYAL_MAIL_BOOKING_FAILED',
150
157
  CarrierTrackingWebhookRegistrationFailed: 'CARRIER_TRACKING_WEBHOOK_REGISTRATION_FAILED',
151
158
  CarrierCustomsUnsupportedProduct: 'CARRIER_CUSTOMS_UNSUPPORTED_PRODUCT',
152
159
  CarrierCustomsIncomplete: 'CARRIER_CUSTOMS_INCOMPLETE',
@@ -183,6 +190,9 @@ export const SendShipment422ResponseCodeEnum = {
183
190
  AutomationInvalid: 'AUTOMATION_INVALID',
184
191
  ZippyDisabled: 'ZIPPY_DISABLED',
185
192
  ConversationNotFound: 'CONVERSATION_NOT_FOUND',
193
+ FilterInvalid: 'FILTER_INVALID',
194
+ SavedViewNotFound: 'SAVED_VIEW_NOT_FOUND',
195
+ SavedViewLimitReached: 'SAVED_VIEW_LIMIT_REACHED',
186
196
  AdminForbidden: 'ADMIN_FORBIDDEN',
187
197
  JobHandlerNotRegistered: 'JOB_HANDLER_NOT_REGISTERED',
188
198
  JobQueueNotConfigured: 'JOB_QUEUE_NOT_CONFIGURED',