# Create rules for checkout rates
URL: https://support.starshipit.com/articles/5941927829775-create-rules-for-checkout-rates
Canonical: https://support.starshipit.com/articles/5941927829775-create-rules-for-checkout-rates
Markdown: https://support.starshipit.com/articles/5941927829775-create-rules-for-checkout-rates.md
Updated: 2026-10-10

> For the complete documentation index, see [llms.txt](https://support.starshipit.com/llms.txt).

> Set up rules to control checkout rate behaviour, such as surcharges, free shipping, or courier assignments.

Create checkout rules to choose delivery options and adjust the rates customers see. Use separate margin rules when different courier services need different adjustments.

## Before you begin

Configure the courier services you want to offer under **Settings > Checkout Rates > Courier Configuration**. Keep their product codes available when setting up a margin rule.

:::note
A matching margin rule overrides the margin configured for that courier service under **Settings > Checkout Rates > Courier Configuration**.
:::

{{video:youtube:fmSmi2ndu4M}}

## Understand rule priority

Rules are evaluated from top to bottom. For actions that choose checkout couriers, the first matching rule takes precedence over conflicting rules below it. Margin rules are evaluated for each courier and product code separately, as explained in **Apply margins to multiple services** below.

For example:

* Our first rule says Condition weight >5kg Set the carriers for checkout as Australia Post
  + This means if the weight of the order is greater than 5kg, then only Australia Post will show on checkout.
* Our second rule says Condition weight >10kg Set the carriers for checkout as Aramex.
  + This means if the weight of the order is greater than 10kg, then only Aramex will show on checkout.

In this case, the second rule will never be triggered. This is because any order that is greater than 10kg, will also be greater than 5kg, meaning the first rule will take precedence.

As the rules engine is flexible, you can solve this problem in a couple of different ways:

* Solution 1: Condition weight >5kg and condition weight <10kg Set the carriers for checkout as Australia Post.
  + This rule solves the issue by providing a range: Show Australia Post for orders heavier than 5kg and lighter than 10kg. Show Aramex for orders weighing more than 10kg.
* Solution 2: Change the order of the rules so the order containing the >10kg condition is first on the list.
  + This solves the issue as the second rule (showing Australia Post) will now only trigger for orders under 10kg.

## Enter currency and weight values

* When using Shopify, dollar values need to be entered in cents ($100 = 10000, $80 = 8000). This is due to a limitation with the Shopify plugin.
* Weight values need to be entered in kilograms (10kg = 10)

## Create a checkout rule

1. Go to **Settings** > **Checkout Rates** > **Rules**.
2. Select **Add a new rule**.
3. Choose the **Condition(s)** that the rule should apply in.    
   Possible Conditions: 
   * All Orders
   * Destination Country Name
   * Destination Country Code
   * Destination Post Code - AU
   * Destination Post Code - NZ
   * Destination Post Code
   * Destination State
   * Destination Suburb or City
   * Destination Street
   * Destination Building
   * Destination Company
   * Item SKU
   * Item Quantity
   * Order Value
   * Order Weight
   * Customer Tags (only for Shopify)
   * PO Box & Parcel Locker Orders
   * Line Item Value
   * Shipping Zone
   * Their Reference
4. Choose the **Action** you would like to apply.
   * Set Carriers for Checkout: Only display the selected courier options on checkout
   * Set Checkout Rates: Use a specified rate rather than the default couriers you have defined
   * Set Courier & Product Code:  Specify the courier that should display in this case  
   * Set Margin Type & Value: Add or subtract a margin from the quoted rate on checkout
   * Set Shipping Location: Use an alternate shipping address from your Pickup Address defined in Starshipit as the sender address for the rate. This is useful if you are shipping from multiple locations and would like the live rate to be based on a specific address depending on what is in the cart or where the customer is based.
5. Click **Save**.

:::important
For Table Rates product codes, the *Set Courier & Product Code* rule only works when using the **Plain Label – Table Rates** option. If you are using any other courier’s **Table Rates** option, this rule will not apply. This means you cannot use this rule to specify a product code that has been set up under Table Rate unless it is under Plain Label(Flat Rate) Table Rate.
:::

## Apply margins to multiple services

Create one **Set Margin Type & Value** rule for each courier and product code that needs an adjustment. Matching rules for different services can apply to the same checkout request, even when they use the same condition.

For the same courier and product code, only the first matching margin rule applies. The margins do not stack. Put the more specific rule above a broader rule for that service.

1. Go to **Settings > Checkout Rates > Rules** and select **Add a new rule**.
2. Set the **Condition(s)** for the checkout requests you want to adjust.
3. Select **Set Margin Type & Value** as the **Action**.
4. Choose the courier under **Value**.
5. Enter the service's **product code** exactly as configured for checkout.
6. Select the **margin type**, then enter the adjustment value.
7. Click **Save**.
8. Repeat for each additional courier service.

Test a cart that matches the shared condition and check the returned rate for every service. If one service is incorrect, check its courier, product code and any earlier matching margin rule for that same service.

## Show different rates to Shopify customer groups

For Shopify checkout rates, the **Customer Tags** condition can match the tags on the customer requesting the rate. Use it to show different delivery options to groups such as wholesale and retail customers.

1. In Shopify, add the customer tag you want to use, such as `B2B`.
2. In Starshipit, go to **Settings > Checkout Rates > Rules**.
3. Create a rule with **Customer Tags** as the condition and enter the customer tag.
4. Choose **Set Carriers for Checkout** or **Set Checkout Rates** as the action.
5. Select the delivery options that customer group should see, then click **Save**.

Test the rule at checkout with a customer that has the tag. Place more specific tag rules above broader rules so the intended delivery options are returned.

## Common use cases for rules at checkout

### Cover a surcharge

Some couriers may apply a surcharge if a package is over a specific weight, but this surcharge isn’t always provided on the quote you get back from the courier. You can set up a rule to specify that if a package weighs over a certain amount, add a 10% margin to cover the surcharge.

1. Select **Add a new rule.**
2. Select **Condition(s)** > **Order weight** (Enter your weight threshold in the field provided).
3. Select **Action** > **Set Margin Type & Value**.
4. Select **Value** (Choose your courier from the dropdown).
5. Input your **product code**.
6. Select your **margin type** (Amount or percentage).
7. Enter your **value** (10%).
8. Click **Save.**

### Exclude couriers for PO boxes

Not all couriers deliver to PO boxes. You can set up a rule which says that if an address includes a PO box, remove those couriers that won’t deliver to them.

1. Select **Add a new rule**.
2. Select **Condition(s)** > **PO Box & Parcel Locker Orders > Equals > True**.
3. Select **Action** > **Set Carriers for Checkout**.
4. Select the couriers you’d like to display in your checkout.
5. Click **Save**.

### Offer free shipping above an order value

You can set up a rule where if an order is over $100 (for example), you can display a free shipping option to the customer.

1. Select **Add a new rule**.
2. Select **Condition(s)** > **Order Value > Greater Than >** (Enter your order value, for example $100. Note, this needs to be entered as 10000)
3. Select **Action > Set Checkout Rates**.
4. Select **Value** (Choose your courier from the dropdown).
5. Select **Free Shipping**.
6. Click **Return this item only**.
7. Click **Save**.

You can customise this further by adding additional conditions (such as below a certain order weight, or within a certain destination).

### Choose couriers for dangerous goods

Some couriers won’t transport dangerous goods (Something flammable or even an item which includes a dangerous item like a battery). You can create a rule to remove these couriers from the checkout if the cart contains a dangerous item.

1. Select **Add a new rule**.
2. Select **Condition(s)** > **Item SKU** > (Enter the SKUs of your dangerous goods items).
3. Select **Action > Set Carriers for Checkout**.
4. Select the couriers you’d like to display in your checkout.
5. Click **Save**.

### Set an alternate shipping location

If you ship from multiple locations, you may want to provide a live rate based on the warehouse the order will ship from. You could create a rule which says if the order is in state/country A, use warehouse A. Or, if the order is in state/country B, use warehouse B.

1. Select **Add a new rule**.
2. Select **Condition(s)** >**Destination Country Name** or **Destination State**.
3. Select **Action > Set Shipping Location**.
4. Enter your **Value** (The name of your shipping location).
5. Click **Save**.

## Troubleshooting

### A rule is not applying

There are a few reasons why your rules may not be working:

* Rules apply from top to bottom in the list, so you may have conflicting rules. See the section “Understanding the order of rules” at the top of this article.
* With Shopify dollar values need to be entered in cents ($100 = 10000, $80 = 8000)
* Weight values need to be entered in kilograms (10kg = 10).
* If you’ve entered a weight for the order to be less than, your orders could be going above that weight and therefore the rules aren't applying as you intend them to. You may need to provide a range for orders to sit within instead of having a “less than” option.

### An imported order uses the wrong courier service

While this isn't default behaviour, it is recommended that you set up rules to map the 'Shipping Method' to the 'Select Courier and Product Code' action.

![Shipping method to courier mapping rule](/uploads/attachments/rules-shipping-method-mapping.png)

## Verify your rules

Use a representative checkout cart for each rule. Check the services displayed and their quoted rates, then test a cart that does not match the rule. Review the order of overlapping rules before making the changes available to customers.
