Skip to content

Latest commit

 

History

History
101 lines (73 loc) · 2.82 KB

README.md

File metadata and controls

101 lines (73 loc) · 2.82 KB

Medusa v2 Example: ShipStation Integration

This directory holds the code for the ShipStation Integration Guide.

You can either:

Prerequisites

Installation

  1. 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

Copy into Existing Medusa Application

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.

More Resources