Using REST API to get a single order by name when name contains a # prefix

Topic summary

Issue: Retrieving a single Shopify order via REST API fails when the order name contains the default # prefix (e.g., #6298). Queries return all orders instead of the specific one, or return nothing when the # is omitted.

Root Cause: The # character in URL parameters causes parsing issues. Standard URL encoding (%23) and various query formats initially failed to resolve the problem.

Working Solutions:

  • Use the format query=name:<order_name> instead of name=<order_name>
    • Example: /admin/api/2023-07/orders.json?query=name:#6298 or with %23 encoding
  • Upgrade to newer API versions (2024-04+), where /orders.json?name=#110469 works without special encoding
  • Workaround: Change the store’s order prefix from # to something else (e.g., US, CA)

Key Notes:

  • Older API versions appear broken for this use case
  • The issue affects standard Shopify plans; GraphQL queries handle the # prefix correctly
  • Adding &status=any parameter alone does not resolve the issue
  • The problem persisted for 9+ months before community members identified the query=name: format solution
Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

We have it working now with /admin/api/2024-04/orders.json?name=#110469 (no encoding)

Older API versions seem to be broken.