@shipengine/js-api 0.0.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.
Files changed (54) hide show
  1. package/account-settings/api.d.ts +8 -0
  2. package/account-settings/index.d.ts +2 -0
  3. package/account-settings/types.d.ts +8 -0
  4. package/addresses/api.d.ts +8 -0
  5. package/addresses/index.d.ts +2 -0
  6. package/addresses/types.d.ts +94 -0
  7. package/carriers/api.d.ts +17 -0
  8. package/carriers/index.d.ts +2 -0
  9. package/carriers/types.d.ts +109 -0
  10. package/client.d.ts +34 -0
  11. package/custom-packages/api.d.ts +9 -0
  12. package/custom-packages/index.d.ts +2 -0
  13. package/custom-packages/types.d.ts +11 -0
  14. package/dimensions/index.d.ts +1 -0
  15. package/dimensions/types.d.ts +18 -0
  16. package/errors/index.d.ts +2 -0
  17. package/errors/types.d.ts +27 -0
  18. package/errors/utils.d.ts +3 -0
  19. package/index.d.ts +2 -0
  20. package/index.js +16 -0
  21. package/index.mjs +2913 -0
  22. package/insurance/api.d.ts +7 -0
  23. package/insurance/index.d.ts +2 -0
  24. package/insurance/types.d.ts +9 -0
  25. package/labels/api.d.ts +22 -0
  26. package/labels/index.d.ts +2 -0
  27. package/labels/types.d.ts +65 -0
  28. package/order-sources/api.d.ts +11 -0
  29. package/order-sources/index.d.ts +2 -0
  30. package/order-sources/types.d.ts +23 -0
  31. package/package.json +18 -0
  32. package/payments/index.d.ts +1 -0
  33. package/payments/types.d.ts +37 -0
  34. package/rates/api.d.ts +20 -0
  35. package/rates/index.d.ts +2 -0
  36. package/rates/types.d.ts +52 -0
  37. package/relay-points/index.d.ts +1 -0
  38. package/relay-points/types.d.ts +12 -0
  39. package/resources/index.d.ts +1 -0
  40. package/resources/types.d.ts +16 -0
  41. package/sales-order-shipments/api.d.ts +15 -0
  42. package/sales-order-shipments/index.d.ts +2 -0
  43. package/sales-order-shipments/types.d.ts +16 -0
  44. package/sales-orders/api.d.ts +15 -0
  45. package/sales-orders/index.d.ts +2 -0
  46. package/sales-orders/types.d.ts +78 -0
  47. package/shipments/index.d.ts +1 -0
  48. package/shipments/types.d.ts +195 -0
  49. package/types.d.ts +18 -0
  50. package/warehouses/api.d.ts +12 -0
  51. package/warehouses/index.d.ts +2 -0
  52. package/warehouses/types.d.ts +12 -0
  53. package/weight/index.d.ts +1 -0
  54. package/weight/types.d.ts +23 -0
@@ -0,0 +1,7 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { InsuranceAccount, InsuranceProvider } from "./types";
3
+ export declare class InsuranceAPI {
4
+ private client;
5
+ constructor(client: AxiosInstance);
6
+ get: (insuranceProvider: InsuranceProvider) => Promise<import("axios").AxiosResponse<InsuranceAccount, any>>;
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api";
2
+ export * from "./types";
@@ -0,0 +1,9 @@
1
+ import { Currency } from "../payments";
2
+ /**
3
+ * @category Entities
4
+ */
5
+ export interface InsuranceAccount {
6
+ amount: number;
7
+ currency: Currency;
8
+ }
9
+ export type InsuranceProvider = "shipsurance";
@@ -0,0 +1,22 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { Label, LabelLayout, VoidRequest } from "./types";
3
+ export interface CreateLabelOptions {
4
+ displayScheme?: string;
5
+ labelDownloadType?: string;
6
+ labelFormat?: string;
7
+ labelLayout?: LabelLayout;
8
+ validateAddress?: string;
9
+ }
10
+ export interface ListLabelsParams {
11
+ shipmentId?: string;
12
+ }
13
+ export declare class LabelsAPI {
14
+ private client;
15
+ constructor(client: AxiosInstance);
16
+ get: (labelId: string) => Promise<import("axios").AxiosResponse<Label, any>>;
17
+ list: (params?: ListLabelsParams) => Promise<import("axios").AxiosResponse<{
18
+ labels: Label[];
19
+ }, any>>;
20
+ createByRateId: (rateId: string, options: CreateLabelOptions) => Promise<import("axios").AxiosResponse<Label, any>>;
21
+ void: (labelId: string) => Promise<import("axios").AxiosResponse<VoidRequest, any>>;
22
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api";
2
+ export * from "./types";
@@ -0,0 +1,65 @@
1
+ import { Money } from "../payments";
2
+ import { RelayPoint } from "../relay-points";
3
+ import { Download, LinkedResource } from "../resources";
4
+ import { ShipmentPackage } from "../shipments";
5
+ /**
6
+ * @category Entities
7
+ */
8
+ export type LabelChargeEvent = "carrier_default" | "on_creation" | "on_carrier_acceptance";
9
+ /**
10
+ * @category Entities
11
+ */
12
+ export type LabelDisplayScheme = "label" | "qr_code";
13
+ /**
14
+ * @category Entities
15
+ */
16
+ export type LabelFormat = "pdf" | "png" | "zpl";
17
+ /**
18
+ * @category Entities
19
+ */
20
+ export type LabelLayout = "4x6" | "letter";
21
+ /**
22
+ * @category Entities
23
+ */
24
+ export type Label = {
25
+ batchId: string;
26
+ carrierCode: string;
27
+ carrierId: string;
28
+ chargeEvent: LabelChargeEvent;
29
+ createdAt: string;
30
+ displayScheme: LabelDisplayScheme;
31
+ formDownload: LinkedResource;
32
+ insuranceClaim: LinkedResource;
33
+ insuranceCost: Money;
34
+ isInternational: boolean;
35
+ isReturnLabel: boolean;
36
+ labelDownload: Download;
37
+ labelFormat: LabelFormat;
38
+ labelId: string;
39
+ labelImageId: string;
40
+ labelLayout: LabelLayout;
41
+ packageCode: string;
42
+ packages: ShipmentPackage[];
43
+ relayPoints: {
44
+ shipFrom: RelayPoint;
45
+ shipTo: RelayPoint;
46
+ };
47
+ rmaNumber: string;
48
+ serviceCode: string;
49
+ shipDate: string;
50
+ shipmentCost: Money;
51
+ shipmentId: string;
52
+ status: "processing" | "completed" | "error" | "voided";
53
+ trackable: boolean;
54
+ trackingNumber: string;
55
+ trackingStatus: string;
56
+ voided: boolean;
57
+ voidedAt: string;
58
+ };
59
+ /**
60
+ * @category Entities
61
+ */
62
+ export type VoidRequest = {
63
+ approved: boolean;
64
+ message: string;
65
+ };
@@ -0,0 +1,11 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { OrderSource } from "./types";
3
+ export declare class OrderSourcesAPI {
4
+ private client;
5
+ constructor(client: AxiosInstance);
6
+ list: () => Promise<import("axios").AxiosResponse<{
7
+ orderSources: OrderSource[];
8
+ }, any>>;
9
+ get: (orderSourceId: string) => Promise<import("axios").AxiosResponse<OrderSource, any>>;
10
+ refresh: (orderSourceId: string) => Promise<import("axios").AxiosResponse<OrderSource, any>>;
11
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api";
2
+ export * from "./types";
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @category Entities
3
+ */
4
+ export type OrderSourceCode = "3dcart" | "abantecart" | "acumatica" | "acumatica_v2" | "alibaba" | "amazon" | "amazon_au" | "amazon_ca" | "amazon_de" | "amazon_es" | "amazon_fr" | "amazon_it" | "amazon_jp" | "amazon_mx" | "amazon_uk" | "americommerce" | "auctane-orders" | "back-market" | "bandcamp" | "big_cartel" | "bigcommerce" | "bigcommerce_v3" | "bigcommerce_v2" | "bizelo" | "bluepark" | "bonanza" | "brightpearl" | "cdiscount" | "celery" | "channeladvisor" | "channelsale" | "choxi" | "cin7" | "commerceinterface" | "corecommerce" | "coupang" | "cratejoy" | "cs-cart" | "custom_store" | "dear_systems" | "dummy-marketplace" | "ebay" | "ebay_au" | "ebay_ca" | "ebay_uk" | "ebay_fr" | "ebay_v2" | "ecwid" | "ecwid_v1" | "edesk" | "ekm" | "etsy" | "facebook" | "fnac" | "foxycart" | "freestyle" | "fullscreen_direct" | "geekseller" | "goodsie" | "google" | "google_checkout" | "gorgias" | "groopdealz" | "groupon_goods" | "handshake" | "hatch" | "highwire" | "homeroots" | "houzz" | "idealo_de" | "inksoft" | "jane" | "jet" | "kaufland" | "labelapi" | "lemonstand" | "lengow" | "liftoff" | "linnworks" | "listingmirror" | "magento" | "zoey" | "magento_go" | "memberly" | "mercado_libre" | "mijoshop" | "best_buy_ca" | "catch" | "darty" | "fanatics" | "kohls" | "kroger" | "urbn" | "miva_merchant" | "morecommerce" | "mozu" | "neto" | "newegg" | "newegg_business" | "newegg_ca" | "notonthehighstreet" | "oauth_dummy" | "odbc" | "onbuy" | "opencart" | "order_time" | "ordersource_api" | "oscommerce" | "overstock" | "oxatis" | "paypal" | "paypal_v2" | "payvment" | "penny" | "prestashop" | "rakuten" | "best_buy" | "rakuten-fr" | "rate_browser" | "redditgifts" | "reverb" | "revolutionparts" | "salesforce_commerce_cloud" | "salesforce_core" | "sap_anywhere" | "scout_topshelf" | "sears" | "securestore" | "sellbrite" | "selleractive" | "shipengine_api" | "shipengine_merchant" | "shipstation" | "shop_premium_outlets" | "shopify" | "shoppingfeed" | "shopware_de" | "simplepart" | "skuvault" | "soldsie" | "sophio" | "spark_shipping" | "spree" | "spreesy" | "square" | "squarespace" | "stitch_labs" | "storenvy" | "stripe" | "suredone" | "tanga" | "tophatter" | "trade_me" | "tradegecko" | "ultracart" | "unbranded_ecommerce_store" | "unleashed" | "vault" | "visualsoft" | "volo" | "volusion" | "vtex" | "walmart" | "walmart_ca" | "wayfair" | "webflow" | "weebly" | "wish" | "wix" | "woocommerce" | "woocommerce_v2" | "woot" | "x-cart" | "yahoo" | "sec_yumbles" | "zen_cart" | "zonos";
5
+ /**
6
+ * @category Entities
7
+ */
8
+ export type OrderSourceStatus = "idle" | "preparing_update" | "updating" | "error" | "unknown";
9
+ /**
10
+ * @category Entities
11
+ */
12
+ export interface OrderSource {
13
+ active: boolean;
14
+ orderSourceCode: OrderSourceCode;
15
+ orderSourceFriendlyName: string;
16
+ orderSourceId: string;
17
+ orderSourceNickname: string;
18
+ refreshInfo: {
19
+ lastRefreshAttempt?: string;
20
+ refreshDate?: string;
21
+ status: OrderSourceStatus;
22
+ };
23
+ }
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@shipengine/js-api",
3
+ "version": "0.0.3",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./index.mjs",
9
+ "require": "./index.js"
10
+ }
11
+ },
12
+ "typedoc": {
13
+ "displayName": "@shipengine/js-api",
14
+ "entryPoint": "./src/index.ts",
15
+ "readmeFile": "./README.md",
16
+ "tsconfig": "./tsconfig.lib.json"
17
+ }
18
+ }
@@ -0,0 +1 @@
1
+ export * from "./types";
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @category Entities
3
+ */
4
+ export declare enum CreditCardVendor {
5
+ AMERICAN_EXPRESS = "americanexpress",
6
+ DISCOVER = "discover",
7
+ MASTERCARD = "mastercard",
8
+ VISA = "visa"
9
+ }
10
+ /**
11
+ * @category Entities
12
+ */
13
+ export interface CreditCard {
14
+ expirationMonth: string;
15
+ expirationYear: string;
16
+ name: string;
17
+ number: string;
18
+ type: CreditCardVendor;
19
+ }
20
+ /**
21
+ * @category Entities
22
+ */
23
+ export declare enum Currency {
24
+ USD = "usd",
25
+ CAD = "cad",
26
+ AUD = "aud",
27
+ GBP = "gbp",
28
+ EUR = "eur",
29
+ NZD = "nzd"
30
+ }
31
+ /**
32
+ * @category Entities
33
+ */
34
+ export interface Money {
35
+ amount: number;
36
+ currency: Currency;
37
+ }
package/rates/api.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { Currency } from "../payments";
3
+ import { RateResponse } from "./types";
4
+ export interface CalculateRatesOptions {
5
+ calculateTaxAmount?: boolean;
6
+ carrierIds: string[];
7
+ packageTypes?: string[];
8
+ preferredCurrency?: Currency;
9
+ serviceCodes?: string[];
10
+ }
11
+ export declare class RatesAPI {
12
+ private client;
13
+ constructor(client: AxiosInstance);
14
+ calculateByShipmentId: (shipmentId: string, options: CalculateRatesOptions) => Promise<import("axios").AxiosResponse<Omit<import("../shipments").Shipment, "items"> & {
15
+ items: import("../sales-order-shipments").SalesOrderShipmentItem[];
16
+ salesOrderIds: string[];
17
+ } & {
18
+ rateResponse: RateResponse;
19
+ }, any>>;
20
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api";
2
+ export * from "./types";
@@ -0,0 +1,52 @@
1
+ import { CodedError } from "../errors";
2
+ import { Money } from "../payments";
3
+ /**
4
+ * @category Entities
5
+ */
6
+ export type RateType = "check" | "shipment";
7
+ /**
8
+ * @category Entities
9
+ */
10
+ export type RateValidationStatus = "valid" | "invalid" | "has_warnings" | "unknown";
11
+ /**
12
+ * @category Entities
13
+ */
14
+ export interface Rate {
15
+ carrierCode: string;
16
+ carrierDeliveryDays: string;
17
+ carrierFriendlyName: string;
18
+ carrierId: string;
19
+ carrierNickname: string;
20
+ confirmationAmount: Money;
21
+ deliveryDays: number;
22
+ errorMessages: string[];
23
+ estimatedDeliveryDate: string;
24
+ guaranteedService: boolean;
25
+ insuranceAmount: Money;
26
+ negotiatedRate: boolean;
27
+ otherAmount: Money;
28
+ packageType: string;
29
+ rateId: string;
30
+ rateType: RateType;
31
+ serviceCode: string;
32
+ serviceType: string;
33
+ shipDate: string;
34
+ shippingAmount: Money;
35
+ taxAmount?: Money;
36
+ trackable: boolean;
37
+ validationStatus: RateValidationStatus;
38
+ warningMessages: string[];
39
+ zone?: number;
40
+ }
41
+ /**
42
+ * @category Entities
43
+ */
44
+ export interface RateResponse {
45
+ createdAt: string;
46
+ errors: CodedError[];
47
+ invalidRates: Rate[];
48
+ rateRequestId: string;
49
+ rates: Rate[];
50
+ shipmentId: string;
51
+ status: "working" | "completed" | "partial" | "error";
52
+ }
@@ -0,0 +1 @@
1
+ export * from "./types";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @category Entities
3
+ */
4
+ export interface RelayPoint {
5
+ addressLine1: string;
6
+ cityLocality: string;
7
+ companyName: string;
8
+ countryCode: string;
9
+ postalCode: string;
10
+ relayPointId: string;
11
+ stateProvince: string;
12
+ }
@@ -0,0 +1 @@
1
+ export * from "./types";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @category Entities
3
+ */
4
+ export interface Download {
5
+ href: string;
6
+ pdf: string;
7
+ png: string;
8
+ zpl: string;
9
+ }
10
+ /**
11
+ * @category Entities
12
+ */
13
+ export interface LinkedResource {
14
+ href: string;
15
+ type: string;
16
+ }
@@ -0,0 +1,15 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { SalesOrderShipment } from "./types";
3
+ export interface ListSalesOrderShipmentsParams {
4
+ salesOrderIds?: string[];
5
+ }
6
+ export declare class SalesOrderShipmentsAPI {
7
+ private client;
8
+ constructor(client: AxiosInstance);
9
+ list: (params?: ListSalesOrderShipmentsParams) => Promise<import("axios").AxiosResponse<{
10
+ shipments: SalesOrderShipment[];
11
+ }, any>>;
12
+ get: (shipmentId: string) => Promise<import("axios").AxiosResponse<SalesOrderShipment, any>>;
13
+ create: (salesOrderId: string, shipment: Partial<SalesOrderShipment>) => Promise<import("axios").AxiosResponse<SalesOrderShipment, any>>;
14
+ update: (shipmentId: string, shipment: Partial<SalesOrderShipment>) => Promise<import("axios").AxiosResponse<SalesOrderShipment, any>>;
15
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api";
2
+ export * from "./types";
@@ -0,0 +1,16 @@
1
+ import { Shipment, ShipmentItem } from "../shipments";
2
+ /**
3
+ * @category Entities
4
+ */
5
+ export type SalesOrderShipmentItem = ShipmentItem & {
6
+ name?: string;
7
+ salesOrderId?: string;
8
+ salesOrderItemId?: string;
9
+ };
10
+ /**
11
+ * @category Entities
12
+ */
13
+ export type SalesOrderShipment = Omit<Shipment, "items"> & {
14
+ items: SalesOrderShipmentItem[];
15
+ salesOrderIds: string[];
16
+ };
@@ -0,0 +1,15 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { SalesOrder, SalesOrderTracking } from "./types";
3
+ export interface ListSalesOrdersParams {
4
+ externalOrderId?: string;
5
+ externalOrderNumber?: string;
6
+ }
7
+ export declare class SalesOrdersAPI {
8
+ private client;
9
+ constructor(client: AxiosInstance);
10
+ list: (params?: ListSalesOrdersParams) => Promise<import("axios").AxiosResponse<{
11
+ salesOrders: SalesOrder[];
12
+ }, any>>;
13
+ get: (salesOrderId: string) => Promise<import("axios").AxiosResponse<SalesOrder, any>>;
14
+ notifyShipped: (salesOrderId: string, tracking: SalesOrderTracking) => Promise<import("axios").AxiosResponse<SalesOrder, any>>;
15
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api";
2
+ export * from "./types";
@@ -0,0 +1,78 @@
1
+ import { Address } from "../addresses";
2
+ import { OrderSource } from "../order-sources";
3
+ import { Money } from "../payments";
4
+ import { WeightWithUnit } from "../weight";
5
+ /**
6
+ * @category Entities
7
+ */
8
+ export type PaymentStatus = "unknown" | "paid" | "unpaid" | "partially_paid";
9
+ /**
10
+ * @category Entities
11
+ */
12
+ export type FulfillmentStatus = "unknown" | "fulfilled" | "unfulfilled" | "partially_fulfilled" | "on_hold";
13
+ /**
14
+ * @category Entities
15
+ */
16
+ export interface SalesOrderItem {
17
+ isGift: boolean;
18
+ lineItemDetails: {
19
+ asin: string;
20
+ name: string;
21
+ sku: string;
22
+ weight: WeightWithUnit;
23
+ };
24
+ priceSummary: {
25
+ estimatedShipping?: Money;
26
+ estimatedTax: Money;
27
+ total?: Money;
28
+ unitPrice: Money;
29
+ };
30
+ quantity: number;
31
+ requestedShippingOptions: {
32
+ shipDate: string | null;
33
+ shippingService: string;
34
+ };
35
+ salesOrderItemId: string;
36
+ shipTo: Address;
37
+ }
38
+ /**
39
+ * @category Entities
40
+ */
41
+ export interface SalesOrderTracking {
42
+ carrierCode: string;
43
+ trackingNumber: string;
44
+ }
45
+ /**
46
+ * @category Entities
47
+ */
48
+ export interface SalesOrder {
49
+ billTo: {
50
+ address: Address;
51
+ email: string;
52
+ };
53
+ createdAt: string;
54
+ customer: {
55
+ email: string;
56
+ name: string;
57
+ phone: string;
58
+ };
59
+ externalOrderId?: string;
60
+ externalOrderNumber?: string;
61
+ modifiedAt: string;
62
+ orderDate: string;
63
+ orderSource: OrderSource;
64
+ paymentDetails: {
65
+ estimatedShipping: Money;
66
+ estimatedTax: Money;
67
+ grandTotal: Money;
68
+ subtotal: Money;
69
+ };
70
+ salesOrderId: string;
71
+ salesOrderItems: SalesOrderItem[];
72
+ salesOrderStatus: {
73
+ fulfillmentStatus: FulfillmentStatus;
74
+ isCancelled: boolean;
75
+ paymentStatus: PaymentStatus;
76
+ };
77
+ shipTo: Address;
78
+ }
@@ -0,0 +1 @@
1
+ export * from "./types";
@@ -0,0 +1,195 @@
1
+ import { Address, AddressValidation } from "../addresses";
2
+ import { CarrierPackage } from "../carriers";
3
+ import { OrderSourceCode } from "../order-sources";
4
+ import { Money } from "../payments";
5
+ import { Download, LinkedResource } from "../resources";
6
+ import { WeightWithUnit } from "../weight";
7
+ /**
8
+ * @category Entities
9
+ */
10
+ export type AddressValidationOptions = "no_validation" | "validate_only" | "validate_and_clean";
11
+ /**
12
+ * @category Entities
13
+ */
14
+ export type CustomsContents = "documents" | "gift" | "merchandise" | "returned_goods" | "sample";
15
+ /**
16
+ * @category Entities
17
+ */
18
+ export type CustomsNonDeliveryOptions = "return_to_sender" | "treat_as_abandoned";
19
+ /**
20
+ * @category Entities
21
+ */
22
+ export type BillToParties = "recipient" | "third_party";
23
+ /**
24
+ * @category Entities
25
+ */
26
+ export declare enum ConfirmationType {
27
+ DELIVERY = "delivery",
28
+ SIGNATURE = "signature",
29
+ ADULT_SIGNATURE = "adult_signature",
30
+ DIRECT_SIGNATURE = "direct_signature",
31
+ VERBAL_CONFIRMATION = "verbal_confirmation",
32
+ DELIVERY_MAILED = "delivery_mailed",
33
+ NONE = "none"
34
+ }
35
+ /**
36
+ * @category Entities
37
+ */
38
+ export declare enum CustomsContentsType {
39
+ DOCUMENTS = "documents",
40
+ GIFT = "gift",
41
+ MERCHANDISE = "merchandise",
42
+ RETURNED_GOODS = "returned_goods",
43
+ SAMPLE = "sample"
44
+ }
45
+ /**
46
+ * @category Entities
47
+ */
48
+ export declare enum CustomsNonDeliveryType {
49
+ RETURN_TO_SENDER = "return_to_sender",
50
+ TREAT_AS_ABANDONED = "treat_as_abandoned"
51
+ }
52
+ /**
53
+ * @category Entities
54
+ */
55
+ export declare enum InsuranceProviderType {
56
+ SHIPSURANCE = "shipsurance",
57
+ CARRIER = "carrier",
58
+ THIRD_PARTY = "third_party",
59
+ NONE = "none"
60
+ }
61
+ /**
62
+ * @category Entities
63
+ */
64
+ export type ShipmentStatus = "cancelled" | "label_purchased" | "pending" | "processing";
65
+ /**
66
+ * @category Entities
67
+ */
68
+ export type TaxableEntityType = "shipper" | "recipient";
69
+ /**
70
+ * @category Entities
71
+ */
72
+ export type TaxableIdentifierType = "vat" | "eori" | "ssn" | "ein" | "tin" | "ioss" | "pan" | "voec";
73
+ /**
74
+ * @category Entities
75
+ */
76
+ export interface CustomsItem {
77
+ countryOfOrigin?: string;
78
+ customsItemId?: string;
79
+ description?: string;
80
+ harmonizedTariffCode?: string;
81
+ quantity: number;
82
+ sku?: string;
83
+ skuDescription?: string;
84
+ unitOfMeasure?: string;
85
+ value: Money | number;
86
+ }
87
+ /**
88
+ * @category Entities
89
+ */
90
+ export interface ShipmentItem {
91
+ asin?: string;
92
+ externalOrderId?: string;
93
+ externalOrderItemId?: string;
94
+ name?: string;
95
+ orderSourceCode: OrderSourceCode;
96
+ quantity: number;
97
+ sku?: string;
98
+ }
99
+ /**
100
+ * @category Entities
101
+ */
102
+ export type ShipmentPackage = Omit<CarrierPackage, "name"> & {
103
+ externalPackageId?: string;
104
+ formDownload?: LinkedResource;
105
+ insuredValue?: Money;
106
+ labelDownload?: Download;
107
+ labelMessages?: {
108
+ reference1: string;
109
+ reference2: string;
110
+ reference3: string;
111
+ };
112
+ sequence?: number;
113
+ trackingNumber?: string;
114
+ weight: WeightWithUnit;
115
+ };
116
+ /**
117
+ * @category Entities
118
+ */
119
+ export interface TaxIdentifier {
120
+ identifierType: TaxableIdentifierType;
121
+ issuingAuthority: string;
122
+ taxableEntityType: TaxableEntityType;
123
+ value: string;
124
+ }
125
+ /**
126
+ * @category Entities
127
+ */
128
+ export type OriginTypes = "pickup" | "drop_off";
129
+ /**
130
+ * @category Entities
131
+ */
132
+ export type PaymentTypes = "any" | "cash" | "cash_equivalent" | "none";
133
+ /**
134
+ * @category Entities
135
+ */
136
+ export type Customs = {
137
+ contents: CustomsContents;
138
+ customsItems: CustomsItem[];
139
+ nonDelivery: CustomsNonDeliveryOptions;
140
+ };
141
+ /**
142
+ * @category Entities
143
+ */
144
+ export interface Shipment {
145
+ addressValidation?: AddressValidation;
146
+ advancedOptions?: {
147
+ billToAccount?: string;
148
+ billToCountryCode?: string;
149
+ billToParty?: BillToParties;
150
+ billToPostalCode?: string;
151
+ collectOnDelivery?: {
152
+ paymentAmount: Money;
153
+ paymentType: PaymentTypes;
154
+ };
155
+ containsAlcohol?: boolean;
156
+ customField1?: string;
157
+ customField2?: string;
158
+ customField3?: string;
159
+ deliveredDutyPaid?: boolean;
160
+ dryIce?: boolean;
161
+ dryIceWeight?: WeightWithUnit;
162
+ freightClass?: string;
163
+ nonMachinable?: boolean;
164
+ originType?: OriginTypes;
165
+ saturdayDelivery?: boolean;
166
+ shipperRelease?: boolean;
167
+ useUpsGroundFreightPricing?: boolean;
168
+ };
169
+ carrierId: string;
170
+ confirmation: ConfirmationType;
171
+ createdAt: string;
172
+ customs?: Customs;
173
+ externalOrderId?: string;
174
+ externalShipmentId?: string;
175
+ insuranceProvider: InsuranceProviderType;
176
+ items: ShipmentItem[];
177
+ modifiedAt: string;
178
+ orderSourceCode: OrderSourceCode;
179
+ originType?: OriginTypes;
180
+ packages: ShipmentPackage[];
181
+ returnTo: Address | null;
182
+ serviceCode: string | null;
183
+ shipDate?: string;
184
+ shipFrom: Address | null;
185
+ shipmentId: string;
186
+ shipmentStatus: ShipmentStatus;
187
+ shipTo: Address;
188
+ tags: {
189
+ name: string;
190
+ }[];
191
+ taxIdentifiers?: TaxIdentifier[];
192
+ totalWeight: WeightWithUnit;
193
+ validateAddress?: AddressValidationOptions;
194
+ warehouseId?: string;
195
+ }