ShipEngine JS Api

The shipengine/js-api library instantiates a batteries-included, vanilla JavaScript client for interacting with the ShipEngine API. The client provides a set of fully-typed methods that map directly to ShipEngine API operations[^1], bound to a user specified via platform token.

Features:

  • Converts all outbound JSON keys to snake_case for consumption by the ShipEngine API.
  • Converts all inbound JSON keys to camelCase for use in JS.
  • Attempts to refresh expired tokens on 401 Unauthorized responses, followed by retrying the original request.
  • Logs all requests and responses to the console.

In addition to the client, the shipengine/js-api lib provides TypeScript types for all ShipEngine API entities.

Basic Usage

import { ShipEngineAPI } from "@shipengine/js-api";

const client = new ShipEngineAPI("your-platform-token", {
// Used when attempting to refresh the token on 401 responses
getToken: async () => {
return "your-platform-token";
},
});

client.shipments.list().then((response) => {
console.log(response.data);
// > an object matching the response schema of https://shipengine.github.io/shipengine-openapi/#operation/list_shipments
});

Index

Namespaces

Enumerations - Entities

Enumerations - Other

Classes

Interfaces - Entities

Interfaces - Other

Type Aliases - Entities

Type Aliases - Other

AbbreviatedCreditCardInfo AccountImage AccountImageResponse AccountImagesResponse AddFundsResponse AddressResidentialIndicator AddressValidationOptions ApiError BatchableQuery BillToParties CarrierProviderService CarrierRegistrationInsuranceProvider CarrierServicesListResponse CarrierZone ConnectCarrierAccount ConnectCarrierAccountResponse ConnectionsCarrierName ConnectionsCarrierSettingsData ConnectionsCarrierSettingsResponse CreateFundingSource CreateSellerApiKeyParams CreateShipmentResult CreationRangeQuery Customs CustomsContents CustomsNonDeliveryOptions CustomsTermsOfTradeCode DHLExpressSettings DangerousGoodsPackagingGroup DangerousGoodsPackagingInstructionSection DangerousGoodsRegulationLevel DangerousGoodsTransportMean DayOfOperation DeleteSellerApiKeyParams FedexSettings FundingSource FundingSourceCarrier FundingSourceInsuranceProvider FundingSourceTransaction FundingSourceTransactionsResponse GenericObject GetCarrierConnectionFormParams GetServicePointParams GetShipmentRatesOptions HereTokenResponse ISOString InsuranceFundingSourceAcceptedTermsResponse InsuranceProvider Label LabelChargeEvent LabelDisplayScheme LabelFormat LabelLayout LabelStatus LabelTrackingStatus ListCarrierConnectionsParams ListCarrierConnectionsResponse ListLabelsParams ListLabelsResult ListSalesOrderShipmentBody ListSalesOrderShipmentsParams ListSalesOrderShipmentsResult ListSandboxSellersParams ListSellerApiKeysParams ListServicePointsOptionAddress ListServicePointsOptionAddressQuery ListServicePointsOptionCoordinates ListServicePointsOptions ListShipmentOptions ListShipmentResult ListWebhookOptions LocaleBasedQuery MetadataCarrierProfile MetadataRegistrationRequirement ModificationRangeQuery OperatingHours OriginTypes PageableQuery PageableResult PaperlessDownload PartnerTheme PartnerThemeCarrierHomeCountry PartnerThemeCarriers PartnerThemeLogo PartnerThemeOnboarding PaymentTypes Provider RateDetail RateDetailAttributes RateDetailBillingSource RateDetailType RateType RateValidationStatus RatesEstimateResponse SandboxMethodParams SandboxableMutation SandboxableQuery SellerApiKey ServicePoint ServicePointAddress ServicePointCustomError ServicePointFeature ServicePointProvider ServicePointsListResponse ServicesListSupportedCountries ShipEngineAPIHeaders ShipmentPackage ShipmentRateResponse ShipmentStatus ShippingRule SortableQuery TaggableQuery TaxType TaxableEntityType TaxableIdentifierType TransactionCategory TransactionHistoryCsvLink UPSSettings UPSUpdateSettings UpdateAccountImage VoidRequest WalletTransaction WalletTransactionHistory WalletTransactionType WindsorFrameworkDetails

Type Aliases - Responses

Functions

Generated using TypeDoc