The spree_shipstation integration connects your Spree stores with ShipStation, allowing ShipStation to pull shipments from your store, and when a shipment is sent, update the order with a tracking number and mark it as shipped.
-
Add this extension to your Gemfile with this line:
gem "spree_shipstation", github: "matthewkennedy/spree_shipstation", tag: "v2.0.0"
-
Install the gem using Bundler
bundle install
-
Copy & run install the generator
bundle exec rails generate spree_shipstation:install
Visit the Integrations section of your Spree store and configure the ShipStation integration by creating a unique username and password.
Create a new ShipStation store by visiting: Settings -> Selling Channels -> Stores -> Add Store, then selecting the Custom Store option.
Enter the following details:
- Username: The username you created in Step 1.
- Password: The password you created in Step 1.
- URL to custom page:
https://your-store-domain.com/shipstation.xml.
There are five shipment states for an order (= shipment) in ShipStation. These states do not necessarily align with Spree, but you can configure ShipStation to create a mapping for your specific needs. Here's the default mapping:
| ShipStation description | ShipStation status | Spree status |
|---|---|---|
| Awaiting Payment | unpaid |
pending |
| Awaiting Shipment | paid |
ready |
| Shipped | shipped |
shipped |
| Cancelled | cancelled |
cancelled |
| On-Hold | on-hold |
pending |
The integration respects Spree's auto_capture_on_dispatch setting. When enabled in your Spree store, pending payments are captured automatically before a shipment is marked as shipped. If a payment capture fails, an error is returned to ShipStation (HTTP 400), preventing the shipment from being marked as shipped until the issue is resolved.
The export endpoint returns up to 50 shipments per page. ShipStation handles pagination automatically using the page query parameter.
There's nothing you need to do. Once properly configured, the integration just works!
This extension works with the following Spree versions:
- 5.x
First bundle your dependencies:
bundleTo run the tests use:
bundle exec rakeTo check your code formatting with Standard Rb run:
bundle exec standardrbTo fix basic code formatting issues run:
bundle exec standardrb --fixbundle exec gem bump -p -t
bundle exec gem releaseCopyright (c) 2025 Matthew Kennedy, released under the New BSD License.