@shipengine/js-api 1.22.0 → 1.24.0
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.
- package/addresses/types.d.ts +2 -0
- package/connections/api.d.ts +11 -1
- package/connections/settings-types.d.ts +42 -0
- package/connections/types.d.ts +1 -0
- package/index.js +19 -0
- package/index.mjs +19 -0
- package/labels/api.d.ts +1 -86
- package/labels/types.d.ts +86 -27
- package/package.json +1 -1
- package/shipments/types.d.ts +15 -81
package/addresses/types.d.ts
CHANGED
package/connections/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
-
import { CarrierServicesListResponse, ConnectCarrierAccount, ConnectCarrierAccountResponse, GetCarrierConnectionFormParams, GetCarrierConnectionFormResponse, ListCarrierConnectionsParams, ListCarrierConnectionsResponse } from "./types";
|
|
2
|
+
import { CarrierServicesListResponse, ConnectCarrierAccount, ConnectCarrierAccountResponse, ConnectionsCarrierName, ConnectionsCarrierSettingsData, ConnectionsCarrierSettingsResponse, GetCarrierConnectionFormParams, GetCarrierConnectionFormResponse, ListCarrierConnectionsParams, ListCarrierConnectionsResponse } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* # Connections API module - /v1/connections
|
|
5
5
|
*/
|
|
@@ -24,4 +24,14 @@ export declare class ConnectionsAPI {
|
|
|
24
24
|
* identified by the `carrier_code`.
|
|
25
25
|
*/
|
|
26
26
|
getCarrierConnectionsServicesList: (carrierCode: string) => Promise<import("axios").AxiosResponse<CarrierServicesListResponse, any>>;
|
|
27
|
+
/**
|
|
28
|
+
* The `getCarrierSettings` method retrieves the settings for a given carrier,
|
|
29
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
30
|
+
*/
|
|
31
|
+
getCarrierSettings: <T extends ConnectionsCarrierName>(carrierName: T, carrierCode: string) => Promise<import("axios").AxiosResponse<ConnectionsCarrierSettingsResponse<T>, any>>;
|
|
32
|
+
/**
|
|
33
|
+
* The `updateCarrierSettings` method updates the settings for a given carrier,
|
|
34
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
35
|
+
*/
|
|
36
|
+
updateCarrierSettings: <T extends ConnectionsCarrierName>(carrierName: T, carrierCode: string, formData: ConnectionsCarrierSettingsData<T>) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
27
37
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type DHLExpressSettings = {
|
|
2
|
+
isPrimaryAccount: boolean;
|
|
3
|
+
nickname: string;
|
|
4
|
+
shouldHideAccountNumberOnArchiveDoc: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type FedexSettings = {
|
|
7
|
+
isPrimaryAccount: boolean;
|
|
8
|
+
letterheadImage?: string;
|
|
9
|
+
nickname: string;
|
|
10
|
+
pickupType: "none" | "regular_pickup" | "request_courier" | "drop_box" | "business_service_center" | "station";
|
|
11
|
+
signatureImage?: string;
|
|
12
|
+
smartPostEndorsement: "none" | "return_service_requested" | "forwarding_service_requested" | "address_service_requested" | "change_service_requested" | "leave_if_no_response";
|
|
13
|
+
smartPostHub: "none" | "allentown_pa" | "atlanta_ga" | "baltimore_md" | "charlotte_nc" | "chino_ca" | "dallas_tx" | "denver_co" | "detroit_mi" | "edison_nj" | "grove_city_oh" | "groveport_oh" | "houston_tx" | "indianapolis_in" | "kansas_city_ks" | "los_angeles_ca" | "martinsburg_wv" | "memphis_tn" | "minneapolis_mn" | "new_berlin_wi" | "northborough_ma" | "orlando_fl" | "phoneix_az" | "pittsburgh_pa" | "reno_nv" | "sacramento_ca" | "salt_lake_city_ut" | "seattle_wa" | "st_louis_mo" | "windsor_ct" | "newark_ny" | "south_brunswick_nj" | "scranton_pa" | "wheeling_il";
|
|
14
|
+
};
|
|
15
|
+
export type UPSSettings = {
|
|
16
|
+
accountCountryCode: string;
|
|
17
|
+
accountNumber: string;
|
|
18
|
+
accountPostalCode: string;
|
|
19
|
+
invoice?: {
|
|
20
|
+
controlId: string;
|
|
21
|
+
invoiceAmount: number;
|
|
22
|
+
invoiceCurrencyCode: string;
|
|
23
|
+
invoiceDate: string;
|
|
24
|
+
invoiceNumber: string;
|
|
25
|
+
};
|
|
26
|
+
isPrimaryAccount: boolean;
|
|
27
|
+
mailInnovationsCostCenter?: string;
|
|
28
|
+
mailInnovationsCustomerGuid?: string;
|
|
29
|
+
mailInnovationsCustomerId?: string;
|
|
30
|
+
mailInnovationsEndorsement: "none" | "return_service_requested" | "forwarding_service_requested" | "address_service_requested" | "change_service_requested" | "leave_if_no_response";
|
|
31
|
+
nickname: string;
|
|
32
|
+
pickupType: "daily_pickup" | "occasional_pickup" | "customer_counter";
|
|
33
|
+
useCarbonNeutralShippingProgram: boolean;
|
|
34
|
+
useConsolidationServices: boolean;
|
|
35
|
+
useGroundFreightPricing: boolean;
|
|
36
|
+
useNegotiatedRates: boolean;
|
|
37
|
+
useOrderNumberOnMailInnovationsLabels: boolean;
|
|
38
|
+
};
|
|
39
|
+
export type UPSUpdateSettings = Omit<UPSSettings, "accountNumber">;
|
|
40
|
+
export type ConnectionsCarrierName = "dhl_express" | "fedex" | "ups";
|
|
41
|
+
export type ConnectionsCarrierSettingsResponse<Name extends ConnectionsCarrierName = ConnectionsCarrierName> = Name extends "dhl_express" ? DHLExpressSettings : Name extends "fedex" ? FedexSettings : Name extends "ups" ? UPSSettings : never;
|
|
42
|
+
export type ConnectionsCarrierSettingsData<Name extends ConnectionsCarrierName = ConnectionsCarrierName> = Name extends "dhl_express" ? DHLExpressSettings : Name extends "fedex" ? FedexSettings : Name extends "ups" ? UPSUpdateSettings : never;
|
package/connections/types.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1221,6 +1221,25 @@ class ConnectionsAPI {
|
|
|
1221
1221
|
`/v1/connections/carriers/${carrierCode}/services`
|
|
1222
1222
|
);
|
|
1223
1223
|
};
|
|
1224
|
+
/**
|
|
1225
|
+
* The `getCarrierSettings` method retrieves the settings for a given carrier,
|
|
1226
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
1227
|
+
*/
|
|
1228
|
+
this.getCarrierSettings = (carrierName, carrierCode) => {
|
|
1229
|
+
return this.client.get(
|
|
1230
|
+
`/v1/connections/carriers/${carrierName}/${carrierCode}/settings`
|
|
1231
|
+
);
|
|
1232
|
+
};
|
|
1233
|
+
/**
|
|
1234
|
+
* The `updateCarrierSettings` method updates the settings for a given carrier,
|
|
1235
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
1236
|
+
*/
|
|
1237
|
+
this.updateCarrierSettings = (carrierName, carrierCode, formData) => {
|
|
1238
|
+
return this.client.put(
|
|
1239
|
+
`/v1/connections/carriers/${carrierName}/${carrierCode}/settings`,
|
|
1240
|
+
formData
|
|
1241
|
+
);
|
|
1242
|
+
};
|
|
1224
1243
|
this.client = client;
|
|
1225
1244
|
}
|
|
1226
1245
|
}
|
package/index.mjs
CHANGED
|
@@ -1217,6 +1217,25 @@ class ConnectionsAPI {
|
|
|
1217
1217
|
`/v1/connections/carriers/${carrierCode}/services`
|
|
1218
1218
|
);
|
|
1219
1219
|
};
|
|
1220
|
+
/**
|
|
1221
|
+
* The `getCarrierSettings` method retrieves the settings for a given carrier,
|
|
1222
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
1223
|
+
*/
|
|
1224
|
+
this.getCarrierSettings = (carrierName, carrierCode) => {
|
|
1225
|
+
return this.client.get(
|
|
1226
|
+
`/v1/connections/carriers/${carrierName}/${carrierCode}/settings`
|
|
1227
|
+
);
|
|
1228
|
+
};
|
|
1229
|
+
/**
|
|
1230
|
+
* The `updateCarrierSettings` method updates the settings for a given carrier,
|
|
1231
|
+
* identified by the `carrierName` and `carrierCode`.
|
|
1232
|
+
*/
|
|
1233
|
+
this.updateCarrierSettings = (carrierName, carrierCode, formData) => {
|
|
1234
|
+
return this.client.put(
|
|
1235
|
+
`/v1/connections/carriers/${carrierName}/${carrierCode}/settings`,
|
|
1236
|
+
formData
|
|
1237
|
+
);
|
|
1238
|
+
};
|
|
1220
1239
|
this.client = client;
|
|
1221
1240
|
}
|
|
1222
1241
|
}
|
package/labels/api.d.ts
CHANGED
|
@@ -1,90 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
-
import {
|
|
3
|
-
import { Label, LabelLayout, LabelStatus, VoidRequest } from "./types";
|
|
4
|
-
/**
|
|
5
|
-
* # Labels API - Create Label Options
|
|
6
|
-
*/
|
|
7
|
-
export interface CreateLabelOptions {
|
|
8
|
-
/**
|
|
9
|
-
* `displayScheme` is an optional string to control the display scheme of the label.
|
|
10
|
-
*/
|
|
11
|
-
displayScheme?: string;
|
|
12
|
-
/**
|
|
13
|
-
* `labelDownloadType` is an optional string to control the download type of the label.
|
|
14
|
-
*
|
|
15
|
-
* e.g. `url` or `inline`
|
|
16
|
-
*/
|
|
17
|
-
labelDownloadType?: string;
|
|
18
|
-
/**
|
|
19
|
-
* `labelFormat` is an optional string to control the format of the label.
|
|
20
|
-
*
|
|
21
|
-
* e.g. `pdf` or `zpl`
|
|
22
|
-
*/
|
|
23
|
-
labelFormat?: string;
|
|
24
|
-
/**
|
|
25
|
-
* `labelLayout` is an optional string to control the layout of the label.
|
|
26
|
-
*
|
|
27
|
-
* e.g. `4x6` or `8.5x11`
|
|
28
|
-
*/
|
|
29
|
-
labelLayout?: LabelLayout;
|
|
30
|
-
/**
|
|
31
|
-
* A unique identifier for a carrier drop-off point where a merchant plans to deliver packages. This will take precedence over a shipment's Ship From address.
|
|
32
|
-
*/
|
|
33
|
-
shipFromServicePointId?: string;
|
|
34
|
-
/**
|
|
35
|
-
* A unique identifier for a carrier service point where the shipment will be delivered by the carrier. This will take precedence over a shipment's Ship To address.
|
|
36
|
-
*/
|
|
37
|
-
shipToServicePointId?: string;
|
|
38
|
-
/**
|
|
39
|
-
* `validateAddress` is an optional string to control address validation during
|
|
40
|
-
* label purchase.
|
|
41
|
-
*/
|
|
42
|
-
validateAddress?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* # Labels API - List Labels Params
|
|
46
|
-
*/
|
|
47
|
-
export type ListLabelsParams = {
|
|
48
|
-
/**
|
|
49
|
-
* `batchId` is an optional string to retrieve labels within a given batch.
|
|
50
|
-
*/
|
|
51
|
-
batchId?: string;
|
|
52
|
-
/**
|
|
53
|
-
* `carrierId` is an optional string to limit results to only lables for
|
|
54
|
-
* a specific carrier.
|
|
55
|
-
*/
|
|
56
|
-
carrierId?: string;
|
|
57
|
-
/**
|
|
58
|
-
* `labelStatus` optionally allows filtering results to a specific status.
|
|
59
|
-
*/
|
|
60
|
-
labelStatus?: LabelStatus;
|
|
61
|
-
/**
|
|
62
|
-
* `rateId` is an optional string to return labels purchased with a
|
|
63
|
-
* specific rate.
|
|
64
|
-
*/
|
|
65
|
-
rateId?: string;
|
|
66
|
-
/**
|
|
67
|
-
* `serviceCode` is an optional string to limit results to only labels for
|
|
68
|
-
* a specific carrier service.
|
|
69
|
-
*/
|
|
70
|
-
serviceCode?: string;
|
|
71
|
-
/**
|
|
72
|
-
* `shipmentId` is an optional string to filter labels by shipment ID. This
|
|
73
|
-
* is a unique identifier that ShipEngine API associates with your shipment.
|
|
74
|
-
*/
|
|
75
|
-
shipmentId?: string;
|
|
76
|
-
/** `trackingNumber` is an optional string to retrieve labels for a specific
|
|
77
|
-
* tracking number
|
|
78
|
-
*/
|
|
79
|
-
trackingNumber?: string;
|
|
80
|
-
/** `warehouseId` is an optional string to limit results to only those
|
|
81
|
-
* originating from a specific warehouse.
|
|
82
|
-
*/
|
|
83
|
-
warehouseId?: string;
|
|
84
|
-
} & PageableQuery & CreationRangeQuery & SortableQuery<"created_at" | "modified_at" | "order_date">;
|
|
85
|
-
export type ListLabelsResult = {
|
|
86
|
-
labels: Label[];
|
|
87
|
-
} & PageableResult;
|
|
2
|
+
import { CreateLabelOptions, Label, ListLabelsParams, ListLabelsResult, VoidRequest } from "./types";
|
|
88
3
|
/**
|
|
89
4
|
* # Labels API module - /v1/labels
|
|
90
5
|
*/
|
package/labels/types.d.ts
CHANGED
|
@@ -1,32 +1,16 @@
|
|
|
1
|
+
import { Address } from "../addresses";
|
|
1
2
|
import { Money } from "../payments";
|
|
2
3
|
import { RelayPoint } from "../relay-points";
|
|
3
|
-
import { Download, LinkedResource } from "../resources";
|
|
4
|
+
import { CreationRangeQuery, Download, LinkedResource, PageableQuery, PageableResult, SortableQuery } from "../resources";
|
|
4
5
|
import { ShipmentPackage } from "../shipments";
|
|
5
6
|
import { RateDetail } from "../types";
|
|
6
|
-
/**
|
|
7
|
-
* @category Entities
|
|
8
|
-
*/
|
|
9
7
|
export type LabelChargeEvent = "carrier_default" | "on_creation" | "on_carrier_acceptance";
|
|
10
|
-
/**
|
|
11
|
-
* @category Entities
|
|
12
|
-
*/
|
|
13
8
|
export type LabelDisplayScheme = "label" | "qr_code" | "label_and_paperless";
|
|
14
|
-
/**
|
|
15
|
-
* @category Entities
|
|
16
|
-
*/
|
|
17
9
|
export type LabelFormat = "pdf" | "png" | "zpl";
|
|
18
|
-
/**
|
|
19
|
-
* @category Entities
|
|
20
|
-
*/
|
|
21
10
|
export type LabelLayout = "4x6" | "letter";
|
|
22
|
-
/**
|
|
23
|
-
* @category Entities
|
|
24
|
-
*/
|
|
25
11
|
export type LabelStatus = "processing" | "completed" | "error" | "voided";
|
|
26
|
-
/**
|
|
27
|
-
* @category Entities
|
|
28
|
-
*/
|
|
29
12
|
export type Label = {
|
|
13
|
+
alternativeIdentifiers?: string[];
|
|
30
14
|
batchId: string;
|
|
31
15
|
carrierCode: string;
|
|
32
16
|
carrierId: string;
|
|
@@ -46,37 +30,112 @@ export type Label = {
|
|
|
46
30
|
packageCode: string;
|
|
47
31
|
packages: ShipmentPackage[];
|
|
48
32
|
paperlessDownload: PaperlessDownload | null;
|
|
33
|
+
qrCodeDownload?: LinkedResource;
|
|
49
34
|
rateDetails: RateDetail[];
|
|
50
35
|
relayPoints: {
|
|
51
36
|
shipFrom: RelayPoint;
|
|
52
37
|
shipTo: RelayPoint;
|
|
53
38
|
};
|
|
39
|
+
requestedComparisonAmount?: Money;
|
|
54
40
|
rmaNumber: string;
|
|
55
41
|
serviceCode: string;
|
|
56
42
|
shipDate: string;
|
|
57
43
|
shipmentCost: Money;
|
|
58
44
|
shipmentId: string;
|
|
59
|
-
shippingRuleId: string;
|
|
45
|
+
shippingRuleId: string | null;
|
|
46
|
+
shipTo: Address;
|
|
60
47
|
status: LabelStatus;
|
|
61
48
|
trackable: boolean;
|
|
62
49
|
trackingNumber: string;
|
|
63
50
|
trackingStatus: string;
|
|
64
51
|
trackingUrl: string;
|
|
65
52
|
voided: boolean;
|
|
66
|
-
voidedAt: string;
|
|
53
|
+
voidedAt: string | null;
|
|
67
54
|
};
|
|
68
|
-
/**
|
|
69
|
-
* @category Entities
|
|
70
|
-
*/
|
|
71
55
|
export type PaperlessDownload = {
|
|
72
56
|
handoffCode: string;
|
|
73
57
|
href: string;
|
|
74
58
|
instructions: string;
|
|
75
59
|
};
|
|
76
|
-
/**
|
|
77
|
-
* @category Entities
|
|
78
|
-
*/
|
|
79
60
|
export type VoidRequest = {
|
|
80
61
|
approved: boolean;
|
|
81
62
|
message: string;
|
|
82
63
|
};
|
|
64
|
+
export type ListLabelsResult = {
|
|
65
|
+
labels: Label[];
|
|
66
|
+
} & PageableResult;
|
|
67
|
+
export type ListLabelsParams = {
|
|
68
|
+
/**
|
|
69
|
+
* `batchId` is an optional string to retrieve labels within a given batch.
|
|
70
|
+
*/
|
|
71
|
+
batchId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* `carrierId` is an optional string to limit results to only lables for
|
|
74
|
+
* a specific carrier.
|
|
75
|
+
*/
|
|
76
|
+
carrierId?: string;
|
|
77
|
+
/**
|
|
78
|
+
* `labelStatus` optionally allows filtering results to a specific status.
|
|
79
|
+
*/
|
|
80
|
+
labelStatus?: LabelStatus;
|
|
81
|
+
/**
|
|
82
|
+
* `rateId` is an optional string to return labels purchased with a
|
|
83
|
+
* specific rate.
|
|
84
|
+
*/
|
|
85
|
+
rateId?: string;
|
|
86
|
+
/**
|
|
87
|
+
* `serviceCode` is an optional string to limit results to only labels for
|
|
88
|
+
* a specific carrier service.
|
|
89
|
+
*/
|
|
90
|
+
serviceCode?: string;
|
|
91
|
+
/**
|
|
92
|
+
* `shipmentId` is an optional string to filter labels by shipment ID. This
|
|
93
|
+
* is a unique identifier that ShipEngine API associates with your shipment.
|
|
94
|
+
*/
|
|
95
|
+
shipmentId?: string;
|
|
96
|
+
/** `trackingNumber` is an optional string to retrieve labels for a specific
|
|
97
|
+
* tracking number
|
|
98
|
+
*/
|
|
99
|
+
trackingNumber?: string;
|
|
100
|
+
/** `warehouseId` is an optional string to limit results to only those
|
|
101
|
+
* originating from a specific warehouse.
|
|
102
|
+
*/
|
|
103
|
+
warehouseId?: string;
|
|
104
|
+
} & PageableQuery & CreationRangeQuery & SortableQuery<"created_at" | "modified_at" | "order_date">;
|
|
105
|
+
export interface CreateLabelOptions {
|
|
106
|
+
/**
|
|
107
|
+
* `displayScheme` is an optional string to control the display scheme of the label.
|
|
108
|
+
*/
|
|
109
|
+
displayScheme?: string;
|
|
110
|
+
/**
|
|
111
|
+
* `labelDownloadType` is an optional string to control the download type of the label.
|
|
112
|
+
*
|
|
113
|
+
* e.g. `url` or `inline`
|
|
114
|
+
*/
|
|
115
|
+
labelDownloadType?: string;
|
|
116
|
+
/**
|
|
117
|
+
* `labelFormat` is an optional string to control the format of the label.
|
|
118
|
+
*
|
|
119
|
+
* e.g. `pdf` or `zpl`
|
|
120
|
+
*/
|
|
121
|
+
labelFormat?: string;
|
|
122
|
+
/**
|
|
123
|
+
* `labelLayout` is an optional string to control the layout of the label.
|
|
124
|
+
*
|
|
125
|
+
* e.g. `4x6` or `8.5x11`
|
|
126
|
+
*/
|
|
127
|
+
labelLayout?: LabelLayout;
|
|
128
|
+
/**
|
|
129
|
+
* A unique identifier for a carrier drop-off point where a merchant plans to deliver packages. This will take precedence over a shipment's Ship From address.
|
|
130
|
+
*/
|
|
131
|
+
shipFromServicePointId?: string;
|
|
132
|
+
/**
|
|
133
|
+
* A unique identifier for a carrier service point where the shipment will be delivered by the carrier. This will take precedence over a shipment's Ship To address.
|
|
134
|
+
*/
|
|
135
|
+
shipToServicePointId?: string;
|
|
136
|
+
/**
|
|
137
|
+
* `validateAddress` is an optional string to control address validation during
|
|
138
|
+
* label purchase.
|
|
139
|
+
*/
|
|
140
|
+
validateAddress?: string;
|
|
141
|
+
}
|
package/package.json
CHANGED
package/shipments/types.d.ts
CHANGED
|
@@ -6,25 +6,10 @@ import { Money } from "../payments";
|
|
|
6
6
|
import { Rate } from "../rates";
|
|
7
7
|
import { Download, LinkedResource } from "../resources";
|
|
8
8
|
import { WeightWithUnit } from "../weight";
|
|
9
|
-
/**
|
|
10
|
-
* @category Entities
|
|
11
|
-
*/
|
|
12
9
|
export type AddressValidationOptions = "no_validation" | "validate_only" | "validate_and_clean";
|
|
13
|
-
/**
|
|
14
|
-
* @category Entities
|
|
15
|
-
*/
|
|
16
10
|
export type CustomsContents = "documents" | "gift" | "merchandise" | "returned_goods" | "sample";
|
|
17
|
-
/**
|
|
18
|
-
* @category Entities
|
|
19
|
-
*/
|
|
20
11
|
export type CustomsNonDeliveryOptions = "return_to_sender" | "treat_as_abandoned";
|
|
21
|
-
/**
|
|
22
|
-
* @category Entities
|
|
23
|
-
*/
|
|
24
12
|
export type BillToParties = "recipient" | "third_party";
|
|
25
|
-
/**
|
|
26
|
-
* @category Entities
|
|
27
|
-
*/
|
|
28
13
|
export declare enum ConfirmationType {
|
|
29
14
|
DELIVERY = "delivery",
|
|
30
15
|
SIGNATURE = "signature",
|
|
@@ -34,9 +19,6 @@ export declare enum ConfirmationType {
|
|
|
34
19
|
DELIVERY_MAILED = "delivery_mailed",
|
|
35
20
|
NONE = "none"
|
|
36
21
|
}
|
|
37
|
-
/**
|
|
38
|
-
* @category Entities
|
|
39
|
-
*/
|
|
40
22
|
export declare enum CustomsContentsType {
|
|
41
23
|
DOCUMENTS = "documents",
|
|
42
24
|
GIFT = "gift",
|
|
@@ -44,20 +26,11 @@ export declare enum CustomsContentsType {
|
|
|
44
26
|
RETURNED_GOODS = "returned_goods",
|
|
45
27
|
SAMPLE = "sample"
|
|
46
28
|
}
|
|
47
|
-
/**
|
|
48
|
-
* @category Entities
|
|
49
|
-
*/
|
|
50
29
|
export declare enum CustomsNonDeliveryType {
|
|
51
30
|
RETURN_TO_SENDER = "return_to_sender",
|
|
52
31
|
TREAT_AS_ABANDONED = "treat_as_abandoned"
|
|
53
32
|
}
|
|
54
|
-
/**
|
|
55
|
-
* @category Entities
|
|
56
|
-
*/
|
|
57
33
|
export type CustomsTermsOfTradeCode = "exw" | "fca" | "cpt" | "cip" | "dpu" | "dap" | "ddp" | "fas" | "fob" | "cfr" | "cif" | "ddu" | "daf" | "deq" | "des";
|
|
58
|
-
/**
|
|
59
|
-
* @category Entities
|
|
60
|
-
*/
|
|
61
34
|
export interface CustomsInvoiceAdditionalDetails {
|
|
62
35
|
discount?: Money;
|
|
63
36
|
freightCharge?: Money;
|
|
@@ -65,9 +38,6 @@ export interface CustomsInvoiceAdditionalDetails {
|
|
|
65
38
|
otherChargeDescription?: string;
|
|
66
39
|
otherCharges?: Money;
|
|
67
40
|
}
|
|
68
|
-
/**
|
|
69
|
-
* @category Entities
|
|
70
|
-
*/
|
|
71
41
|
export interface DangerousGoods {
|
|
72
42
|
AddionalDescription?: string;
|
|
73
43
|
dangerousAmount?: {
|
|
@@ -92,46 +62,19 @@ export interface DangerousGoods {
|
|
|
92
62
|
transportMean?: DangerousGoodsTransportMean;
|
|
93
63
|
tunnelCode?: string;
|
|
94
64
|
}
|
|
95
|
-
/**
|
|
96
|
-
* @category Entities
|
|
97
|
-
*/
|
|
98
65
|
export type DangerousGoodsPackagingGroup = "i" | "ii" | "iii";
|
|
99
|
-
/**
|
|
100
|
-
* @category Entities
|
|
101
|
-
*/
|
|
102
66
|
export type DangerousGoodsPackagingInstructionSection = "section_1" | "section_2" | "section_1a" | "section_1b";
|
|
103
|
-
/**
|
|
104
|
-
* @category Entities
|
|
105
|
-
*/
|
|
106
67
|
export type DangerousGoodsRegulationLevel = "lightly_regulated" | "fully_regulated" | "limited_quantities" | "excepted_quantity";
|
|
107
|
-
/**
|
|
108
|
-
* @category Entities
|
|
109
|
-
*/
|
|
110
68
|
export type DangerousGoodsTransportMean = "ground" | "water" | "cargo_aircraft_only" | "passenger_aircraft";
|
|
111
|
-
/**
|
|
112
|
-
* @category Entities
|
|
113
|
-
*/
|
|
114
69
|
export declare enum InsuranceProviderType {
|
|
115
70
|
SHIPSURANCE = "shipsurance",
|
|
116
71
|
CARRIER = "carrier",
|
|
117
72
|
THIRD_PARTY = "third_party",
|
|
118
73
|
NONE = "none"
|
|
119
74
|
}
|
|
120
|
-
/**
|
|
121
|
-
* @category Entities
|
|
122
|
-
*/
|
|
123
75
|
export type ShipmentStatus = "cancelled" | "label_purchased" | "pending" | "processing";
|
|
124
|
-
/**
|
|
125
|
-
* @category Entities
|
|
126
|
-
*/
|
|
127
76
|
export type TaxableEntityType = "shipper" | "recipient";
|
|
128
|
-
/**
|
|
129
|
-
* @category Entities
|
|
130
|
-
*/
|
|
131
77
|
export type TaxableIdentifierType = "vat" | "eori" | "ssn" | "ein" | "tin" | "ioss" | "pan" | "voec";
|
|
132
|
-
/**
|
|
133
|
-
* @category Entities
|
|
134
|
-
*/
|
|
135
78
|
export interface Product {
|
|
136
79
|
countryOfOrigin?: string;
|
|
137
80
|
dangerousGoods?: DangerousGoods;
|
|
@@ -147,9 +90,6 @@ export interface Product {
|
|
|
147
90
|
vatRate?: number;
|
|
148
91
|
weight?: WeightWithUnit;
|
|
149
92
|
}
|
|
150
|
-
/**
|
|
151
|
-
* @category Entities
|
|
152
|
-
*/
|
|
153
93
|
export interface ShipmentItem {
|
|
154
94
|
asin?: string;
|
|
155
95
|
externalOrderId?: string;
|
|
@@ -159,9 +99,6 @@ export interface ShipmentItem {
|
|
|
159
99
|
quantity: number;
|
|
160
100
|
sku?: string;
|
|
161
101
|
}
|
|
162
|
-
/**
|
|
163
|
-
* @category Entities
|
|
164
|
-
*/
|
|
165
102
|
export type ShipmentPackage = Omit<CarrierPackage, "name"> & {
|
|
166
103
|
contentDescription?: string;
|
|
167
104
|
externalPackageId?: string;
|
|
@@ -178,26 +115,15 @@ export type ShipmentPackage = Omit<CarrierPackage, "name"> & {
|
|
|
178
115
|
trackingNumber?: string;
|
|
179
116
|
weight: WeightWithUnit;
|
|
180
117
|
};
|
|
181
|
-
/**
|
|
182
|
-
* @category Entities
|
|
183
|
-
*/
|
|
184
118
|
export interface TaxIdentifier {
|
|
185
119
|
identifierType: TaxableIdentifierType;
|
|
186
120
|
issuingAuthority: string;
|
|
187
121
|
taxableEntityType: TaxableEntityType;
|
|
188
122
|
value: string;
|
|
189
123
|
}
|
|
190
|
-
/**
|
|
191
|
-
* @category Entities
|
|
192
|
-
*/
|
|
193
124
|
export type OriginTypes = "pickup" | "drop_off";
|
|
194
|
-
/**
|
|
195
|
-
* @category Entities
|
|
196
|
-
*/
|
|
197
125
|
export type PaymentTypes = "any" | "cash" | "cash_equivalent" | "none";
|
|
198
|
-
/**
|
|
199
|
-
* @deprecated since July 2023
|
|
200
|
-
*/
|
|
126
|
+
/** @deprecated since July 2023 */
|
|
201
127
|
export interface CustomsItem {
|
|
202
128
|
countryOfOrigin?: string;
|
|
203
129
|
customsItemId?: string;
|
|
@@ -210,14 +136,12 @@ export interface CustomsItem {
|
|
|
210
136
|
value: Money | number;
|
|
211
137
|
valueCurrency?: string;
|
|
212
138
|
}
|
|
213
|
-
/**
|
|
214
|
-
* @category Entities
|
|
215
|
-
*/
|
|
216
139
|
export type Customs = {
|
|
217
140
|
contents: CustomsContents;
|
|
218
141
|
contentsExplanation?: string;
|
|
219
142
|
/**
|
|
220
143
|
* @deprecated since July 2023
|
|
144
|
+
* CustomsItems array is deprecated, use the Products array within Packages instead. Leaving this here for backwards compatibility
|
|
221
145
|
*/
|
|
222
146
|
customsItems?: CustomsItem[];
|
|
223
147
|
declaration?: string;
|
|
@@ -226,13 +150,11 @@ export type Customs = {
|
|
|
226
150
|
nonDelivery: CustomsNonDeliveryOptions;
|
|
227
151
|
termsOfTradeCode?: CustomsTermsOfTradeCode;
|
|
228
152
|
};
|
|
229
|
-
/**
|
|
230
|
-
* @category Entities
|
|
231
|
-
*/
|
|
232
153
|
export interface Shipment {
|
|
233
154
|
addressValidation?: AddressValidation;
|
|
234
155
|
advancedOptions?: {
|
|
235
156
|
additionalHandling?: boolean;
|
|
157
|
+
ancillaryEndorsementsOption?: string;
|
|
236
158
|
billToAccount?: string;
|
|
237
159
|
billToCountryCode?: string;
|
|
238
160
|
billToParty?: BillToParties;
|
|
@@ -248,11 +170,20 @@ export interface Shipment {
|
|
|
248
170
|
deliveredDutyPaid?: boolean;
|
|
249
171
|
dryIce?: boolean;
|
|
250
172
|
dryIceWeight?: WeightWithUnit;
|
|
173
|
+
eventNotification?: boolean;
|
|
174
|
+
fedexFreight?: {
|
|
175
|
+
bookingConfirmation?: string;
|
|
176
|
+
shipperLoadAndCount?: string;
|
|
177
|
+
};
|
|
251
178
|
freightClass?: string;
|
|
179
|
+
limitedQuantity?: boolean;
|
|
252
180
|
nonMachinable?: boolean;
|
|
253
181
|
originType?: OriginTypes;
|
|
182
|
+
ownDocumentUpload?: boolean;
|
|
183
|
+
returnPickupAttempts?: number;
|
|
254
184
|
saturdayDelivery?: boolean;
|
|
255
185
|
shipperRelease?: boolean;
|
|
186
|
+
thirdPartyConsignee?: boolean;
|
|
256
187
|
useUpsGroundFreightPricing?: boolean;
|
|
257
188
|
};
|
|
258
189
|
carrierId: string;
|
|
@@ -263,6 +194,7 @@ export interface Shipment {
|
|
|
263
194
|
externalOrderId?: string;
|
|
264
195
|
externalShipmentId?: string;
|
|
265
196
|
insuranceProvider: InsuranceProviderType;
|
|
197
|
+
isReturn?: boolean;
|
|
266
198
|
items: ShipmentItem[];
|
|
267
199
|
modifiedAt: string;
|
|
268
200
|
orderSourceCode: OrderSourceCode;
|
|
@@ -273,7 +205,9 @@ export interface Shipment {
|
|
|
273
205
|
shipDate?: string;
|
|
274
206
|
shipFrom: Address | null;
|
|
275
207
|
shipmentId: string;
|
|
208
|
+
shipmentNumber?: string;
|
|
276
209
|
shipmentStatus: ShipmentStatus;
|
|
210
|
+
shippingRuleId?: string;
|
|
277
211
|
shipTo: Address;
|
|
278
212
|
tags: {
|
|
279
213
|
name: string;
|