ShipEngine React Api

The shipengine/react-api library provides React bindings for the shipengine/js-api client, with the addition of data sharing and cache management via React Query (hereon "RQ").

The client interface is exposed via hooks[^1] sharing a single RQ client instance; this allows multiple components to access data from the same ShipEngine API endpoint with a single network request.

For instance, if ComponentAComponentB and ComponentC separately invoke the useListShipments hook on a single render, the API requests will be deduped to a single GET /v1/shipments, with all three components sharing the data / loading / error / etc states from the RQ cache. Revalidating the request in one component similarly updates the others.

Basic usage

import { ShipEngine, useListShipments } from "@shipengine/react-api";

const MyComponent = () => {
const { data, isLoading, error } = useListShipments();

if (isLoading) return <div>Loading...</div>;
if (error) return <div>{error.message}</div>;

console.log(data);
// > an object matching the response schema of https://shipengine.github.io/shipengine-openapi/#operation/list_shipments

return <div>Retrieved {data.shipments.length} shipments</div>;
};

const MyApp = () => {
return (
<ShipEngine getToken={() => "your-platform-token"}>
<MyComponent />
<MyComponent />
<MyComponent />
{/* All three components will share the same data and only 1 request will be made */}
</ShipEngine>
);
};

Index

Namespaces

Enumerations - Entities

Enumerations - Other

Classes

Interfaces - Entities

Interfaces - Other

Type Aliases - Entities

Type Aliases - Entities Generic object type to be used in any useMutation hook

Type Aliases - Entities Generic object type to be used in any useQuery hook

Type Aliases - Other

AbbreviatedCreditCardInfo AccountImage AccountImageResponse AccountImagesResponse AddFundsResponse AddressResidentialIndicator AddressValidationOptions ApiError BatchableQuery BillToParties CalculateRatesData CarrierProviderService CarrierRegistrationInsuranceProvider CarrierServicesListResponse CarrierZone ConnectCarrierAccount ConnectCarrierAccountData ConnectCarrierAccountResponse ConnectionsCarrierName ConnectionsCarrierSettingsData ConnectionsCarrierSettingsResponse CreateFundingSource CreateLabelData CreateSalesOrderShipmentData CreateSellerApiKeyParams CreateShipmentData CreateShipmentResult CreateWarehouseData CreationRangeQuery Customs CustomsContents CustomsNonDeliveryOptions CustomsTermsOfTradeCode DHLExpressSettings DangerousGoodsPackagingGroup DangerousGoodsPackagingInstructionSection DangerousGoodsRegulationLevel DangerousGoodsTransportMean DayOfOperation DeleteSellerApiKeyParams DeleteWarehouseData FedexSettings FundingSource FundingSourceCarrier FundingSourceInsuranceProvider FundingSourceTransaction FundingSourceTransactionsResponse GenericObject GetCarrierConnectionFormParams GetConnectionsCarrierSettingsParams 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 NotifySalesOrderShippedData OperatingHours OriginTypes PageableQuery PageableResult PaperlessDownload ParseAddressData PartnerTheme PartnerThemeCarrierHomeCountry PartnerThemeCarriers PartnerThemeLogo PartnerThemeOnboarding PaymentTypes Provider RateDetail RateDetailAttributes RateDetailBillingSource RateDetailType RateType RateValidationStatus RatesEstimateData RatesEstimateResponse SandboxMethodParams SandboxableMutation SandboxableQuery SellerApiKey ServicePoint ServicePointAddress ServicePointCustomError ServicePointFeature ServicePointProvider ServicePointsListResponse ServicesListSupportedCountries ShipEngineAPIHeaders ShipEngineProps ShipmentPackage ShipmentRateResponse ShipmentStatus ShippingRule SortableQuery TaggableQuery TaxType TaxableEntityType TaxableIdentifierType TransactionCategory TransactionHistoryCsvLink UPSSettings UPSUpdateSettings UpdateAccountImage UpdateConnectionsCarrierParams UpdateFundingSourceData UpdateSalesOrderShipmentData UpdateWarehouseData UploadRateCardData VoidRequest WalletTransaction WalletTransactionHistory WalletTransactionType WindsorFrameworkDetails

Type Aliases - Responses

Variables

Functions - Other

Functions - ShipEngine API Hooks

useAddFunds useAddInsuranceFunds useCalculateRates useCancelShipment useCarrierConnectionsServicesList useConnectCarrier useConnectCarrierAccount useCreateAccountImage useCreateFundingSource useCreateLabel useCreateRateCard useCreateSalesOrderShipment useCreateShipment useCreateShippingRule useCreateWarehouse useCreateWebhook useDeactivateOrderSource useDeleteAccountImage useDeleteCarrier useDeleteRateCard useDeleteShippingRule useDeleteWarehouse useDeleteWebhook useDownloadRateCard useEditShippingRule useFundingSourcesAddFunds useGetAccountImages useGetAccountSettings useGetAutoFundingConfiguration useGetCarrierById useGetCarrierConnectionForm useGetConnectionsCarrierSettings useGetCountriesByCarrier useGetCurrenciesByCarrier useGetFundingSourceById useGetFundingSourceMetadata useGetFundingSourceTransactions useGetInsuranceAccount useGetInsuranceFundingSourceAcceptedTerms useGetLabel useGetPackageRatingGroupByCarrier useGetRateCardById useGetSalesOrder useGetSalesOrderShipment useGetServicePoint useGetServicesByCarrier useGetShipment useGetShipmentByExternalId useGetShipmentRates useGetShippingRuleById useGetShippingRuleConditionsOptions useGetThemeById useGetZonesByCarrier useListCarrierConnections useListCarriers useListCustomPackageTypes useListFundingSources useListLabels useListOrderSources useListRateCards useListSalesOrderShipments useListSalesOrders useListServicePoints useListShipments useListShippingRules useListWarehouses useListWebhooks useNotifySalesOrderShipped useParseAddress usePublishRateCard useRatesEstimate useRefreshOrderSource useRefreshOrderSourceAsync useRegisterCarrier useUpdateAccountBillingPlan useUpdateAccountImage useUpdateAccountSettings useUpdateAutoFunding useUpdateConnectionsCarrierSettings useUpdateFundingSource useUpdateRateCard useUpdateSalesOrderShipment useUpdateWarehouse useUpdateWebhook useUploadRateCard useValidateAddresses useVoidLabel

Functions - ShipEngine API Hooks No documentation available for this endpoint

Functions - ShipEngine API Hooks Returns an OAuth access token that can be used to authenticate with the HERE Maps API

Functions - Utilities

Generated using TypeDoc