@lecxa/shipstation-sdk
v1.0.4
Published
TypeScript SDK for ShipStation API v2 - Type-safe REST client with full API coverage
Maintainers
Readme
@lecxa/shipstation-sdk
TypeScript SDK for ShipStation API v2.
Installation
npm install @lecxa/shipstation-sdkUsage
import { ShipStationClient } from '@lecxa/shipstation-sdk';
const client = new ShipStationClient({
token: 'your-api-token',
});
// List shipments
const shipments = await client.shipments.list({ page: 1 });
// Create a label
const label = await client.labels.create({
shipment: {
ship_to: {
name: 'John Doe',
address_line1: '123 Main St',
city: 'Austin',
state_province: 'TX',
postal_code: '78701',
country_code: 'US',
},
ship_from: {
name: 'Your Store',
address_line1: '456 Warehouse Ave',
city: 'Austin',
state_province: 'TX',
postal_code: '78702',
country_code: 'US',
},
packages: [{
weight: { value: 1.5, unit: 'pound' },
}],
},
carrier_code: 'stamps_com',
service_code: 'usps_priority_mail',
});
// Calculate rates
const rates = await client.rates.calculate({
shipment: { /* ... */ },
});API Methods
The client organizes methods by resource:
client.batches- Batch operationsclient.carriers- Carrier managementclient.labels- Label creation and managementclient.rates- Rate calculationclient.shipments- Shipment operationsclient.warehouses- Warehouse managementclient.webhooks- Webhook configuration
Additional resources available via direct module imports.
Direct Function Imports
You can also import generated functions directly:
import { listShipments, createLabel } from '@lecxa/shipstation-sdk';Types
All types are exported:
import type {
CreateLabelRequestBody,
ListShipmentsParams,
Shipment,
} from '@lecxa/shipstation-sdk';License
MIT
