This directory holds the code for the ShipStation Integration Guide.
You can either:
- install and use it as a Medusa application;
- or copy its source files into an existing Medusa application.
- Node.js v20+
- Git CLI
- PostgreSQL
- ShipStation account with enabled carriers and activated shipping API, as explained here.
- Clone the repository and change to the
shipstation-integration
directory:
git clone https://github.com/medusajs/examples.git
cd examples/shipstation-integration
2. Rename the .env.template
file to .env
.
3. If necessary, change the PostgreSQL username, password, and host in the DATABASE_URL
environment variable.
4. Set the following environment variables:
SHIPSTATION_API_KEY=
Where SHIPSTATION_API_KEY
is the API key of your ShipStation account, retrieved as explained here.
5. Install dependencies:
yarn # or npm install
6. Setup and seed the database:
npx medusa db:setup
yarn seed # or npm run seed
7. Start the Medusa application:
yarn dev # or npm run dev
If you have an existing Medusa application, copy the src/modules/shipstation
directory into your application.
Then, add the ShipStation Integration to medusa-config.ts
as part of the Fulfillment Module's options:
module.exports = defineConfig({
// ...
modules: [
{
resolve: "@medusajs/medusa/fulfillment",
options: {
providers: [
// default provider
{
resolve: "@medusajs/medusa/fulfillment-manual",
id: "manual",
},
{
resolve: "./src/modules/shipstation",
id: "shipstation",
options: {
api_key: process.env.SHIPSTATION_API_KEY,
},
},
],
},
},
],
})
Make sure to add the following environment variable:
SHIPSTATION_API_KEY=
Where SHIPSTATION_API_KEY
is the API key of your ShipStation account, retrieved as explained here.