Skip to content

Set routing

PUT/admin/v1/stores/{store_id}/inventory/routing
  • settings:write

Save the routing rules and, when sent, the ranking of locations. Send If-Match: "v{version}" ("v0" before the first save). ; staff limited to some locations can't.

Path parameters

  • store_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

Headers

  • If-Matchstring · or null

    ETag from the last read, e.g. "v3"

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • rulesarray of enumsrequired

    The rules on, in the order they apply; each at most once.

    • same_region
    • one_shipment
    • ranked
  • rankingarray of strings · or null

    Locations first to last; locations left out lose their rank. Omit to keep the ranking.

Returns

200 The routing rules.

Errors

  • 403forbiddenMissing permission, or limited to some locations.
  • 412precondition_failedThey changed since they were read.
  • 422validation_failedA rule twice, or an unknown or repeated location.