Fails to update `localizedFields` using `orderCreate`

mutation OrderUpdateWithLocalizedField($id: ID!, $tags: [String!]!, $email: String!, $localizedFields: [LocalizedFieldInput!]!) {
  orderUpdate(
    input: {id: $id, tags: $tags, email: $email, localizedFields: $localizedFields}
  ) {
    order {
      id
      localizedFields(first: 10) {
        nodes {
          value
          key
        }
      }
    }
    userErrors {
      field
      message
    }
  }
}
{
  "id": "gid://shopify/Order/<number>",
  "tags": ["1", "two"],
  "email": "hello@world.com",
  "localizedFields": [{"key": "TAX_CREDENTIAL_BR",
  "value": "30324488249"}]
}

works for email, tags, but not localizedFields.

Response:

{
  "data": {
    "orderUpdate": {
      "order": {
        "id": "gid://shopify/Order/<number>",
        "localizedFields": {
          "nodes": []
        }
      },
      "userErrors": [
        {
          "field": [
            "localizationExtensions",
            "0",
            "value"
          ],
          "message": "Localization extension: 'value' provided is invalid"
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 16,
      "actualQueryCost": 12,
      "throttleStatus": {
        "maximumAvailable": 2000,
        "currentlyAvailable": 1988,
        "restoreRate": 100
      }
    }
  }
}

Why not let orderCreate to have localizedFields?
It is present in draftOrderCreate and in orderUpdate.
Does it mean that to update the value I need to first have it and the only way to do it creating the draftOrder first?

I am using Admin API 2025-07.

Does not work either with TAX_CREDENTIAL_BR or SHIPPING_CREDENTIAL_BR.
Also, the order was created for Brazil. So it should match.

UPDATE:
I checked user errors, and it says the value is invalid. What value would be valid?
It looks like the message is kinda legacy too as it is not localizationExtensions but rather localizedFields

Ok. It worked with:

the number from the example:
39053344705

Hey @madfcat, thanks for confirming that. Sounds like the value provided in your initial example wasn’t a valid Brazil CPF number.

I found an interesting article here explaining how these algorithms work.

Good one!

What about brazilian orders not possible to be created from the draft orders?
It does not work either from admin or from graphql mutation requests.

Video here

Thanks for the video. That is interesting. Can you share how the draft order was created? Did you create it in the admin or did you create it through the API?

I tested by creating a draft order in the admin and was able to add that number and mark the order as paid without any issues.

It does not matter how the order is created (from admin panel or graphql-wise). Always the same result.

Interesting. This may not be specific to the localized field then, as it appears to be saving correctly to the order.

Are you testing in a development store? There are some limitations with testing orders in Development stores. What I would recommend is to use the invoice URL to complete the checkout using the bogus gateway and see if that completes the order properly.

https://help.shopify.com/en/partners/manage-clients-stores/development-stores/test-orders-in-dev-stores

It worked with the invoice and Bogus test gateway.

But for me the idea is to complete the draft order without invoice step.
It does not work only for the Brazilian draft orders from my experience. I did not have any issues with other countries. However, I did not test all the existing countries.

Any idea how to make it work?

Thanks for confirming that. Since I wasn’t able to replicate, it does seem like there may be a setting on the store that is conflicting with orders to Brazil.

I would suggest reaching out to our support team through the help center