Overview
- You may wish to utilize Multi-Origin fulfilment and Shipping Rates if you ship from multiple locations.
- Multi-Origin Fulfillment is when you fulfil a single order from multiple locations due to the location of available stock.
- Multi-Origin Rates is for when you want to charge your customer for the true cost of shipping the packages from the different fulfilment centres.
- Example: You sell hats and shoes and operate out of two different locations, a brick and mortar store and a warehouse. Currently, your store has all of the hat stock and the warehouse stocks all your shoes. When a customer goes to buy one set of shoes and a hat, you may want to charge them the shipping cost of sending one package from your store and one package from your warehouse.
Configuring Rates with the Starship API
As a first step, you should ensure you have activated live rates in your Starshipit account(s).
The Starshipit API rates endpoint will return shipping services based on the locations provided in the API request. You will need to make one rate request per location you are wanting to quote from and then aggregate the returned results for an accurate shipping quote. There are a couple of ways in which you could configure this which are detailed below.
Option One: API Token
All Starshipit API requests have a StarShipIT-Api-Key header. This header determines which account the request will be sent to. If you have set up child accounts for each location's fulfilment (recommended) then you can provide the associated child accounts API token in this header. This would mean that the origin of the quote would be the pickup address of the selected account.
If you are creating orders via the API then this method would be best for you. Once you have quoted based on the API token you should then create the order based on the API token used in the quote request
Example Request:
"url": "https://api.starshipit.com/api/rates",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"StarShipIT-Api-Key": "<LOCATION_API_TOKEN>",
"Ocp-Apim-Subscription-Key": ""
},
"data": {
"destination": {
"street": "20 George Street",
"suburb": "Sydney","city": "Sydney",
"state": "NSW",
"post_code": "2000",
"country_code": "AU"
},
"packages": [
{
"weight": 0.5
{
]
}
Option Two: Senders Address
The rates endpoint has an optional "Senders" address object which you can populate with the location you would like to quote from.
In this option, you do not need to know what API token is associated with what address. Address details are passed directly to the API
Example Request:
"url": "https://api.starshipit.com/api/rates",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"StarShipIT-Api-Key": "",
"Ocp-Apim-Subscription-Key": ""
},
"data": {
"destination": {
"street": "20 George Street",
"suburb": "Sydney","city": "Sydney",
"state": "NSW",
"post_code": "2000",
"country_code": "AU"
},
"sender": {
"street": "100 Beaumont Street",
"suburb": "Menzies",
"state": "WA",
"post_code": "6436",
"country_code": "AU"
},
"packages": [
{
"weight": 0.5
{
]
}
- For more information on the Starshipit API please see read this Starshipit API Overview.
- For API support, please contact our support team here.