Main site

Running Your Code

With JsRates, you can validate your shipping rate code before it goes live to process requests received from your checkout page.

  • Automatic Test Input Generation: Upon installation, JsRates generates test input data using your first product as the cart item, the default shop address as the shipping origin, a random destination address, and your shop’s currency and language.

  • Custom Test Input Data: You can create sample input JSON that matches Shopify's format for shipping rate requests. This data includes cart items, addresses, currency, and locale, and can be customized to test various scenarios like different products, addresses, and currencies.

  • Configuring Test Input Data:

    1. Go to the Editor page.
    2. Click on the More Actions dropdown.
    3. Choose Test data to open the configuration popup.
    4. Add product variants, and specify origin and destination addresses, currency, and locale.
    5. Use Google address autocomplete to ensure full address details, including lat/long.
    6. Save your changes to maintain the test setup.
  • Executing the Test Run:

    1. Confirm that the test input data has all the necessary information for the shipping code you test.
    2. Head over to the Editor page.
    3. Open the More Actions dropdown.
    4. Click Run to start the code on the JsRates server.
    5. View the results in the output window at the bottom post-execution.
    6. Review the output to fine-tune your code or input data, optimizing your shipping rate solution.

Configuring test input data in JsRates