Overview
Openfront provides a unified shipping adapter system that supports multiple carriers through providers like Shippo and ShipEngine, or manual rate configuration for custom needs.Shipping Adapter Interface
All shipping providers implement a standard interface:getRatesFunction- Get shipping rates for an ordercreateLabelFunction- Generate shipping labelsvalidateAddressFunction- Validate shipping addressestrackShipmentFunction- Track shipment statuscancelLabelFunction- Cancel/refund shipping labels
features/integrations/shipping-providers/index.ts:
features/integrations/shipping-providers/index.ts
Shippo Configuration
Setup
- Sign up for a Shippo account
- Get your API token from the dashboard
- Configure the provider in Openfront admin
Environment Variables
Store your Shippo API token securely:.env
Implementation Details
The Shippo adapter (features/integrations/shipping-providers/shippo.ts) provides full integration:
ShipEngine Configuration
Setup
- Sign up for a ShipEngine account
- Get your API key from the dashboard
- Connect your carrier accounts (USPS, UPS, FedEx, etc.)
Environment Variables
.env
Implementation Details
The ShipEngine adapter (features/integrations/shipping-providers/shipengine.ts) handles unit conversions and multi-carrier support:
Unit Conversion
ShipEngine requires specific unit formats. The adapter handles conversions:features/integrations/shipping-providers/shipengine.ts
Manual Shipping Provider
The manual provider simulates shipping rates without external API calls, useful for:- Local pickup
- Flat rate shipping
- Testing and development
- Custom rate calculations
features/integrations/shipping-providers/manual.ts
Building Custom Shipping Adapters
Create custom adapters for direct carrier integrations or specialized shipping logic:features/integrations/shipping-providers/custom.ts
features/integrations/shipping-providers/index.ts
Package Dimensions
All shipping providers require package dimensions:Using Shipping Providers
Shipping providers are configured in the KeystoneJS admin panel:Best Practices
Rate Accuracy
Rate Accuracy
- Always provide accurate package dimensions
- Include all packaging materials in weight
- Test with various package sizes
- Cache rates when possible to reduce API calls
Address Validation
Address Validation
- Validate addresses before calculating rates
- Handle address suggestions gracefully
- Provide clear error messages for invalid addresses
- Support international address formats
Label Management
Label Management
- Store label URLs securely
- Implement label reprinting functionality
- Track label usage and costs
- Handle label cancellation within carrier time limits
Error Handling
Error Handling
- Implement fallback providers
- Handle carrier API outages gracefully
- Log errors for debugging
- Provide user-friendly error messages
Related Resources
- Payment Providers - Configure payment integrations
- Webhooks - Track shipping events via webhooks
- API Reference - Full API documentation