{"templateId":"markdown","versions":[{"version":"shipengine","label":"ShipStation API (formerly ShipEngine)","link":"/apis/shipengine/docs/getting-started/sdks","default":false,"active":false,"folderId":"58c9a61d"},{"version":"shipstation-v2","label":"ShipStation V2 API","link":"/apis/docs/getting-started/sdks","default":true,"active":true,"folderId":"58c9a61d"},{"version":"shipstation-v1","label":"ShipStation V1 API","link":"/apis/shipstation-v1/docs/getting-started/sdks","default":false,"active":false,"folderId":"58c9a61d"}],"sharedDataIds":{"sidebar":"sidebar-apis/@shipengine/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"SDKs","keywords":"shipping, labels, shipstation, documentation, api","siteUrl":"https://docs.shipstation.com","lang":"en-US","llmstxt":{"hide":false,"title":"ShipStation API LLM Docs","description":"Find links and references to all markdown documentation for use with LLMs","excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"sdks","__idx":0},"children":["SDKs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ShipStation provides official SDKs for the ShipStation API V2. Each SDK's client is generated from the same ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/openapi"},"children":["OpenAPI specification"]}," that powers this documentation, and it is regenerated automatically whenever the API changes. As a result, the SDK's methods and types stay in sync with the API reference."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success","name":"TIP"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Get your API key before you start:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ShipStation API customers"]}," (formerly ShipEngine): find yours in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://api-portal.shipstation.com/"},"children":["ShipStation API dashboard"]},"."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"available-sdks","__idx":1},"children":["Available SDKs"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Language"},"children":["Language"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Package"},"children":["Package"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Repository"},"children":["Repository"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["TypeScript / JavaScript"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@shipstation/shipstation-js-sdk"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/shipstation/shipstation-js-sdk"},"children":["shipstation/shipstation-js-sdk"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"typescript--javascript","__idx":2},"children":["TypeScript / JavaScript"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"installation","__idx":3},"children":["Installation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install @shipstation/shipstation-js-sdk\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Requires Node.js ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[">=22"]},". The package ships as both ESM and CommonJS."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"quickstart","__idx":4},"children":["Quickstart"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"import { ShipStationAPI } from '@shipstation/shipstation-js-sdk';\n\nconst api = new ShipStationAPI('your-api-key');\n\nconst shipments = await api.shipments.listShipments();\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every resource in the API is exposed as a property on the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ShipStationAPI"]}," instance (for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.shipments"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.labels"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.rates"]},"), matching the tags in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/openapi"},"children":["API reference"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configuration","__idx":5},"children":["Configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can pass a configuration object instead of an API key:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"const api = new ShipStationAPI({\n  apiKey: 'your-api-key',\n  baseUrl: 'https://api.shipstation.com', // default\n  timeout: 60000, // per-attempt request timeout, in ms\n  fetch: customFetch, // override the fetch implementation (testing, proxies, HTTP/2, ...)\n  middleware: [myMiddleware], // extra middleware appended after the SDK's own\n});\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"plain-and-raw-methods","__idx":6},"children":["Plain and raw methods"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every operation is available in two forms, for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["listCarriers"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["listCarriersRaw"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"// Plain: returns the parsed response body\nconst carriers = await api.carriers.listCarriers();\n\n// Raw: gives access to the HTTP status and headers\nconst raw = await api.carriers.listCarriersRaw();\nraw.raw.status;\nconst body = await raw.value();\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the plain method by default, and the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Raw"]}," variant only when you need the status code or headers."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"error-handling","__idx":7},"children":["Error handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All errors thrown by the SDK extend ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ShipStationError"]},":"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ShipStationApiError"]},": the API responded with a non-2xx status. It includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errors"]}," (the parsed error body), and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["requestId"]}," when the API returned one."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ShipStationConnectionError"]},": the request failed before a response was received (network error, DNS, etc.)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ShipStationTimeoutError"]},": the request exceeded the configured ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["timeout"]},"."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ts","header":{"controls":{"copy":{}}},"source":"import { ShipStationApiError } from '@shipstation/shipstation-js-sdk';\n\ntry {\n  await api.labels.createLabel({ createLabelRequest: { /* ... */ } });\n} catch (error) {\n  if (error instanceof ShipStationApiError) {\n    console.error(error.status, error.errors, error.requestId);\n  }\n}\n","lang":"ts"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"versioning-and-changelogs","__idx":8},"children":["Versioning and changelogs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK follows ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://semver.org/"},"children":["semantic versioning"]},". Two changelogs are maintained in the repository:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/shipstation/shipstation-js-sdk/blob/main/CHANGELOG.md"},"children":["CHANGELOG.md"]},": SDK package releases."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To report a bug or request a feature, ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/shipstation/shipstation-js-sdk/issues"},"children":["open an issue"]}," in the repository."]}]},"headings":[{"value":"SDKs","id":"sdks","depth":1},{"value":"Available SDKs","id":"available-sdks","depth":2},{"value":"TypeScript / JavaScript","id":"typescript--javascript","depth":2},{"value":"Installation","id":"installation","depth":3},{"value":"Quickstart","id":"quickstart","depth":3},{"value":"Configuration","id":"configuration","depth":3},{"value":"Plain and raw methods","id":"plain-and-raw-methods","depth":3},{"value":"Error handling","id":"error-handling","depth":3},{"value":"Versioning and changelogs","id":"versioning-and-changelogs","depth":3}],"frontmatter":{"slug":"/sdks","seo":{"title":"SDKs"}},"lastModified":"2026-10-26T09:22:04.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/sdks","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}