Carrier Service Response Metadata

Why doesn’t Shopify save metadata from CarrierService response?

Summary

When returning shipping rates from a Carrier Service endpoint, the metadata field in the response is not persisted to the order’s shipping line, making it impossible to access critical shipping information needed for downstream order processing.

The Problem

According to the Carrier Service API documentation, the rate response supports a metadata object for “additional information about the rate”. However, when an order is placed with a carrier service rate, this metadata is completely discarded and not available anywhere on the order.

Our Use Case

Currently, we return rates like this:

json

{
  "rates": [
    {
      "service_name": "UPS Worldwide Expedited DDP",
      "service_code": "ups.worldwide_expedited_DDP",
      "total_price": "20578",
      "currency": "USD",
      "description": "Duties & Taxes Included",
      "metadata": {
        "zonos_quote_id": "quote_abc123",
        "duties_amount": "9680",
        "taxes_amount": "10380",
        "fees_amount": "518"
      }
    }
  ]
}

But when we query the order’s shipping line after checkout, the metadata is nowhere to be found - not on the shipping line, not in metafields, not anywhere.

Questions

  1. Why is the metadata field documented if it’s not persisted? What is its intended purpose?

  2. Is there any way to retrieve this data after an order is placed? Even if it’s stored temporarily somewhere?

  3. What is the recommended approach for passing carrier-calculated data through to orders?

  4. Are there plans to support metadata persistence in the future?

Current Workaround

We’re forced to make additional API calls during order processing to recalculate or re-fetch shipping information that we already calculated during checkout. This creates:

  • Additional latency in order processing

  • Potential for rate discrepancies if shipping costs change between checkout and fulfillment

  • Unnecessary load on our systems

  • Risk of errors if the original quote expires

Request

It would be extremely valuable if Shopify could either:

  1. Persist the metadata field to the shipping line (as metafields or a dedicated field)

  2. Provide clear documentation about what the metadata field actually does

  3. Offer an alternative mechanism for carrier services to pass data through to orders

This would enable carrier service apps to provide a much better experience for merchants who need detailed shipping and customs information for international orders.

1 Like

Hey @Brad_Kubie, the REST docs you linked don’t include a metadata field in the carrier service response. The correct field is metafields, which is documented in the GraphQL CarrierService docs. GraphQL is the preferred method for interacting with Shopify APIs. About REST to GraphQL migration

A similar question was just answered here: Metafields in carrierService response That thread covers the correct metafields format and where they’re accessible.

I can see how your request would be valuable and useful and I have passed that on as a feature request.

Good to know! Thanks @KyleG-Shopify

1 Like

+1 for this feature (to be able to feed information back into the order)

1 Like