PHPackages                             onedesign/oneshipstation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. onedesign/oneshipstation

ActiveCraft-plugin

onedesign/oneshipstation
========================

A Craft CMS plugin for integrating Craft Commerce with ShipStation

0.2.27(7y ago)42461[3 issues](https://github.com/onedesign/oneshipstation/issues)[2 PRs](https://github.com/onedesign/oneshipstation/pulls)MITPHP

Since Dec 17Pushed 7y ago11 watchersCompare

[ Source](https://github.com/onedesign/oneshipstation)[ Packagist](https://packagist.org/packages/onedesign/oneshipstation)[ Docs](https://github.com/onedesign/oneshipstation)[ RSS](/packages/onedesign-oneshipstation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (35)Used By (0)

One ShipStation
===============

[](#one-shipstation)

Integrates Craft Commerce with [ShipStation](https://www.shipstation.com/) using the [Custom Store Integration](https://help.shipstation.com/hc/en-us/articles/205928478).

Installation
------------

[](#installation)

**Note: This plugin is written for Craft 2.x. It may not work in Craft 3+.**

Use [composer](https://getcomposer.org/) to install this package:

```
composer require onedesign/oneshipstation

```

After installing with composer, go to the Craft control panel plugin page to install and configure the settings for the plugin.

Craft Configuration
-------------------

[](#craft-configuration)

### CSRF Protection

[](#csrf-protection)

If you have CSRF protection enabled in your app, you will need to disable it for when ShipStation POSTs shipment notifications.

In `craft/config/general.php`, if you have `enableCsrfProtection` set to true (or, in Craft 3+, if you *don't* have it set to false), you will need to add the following:

```
return array(
    //...
    'enableCsrfProtection' => !isset($_REQUEST['p']) || $_REQUEST['p'] != '/actions/oneShipStation/orders/process'
)

```

This will ensure that CSRF protection is enabled for all routes that are NOT the route ShipStation posts to.

### "Action" naming collision

[](#action-naming-collision)

ShipStation and Craft have a routing collision due to their combined use of the parameter `action`. ShipStation sends requests using `?action=export` to read order data, and `?action=shipnotify` to update shipping data. This conflicts with Craft's reserved word `action` to describe an ["action request"](https://craftcms.com/docs/plugins/controllers#how-controller-actions-fit-into-routing), which is designed to allow for easier routing configuration.

Because of this, the route given to ShipStation for their Custom Store integration *must* begin with your Craft config's "actionTrigger" (in `craft/config/general.php`), which defaults to the string "actions".

For example, if your actionTrigger is set to "actions", the URL you prove to ShipStation should be:

```
https://{yourdomain.com}/actions/oneShipStation/orders/process

```

If your actionTrigger is set to "myCustomActionTrigger", it would be:

```
https://{yourdomain.com}/myCustomActionTrigger/oneShipStation/orders/process

```

**Note: the above URL is case sensitive**! Due to Craft's segment matching, the `oneShipStation` segment in the URL *must* be `oneShipStation`, not `oneshipstation` or `ONESHIPSTATION`.

ShipStation Configuration
-------------------------

[](#shipstation-configuration)

### Order Statuses

[](#order-statuses)

When ShipStation marks an order as shipped it calls back to Craft to update the order. This plugin assumes that there is an order status defined in Craft Commerce with the handle "shipped".

### Authentication

[](#authentication)

Once you have configured your Craft application's OneShipStation, you will need to complete the process by configuring your [ShipStation "Custom Store" integration](https://help.shipstation.com/hc/en-us/articles/205928478-ShipStation-Custom-Store-Development-Guide#3a).

There, you will be required to provide a user name, password, and a URL that ShipStation will use to contact your application. These can be found in the plugin settings in Craft control panel.

Using OneShipStation in your Site Templates
-------------------------------------------

[](#using-oneshipstation-in-your-site-templates)

### Tracking Information

[](#tracking-information)

One ShipStation provides a helper method to add to your template to provide customers with a link to track their shipment.

```
{% for shipmentInfo in order.shippingInfo %}
  {% set tracking = craft.oneShipStation.trackingNumberLinkHTML(shipmentInfo) %}
  {% if tracking|length %}
    Track shipment: {{ tracking|raw }}
  {% endif %}
{% endfor %}

```

Hooks / Customizing
-------------------

[](#hooks--customizing)

### Custom Fields &amp; Order Notes

[](#custom-fields--order-notes)

Shipstation allows the adding extra data to orders. These fields appear in ShipStation as `customField1`, `customField2`, `customField3`, `internalNotes`, `customerNotes`, `gift` and `giftMessage`.

You can populate these fields by ["latching on" to a Craft hook](https://craftcms.com/docs/plugins/hooks-and-events#latching-onto-hooks) in your custom site plugin.

Your plugin should return a callback that takes a single parameter `$order`, which is the order instance. It should return a single value.

In this example, the plugin `MyPlugin` will send the value `my custom value` to all orders in the `customField1` param to ShipStation:

```
class MyPlugin extends BasePlugin {

    public function oneShipStationCustomField1() {
        return function($order) {
            return 'my custom value';
        };
    }

}

```

Note: OneShipStation will add a `CustomFieldX` child for each plugin that responds to the hook. So, to avoid overlap, be sure to only use one hook.

For internal notes, if a plugin responds to the hook at all, the key will be added. Respond as:

```
class MyPlugin extends BasePlugin {

    public function oneShipStationInternalNotes() {
        return function($order) {
            return 'internal notes for this order';
        };
    }

}

```

### Overriding Shipping Method

[](#overriding-shipping-method)

By default, One Shipstation will send the shipping method handle to Shipstation for the `ShippingMethod` on each order.

You can override this very much like you'd add a custom field or internal notes above. In your plugin, define a function `oneShipStationShippingMethod()`, which returns a callback that takes an order and returns a string. For example, if you want the ShippingMethod to be called `Ground` for all customers in the US, you could declare a method as follows:

```
class MyPlugin extends BasePlugin {

    public function oneShipStationShippingMethod() {
        return function($order) {
            if ($order->getShippingAddress()->country == 'US') {
                return 'Ground';
            }
        }
    }

}

```

If you return null or void, OneShipstation will assign the shipping method to be the shipping method handle, as default.

### Overriding Tracking URLs

[](#overriding-tracking-urls)

Currently One ShipStation only provides links for common carriers. If your carrier is not defined, or if you want a different URL, you can override:

```
class MyPlugin extends BasePlugin {

    public function oneShipStation_trackingURL($shippingInfo) {
        return 'https://mycustomlink?tracking=' . urlencode($shippingInfo->trackingNumber);
    }

}

```

Development
-----------

[](#development)

On any Craft 2.x project, navigate to `craft/plugins` and clone the repository:

```
$ cd craft/plugins
$ git clone git@github.com:onedesign/oneshipstation.git

```

Be sure to add `craft/plugins/oneshipstation` to your other project's gitignore, if applicable:

```
# .gitignore
craft/plugins/oneshipstation

```

Bugs / Issues
-------------

[](#bugs--issues)

Submit bug reports and issues via . Please be as thorough as possible when submitting bug reports.

Contributing
------------

[](#contributing)

1. Fork the repo on GitHub
2. Clone the project to your own machine
3. Commit changes to your own branch
4. Push your work back up to your fork
5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance5

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Recently: every ~80 days

Total

30

Last Release

2846d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/99e41003ff905aa96723ebc124836b6fa5664823d554c10bfa27149d45f95768?d=identicon)[onedesign](/maintainers/onedesign)

---

Top Contributors

[![mkornatz](https://avatars.githubusercontent.com/u/1489817?v=4)](https://github.com/mkornatz "mkornatz (39 commits)")[![setoalan](https://avatars.githubusercontent.com/u/4769486?v=4)](https://github.com/setoalan "setoalan (22 commits)")[![thelowlypeon](https://avatars.githubusercontent.com/u/1338290?v=4)](https://github.com/thelowlypeon "thelowlypeon (19 commits)")[![bernsno](https://avatars.githubusercontent.com/u/13946?v=4)](https://github.com/bernsno "bernsno (12 commits)")[![brianjhanson](https://avatars.githubusercontent.com/u/1843073?v=4)](https://github.com/brianjhanson "brianjhanson (12 commits)")[![andygiannini](https://avatars.githubusercontent.com/u/5375498?v=4)](https://github.com/andygiannini "andygiannini (5 commits)")[![michaelramuta](https://avatars.githubusercontent.com/u/10780725?v=4)](https://github.com/michaelramuta "michaelramuta (4 commits)")[![collinjoyce](https://avatars.githubusercontent.com/u/6598779?v=4)](https://github.com/collinjoyce "collinjoyce (3 commits)")[![jmauzyk](https://avatars.githubusercontent.com/u/21298596?v=4)](https://github.com/jmauzyk "jmauzyk (2 commits)")[![lukeholder](https://avatars.githubusercontent.com/u/133571?v=4)](https://github.com/lukeholder "lukeholder (1 commits)")[![danboy](https://avatars.githubusercontent.com/u/8213?v=4)](https://github.com/danboy "danboy (1 commits)")

---

Tags

pluginCraftshipstation

### Embed Badge

![Health badge](/badges/onedesign-oneshipstation/health.svg)

```
[![Health](https://phpackages.com/badges/onedesign-oneshipstation/health.svg)](https://phpackages.com/packages/onedesign-oneshipstation)
```

###  Alternatives

[am-impact/amcommand

Command palette in Craft.

8674.1k3](/packages/am-impact-amcommand)[putyourlightson/craft-log-to-file

Logs messages to a specific log file for Craft CMS.

29368.0k5](/packages/putyourlightson-craft-log-to-file)[marionnewlevant/twig-perversion

Making twig do things it really shouldn't

5465.6k1](/packages/marionnewlevant-twig-perversion)[froala/craft-froala-wysiwyg

Craft 3 CMS plugin for Froala WYSIWYG HTML Rich Text Editor.

1719.0k](/packages/froala-craft-froala-wysiwyg)[topshelfcraft/walk

A Craft-aware array\_walk() method, plus some super-convenient console commands, to easily call Craft service methods on a collection of elements or values.

221.5k](/packages/topshelfcraft-walk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
