Request for Guidance on Creating a Custom App to add Custom Shipping Methods on Checkout Page

Topic summary

A developer seeks guidance on building a Shopify app to add custom shipping methods and rates at checkout.

Key Requirements & Limitations:

  • Checkout customization is restricted to Shopify Plus merchants via Checkout Scripts API
  • Standard plan merchants must use the Carrier Service API through custom apps
  • Carrier-calculated shipping feature must be enabled (included with Plus or available as add-on)

Implementation Approach:

  1. Create a custom app in Shopify Admin
  2. Register a carrier service using the CarrierService API endpoint
  3. Set up a callback server endpoint to receive POST requests from Shopify
  4. Return dynamic shipping rates based on cart content, weight, and shipping address

Technical Details:

  • Code examples provided for registering carrier service and handling callback requests
  • Response format includes service name, code, price (in cents), currency, and delivery dates
  • Server endpoint must be publicly accessible to receive Shopify’s requests

Status: The question has been answered with a comprehensive technical solution. Non-Plus merchants may need to upgrade or use existing App Store solutions.

Summarized with AI on November 2. AI used: claude-sonnet-4-5-20250929.

Hello Shopify Team,

I am looking to develop a Shopify app that enables the functionality to add custom shipping methods and rates. The goal is to display these custom shipping methods on the checkout page for customers to select. Could you provide guidance on how to approach this, including any relevant APIs or restrictions?

Thank you!

Hi @Dimtar

Creating a custom Shopify app to add custom shipping methods and rates at checkout is definitely achievable, but it involves understanding Shopify’s architecture and some of its limitations. Here’s a step-by-step guide:

1. Understand Shopify’s Limitations- Checkout Restrictions: For Shopify Plus merchants, the checkout process can be customized using the Checkout Scripts API. If you’re not on Shopify Plus, the checkout cannot be directly modified.

  • Third-Party Apps: If you’re on a standard Shopify plan, you’ll need to rely on custom apps that calculate shipping rates using the Carrier Service API.

2. Approach to Develop the Custom App#### A. Enable Carrier-Calculated Shipping- This feature is required to display custom shipping rates during checkout.

  • Contact Shopify Support to enable this feature if it’s not already available on your plan (it’s included for Plus merchants or available as an add-on for others).

B. Use the Carrier Service API- The Carrier Service API allows you to create custom shipping methods and rates dynamically.

  • The API responds with shipping rates based on the cart’s content, weight, shipping address, and other parameters.
Key Steps to Implement:

1-Set Up a Shopify Custom App:

  • Go to Shopify Admin > Apps > Develop Apps.
  • Create a new custom app and install it on your store.

2-Register a Carrier Service:

  • Use the CarrierService object to register your service.

Example API endpoint for registering:

POST /admin/api/2023-01/carrier_services.json

{

“carrier_service”: {

“name”: “Custom Shipping”,

“callback_url”: “https://your-server.com/custom-shipping”,

“service_discovery”: true

}

}

3-Set Up Your Callback Endpoint:

  • Your app’s server will receive a POST request when Shopify needs to fetch shipping rates.

Example callback response:

{

“rates”: [

{

“service_name”: “Express Delivery”,

“service_code”: “EXPRESS”,

“total_price”: 1000, // Price in cents

“currency”: “USD”,

“min_delivery_date”: “2025-01-21T14:00:00Z”,

“max_delivery_date”: “2025-01-23T14:00:00Z”

},

{

“service_name”: “Standard Delivery”,

“service_code”: “STANDARD”,

“total_price”: 500,

“currency”: “USD”,

“min_delivery_date”: “2025-01-24T14:00:00Z”,

“max_delivery_date”: “2025-01-28T14:00:00Z”

}

]

}

4-Host the App:

  • Use a reliable hosting service like AWS, Google Cloud, or Heroku.
  • Ensure your server uses HTTPS (Shopify requires secure endpoints).

C. Test the Integration- Add test orders to ensure the shipping methods appear correctly at checkout.

  • Verify that rates are calculated as expected based on inputs like weight or destination.

3. Consider Using Webhooks- Use Shopify webhooks to track changes in orders or shipping configurations.

  • Example webhook topics: orders/create, orders/fulfilled.

4. Customize Shipping Labels (Optional)- If you need label printing, integrate with third-party APIs like Shippo or EasyPost for label generation.

5. Shopify Plus (Advanced Customization)- If you’re on Shopify Plus, you can create advanced checkout customizations using Shopify Scripts.

  • Example: Offer discounts or modify shipping rates based on customer tags or order value.

Example Code for the Callback Server (Node.js)

Here’s a basic server setup for handling rate requests:

const express = require(‘express’);

const app = express();

const PORT = 3000;

app.use(express.json());

app.post(‘/custom-shipping’, (req, res) => {

const shippingRates = {

rates: [

{

service_name: “Express Delivery”,

service_code: “EXPRESS”,

total_price: 1500, // in cents

currency: “USD”,

min_delivery_date: “2025-01-21T10:00:00Z”,

max_delivery_date: “2025-01-23T10:00:00Z”

},

{

service_name: “Standard Delivery”,

service_code: “STANDARD”,

total_price: 800,

currency: “USD”,

min_delivery_date: “2025-01-24T10:00:00Z”,

max_delivery_date: “2025-01-28T10:00:00Z”

}

]

};

res.json(shippingRates);

});

app.listen(PORT, () => {

console.log(Server is running on port ${PORT});

});

Final Notes

If you’re on a plan without checkout customization options, you may need to explore alternatives like upgrading to Shopify Plus or using apps from the Shopify App Store that offer similar functionality.

If you need any other assistance, feel free to reply and I will try my best to respond.

Best regards,
Daisy