Carrier service not called when attaching to shipping zone (Admin) – intermittent behavior

Hi everyone,

We have a carrier-calculated shipping app and are seeing inconsistent behaviour when merchants try to attach our carrier service via Admin → Shipping & delivery → Zones → Add rates → Carrier.

In some cases, Shopify shows our carrier services correctly. In other cases, the Admin UI shows an empty list and Shopify never calls our carrier callback endpoint at all (confirmed via logs).

Is this consistent with your experience?

  • Are there documented best practices for admin vs checkout carrier behavior?

  • Any known invalidation triggers we should account for?

Thanks in advance!

Below is the code related details

app.post(“/api/carrier-service/create”, async (_req, res) => {

try {

const carrier_service = new shopify.api.rest.CarrierService({

session: res.locals.shopify.session,

});

carrier_service.name = “Fast Courier”;

carrier_service.callback_url =

“https://shop.test.com.au/api/shipping-rates”;

carrier_service.service_discovery = true;

await carrier_service.save({

update: true,

});

res.status(200).send(carrier_service);

} catch (error) {

console.log(“carrier-create=”, error);

res.status(500).send(error);

}

});

Hi @suraj_rawat

The first thing I’d recommend is to migrate to using the GraphQL API - the REST API is legacy and may have inconsistent behavior. Following from that, you could be seeing this behaviour due to the carrier services not being associated with a location.

The Admin UI uses the availableCarrierServices query which returns carrier services and their associated shop locations. If a carrier service isn’t associated with the location configured in a shipping profile/zone, it won’t appear in the Admin dropdown.

You can verify this by running this GraphQL query:

query {
  availableCarrierServices {
    carrierService {
      id
      name
      active
      callbackUrl
      supportsServiceDiscovery
    }
    locations {
      id
      name
    }
  }
}

If your carrier service has an empty locations array for certain shops, that explains the intermittent behavior.

Hey Liam, Thanks for responding. As you said I ran the availableCarrierServices query and it correctly returns the locations. The carrier also appears in the Shopify admin dropdown. However, the callback URL is never being triggered—I’ve confirmed this by checking the server logs and no requests are coming in.

Result of the GraphiQL query

{
  "data": {
    "availableCarrierServices": [
      {
        "carrierService": {
          "id": "gid://shopify/DeliveryCarrierService/71941619891",
          "name": "Fast Courier",
          "active": true,
          "callbackUrl": null,
          "supportsServiceDiscovery": true
        },
        "locations": [
          {
            "id": "gid://shopify/Location/31663947821",
            "name": "Show Room"
          },
          {
            "id": "gid://shopify/Location/79449718963",
            "name": "Warehouse"
          },
          {
            "id": "gid://shopify/Location/79449751731",
            "name": "Main Store"
          },
          {
            "id": "gid://shopify/Location/79449784499",
            "name": "To Be Sorted"
          }
        ]
      },
      {
        "carrierService": {
          "id": "gid://shopify/DeliveryCarrierService/75620090035",
          "name": "Carrier Service",
          "active": true,
          "callbackUrl": null,
          "supportsServiceDiscovery": true
        },
        "locations": [
          {
            "id": "gid://shopify/Location/31663947821",
            "name": "Show Room"
          },
          {
            "id": "gid://shopify/Location/79449718963",
            "name": "Warehouse"
          },
          {
            "id": "gid://shopify/Location/79449751731",
            "name": "Main Store"
          },
          {
            "id": "gid://shopify/Location/79449784499",
            "name": "To Be Sorted"
          }
        ]
      },
      {
        "carrierService": {
          "id": "gid://shopify/DeliveryCarrierService/75620286643",
          "name": "australia_post_mypost_business",
          "active": true,
          "callbackUrl": null,
          "supportsServiceDiscovery": true
        },
        "locations": [
          {
            "id": "gid://shopify/Location/31663947821",
            "name": "Show Room"
          },
          {
            "id": "gid://shopify/Location/79449718963",
            "name": "Warehouse"
          },
          {
            "id": "gid://shopify/Location/79449751731",
            "name": "Main Store"
          },
          {
            "id": "gid://shopify/Location/79449784499",
            "name": "To Be Sorted"
          }
        ]
      },
      {
        "carrierService": {
          "id": "gid://shopify/DeliveryCarrierService/43051548717",
          "name": "sendle",
          "active": true,
          "callbackUrl": null,
          "supportsServiceDiscovery": true
        },
        "locations": [
          {
            "id": "gid://shopify/Location/31663947821",
            "name": "Show Room"
          },
          {
            "id": "gid://shopify/Location/79449718963",
            "name": "Warehouse"
          },
          {
            "id": "gid://shopify/Location/79449751731",
            "name": "Main Store"
          },
          {
            "id": "gid://shopify/Location/79449784499",
            "name": "To Be Sorted"
          }
        ]
      }
    ]
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 3,
      "actualQueryCost": 3,
      "throttleStatus": {
        "maximumAvailable": 2000,
        "currentlyAvailable": 1997,
        "restoreRate": 100
      }
    }
  }
}