Using the Rate Lab Interface
Rate Lab’s workspace is built around three panels that work together to help you design and test shipping rates. This guide will show you how to use each panel and the tools available to you.The three-panel workspace
Left panel: Your Liquid template
This is your code editor where you write shipping logic using Liquid. Think of it like editing a theme template, but for shipping rates. What you can do:- Write Liquid code with syntax highlighting and auto-completion
- Access order data through the
shopify_rate_checkobject - Calculate shipping prices using Liquid filters and logic
- Return one or more shipping rate options for customers
- The editor supports standard keyboard shortcuts (Ctrl/Cmd+S to save, Ctrl/Cmd+F to find)
- Liquid syntax errors are highlighted as you type
- You can undo/redo changes normally
Top right panel: Order context (test data)
This panel shows the order information that Shopify sends to your rate function. It’s formatted as JSON and includes everything you need to make shipping decisions. What’s included:line_items- Products in the cart with quantities, weights, prices, SKUs, and propertiesdestination- Where the order is shipping (country, province, city, postal code)currency- The currency for this order- Cart totals, item counts, and more
- Edit this data to test different scenarios (heavier orders, different countries, more items)
- Try edge cases: single items, huge orders, international destinations
- See how your rate logic responds to different inputs
- Click Run after editing to recalculate rates
grams field in a line item to test how your calculation responds.
Bottom right panel: Rate results
This read-only panel shows exactly what shipping options customers will see at checkout after your Liquid template runs. What you’ll see:service_name- The shipping method name (e.g., “Standard Shipping”, “Express”)service_code- An internal identifiertotal_price- The price in cents (e.g., 995 = $9.95)currency- The currency codedescription(optional) - Additional information shown to customers
Toolbar controls
Run button Click this whenever you change your Liquid template or test data. It recalculates the rates and updates the results panel. Template name field Give your rate function a descriptive name like “Holiday Shipping Rules” or “Multi-Vendor Rates”. This helps when you have multiple rate functions. Auto-update indicator When active, this shows that your workspace automatically updates when changes are saved. You’ll see your rate results refresh in real-time.Common workflows
Building a new rate from scratch
-
Clear the left panel and start with this basic structure:
-
Add Liquid logic to calculate
total_pricebased on order data - Click Run to test
- Iterate until the rate behaves as expected
Testing different scenarios
- Start with your working template in the left panel
- Edit the order context (top right) to simulate different orders:
- Change item quantities
- Modify destination country or postal code
- Adjust product weights or prices
- Click Run after each change
- Verify the rate results (bottom right) match your expectations
Copying an example
- Browse the Shipping Examples section
- Copy the Liquid code from an example that’s close to what you need
- Paste it into your left panel
- Modify the logic for your specific requirements
- Test with your order data
Quick tips
Prices are in cents Always work with prices in cents/pennies. $9.95 = 995, not 9.95. Use the json filter When outputting strings in JSON, use{{ my_variable | json }} to properly escape quotes and special characters.
Test edge cases
Try extreme scenarios: empty carts, single items, international orders, very heavy shipments. Your rate logic should handle all cases gracefully.
Check your math
If rates seem wrong, use Liquid’s math filters step by step and verify each calculation in the results.
Next steps
- Understanding Your Data - Learn about all the order information available in your Liquid templates
- Shipping Examples - Browse ready-to-use templates for common scenarios
- Troubleshooting - Fix common issues and error messages