Skip to main content

Integrate Carrier Shipping Rate API with Subscription Portal

Updated over a month ago

Live carrier shipping rates are used when merchants want to allow end customers to change the delivery date of an upcoming subscription order. By default, Shopify fetches shipping rates based on the order creation date, not the delivery date. Since shipping availability and pricing can vary by date, Recurpay allows you to fetch real-time shipping rates from carriers at the moment the delivery date is updated, ensuring accurate shipping options and charges for the newly selected date.


Why use live carrier shipping rates for delivery date changes?

When live carrier rates are enabled alongside Recurpay, merchants can:

  • Show accurate shipping rates to customers when delivery dates change
    Carriers may offer different services or pricing depending on the selected delivery date. Customers can clearly see available shipping options and costs before confirming the new date.

  • Reduce operational exceptions
    Prevent under-charging or manual shipping corrections when delivery dates shift.


How it works?

Live carrier shipping rates for delivery date changes work by passing the delivery date through Shopify and re-fetching shipping rates when the customer updates that date in the subscription portal.

Step 1: Pass Delivery Date to Shopify Order Attributes

To enable delivery-date–based shipping logic, the delivery date must be passed as an additional parameter in Shopify order attributes.

This can be done by:

This ensures the delivery date is stored at the order level and can be reused later.


Step 2: Display Delivery Date in the Subscription Portal

The passed delivery date can be accessed in the Recurpay subscription portal using the global JavaScript object:

window.recurpay_account

Using this object, you can fetch the delivery date and display it inside the subscription portal via custom JavaScript (Settings > General > Customer Portal), allowing customers to clearly see their upcoming delivery schedule.

window.recurpay_account.subscription.order_data.note_attributes


Step 3: Allow Customer to Update the Delivery Date

When a customer updates the delivery date from the subscription portal:

  • Capture the new delivery date

  • Fetch required details from global object window.recurpay_account.subscription such as :

    • Shipping address

    • Subscribed items (if applicable)

At this point, call the Live Carrier Shipping Rate API to fetch real-time shipping rates based on the newly selected delivery date.

Example: Here is one of the app "Bespoke Shipping" which allows to fetch shipping rates via API: https://parcelintelligence.com.au/cs/documentation/api


Step 4: Fetch and Display Live Shipping Rates

Once the API call is made:

  • Show all available shipping options and display it to the customer. You can add a new section on subscription portal via the custom javascript. You can also add a custom css by navigating to Settings > General > Customer portal.

This allows customers to understand how shipping charges may vary depending on the delivery date they select.


Optional: Let Customers Choose a Shipping Rate based on delivery date

If you want to allow customers to select from multiple available shipping rates:

Save the Selected Shipping Rate for the Next Renewal

  1. Allow the customer to choose a preferred shipping option from the available rates displayed in last step.

  2. Call the Recurpay Subscription Update API to pass the selected shipping rate as a custom shipping charge: https://docs.recurpay.com/reference/update-a-subscription

  3. The selected shipping rate is saved and applied to the next subscription renewal order.


If you face any issues during installation, reach out to our team at help@recurpay.com or click the Instant Call button on your dashboard for real-time assistance. You can also start a live chat anytime we are available 24*7.

Did this answer your question?