{"templateId":"markdown","versions":[{"version":"shipstation-v2","label":"ShipStation V2 API","link":"/apis/shipstation-v2/docs/shipping/shipping-rules-guide","default":true,"active":false,"folderId":"58c9a61d"},{"version":"shipengine","label":"ShipStation API (formerly ShipEngine)","link":"/apis/shipengine/docs/shipping/shipping-rules-guide","default":false,"active":true,"folderId":"58c9a61d"},{"version":"shipstation-v1","label":"ShipStation V1 API","link":"/apis/shipstation-v1/docs/shipping/shipping-rules-guide","default":false,"active":false,"folderId":"58c9a61d"}],"sharedDataIds":{"sidebar":"sidebar-apis/@shipengine/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Shipping Rules Guide","keywords":"shipping, labels, shipstation, documentation, api","siteUrl":"https://docs.shipstation.com","lang":"en-US","llmstxt":{"hide":false,"title":"ShipStation API LLM Docs","description":"Find links and references to all markdown documentation for use with LLMs","excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"shipping-rules-guide","__idx":0},"children":["Shipping Rules Guide"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Shipping Rules provide ShipStation API with a set of criteria to determine which carrier and service to apply to a shipment. This allows you to automate the selection of carrier and service according to your specific business needs."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you are new to Shipping Rules, be sure to read our ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/apis/shipengine/docs/shipping/shipping-rules-intro"},"children":["Introduction to Shipping Rules"]}," page."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Currently, you must create your shipping rules in your account dashboard. Once created, each rule will have a shipping rule ID you can add to the shipment object for either ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/apis/shipengine/docs/shipping/create-a-shipment"},"children":["Create Shipment"]}," or ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/apis/shipengine/docs/labels/create-a-label"},"children":["Purchase Label"]}," calls."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For each shipment, ShipStation API will evaluate the rule statements against the shipment details and apply the appropriate ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["carrier_id"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["service_code"]}," to the shipment for you."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["NOTICE:"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"shipping-rules-endpoints-coming-soon","__idx":1},"children":["Shipping Rules Endpoints Coming Soon"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We will sooon be adding a shipping rules endpoint so you can also create rules programmatically. Check back soon for details on using this new endpoint."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-shipping-rule","__idx":2},"children":["Create a Shipping Rule"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To create a shipping rule:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Log into your account dashboard and go to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Shipping Rules"]},"."," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/dash_sidenav_shippingrules.4c9f94780fc4d7cf57975981dfa2a5d10f8b561bc0f9a85a507e9ddeef33679c.31478e40.png","alt":"ShipStation API Dashboard Shipping Rules in the side navigation"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create rule"]}," button."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose the type of rule you wish to create, condition or service group."," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/dash_shippingrules_selectruletype.7485fffe2bae30c25b693b8a147a31fb2f43abf547076af630a321aefd5afcac.31478e40.png","alt":"Select shipping rule type popup"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter a name for your rule (each rule requires a unique name)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create the statements with the conditions you require (see below sections for details on creating each type of rule)."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"condition-based-rules","__idx":3},"children":["Condition-based Rules"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["With condition based rules, you define explicit sets of conditions the shipment must meet for the service defined in the statement to be allocated to that shipment."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To create a condition-based rule:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Fill in the first condition for Statement 1. ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/dash_shippingrule_conditionbased_firststatement.3e6bd72ec4c071bd0f6913c0c03cc37c5d80086c2b6c69b4ad753eec95124f99.31478e40.png","alt":"Shipping rule with first rule statement"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add more conditions if needed. Remember, additional conditions behave as AND statements."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set the carrier and service that should apply to shipments meeting the statement conditions in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["allocate"]}," fields."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add more statements if needed. Remember, additional statements behave as ELSE IF statements. ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/dash_shippingrule_conditionbased_secondstatement.db1ed592f9f2243dff440ce039c89e567d7b3e860620996e44a7e0add58a411e.31478e40.png","alt":"Shipping rule with second rule statement"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set the default carrier and service that will apply if the shipment does not meet the conditions for any of the rule statements."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Save the rule."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"service-group-rules","__idx":4},"children":["Service Group Rules"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["With service group rules, you first create a list of services in a prioritized order. Then, you create \"exclusion statements\" with conditions that will ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["exclude"]}," a service from the shipment if the shipment meets the statement conditions."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To create a service group rule:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose a carrier and select which of that carrier's services to include in your priority list. ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/dash_shippingrule_servicegroup_addservices_mrk.4589c2236cb607c9a5fc2a76897f30b89d1670ef8129142b5402a2f4e9678feb.31478e40.png","alt":"Add services to Service Group shipping rule"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Add to list"]}," button to add this set of services to the list."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["(Optional) Continue to add services to your priority list, a carrier at a time, until you have the full list of services you wish this rule to contiain."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Arrange the priority of the services in your list. You can drag and drop the services into the desired order, or use the up/down arrows to adjust the position of a service in the list. ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/dash_shippingrules_moveservicesinlist_mrk.fe725df49067156f9bcacd88f9450b20857c4bd0f01fc509c727cb31d0fdb3d6.31478e40.png","alt":"Move services in priority list for shipping rules"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Fill in the first condition for Statement 1. ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/dash_shippingrule_servicegroup-firststatement.2c164fccc6cc02da8daf20c18a66995aaf9a779b3dad39b4e45d072f3c524a99.31478e40.png","alt":"Service group rule first statement"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add more conditions if needed. Remember, additional conditions behave as AND statements."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose which services to exclude from shipments that meet the statement conditions."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add more statements if needed. Remember, additional statements behave as ELSE IF statements. ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/dash_shippingrule_servicegroup-secondstatement.37961fe3e70c83d6361884748b74b438bb4fd05abb998d29960419ab88c23592.31478e40.png","alt":"Service group rule second statement"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Save the rule."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"apply-rules-to-your-shipments","__idx":5},"children":["Apply Rules to Your Shipments"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once you have created your shipping rules, you will use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shipping_rule_id"]}," property in place of the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["carrier_id"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["service_code"]}," properties in your shipment object for any shipment you want the rule to apply to. You can use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shipping_rule_id"]}," property for both the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/apis/shipengine/docs/shipping/create-a-shipment"},"children":["Create Shipment"]}," and ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/apis/shipengine/docs/labels/create-a-label"},"children":["Purchase Label"]}," endpoints."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ShipStation API will evaluate the shipping rule provided in the request to determine the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["carrier_id"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["service_code"]}," that should apply to the shipment. Both will then be included in the corresponding response."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-shipment-example-request","__idx":6},"children":["Create Shipment Example Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is an example of the shipment object in a request for ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/apis/shipengine/docs/shipping/create-a-shipment"},"children":["Creating a Shipment"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["POST /v1/shipments/"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"POST /v1/shipments HTTP/1.1\nHost: api.shipengine.com\nAPI-Key: __YOUR_API_KEY_HERE__\nContent-Type: application/json\n\n{\n \"shipments\": [\n  {\n   \"shipping_rule_id\": \"se-49\",\n   \"ship_to\": {\n      \"address_line1\": \"200 Grays Inn Road\",\n      \"city_locality\": \"London\",\n      \"postal_code\": \"WC1X 8XZ\",\n      \"country_code\": \"GB\",\n      \"name\": \"John Smith\",\n      \"phone\": \"+44 020 5555 5555\",\n      \"email\": \"myemail@test.com\"\n    },\n   \"ship_from\": {\n      \"address_line1\": \"Victoria Embankment\",\n      \"city_locality\": \"London\",\n      \"postal_code\": \"SW1A 2JF\",\n      \"country_code\": \"GB\",\n      \"name\": \"Norman Shaw\",\n      \"phone\": \"+44 020 7219 4272\",\n      \"email\": \"youremail@test.com\"\n    },\n   \"packages\": [\n     {\n      \"package_code\": \"package\",\n      \"weight\": {\n        \"value\": 1.5,\n        \"unit\": \"kilogram\"\n       },\n      \"dimensions\": {\n        \"height\": 6,\n        \"width\": 5,\n        \"length\": 15,\n        \"unit\": \"centimeter\"\n      }\n    }\n   ]\n  }\n ]\n}\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"purchase-label-example-request","__idx":7},"children":["Purchase Label Example Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is an example of the shipment object in a request for ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/apis/shipengine/docs/labels/create-a-label"},"children":["Purchasing a Label"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["POST /v1/labels/"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"POST /v1/labels HTTP/1.1\nHost: api.shipengine.com\nAPI-Key: __YOUR_API_KEY_HERE__\nContent-Type: application/json\n\n{\n \"shipment\": {\n   \"shipping_rule_id\": \"se-49\",\n   \"ship_to\": {\n      \"address_line1\": \"200 Grays Inn Road\",\n      \"city_locality\": \"London\",\n      \"postal_code\": \"WC1X 8XZ\",\n      \"country_code\": \"GB\",\n      \"name\": \"John Smith\",\n      \"phone\": \"+44 020 5555 5555\",\n      \"email\": \"myemail@test.com\"\n    },\n   \"ship_from\": {\n      \"address_line1\": \"Victoria Embankment\",\n      \"city_locality\": \"London\",\n      \"postal_code\": \"SW1A 2JF\",\n      \"country_code\": \"GB\",\n      \"name\": \"Norman Shaw\",\n      \"phone\": \"+44 020 7219 4272\",\n      \"email\": \"youremail@test.com\"\n    },\n   \"packages\": [\n     {\n      \"package_code\": \"package\",\n      \"weight\": {\n        \"value\": 1.5,\n        \"unit\": \"kilogram\"\n       },\n      \"dimensions\": {\n        \"height\": 6,\n        \"width\": 5,\n        \"length\": 15,\n        \"unit\": \"centimeter\"\n      }\n    }\n   ]\n  }\n}\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"available-condition-properties","__idx":8},"children":["Available Condition Properties"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following identifiers are currently available to use in your statement conditions:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Identifier"},"children":["Identifier"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value Type"},"children":["Value Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Available Operators"},"children":["Available Operators"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["To address residential indicator"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["is, is not"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Indicates whether this is a residential address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["From address residential indicator"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["is, is not"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Indicates whether this is a residential address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["To country"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["is, is not"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://en.wikipedia.org/wiki/ISO_3166-1"},"children":["two-letter ISO 3166-1"]}," country code"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["From country"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["is, is not"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://en.wikipedia.org/wiki/ISO_3166-1"},"children":["two-letter ISO 3166-1"]}," country code"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Warehouse ID"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["list"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["in, not in"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The warehouse that the shipment is being shipped from"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["To postal code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["list"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["in, not in, starts with"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List of postal codes, separated by a comma"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["From postal code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["list"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["in, not in, starts with"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List of postal codes, separated by a comma"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number of packages"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["is, is less than, is less or equal to, is greater than, is greater than or equal to"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number of packages of a shipment"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Total weight"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["decimal"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["is, is less than, is less or equal to, is greater than, is greater than or equal to"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Weight of a shipment ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," Available units: Gram, Kilogram, Pound, Ounce"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Max dimension"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["decimal"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["is, is less than, is less or equal to, is greater than, is greater than or equal to"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Dimension filter of any of the available dimensions of a shipment ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["height"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["width"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["length"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," Available units: centimeter, inch"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shipment value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["decimal"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["is, is less than, is less or equal to, is greater than, is greater than or equal to"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shipment’s product value sum"]}]}]}]}]}]},"headings":[{"value":"Shipping Rules Guide","id":"shipping-rules-guide","depth":1},{"value":"Shipping Rules Endpoints Coming Soon","id":"shipping-rules-endpoints-coming-soon","depth":3},{"value":"Create a Shipping Rule","id":"create-a-shipping-rule","depth":2},{"value":"Condition-based Rules","id":"condition-based-rules","depth":3},{"value":"Service Group Rules","id":"service-group-rules","depth":3},{"value":"Apply Rules to Your Shipments","id":"apply-rules-to-your-shipments","depth":2},{"value":"Create Shipment Example Request","id":"create-shipment-example-request","depth":3},{"value":"Purchase Label Example Request","id":"purchase-label-example-request","depth":3},{"value":"Available Condition Properties","id":"available-condition-properties","depth":2}],"frontmatter":{"seo":{"title":"Shipping Rules Guide"}},"lastModified":"2026-04-08T10:47:45.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/apis/shipengine/docs/shipping/shipping-rules-guide","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}