Skip to content
Last updated

Partner Integrations With ShipStation API

ShipStation's Partner APIs allow platforms to manage individual ShipStation API accounts and make calls on their behalf. This workflow is useful if your customers are paying for their own shipping costs, as it supports the creation of individual account balances and provides logical separation for customer accounts.

Partner Key

In order to use some of the API calls outlined in this section, you will need a Partner Key. Partner Keys are provisioned by the ShipStation API team and are available on request. You will need to provide us an email address that will be associated with the partner key - this email address will be the default on all accounts and can be overridden on account creation. It will also be the primary contact email in case of technical issues where our team may need to get in touch.

You will be provided with two credentials: one for testing, and one for production. The accessible endpoints and functions will be identical for both credentials. However, account access is exclusive to the credential set being used. Credentials can be cycled on request.

Create accounts

The first step to access the ShipStation API as a partner is to create a ShipStation API account. An account created through the Partners API has full access to our production APIs, but limited access to the UI.

Account Management Fuctions

The following functions are available to manage the accounts created through the partners API:

The On-Behalf-Of header

All calls to the ShipStation API will require the following two headers:

Header NameDescription
API-KeyThis is your ShipStation Partner API key. See the Getting Started page for details.
On-Behalf-OfThis is the Account ID of the ShipStation API account that you are operating on behalf of.

Give USPS Access to Each Merchant

Now that you have created an account for your user, they'll need carriers connected in order to ship. You can connect carrier accounts or provision carrier accounts. In the US, you can provision USPS (via Stamps.com), UPS, and DHL Express through ShipStation API.

POST /v1/registration/stamps_com HTTP/1.1
Host: api.shipengine.com
API-Key: __PARTNER_API_KEY_HERE__
On-Behalf-Of: se-123456
Content-Type: application/json

{
  "nickname": "My Stamps account",
  "email": "useremail@gmail.com",
  "agree_to_carrier_terms": true,
  "should_send_email": false,
  "address": {
    "name": "Real Name",
    "phone": "2223334444",
    "company_name": "Real Company",
    "address_line1": "123 Easy St",
    "address_line2": "",
    "city_locality": "Bronx",
    "state_province": "NY",
    "postal_code": "12345",
    "country_code": "US",
    "address_residential_indicator": "yes",
  }
}
{
    "carrier_id": "se-12345"
}

Add UPS Services to an Account

You can enable UPS services for your user which will be funded through the account balance created in the previous step. You will need approval from UPS in order to offer these discounted UPS services to your users.

POST /v1/registration/ups HTTP/1.1
Host: api.shipengine.com
API-Key: __PARTNER_API_KEY_HERE__
On-Behalf-Of: se-123456
Content-Type: application/json

{
   "nickname": "My UPS Account",
   "email": "useremail@gmail.com",
   "agree_to_carrier_terms": true,
   "end_user_ip_address": "154.22.87.100",
   "address": {
    "name": "Real Name",
    "phone": "2223334444",
    "company_name": "Real Company",
    "address_line1": "123 Easy St",
    "address_line2": "",
    "city_locality": "Bronx",
    "state_province": "NY",
    "postal_code": "12345",
    "country_code": "US",
   }
}
{
    "carrier_id": "se-12346"
}

Enabling UPS Ground Saver for Existing Users

You can enable the UPS Ground Saver service for users who have already established their UPS account. This step is only required if the UPS account was created prior to UPS Ground Saver being enabled for your platform. This allows them to access this cost-effective shipping option for residential shipping.

PUT /v1/connections/carriers/ups_walleted/{carrier_id}/settings HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_SHIPENGINE_PARTNER_API_KEY__
On-Behalf-Of: __PAYPAL_ACCOUNT_ID__
Content-Type: application/json

{
  "nickname": "My UPS Account",
  "is_primary_account": true,
  "use_ground_freight_pricing": false,
  "enable_ground_saver_service": true
}

Add DHL Express Services to an Account

You can enable DHL Express services for your user which will be funded through the account balance created in an earlier step.

POST /v1/registration/dhl_express_walleted HTTP/1.1
Host: api.shipengine.com
API-Key: __PARTNER_API_KEY_HERE__
On-Behalf-Of: se-123456
Content-Type: application/json

{
  "nickname": "My DHL Account"
}
{
    "carrier_id": "se-12347"
}

Manage the Account Balance

Labels created via the account balance are pre-paid, meaning that there must be enough funds in the balance to create the label. To check the current balance, List Carriers - Connect carrier accounts.

Add Funds

POST /v1/connections/carriers/stamps_com/::carrier_id/add_funds HTTP/1.1
Host: api.shipengine.com
API-Key: __PARTNER_API_KEY_HERE__
On-Behalf-Of: se-123456
Content-Type: application/json

{
  "currency": "usd",
  "amount": 10.0
}
{
  "balance": {
    "amount": {
      "balance": 14.0400,
      "postage_payment_id": "297745C13332000"
    },
    "currency": "usd"
  },
  "transaction_id": "6622440"
}

Auto-Funding

Some merchants prefer not to manually manage their balance. To facilitate a more seamless workflow we offer the option to setup auto-funding for the account balance, which will add funds when the balance gets below a certain threshold. Please note the balance must start at an amount over the low_balance_purchase_threshold to trigger auto-funding.

POST /v1/carriers/::carrier_id/auto_funding HTTP/1.1
Host: api.shipengine.com
API-Key: __PARTNER_API_KEY_HERE__
On-Behalf-Of: se-123456
Content-Type: application/json

{
  "is_enabled":true,
  "low_balance_purchase_threshold": {
    "currency":"usd",
    "amount":"10.0"
  },
  "purchase_amount":{
    "currency":"usd",
    "amount":"100.0"
    },
  "maximum_purchases_per_day":10
}