How to obtain tax number information in orders from Mexico

AI-generated summary

Issue Identified:
The localizationExtensions GraphQL query successfully retrieves Brazilian tax numbers (CPF/CNPJ) but returns empty data for Mexican tax numbers (RFC).

Solution Found:
Mexican RFC numbers are accessible through a new API endpoint introduced in the 2025-01 version of Shopify’s GraphQL API.

Implementation:

  • Query the localizedFields connection on the order object instead of localizationExtensions
  • Use the following structure:
localizedFields(first: 100) {
  nodes {
    title
    value
  }
}
  • Must upgrade to API version 2025-01, as this change was only introduced at the beginning of 2025

Status: Resolved - Solution confirmed working by multiple users. A screenshot demonstrates successful retrieval of the RFC data.

{“query”:“query { order(id: “gid://shopify/Order/*****”) { name localizationExtensions(first: 100) { edges { node { key countryCode purpose title value } } }}}”}

We obtain the tax ID information of the order through the above interface. But I found a problem. Brazilian tax numbers can be obtained successfully, but Mexican tax numbers cannot be obtained. May I ask how to solve this problem.

Successfully retrieved data from data1, but when retrieving data from data2, the returned data was empty.

data1: CPF/CNPJ:00755720873

data2: RFC:BORO630127DU8

I was just looking for the same number but as you say the endpoint you mention doesn’t include the RFC number on Mexican orders.

I noticed on the 2025-01 version of the GraphQL API there’s a connection on the object order that’s called localizedFields which supposedly should contain the same data, however when I try to query that version of the API it just returns ‘bad request’, regardless of what I query it with, so I haven’t yet been able to see if that localizedFields connection contains the RFC number for Mexico.

If anyone knows where else I can find this number in the GraphQL API, I’d love to know, thank you!

Ok I managed to fix the bad request issue I had and indeed if you query

localizedFields(first: 100) {
    nodes {
          title
          value
     }
}

on the order object, you will indeed get the RFC number on Mexican orders, but you need to switch to the 2025-01 version of the API, since it’s a change that has only just been introduced at the beginning of this year.

Hope it works for you!

This worked for me, thank you @Foxfur !