Purpose: Discover how to use your Checkout Rules in combination with the Checkout API, a dynamic feature that allows you to gain control over your checkout process.
What are the Checkout rules?
Checkout rules work similarly to shipping rules and return rules - they are predefined actions that will automatically apply to your checkout.
The Checkout rules work in combination with the Checkout API. This means that your Dynamic Checkout needs to be configured to be able to use the Checkout rules. See the Dynamic Checkout guide.
Why use Checkout rules?
- Improve customer satisfaction by streamlining your checkout process.
- Display relevant delivery methods.
- Enjoy greater flexibility and control over your checkout page.
Set up your Checkout rules
Create a New Checkout Rule
- Log in to your Sendcloud account.
- Navigate to Settings > Checkout Rules.
- Click on Create New Rule to start defining your conditions.
- Enter a Name for the rule.
- Choose an IF condition (e.g., Postal code, Parcel weight).
- Select an Operator (e.g., Is, Less than, Greater than).
- Enter a Value (e.g., Postal code 12345).
- Choose the Action (e.g., Hide delivery method with Carrier X).
- Click Save Checkout Rule.
Apply the Rule to a Delivery Method
- Navigate to Settings > Dynamic Checkout at the top of your screen.
- Click on the Delivery Method you want to modify.
- Scroll down to the Checkout Rules section.
- Select the rule(s) you created and apply them to the delivery method.
- Click Save Changes.

Publish Your Configuration
- After applying your rules, go back to the Dynamic Checkout page.
- Click Publish Configuration to activate the rules.
- Changes can take up to 15 minutes to be reflected in your store.
Editing or Deleting Rules
- If you need to remove a rule, go to Settings > Checkout Rules, find the rule, and delete it.
- When a rule is deleted, it will be automatically removed from all delivery methods where it was applied.
- If you want to Edit a rule, navigate to Settings > Checkout Rules.
- Find the rule you want to edit and click Edit.
- Modify the Condition, Operator, Value, or Action as needed.
- Click Save Changes.
- (Optional) If this rule is applied to a published delivery method, go to Dynamic Checkout and re-Publish Configuration to ensure updates take effect.
Our Checkout rules
The Checkout rules feature aims to be used to enhance your checkout page and process. Below are all the Checkout rules you can create.
| Conditions: | Determinations: | Explanation: |
| Postal code | Contains/Does not contain/Ends with/Is/Is not/Starts with/Pattern match/Regex match* |
Use it for showing or hiding delivery methods based on the postal code of the destination of the parcel |
| Parcel dimensions rules (parcel length, parcel width, parcel heigh) | Contains/Does not contain/Ends with/Is/Is not/Starts with/Pattern match/Regex match |
Use it for filtering mailbox sizes etc. Merchant to calculate and provide the box sizes in the checkout. This applies to total order, not individual item dimension checks. |
| Parcel width | Is/Is not/Less than/Greater than/Greater or equal than/Less or equal than | Helps control delivery methods by filtering based on parcel width. |
| Parcel height | Is/Is not/Less than/Greater than/Greater or equal than/Less or equal than | Helps merchants filter out oversized parcels from certain delivery methods. |
| Weight (grams) | Is/Is not/Less than/Greater than/Greater or equal than/Less or equal than | Useful for restricting shipping options based on parcel weight. |
| Total order value | Is/Is not/Less than/Greater than/Greater or equal than/Less or equal than | Helps set delivery rules based on order value (e.g., free shipping for orders above a threshold). |
| Checkout metadata | Is/Is not/Contains/Does not contain/Starts with/Ends with/Pattern match/In/Not in/Regex match | Allows merchants to create rules based on metadata values from the checkout process. |
Examples of Checkout rules
Show or hide delivery methods based on postal code rules
IF "Postal code" IS "X" THEN "Hide delivery method" X
IF "Postal code" IS "X" THEN "Show delivery method" X
If you have a lot of delivery options, including standard, express, same-day delivery and more, with your Checkout rules, you can ensure that your customers only see the options relevant to their situation. For example, if a customer's address is close to your store, you can only display the cost effective delivery option, reducing their shipping costs and encouraging a purchase.
IF "Postal code" PATTERN MATCH "[AB,PA,FK,KA,HS,IV,KW,ZE]" THEN "Hide delivery method" X
This rule can be used to hide certain methods from Scottish Highlands remote areas for example. Learn more about pattern matching.
Show or hide delivery methods based on parcel dimensions
IF "Parcel length” GREATER THAN OR EQUAL TO 100, AND "Parcel width” GREATER THAN OR EQUAL TO 50, AND "Parcel height” GREATER THAN OR EQUAL TO 20, THEN "Hide delivery method" X, Y, Z
For example, you can use this checkout rule to only show some delivery methods when the parcel is letterbox size.
Text Matching in Checkout Rules: Pattern Match vs Regex Match
When creating Checkout Rules that depend on text-based fields (such as Postal code or Checkout metadata), you can choose between Pattern match and Regex match. Both options allow you to match text values, but they offer different levels of flexibility and complexity.
Pattern match
Pattern match is a simple text-matching method that uses the wildcard *. It does not require any advanced technical knowledge.
A pattern match is like using a shortcut to search for text.
You can use the star symbol * as a blank that can be “anything.”
Think of it like this:
gift*means: “anything that starts with the word gift”*giftmeans: “anything that ends with gift”*gift*means: “anything that contains the word gift anywhere”
You don’t need to know any special rules, just put a * where “anything goes.”
👉 Pattern match = simple rules with one wildcard *
How it works
*matches any number of characters-
Pattern matching is case-sensitive
Example:
gift*matchesgift_box, but notGift_box
Examples
| Field | Pattern | Matches |
|---|---|---|
| Postal code | 10* |
1011, 1023 |
| Checkout metadata | gift* |
gift_wrap, gift_box |
| Checkout metadata | *bundle |
Summer-bundle, Starter-bundle |
When to use Pattern match
Simple, single-value checks
Basic wildcard needs
When case sensitivity is desired
When the format does not need validation
Regex match
Regex (regular expressions) is a more advanced and flexible way to match text. It allows multiple combinations, case-insensitive options, and strict format validation.
Regex is like a super-powered version of text matching.
It can check things that Pattern match cannot, such as:
multiple options at once
→ “10 OR 11 OR 12”ignoring uppercase/lowercase
→ matches “gift”, “GIFT”, “Gift”checking exact structure
→ “4 numbers followed by 2 letters”matching only the beginning or end of text
→ “must end with -bundle”
👉 Regex match = advanced rules that let you be very specific and powerful
How it works
Regex uses special characters to define patterns, such as:
|means OR^means starts with$means ends with\dmeans any digit(?i)means ignore uppercase/lowercase
Examples
| Field | Regex | Matches |
|---|---|---|
| Postal code | `^(10 | 11 |
| Checkout metadata | (?i)gift |
gift, GiftBox, GIFT |
| Checkout metadata | -bundle$ |
values ending in “-bundle” |
| Metadata / promo code | ^SUMMER\d{2}$ |
SUMMER10, SUMMER21 |
When to use Regex match
You need to check multiple options in one rule
Case-insensitive matching
Strict format or length validation
Complex text patterns
Matching values that must appear only at the start or end of a field
Choosing the right method
| Pattern match | Regex match |
|---|---|
|
|
Practical examples where Regex is more powerful
| Scenario | Description | Regex | Why Regex is better |
|---|---|---|---|
| Multiple postal code prefixes (NL) | Hide a delivery method for NL postal codes starting with 10, 11, or 12 | ^(10|11|12) |
Pattern match can only check one prefix per rule, so you would need three separate rules (10*, 11*, 12*). Regex combines all prefixes into one rule, making it cleaner and easier to maintain. |
| Validate Dutch postal code format | Match 4 digits + 2 letters (e.g., 1234AB) | ^\d{4}\s?[A-Za-z]{2}$ |
Pattern match cannot check the exact structure or number of characters. Regex enforces the precise format: 4 digits + optional space + 2 letters. |
| Case-insensitive metadata search | Match “gift” or “free” regardless of casing | (?i)(gift|free) |
Pattern match is case-sensitive, meaning you would need multiple rules for “gift”, “Gift”, “GIFT”, etc. Regex handles all capitalizations in a single rule. |
| Suffix-specific matching | Match values that end with “-bundle” | -bundle$ |
Pattern match can find “bundle” anywhere in the text, but cannot ensure it appears at the end. Regex can enforce an exact ending. |
| Promo codes with structure | Match codes with exactly 3 letters + 2 digits (e.g., ABC12) | ^[A-Za-z]{3}\d{2}$ |
Pattern match cannot check letter/digit patterns or character counts. Regex guarantees the exact format every time. |
| Email domain checks | Match emails ending with @gmail.com or @yahoo.com | @(gmail|yahoo)\.com$ |
Pattern match cannot combine multiple domains or handle special characters like “.” correctly. Regex allows multiple options and precise ending matching in one rule. |
Tips for using Regex
Start simple, then build complexity
Use
^and$to anchor start or end of textAdd
(?i)for case-insensitive rulesUse a backslash
\to escape special charactersTest your patterns with tools like regex101.com
Document complex expressions internally for clarity
Related articles:
→ Dynamic Checkout: Setup & Configuration Guide
→ How to add Dynamic Checkout rates