diff --git a/CHANGELOG.md b/CHANGELOG.md index d333979a5..05eeb8581 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## v9.1.0 (2026-10-29) + +- Adds `manufacturer_product_id` and `standardized_product_id` to the `CustomsItem` model and create parameters, including customs items nested in `CustomsInfo` create parameters +- Adds `TaxIdentifier` model (with `address`) and `tax_identifiers` to the `Shipment` model +- Adds `address` to the shipment tax identifier create parameters + ## v9.0.0 (2026-10-27) See our [Upgrade Guide](UPGRADE_GUIDE.md#upgrading-from-8x-to-90) for more details. diff --git a/package-lock.json b/package-lock.json index 6bc2f6296..339461b15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@easypost/api", - "version": "9.0.0", + "version": "9.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@easypost/api", - "version": "9.0.0", + "version": "9.1.0", "license": "MIT", "dependencies": { "uuid": "^11.1.0" diff --git a/package.json b/package.json index 086b84894..4c2c5b8ef 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@easypost/api", "description": "EasyPost Node Client Library", - "version": "9.0.0", + "version": "9.1.0", "author": "Easypost Engineering ", "homepage": "https://easypost.com", "exports": { diff --git a/src/models/customs_info.ts b/src/models/customs_info.ts index 3ea4237bc..0065e8486 100644 --- a/src/models/customs_info.ts +++ b/src/models/customs_info.ts @@ -1,3 +1,4 @@ +import CustomsItem from './customs_item'; import EasyPostObject from './easypost_object'; /** @@ -9,7 +10,7 @@ export default class CustomsInfo extends EasyPostObject { declare content_explanation?: string | null; declare contents_type?: string | null; declare customs_certify?: boolean | null; - declare customs_items?: unknown[] | null; + declare customs_items?: CustomsItem[] | null; declare customs_signer?: string | null; declare declaration?: string | null; declare eel_pfc?: string | null; diff --git a/src/models/customs_item.ts b/src/models/customs_item.ts index e2aac7b6c..8480ecabd 100644 --- a/src/models/customs_item.ts +++ b/src/models/customs_item.ts @@ -10,8 +10,10 @@ export default class CustomsItem extends EasyPostObject { declare currency?: string | null; declare description?: string | null; declare hs_tariff_number?: string | null; + declare manufacturer_product_id?: string | null; declare origin_country?: string | null; declare quantity?: number | null; + declare standardized_product_id?: string | null; declare value?: number | null; declare weight?: number | null; } diff --git a/src/models/shipment.ts b/src/models/shipment.ts index a6678381d..35f98eb2e 100644 --- a/src/models/shipment.ts +++ b/src/models/shipment.ts @@ -8,6 +8,7 @@ import Parcel from './parcel'; import PostageLabel from './postage_label'; import Rate from './rate'; import ScanForm from './scan_form'; +import TaxIdentifier from './tax_identifier'; import Tracker from './tracker'; /** @@ -37,6 +38,7 @@ export default class Shipment extends EasyPostObject { declare scan_form?: ScanForm | null; declare selected_rate?: Rate | null; declare status?: string | null; + declare tax_identifiers?: TaxIdentifier[] | null; declare to_address?: Address | null; declare tracker?: Tracker | null; declare tracking_code?: string | null; diff --git a/src/models/tax_identifier.ts b/src/models/tax_identifier.ts new file mode 100644 index 000000000..6880dd9d1 --- /dev/null +++ b/src/models/tax_identifier.ts @@ -0,0 +1,13 @@ +import Address from './address'; + +/** + * A TaxIdentifier represents tax information used by carriers for a {@link Shipment}. + * @public + */ +export default class TaxIdentifier { + declare address?: Address | null; + declare entity?: string | null; + declare issuing_country?: string | null; + declare tax_id?: string | null; + declare tax_id_type?: string | null; +} diff --git a/src/services/customs_info_service.ts b/src/services/customs_info_service.ts index 694233dd2..0e4e5f4d0 100644 --- a/src/services/customs_info_service.ts +++ b/src/services/customs_info_service.ts @@ -1,8 +1,10 @@ import type EasyPostClient from '../easypost'; import CustomsInfo from '../models/customs_info'; +import CustomsItem from '../models/customs_item'; import baseService from './base_service'; +import type { CustomsItemCreateParameters } from './customs_item_service'; -export type CustomsItemInput = Record; +export type CustomsItemInput = CustomsItemCreateParameters | CustomsItem; export type CustomsInfoCreateParameters = Record & { eel_pfc?: string | null; diff --git a/src/services/customs_item_service.ts b/src/services/customs_item_service.ts index b0337e40a..ffb12688c 100644 --- a/src/services/customs_item_service.ts +++ b/src/services/customs_item_service.ts @@ -2,7 +2,7 @@ import baseService from './base_service'; import CustomsItem from '../models/customs_item'; import type EasyPostClient from '../easypost'; -type CustomsItemCreateParameters = Record & { +export type CustomsItemCreateParameters = Record & { description?: string | null; quantity?: number | null; value?: number | null; @@ -11,6 +11,8 @@ type CustomsItemCreateParameters = Record & { code?: string | null; origin_country?: string | null; currency?: string | null; + manufacturer_product_id?: string | null; + standardized_product_id?: string | null; }; export default (easypostClient: EasyPostClient) => diff --git a/src/services/shipment_service.ts b/src/services/shipment_service.ts index b34c92171..e6298cc75 100644 --- a/src/services/shipment_service.ts +++ b/src/services/shipment_service.ts @@ -14,6 +14,7 @@ type ShipmentTaxIdentifier = Record & { tax_id?: string | null; tax_id_type?: string | null; issuing_country?: string | null; + address?: AddressCreateParameters | Address | null; }; type ShipmentLineItem = Record & { @@ -48,7 +49,7 @@ export default (easypostClient: EasyPostClient) => */ class ShipmentService extends baseService(easypostClient) { /** - static async createAndBuyLuma(params: ShipmentCreateParameters): Promise { + * Create a {@link Shipment shipment}. * See {@link https://docs.easypost.com/docs/shipments#create-a-shipment EasyPost API Documentation} for more information. * @param {Object} params - The parameters to create a shipment with. * @returns {Shipment} - The created shipment.