# Testing Shipping Thresholds

{% hint style="danger" %}
Setting up shipping threshold tests can be **very technical**, requiring thorough QA and monitoring to ensure tests are set up correctly. Therefore, we suggest working closely with a team of developers or upgrading to our [Pro plan](https://www.shoplift.ai/pricing) before launching a test on shipping thresholds.
{% endhint %}

Testing different free shipping thresholds requires passing test assignment data through to checkout. Here's the recommended approach:

{% stepper %}
{% step %}

#### Step 1: Create a JS API Test in Shoplift

Set up a new JS API test. This will generate two HypothesisIDs (one for each variant) that you will need to reference in your theme and checkout logic.
{% endstep %}

{% step %}

#### Step 2: Expose HypothesisIDs as Cart Attributes

Store the assigned HypothesisID as a cart attribute. This ensures the visitor's test assignment persists through to checkout, where shipping rates are determined.
{% endstep %}

{% step %}

#### Step 3: Create Shipping Methods in Shopify

Configure two separate shipping methods in Shopify, each corresponding to one of your test variants (e.g., free shipping at $50 vs. free shipping at $75).
{% endstep %}

{% step %}

#### Step 4: Implement Assignment Logic

You have two options:

**Recommended: Shopify Function** Write a Shopify Function that reads the cart attribute and returns the corresponding shipping rate at checkout. This approach is cleaner and more stable for checkout-level control.

**Alternative: Theme Logic** Implement similar logic directly in the theme (can do this with JS API or theme tests). This works but offers less reliable control at the checkout stage.
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shoplift.ai/learn/guides/testing-shipping-thresholds.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
