@shipengine/connect-carrier-api 2.2.2 → 2.3.1
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/lib/app/carrier-app.js +6 -39
- package/lib/app/carrier-app.js.map +1 -1
- package/lib/app/internal/carrier-specification.js +14 -1
- package/lib/app/internal/carrier-specification.js.map +1 -1
- package/lib/app/internal/metadata.js.map +1 -1
- package/lib/app/metadata/account-modals.d.ts +8 -2
- package/lib/app/metadata/account-modals.js.map +1 -1
- package/lib/app/metadata/carrier-app-metadata.js.map +1 -1
- package/lib/app/metadata/carrier.d.ts +1 -0
- package/lib/app/metadata/carrier.js +6 -12
- package/lib/app/metadata/carrier.js.map +1 -1
- package/lib/app/metadata/label-formats.js.map +1 -1
- package/lib/app/metadata/label-sizes.js.map +1 -1
- package/lib/app/metadata/monoauth.js.map +1 -1
- package/lib/app/metadata/package-type.d.ts +1 -0
- package/lib/app/metadata/package-type.js +3 -0
- package/lib/app/metadata/package-type.js.map +1 -1
- package/lib/app/metadata/service-class.js.map +1 -1
- package/lib/app/metadata/service-grade.js.map +1 -1
- package/lib/app/metadata/shipping-service.d.ts +1 -0
- package/lib/app/metadata/shipping-service.js +7 -16
- package/lib/app/metadata/shipping-service.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/models/addresses/address-base.d.ts +13 -13
- package/lib/models/addresses/address-base.js.map +1 -1
- package/lib/models/addresses/address-residential-indicator.d.ts +3 -0
- package/lib/models/addresses/address-residential-indicator.js +3 -0
- package/lib/models/addresses/address-residential-indicator.js.map +1 -1
- package/lib/models/addresses/ship-from-display.d.ts +1 -0
- package/lib/models/addresses/ship-from-display.js +1 -0
- package/lib/models/addresses/ship-from-display.js.map +1 -1
- package/lib/models/addresses/ship-from.d.ts +1 -0
- package/lib/models/addresses/ship-from.js +1 -0
- package/lib/models/addresses/ship-from.js.map +1 -1
- package/lib/models/addresses/ship-to.d.ts +1 -0
- package/lib/models/addresses/ship-to.js +1 -0
- package/lib/models/addresses/ship-to.js.map +1 -1
- package/lib/models/advanced-options.d.ts +1 -1
- package/lib/models/authorization.d.ts +2 -0
- package/lib/models/authorization.js.map +1 -1
- package/lib/models/billing/billing-categories.d.ts +1 -1
- package/lib/models/billing/billing-categories.js +1 -1
- package/lib/models/billing/billing-categories.js.map +1 -1
- package/lib/models/billing/billing-line-item.d.ts +5 -0
- package/lib/models/billing/billing-line-item.js +2 -2
- package/lib/models/billing/billing-line-item.js.map +1 -1
- package/lib/models/confirmation-types.d.ts +5 -5
- package/lib/models/confirmation-types.js +5 -5
- package/lib/models/confirmation-types.js.map +1 -1
- package/lib/models/currency.d.ts +2 -0
- package/lib/models/currency.js.map +1 -1
- package/lib/models/customs/customs-content-types.d.ts +5 -1
- package/lib/models/customs/customs-content-types.js +5 -1
- package/lib/models/customs/customs-content-types.js.map +1 -1
- package/lib/models/customs/customs-item.d.ts +9 -1
- package/lib/models/customs/customs-item.js +1 -1
- package/lib/models/customs/customs-item.js.map +1 -1
- package/lib/models/customs/customs-non-delivery.d.ts +2 -0
- package/lib/models/customs/customs-non-delivery.js +2 -0
- package/lib/models/customs/customs-non-delivery.js.map +1 -1
- package/lib/models/customs/customs.d.ts +6 -1
- package/lib/models/customs/customs.js +1 -1
- package/lib/models/customs/customs.js.map +1 -1
- package/lib/models/documents/document-type.d.ts +4 -0
- package/lib/models/documents/document-type.js +4 -0
- package/lib/models/documents/document-type.js.map +1 -1
- package/lib/models/documents/document.d.ts +3 -0
- package/lib/models/documents/document.js.map +1 -1
- package/lib/models/errors/detailed-error.d.ts +1 -1
- package/lib/models/errors/detailed-error.js +1 -1
- package/lib/models/errors/detailed-error.js.map +1 -1
- package/lib/models/errors/standardized-error-code.d.ts +1 -1
- package/lib/models/errors/standardized-error-code.js +1 -1
- package/lib/models/errors/standardized-error-code.js.map +1 -1
- package/lib/models/fulfillment-plans/fulfillment-plan-details.d.ts +4 -1
- package/lib/models/fulfillment-plans/fulfillment-plan-details.js +1 -1
- package/lib/models/fulfillment-plans/fulfillment-plan-details.js.map +1 -1
- package/lib/models/fulfillment-plans/fulfillment-plan-items.d.ts +4 -4
- package/lib/models/fulfillment-plans/raw-external-source.d.ts +2 -0
- package/lib/models/fulfillment-plans/raw-external-source.js +1 -0
- package/lib/models/fulfillment-plans/raw-external-source.js.map +1 -1
- package/lib/models/labels/document-formats.js.map +1 -1
- package/lib/models/labels/form-download.d.ts +2 -0
- package/lib/models/labels/form-download.js +1 -0
- package/lib/models/labels/form-download.js.map +1 -1
- package/lib/models/labels/label-download.d.ts +2 -0
- package/lib/models/labels/label-download.js +1 -0
- package/lib/models/labels/label-download.js.map +1 -1
- package/lib/models/labels/label-package.d.ts +2 -0
- package/lib/models/labels/label-package.js.map +1 -1
- package/lib/models/labels/return-label-details.d.ts +1 -0
- package/lib/models/labels/return-label-details.js.map +1 -1
- package/lib/models/labels/void-request.d.ts +2 -0
- package/lib/models/labels/void-request.js.map +1 -1
- package/lib/models/labels/void-response.d.ts +1 -1
- package/lib/models/manifests/label.d.ts +2 -0
- package/lib/models/manifests/label.js.map +1 -1
- package/lib/models/manifests/manifest.d.ts +5 -1
- package/lib/models/manifests/manifest.js +1 -1
- package/lib/models/manifests/manifest.js.map +1 -1
- package/lib/models/package.d.ts +6 -0
- package/lib/models/package.js.map +1 -1
- package/lib/models/pickup/cancellation-details.d.ts +1 -0
- package/lib/models/pickup/cancellation-details.js.map +1 -1
- package/lib/models/pickup/pickup-confirmation.d.ts +3 -0
- package/lib/models/pickup/pickup-confirmation.js.map +1 -1
- package/lib/models/pickup/pickup-contact-details.d.ts +6 -1
- package/lib/models/pickup/pickup-contact-details.js +1 -1
- package/lib/models/pickup/pickup-contact-details.js.map +1 -1
- package/lib/models/pickup/pickup-location-details.d.ts +1 -0
- package/lib/models/pickup/pickup-location-details.js.map +1 -1
- package/lib/models/pickup/pickup-package.d.ts +7 -0
- package/lib/models/pickup/pickup-package.js.map +1 -1
- package/lib/models/pickup/pickup-shipment-details.d.ts +1 -0
- package/lib/models/pickup/pickup-shipment-details.js.map +1 -1
- package/lib/models/pickup/pickup-window.d.ts +5 -1
- package/lib/models/pickup/pickup-window.js +1 -1
- package/lib/models/pickup/pickup-window.js.map +1 -1
- package/lib/models/pickup/shipment-identifier.d.ts +2 -0
- package/lib/models/pickup/shipment-identifier.js.map +1 -1
- package/lib/models/pickup/shipped-package.d.ts +7 -0
- package/lib/models/pickup/shipped-package.js.map +1 -1
- package/lib/models/pickup/shipped-shipment.d.ts +6 -0
- package/lib/models/pickup/shipped-shipment.js.map +1 -1
- package/lib/models/rates/rate.d.ts +2 -4
- package/lib/models/rates/rate.js.map +1 -1
- package/lib/models/registration/credentials.d.ts +2 -0
- package/lib/models/registration/credentials.js.map +1 -1
- package/lib/models/resource-download.d.ts +2 -0
- package/lib/models/resource-download.js.map +1 -1
- package/lib/models/taxes/tax-identifier.d.ts +1 -1
- package/lib/models/taxes/tax-identifier.js +1 -1
- package/lib/models/taxes/tax-identifier.js.map +1 -1
- package/lib/models/tracking/lat-long.d.ts +2 -2
- package/lib/models/tracking/service.d.ts +2 -0
- package/lib/models/tracking/service.js.map +1 -1
- package/lib/models/tracking/track-event.d.ts +9 -0
- package/lib/models/tracking/track-event.js.map +1 -1
- package/lib/models/tracking/tracking-info.d.ts +18 -0
- package/lib/models/tracking/tracking-info.js.map +1 -1
- package/lib/models/tracking/update-method.js.map +1 -1
- package/lib/models/units/dimension-details.d.ts +4 -0
- package/lib/models/units/dimension-details.js.map +1 -1
- package/lib/models/units/weight-details.d.ts +4 -0
- package/lib/models/units/weight-details.js.map +1 -1
- package/lib/responses/normalize-tracking-data-response.js.map +1 -1
- package/lib/responses/validate-inbound-data-response.js.map +1 -1
- package/package.json +1 -1
- package/spec.json +355 -176
- package/src/app/carrier-app-definition.ts +5 -15
- package/src/app/carrier-app.ts +9 -45
- package/src/app/internal/carrier-specification.ts +20 -7
- package/src/app/internal/metadata.ts +1 -3
- package/src/app/metadata/account-modals.ts +8 -2
- package/src/app/metadata/carrier-app-metadata.ts +1 -6
- package/src/app/metadata/carrier.ts +11 -28
- package/src/app/metadata/label-formats.ts +1 -3
- package/src/app/metadata/label-sizes.ts +1 -3
- package/src/app/metadata/monoauth.ts +1 -4
- package/src/app/metadata/package-type.ts +4 -0
- package/src/app/metadata/service-class.ts +1 -3
- package/src/app/metadata/service-grade.ts +1 -3
- package/src/app/metadata/shipping-service.ts +10 -24
- package/src/index.ts +1 -0
- package/src/models/addresses/address-base.ts +13 -14
- package/src/models/addresses/address-residential-indicator.ts +3 -0
- package/src/models/addresses/ship-from-display.ts +1 -0
- package/src/models/addresses/ship-from.ts +1 -0
- package/src/models/addresses/ship-to.ts +1 -0
- package/src/models/advanced-options.ts +1 -1
- package/src/models/authorization.ts +2 -0
- package/src/models/billing/billing-categories.ts +2 -4
- package/src/models/billing/billing-line-item.ts +8 -6
- package/src/models/confirmation-types.ts +5 -5
- package/src/models/currency.ts +2 -0
- package/src/models/customs/customs-content-types.ts +5 -1
- package/src/models/customs/customs-item.ts +9 -1
- package/src/models/customs/customs-non-delivery.ts +2 -0
- package/src/models/customs/customs.ts +6 -1
- package/src/models/documents/document-type.ts +5 -3
- package/src/models/documents/document.ts +4 -4
- package/src/models/errors/detailed-error.ts +1 -1
- package/src/models/errors/standardized-error-code.ts +1 -1
- package/src/models/fulfillment-plans/fulfillment-plan-details.ts +4 -1
- package/src/models/fulfillment-plans/fulfillment-plan-items.ts +4 -4
- package/src/models/fulfillment-plans/raw-external-source.ts +2 -0
- package/src/models/labels/document-formats.ts +1 -3
- package/src/models/labels/form-download.ts +2 -0
- package/src/models/labels/label-download.ts +2 -0
- package/src/models/labels/label-package.ts +2 -0
- package/src/models/labels/return-label-details.ts +1 -0
- package/src/models/labels/void-request.ts +2 -0
- package/src/models/labels/void-response.ts +1 -1
- package/src/models/manifests/label.ts +2 -0
- package/src/models/manifests/manifest.ts +5 -1
- package/src/models/package.ts +6 -0
- package/src/models/pickup/cancellation-details.ts +1 -0
- package/src/models/pickup/pickup-confirmation.ts +4 -4
- package/src/models/pickup/pickup-contact-details.ts +6 -1
- package/src/models/pickup/pickup-location-details.ts +1 -0
- package/src/models/pickup/pickup-package.ts +7 -0
- package/src/models/pickup/pickup-shipment-details.ts +1 -0
- package/src/models/pickup/pickup-window.ts +5 -1
- package/src/models/pickup/shipment-identifier.ts +2 -0
- package/src/models/pickup/shipped-package.ts +7 -0
- package/src/models/pickup/shipped-shipment.ts +6 -0
- package/src/models/rates/rate.ts +3 -8
- package/src/models/registration/credentials.ts +2 -0
- package/src/models/resource-download.ts +2 -0
- package/src/models/taxes/tax-identifier.ts +1 -1
- package/src/models/tracking/lat-long.ts +2 -2
- package/src/models/tracking/service.ts +2 -0
- package/src/models/tracking/track-event.ts +9 -0
- package/src/models/tracking/tracking-info.ts +18 -0
- package/src/models/tracking/update-method.ts +1 -3
- package/src/models/units/dimension-details.ts +4 -0
- package/src/models/units/weight-details.ts +4 -0
- package/src/responses/normalize-tracking-data-response.ts +1 -6
- package/src/responses/validate-inbound-data-response.ts +1 -4
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/** @description Denotes the type of content for customs */
|
|
2
2
|
export enum CustomsContentTypes {
|
|
3
|
+
/** @description This is generalized merchandise that someone has purchased */
|
|
3
4
|
Merchandise = 'merchandise',
|
|
5
|
+
/** @description Documents that are being shipped */
|
|
4
6
|
Documents = 'documents',
|
|
7
|
+
/** @description An item that is being shipped as a gift (not purchased) */
|
|
5
8
|
Gift = 'gift',
|
|
6
|
-
/** @description
|
|
9
|
+
/** @description Sample goods that are being shipped */
|
|
7
10
|
Sample = 'sample',
|
|
11
|
+
/** @description Items that are being returned */
|
|
8
12
|
ReturnedGoods = 'returned_goods',
|
|
9
13
|
}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { Currency } from '../currency';
|
|
2
2
|
import { WeightDetails } from '../units';
|
|
3
3
|
|
|
4
|
-
/** @description
|
|
4
|
+
/** @description This model represents the customs declaration for a single item */
|
|
5
5
|
export class CustomsItem {
|
|
6
|
+
/** @description A user specified free form string describing this customs item. If the field is absent the user has not specified a description */
|
|
6
7
|
description?: string;
|
|
8
|
+
/** @description The user specified count of items in this declaration. This value should be 1 or greater */
|
|
7
9
|
quantity?: number;
|
|
10
|
+
/** @description The user specified declared customs value of this customs item. Generally, this value needs to be greater than 0 to be accepted through customs */
|
|
8
11
|
value?: Currency;
|
|
12
|
+
/** @description The user specified declared country of origin of this customs item */
|
|
9
13
|
country_of_origin?: string;
|
|
14
|
+
/** @description The user specified Harmonized Tariff Code. See https://hts.usitc.gov/ for more information */
|
|
10
15
|
harmonized_tariff_code?: string;
|
|
16
|
+
/** @description The user specified SKU of this customs item. This field is completely free form. */
|
|
11
17
|
sku?: string;
|
|
18
|
+
/** @description The user specified SKU description of this customs item. This field is completely free form. */
|
|
12
19
|
sku_description?: string;
|
|
20
|
+
/** @description Detailed information about the weight of this item */
|
|
13
21
|
item_weight?: WeightDetails;
|
|
14
22
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** @description Denotes the action that should be taken when a shipment is not deliverable */
|
|
2
2
|
export enum CustomsNonDelivery {
|
|
3
|
+
/** @description Make an attempt to return this package to sender if unable to deliver */
|
|
3
4
|
ReturnToSender = 'return_to_sender',
|
|
5
|
+
/** @description Do not make an attempt to return this package to sender if unable to deliver */
|
|
4
6
|
TreatAsAbandoned = 'treat_as_abandoned',
|
|
5
7
|
}
|
|
@@ -3,11 +3,16 @@ import { CustomsNonDelivery } from './customs-non-delivery';
|
|
|
3
3
|
import { CustomsItem } from './customs-item';
|
|
4
4
|
import { Currency } from '../currency';
|
|
5
5
|
|
|
6
|
-
/** @description Basic structure for a customs declaration
|
|
6
|
+
/** @description Basic structure for a customs declaration */
|
|
7
7
|
export class Customs {
|
|
8
|
+
/** @description Indicates the type of contents associated with this shipment */
|
|
8
9
|
contents?: CustomsContentTypes;
|
|
10
|
+
/** @description Indicates what the seller would like done in case of an issue with delivery */
|
|
9
11
|
non_delivery?: CustomsNonDelivery;
|
|
12
|
+
/** @description A list of customs items to declare */
|
|
10
13
|
customs_items!: CustomsItem[];
|
|
14
|
+
/** @description Indicates how much the buyer paid for shipping, if any. This amount may be different than the shipping cost billed to the shipper. */
|
|
11
15
|
buyer_shipping_amount_paid?: Currency;
|
|
16
|
+
/** @description The amount of duties paid by the shipper, if any. This is generally only necessary for DDP (bill_duties_to_sender) shipments. */
|
|
12
17
|
duties_paid?: Currency;
|
|
13
18
|
}
|
|
@@ -2,12 +2,14 @@ import Joi from 'joi';
|
|
|
2
2
|
|
|
3
3
|
/** @description Types of documents */
|
|
4
4
|
export enum DocumentType {
|
|
5
|
+
/** @description A shipping label */
|
|
5
6
|
Label = 'label',
|
|
7
|
+
/** @description A form that lists the details of goods that are being imported or exported when a citizen or visitor enters a customs territory (country's borders) */
|
|
6
8
|
CustomsForm = 'customs_form',
|
|
9
|
+
/** @description A legal document issued by the seller (exporter) to the buyer (importer) in an international transaction and serves as a contract and a proof of sale between the buyer and seller */
|
|
7
10
|
CommercialInvoice = 'commercial_invoice',
|
|
11
|
+
/** @description A legal document issued by a carrier to a shipper that details the type, quantity, and destination of the goods being carried (does not indicate the ownership of goods nor does it carry a title to the goods being sold) */
|
|
8
12
|
BillOfLading = 'bill_of_lading',
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
export const DocumentTypeSchema = Joi.string().valid(
|
|
12
|
-
...Object.values(DocumentType),
|
|
13
|
-
);
|
|
15
|
+
export const DocumentTypeSchema = Joi.string().valid(...Object.values(DocumentType));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DocumentType, DocumentTypeSchema } from './document-type';
|
|
2
|
-
import {
|
|
3
|
-
DocumentFormat,
|
|
4
|
-
DocumentFormatSchema,
|
|
5
|
-
} from '../labels/document-formats';
|
|
2
|
+
import { DocumentFormat, DocumentFormatSchema } from '../labels/document-formats';
|
|
6
3
|
import Joi from 'joi';
|
|
7
4
|
|
|
8
5
|
/** @description Basic structure for a document */
|
|
9
6
|
export class Document {
|
|
7
|
+
/** @description The document type(s) being returned. In most cases this is just a single document type; however, some carriers return multiple document types in the same PDF or ZPL */
|
|
10
8
|
type!: DocumentType[];
|
|
9
|
+
/** @description Base64 encoded data for the document */
|
|
11
10
|
data!: string;
|
|
11
|
+
/** @description The format the document is in (Pdf, Zpl, etc) */
|
|
12
12
|
format!: DocumentFormat;
|
|
13
13
|
}
|
|
14
14
|
export const DocumentSchema = Joi.object({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StandardizedErrorCode } from './standardized-error-code';
|
|
2
2
|
|
|
3
|
-
/** @
|
|
3
|
+
/** @deprecated Please Use Runtime Errors */
|
|
4
4
|
export class DetailedError {
|
|
5
5
|
standardized_error_code!: StandardizedErrorCode;
|
|
6
6
|
external_error_code?: string;
|
|
@@ -2,9 +2,12 @@ import { Identifier } from '../identifier';
|
|
|
2
2
|
import { FulfillmentPlanItems } from './fulfillment-plan-items';
|
|
3
3
|
import { RawExternalSource } from './raw-external-source';
|
|
4
4
|
|
|
5
|
-
/** @description
|
|
5
|
+
/** @description This model contains information about the fulfillment plan. */
|
|
6
6
|
export class FulfillmentPlanDetails {
|
|
7
|
+
/** @description A list of identifiers for the sales order. */
|
|
7
8
|
external_sales_order_identifiers?: Identifier[];
|
|
9
|
+
/** @description Information about the fulfillment plan item. */
|
|
8
10
|
items?: FulfillmentPlanItems[];
|
|
11
|
+
/** @description This model represents a raw external source of information */
|
|
9
12
|
raw_external_source?: RawExternalSource;
|
|
10
13
|
}
|
|
@@ -2,12 +2,12 @@ import { Identifier } from '../identifier';
|
|
|
2
2
|
|
|
3
3
|
/** @description Information about the fulfillment plan for a set of items */
|
|
4
4
|
export class FulfillmentPlanItems {
|
|
5
|
-
/** @description
|
|
5
|
+
/** @description A list of identifiers for the sales order */
|
|
6
6
|
external_sales_order_identifiers?: Identifier[];
|
|
7
|
-
/** @description
|
|
7
|
+
/** @description A list of identifiers specific to the selling channel */
|
|
8
8
|
external_product_identifiers?: Identifier[];
|
|
9
|
-
/** @description
|
|
9
|
+
/** @description The name of the item */
|
|
10
10
|
name?: string;
|
|
11
|
-
/** @description
|
|
11
|
+
/** @description The number of items */
|
|
12
12
|
quantity?: number;
|
|
13
13
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
2
|
import { ResourceDownload, ResourceDownloadSchema } from '../resource-download';
|
|
3
3
|
|
|
4
|
+
/** @description This provides any additional forms that go with the label. For example, customs forms. Exactly one of the keys should be populated. Set href is the forms should be downloaded separately. Set data if the forms are returned directly in the response. */
|
|
4
5
|
export class FormDownload extends ResourceDownload {
|
|
6
|
+
/** @description The base64 encoded resource data. */
|
|
5
7
|
form_data?: string;
|
|
6
8
|
}
|
|
7
9
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
2
|
import { ResourceDownload, ResourceDownloadSchema } from '../resource-download';
|
|
3
3
|
|
|
4
|
+
/** @description This object provides the requested label that was just created. Exactly one of the keys should be populated. Set href if the label should be downloaded separately. Set data if the label is returned directly in the response. */
|
|
4
5
|
export class LabelDownload extends ResourceDownload {
|
|
6
|
+
/** @description The base64 encoded resource data. */
|
|
5
7
|
label_data?: string;
|
|
6
8
|
}
|
|
7
9
|
|
|
@@ -4,9 +4,11 @@ import Joi from 'joi';
|
|
|
4
4
|
|
|
5
5
|
/** @description Package information provided by the carrier */
|
|
6
6
|
export class LabelPackage {
|
|
7
|
+
/** @description Tracking number for the package */
|
|
7
8
|
tracking_number?: string;
|
|
8
9
|
/** @description Non-tracking alternative ids associated with this package */
|
|
9
10
|
alternative_identifiers?: Identifier[];
|
|
11
|
+
/** @description Documents associated with this package, if documents are not specified at a package level, use the Documents array at the CreateLabelResponse level. */
|
|
10
12
|
documents?: Document[];
|
|
11
13
|
}
|
|
12
14
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @description Basic structure for a return label */
|
|
2
2
|
export class ReturnLabelDetails {
|
|
3
|
+
/** @description A return merchandise authorization (RMA) is an associated number assigned to process the return, this number is often printed on the label, and used when the original shipper processes the inbound return. */
|
|
3
4
|
rma_number?: string;
|
|
4
5
|
}
|
|
@@ -3,6 +3,8 @@ import { ShipFrom } from '../addresses';
|
|
|
3
3
|
|
|
4
4
|
/** @description Basic structure for a request to void a label */
|
|
5
5
|
export class VoidRequest extends ShippedShipment {
|
|
6
|
+
/** @description Uniquely identifies this request to void a label. Must be returned in a void response. */
|
|
6
7
|
void_request_id!: string;
|
|
8
|
+
/** @description The location the shipment was shipped from */
|
|
7
9
|
ship_from!: ShipFrom;
|
|
8
10
|
}
|
|
@@ -8,7 +8,7 @@ export class VoidResponse {
|
|
|
8
8
|
message?: string;
|
|
9
9
|
/** @description Any errors from attempting to void */
|
|
10
10
|
errors?: string[];
|
|
11
|
-
/** @description Individual Billing Line items which remain after voiding the label, e.g. a cancellation fee
|
|
11
|
+
/** @description Individual Billing Line items which remain after voiding the label, e.g. a cancellation fee */
|
|
12
12
|
billing_line_items?: BillingLineItem[];
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** @description Basic structure of a manifest label */
|
|
2
2
|
export class Label {
|
|
3
|
+
/** @description The carrier tracking number for this shipment */
|
|
3
4
|
tracking_number?: string;
|
|
5
|
+
/** @description The carrier specific identifier for this shipment */
|
|
4
6
|
carrier_transaction_id?: string;
|
|
5
7
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
2
|
import { ResourceDownload, ResourceDownloadSchema } from '../resource-download';
|
|
3
3
|
|
|
4
|
-
/** @description
|
|
4
|
+
/** @description This model represents a single manifest created with a shipping provider. */
|
|
5
5
|
export class Manifest {
|
|
6
|
+
/** @description The unique identifier for this manifest. */
|
|
6
7
|
manifest_id?: string;
|
|
8
|
+
/** @description The resource and where it can be downloaded */
|
|
7
9
|
document_download?: ResourceDownload;
|
|
10
|
+
/** @deprecated This property is no longer used please use the document_download */
|
|
8
11
|
document_href?: string;
|
|
12
|
+
/** @deprecated This property is no longer used please use the document_download */
|
|
9
13
|
document_data?: string;
|
|
10
14
|
}
|
|
11
15
|
|
package/src/models/package.ts
CHANGED
|
@@ -7,10 +7,16 @@ import { Customs } from './customs';
|
|
|
7
7
|
|
|
8
8
|
/** @description Basic structure for a package */
|
|
9
9
|
export class Package {
|
|
10
|
+
/** @description Package code defined for the carrier in ShipEngine. */
|
|
10
11
|
package_code?: string;
|
|
12
|
+
/** @description Details about the dimensions of the package */
|
|
11
13
|
dimension_details?: DimensionDetails;
|
|
14
|
+
/** @description Details about the weight of the package */
|
|
12
15
|
weight_details?: WeightDetails;
|
|
16
|
+
/** @description The insured value of this package. */
|
|
13
17
|
insured_value!: Currency;
|
|
18
|
+
/** @description The message the seller requested to have on their label */
|
|
14
19
|
label_messages?: LabelMessage;
|
|
20
|
+
/** @description Basic structure for a customs declaration (Only available on international shipments) */
|
|
15
21
|
customs?: Customs;
|
|
16
22
|
}
|
|
@@ -2,6 +2,7 @@ import { CancellationReason } from './cancellation-reason';
|
|
|
2
2
|
|
|
3
3
|
/** @description Basic structure for a cancellation */
|
|
4
4
|
export class CancellationDetails {
|
|
5
|
+
/** @description The reason the pickup has been cancelled */
|
|
5
6
|
reason!: CancellationReason;
|
|
6
7
|
/** @description Additional properties about cancellation */
|
|
7
8
|
cancellation_options?: { [key: string]: string };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
2
|
import { Identifier, IdentifierSchema } from '../identifier';
|
|
3
|
-
import {
|
|
4
|
-
ShipmentIdentifier,
|
|
5
|
-
ShipmentIdentifierSchema,
|
|
6
|
-
} from './shipment-identifier';
|
|
3
|
+
import { ShipmentIdentifier, ShipmentIdentifierSchema } from './shipment-identifier';
|
|
7
4
|
|
|
8
5
|
/** @description Basic structure for a pickup confirmation */
|
|
9
6
|
export class PickupConfirmation {
|
|
7
|
+
/** @description The primary confirmation ID for this request. */
|
|
10
8
|
confirmation_id?: string;
|
|
9
|
+
/** @description Other identifiers potentially needed in other calls. */
|
|
11
10
|
alternate_identifiers?: Identifier[];
|
|
11
|
+
/** @description List of the shipments added for this pickup. */
|
|
12
12
|
shipment_identifiers?: ShipmentIdentifier[];
|
|
13
13
|
}
|
|
14
14
|
export const PickupConfirmationSchema = Joi.object({
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
/** @description Contact
|
|
1
|
+
/** @description Contact information for the person who will be present for the pickup. */
|
|
2
2
|
export class PickupContactDetails {
|
|
3
|
+
/** @description The first name of the person who will be there for the pickup. */
|
|
3
4
|
first_name!: string;
|
|
5
|
+
/** @description The last name of the person who will be there for the pickup. */
|
|
4
6
|
last_name?: string;
|
|
7
|
+
/** @description The e-mail address of the person who will be there for the pickup. */
|
|
5
8
|
email!: string;
|
|
9
|
+
/** @description The phone number of the person who will be there for the pickup. */
|
|
6
10
|
phone_number!: string;
|
|
11
|
+
/** @description The phone extension of the person who will be there for the pickup. */
|
|
7
12
|
phone_number_extension?: string;
|
|
8
13
|
}
|
|
@@ -2,6 +2,7 @@ import { ShipFrom } from '../addresses/ship-from';
|
|
|
2
2
|
|
|
3
3
|
/** @description Location details for pickup */
|
|
4
4
|
export class PickupLocationDetails {
|
|
5
|
+
/** @description The address the pickup will take place */
|
|
5
6
|
pickup_address?: ShipFrom;
|
|
6
7
|
/** @description Any notes that may be helpful for a driver to find the pickup location */
|
|
7
8
|
location_notes?: string;
|
|
@@ -5,11 +5,18 @@ import { Dimensions } from '../units/dimensions';
|
|
|
5
5
|
|
|
6
6
|
/** @description Basic structure for a package to be picked up */
|
|
7
7
|
export class PickupPackage {
|
|
8
|
+
/** @description The carrier tracking number for this shipment */
|
|
8
9
|
tracking_number?: string;
|
|
10
|
+
/** @description Alternative identifiers associated with this package */
|
|
9
11
|
alternative_identifiers?: Identifier[];
|
|
12
|
+
/** @description Details about the dimensions of the package */
|
|
10
13
|
dimension_details?: DimensionDetails;
|
|
14
|
+
/** @description Details about the weight of the package */
|
|
11
15
|
weight_details?: WeightDetails;
|
|
16
|
+
/** @description The code associated with the package type */
|
|
12
17
|
package_code?: string;
|
|
18
|
+
/** @deprectated Please use the weight_details property */
|
|
13
19
|
weight?: number;
|
|
20
|
+
/** @deprectated Please use the dimension_details property */
|
|
14
21
|
dimensions?: Dimensions;
|
|
15
22
|
}
|
|
@@ -2,6 +2,7 @@ import { ShippedShipment } from './shipped-shipment';
|
|
|
2
2
|
|
|
3
3
|
/** @description Details for a pickup shipment */
|
|
4
4
|
export class PickupShipmentDetails {
|
|
5
|
+
/** @description Service category for the carrier (ground, express, next_day) */
|
|
5
6
|
pickup_service_code?: string;
|
|
6
7
|
/** @description List of shipments to be picked up */
|
|
7
8
|
shipments?: ShippedShipment[];
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
2
|
|
|
3
|
-
/** @description
|
|
3
|
+
/** @description This model represents a window of time a pickup could be made. */
|
|
4
4
|
export class PickupWindow {
|
|
5
|
+
/** @description The local time zone represented in IANA. See https://www.iana.org/time-zones */
|
|
5
6
|
time_zone_iana!: string;
|
|
7
|
+
/** @description The local date the pickup will occur. Formatted per https://tools.ietf.org/html/rfc3339 */
|
|
6
8
|
pickup_date!: string;
|
|
9
|
+
/** @description The time relative to the time_zone_iana that the carrier says that the pickup could occur. Formatted per https://tools.ietf.org/html/rfc3339 */
|
|
7
10
|
start_time?: string;
|
|
11
|
+
/** @description The end of the window when the pickup could be made relative to the time_zone_iana. Formatted per https://tools.ietf.org/html/rfc3339 */
|
|
8
12
|
end_time?: string;
|
|
9
13
|
}
|
|
10
14
|
export const PickupWindowSchema = Joi.object({
|
|
@@ -3,7 +3,9 @@ import { Identifier, IdentifierSchema } from '../identifier';
|
|
|
3
3
|
|
|
4
4
|
/** @description Identifier object for shiments */
|
|
5
5
|
export class ShipmentIdentifier {
|
|
6
|
+
/** @description The carrier tracking number for this shipment */
|
|
6
7
|
tracking_number?: string;
|
|
8
|
+
/** @description A list of alternate identifiers that can be used to identify a shipment */
|
|
7
9
|
alternate_identifiers?: Identifier[];
|
|
8
10
|
}
|
|
9
11
|
|
|
@@ -5,11 +5,18 @@ import { Dimensions } from '../units/dimensions';
|
|
|
5
5
|
|
|
6
6
|
/** @description Basic structure for a package that has been shipped */
|
|
7
7
|
export class ShippedPackage {
|
|
8
|
+
/** @description The carrier tracking number associated with this package */
|
|
8
9
|
tracking_number?: string;
|
|
10
|
+
/** @description Alternative identifiers associated with this package */
|
|
9
11
|
alternative_identifiers?: Identifier[];
|
|
12
|
+
/** @description Details about the dimensions of the package */
|
|
10
13
|
dimension_details?: DimensionDetails;
|
|
14
|
+
/** @description Details about the weight of the package */
|
|
11
15
|
weight_details?: WeightDetails;
|
|
16
|
+
/** @description The code associated with the package type */
|
|
12
17
|
package_code?: string;
|
|
18
|
+
/** @deprectated Please use the weight_details property */
|
|
13
19
|
weight?: number;
|
|
20
|
+
/** @deprectated Please use the dimension_details property */
|
|
14
21
|
dimensions?: Dimensions;
|
|
15
22
|
}
|
|
@@ -6,11 +6,17 @@ import { ShippedPackage } from './shipped-package';
|
|
|
6
6
|
|
|
7
7
|
/** @description Basic structure for a shipment that has been shipped */
|
|
8
8
|
export class ShippedShipment extends Label {
|
|
9
|
+
/** @description The carrier tracking number associated with this package */
|
|
9
10
|
tracking_number?: string;
|
|
11
|
+
/** @description The address that a shipment will be delivered to */
|
|
10
12
|
ship_to?: ShipTo;
|
|
13
|
+
/** @description Non-tracking alternative ids associated with this shipment */
|
|
11
14
|
alternative_identifiers?: Identifier[];
|
|
15
|
+
/** @description The service code used for this shipment */
|
|
12
16
|
service_code?: string;
|
|
17
|
+
/** @description The list of packages associated with this shipment */
|
|
13
18
|
packages?: ShippedPackage[];
|
|
19
|
+
/** @description Advanced shipping options (Contains Alcohol, Non Machinable, etc) */
|
|
14
20
|
advanced_options?: AdvancedOptions;
|
|
15
21
|
}
|
|
16
22
|
|
package/src/models/rates/rate.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
-
import {
|
|
3
|
-
BillingLineItem,
|
|
4
|
-
BillingLineItemSchema,
|
|
5
|
-
} from '../billing/billing-line-item';
|
|
2
|
+
import { BillingLineItem, BillingLineItemSchema } from '../billing/billing-line-item';
|
|
6
3
|
import { TimeWindow, TimeWindowSchema } from '../time-window';
|
|
7
4
|
|
|
8
5
|
/** @description Basic structure for a rate */
|
|
9
6
|
export class Rate {
|
|
7
|
+
/** @description The service code uniquely identifies a shipping service that you offer. Which service codes can be passed to you will be configured in ShipEngine. If this field is missing, the rate will be discarded. */
|
|
10
8
|
service_code?: string;
|
|
11
9
|
/** @description ISO 8601 formatted date for shipment */
|
|
12
10
|
ship_datetime?: string;
|
|
@@ -26,10 +24,7 @@ export class Rate {
|
|
|
26
24
|
delivery_window?: TimeWindow;
|
|
27
25
|
/** @description Unique identifier for the carrier rate */
|
|
28
26
|
carrier_rate_id?: string;
|
|
29
|
-
/** @description DateTime after which the rate will no longer be accepted.
|
|
30
|
-
* ISO 8601 format, with local offset.
|
|
31
|
-
* Example: 2021-08-20T14:38:36.859237-05:00
|
|
32
|
-
*/
|
|
27
|
+
/** @description DateTime after which the rate will no longer be accepted. ISO 8601 format, with local offset. Example: 2021-08-20T14:38:36.859237-05:00 */
|
|
33
28
|
expiration_datetime?: string;
|
|
34
29
|
}
|
|
35
30
|
|
|
@@ -2,7 +2,9 @@ import Joi from 'joi';
|
|
|
2
2
|
|
|
3
3
|
/** @description Basic structure for credentials */
|
|
4
4
|
export class Credentials {
|
|
5
|
+
/** @description The username, used as the unique identifier for the account */
|
|
5
6
|
username!: string;
|
|
7
|
+
/** @description The password that will be sent in future requests */
|
|
6
8
|
password!: string;
|
|
7
9
|
}
|
|
8
10
|
|
|
@@ -2,7 +2,9 @@ import Joi from 'joi';
|
|
|
2
2
|
|
|
3
3
|
/** @description Basic structure for a resource to download */
|
|
4
4
|
export class ResourceDownload {
|
|
5
|
+
/** @deprecated This property is not used by the platform */
|
|
5
6
|
href?: string;
|
|
7
|
+
/** @description Base64 encoded data for the resource */
|
|
6
8
|
data?: string;
|
|
7
9
|
}
|
|
8
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TaxIdentifierType } from './tax-identifier-type';
|
|
2
2
|
|
|
3
|
-
/** @description Entity representing a Tax Identification number, type, and country of registration
|
|
3
|
+
/** @description Entity representing a Tax Identification number, type, and country of registration */
|
|
4
4
|
export class TaxIdentifier {
|
|
5
5
|
/** @description Identification number */
|
|
6
6
|
id!: string;
|
|
@@ -2,9 +2,9 @@ import Joi from 'joi';
|
|
|
2
2
|
|
|
3
3
|
/** @description Latitude and longitude */
|
|
4
4
|
export class LatLong {
|
|
5
|
-
/** @description latitude */
|
|
5
|
+
/** @description The latitude of the point. Represented as signed degrees. http://www.geomidpoint.com/latlon.html */
|
|
6
6
|
lat!: number;
|
|
7
|
-
/** @description longitude */
|
|
7
|
+
/** @description The longitude of the point. Represented as signed degrees http://www.geomidpoint.com/latlon.html */
|
|
8
8
|
long!: number;
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -2,7 +2,9 @@ import Joi from 'joi';
|
|
|
2
2
|
|
|
3
3
|
/** @description Basic structure for a tracking service */
|
|
4
4
|
export class Service {
|
|
5
|
+
/** @description The code specific to a shipping provider service. */
|
|
5
6
|
code?: string;
|
|
7
|
+
/** @description The name of this shipping provider service. */
|
|
6
8
|
name?: string;
|
|
7
9
|
}
|
|
8
10
|
export const ServiceSchema = Joi.object({
|
|
@@ -5,20 +5,29 @@ import { StandardizedStatusCodes } from './standardized-status-codes';
|
|
|
5
5
|
|
|
6
6
|
/** @description Basic structure for tracking events */
|
|
7
7
|
export class TrackEvent {
|
|
8
|
+
/** @description When this tracking event occurred. Formatted per https://tools.ietf.org/html/rfc3339. Must be in UTC. */
|
|
8
9
|
event_datetime?: string;
|
|
10
|
+
/** @description Most providers do not provide tracking events in UTC, and without time zone or geo information its hard to deduce. */
|
|
9
11
|
event_datetime_local?: string;
|
|
12
|
+
/** @description Carrier's specific event code */
|
|
10
13
|
event_code?: string;
|
|
14
|
+
/** @description Description of the package status at this event */
|
|
11
15
|
description?: string;
|
|
16
|
+
/** @description City or Locality for this event */
|
|
12
17
|
city?: string;
|
|
13
18
|
/** @description State or province */
|
|
14
19
|
state?: string;
|
|
15
20
|
/** @description Zip or postal code */
|
|
16
21
|
postal_code?: string;
|
|
22
|
+
/** @description Country for this event */
|
|
17
23
|
country?: string;
|
|
24
|
+
/** @description The name of the company this is being delivered to */
|
|
18
25
|
company?: string;
|
|
26
|
+
/** @description If the event had a signer associated, normally on delivery */
|
|
19
27
|
signer?: string;
|
|
20
28
|
/** @description Geographical location */
|
|
21
29
|
geo?: LatLong;
|
|
30
|
+
/** @description This represents the ShipEngine supported status codes for a shipment. UN - Unknown AC - Accepted IT - In Transit DE - Delivered EX - Exception AT - Delivery Attempted NY - Not Yet In System */
|
|
22
31
|
status_code?: StandardizedStatusCodes;
|
|
23
32
|
}
|
|
24
33
|
export const TrackEventSchema = Joi.object({
|
|
@@ -9,23 +9,41 @@ import Joi from 'joi';
|
|
|
9
9
|
|
|
10
10
|
/** @description Basic structure for tracking information */
|
|
11
11
|
export class TrackingInfo {
|
|
12
|
+
/** @description The human readable name of the carrier tracking this shipment. */
|
|
12
13
|
carrier_name?: string;
|
|
14
|
+
/** @description The carrier specific tracking identifier for this shipment. */
|
|
13
15
|
tracking_number?: string;
|
|
16
|
+
/** @description This represents the ShipEngine supported status codes for a shipment. UN - Unknown AC - Accepted IT - In Transit DE - Delivered EX - Exception AT - Delivery Attempted NY - Not Yet In System */
|
|
14
17
|
standardized_status_code!: StandardizedStatusCodes;
|
|
18
|
+
/** @description The carrier specific status code of this shipment's tracking status. */
|
|
15
19
|
carrier_status_code?: string;
|
|
20
|
+
/** @description The human readable description of this shipment's tracking status. */
|
|
16
21
|
carrier_status_description?: string;
|
|
22
|
+
/** @description When the package(s) in this shipment were turned over to the carrier. Formatted per https://tools.ietf.org/html/rfc3339. Must be in UTC. */
|
|
17
23
|
shipped_datetime?: string;
|
|
24
|
+
/** @description When the package(s) in this shipment are expected to arrive at their destination. Formatted per https://tools.ietf.org/html/rfc3339. Must be in UTC. */
|
|
18
25
|
estimated_delivery_datetime?: string;
|
|
26
|
+
/** @description When the package(s) in this shipment arrived at their destination. Formatted per https://tools.ietf.org/html/rfc3339. Must be in UTC. */
|
|
19
27
|
actual_delivery_datetime?: string;
|
|
28
|
+
/** @description A human readable description of why the shipment is in an error state. */
|
|
20
29
|
shipping_problem_description?: string;
|
|
30
|
+
/** @description The weight measured by the carrier of the package(s) in this shipment. */
|
|
21
31
|
weight?: number;
|
|
32
|
+
/** @description The dimensions measured by the carrier of the package(s) in this shipment. */
|
|
22
33
|
dimensions?: Dimensions;
|
|
34
|
+
/** @description A shipping provider specific service. */
|
|
23
35
|
service?: Service;
|
|
36
|
+
/** @description The carrier packaging code. */
|
|
24
37
|
packaging?: string;
|
|
38
|
+
/** @description The carrier observed count of packages in this shipment. */
|
|
25
39
|
package_count?: number;
|
|
40
|
+
/** @description A list of tracking events for this shipment */
|
|
26
41
|
events?: TrackEvent[];
|
|
42
|
+
/** @description Whether or not this shipment has entered an error state. */
|
|
27
43
|
shipping_problem?: boolean;
|
|
44
|
+
/** @description The unique identifying code for the type of error encountered by this shipment. */
|
|
28
45
|
shipping_problem_code?: string;
|
|
46
|
+
/** @description The human readable explanation of the error encountered by this shipment. */
|
|
29
47
|
error_description?: string;
|
|
30
48
|
}
|
|
31
49
|
|
|
@@ -3,8 +3,12 @@ import { DimensionUnit } from './dimension-unit';
|
|
|
3
3
|
|
|
4
4
|
/** @description Basic structure for package dimensions */
|
|
5
5
|
export class DimensionDetails {
|
|
6
|
+
/** @description This contains information about the dimensions in centimeters. This will always be present on the request */
|
|
6
7
|
dimensions_in_centimeters?: Dimensions;
|
|
8
|
+
/** @description This contains information about the dimensions in inches. This will always be present on the request */
|
|
7
9
|
dimensions_in_inches?: Dimensions;
|
|
10
|
+
/** @description This contains information about the dimensions in the source units. This will always be present on the request */
|
|
8
11
|
source_dimensions?: Dimensions;
|
|
12
|
+
/** @description The source units the customer provided */
|
|
9
13
|
source_dimension_unit!: DimensionUnit;
|
|
10
14
|
}
|
|
@@ -2,8 +2,12 @@ import { WeightUnit } from './weight-unit';
|
|
|
2
2
|
|
|
3
3
|
/** @description Basic structure for weight */
|
|
4
4
|
export class WeightDetails {
|
|
5
|
+
/** @description This contains information about the weight in ounces. This will always be present on the request */
|
|
5
6
|
weight_in_ounces?: number;
|
|
7
|
+
/** @description This contains information about the weight in grams. This will always be present on the request */
|
|
6
8
|
weight_in_grams?: number;
|
|
9
|
+
/** @description This contains information about the weight in source unit. This will always be present on the request */
|
|
7
10
|
source_weight?: number;
|
|
11
|
+
/** @description The source units the customer provided */
|
|
8
12
|
source_weight_unit!: WeightUnit;
|
|
9
13
|
}
|