Hi, I’m implementing a Shopify store and I need technical help managing VAT ID (NIF/CIF) in the checkout to comply with Spanish invoicing regulations.
I’ve added a mandatory field in the checkout where customers enter their NIF/CIF. Shopify Support has informed me of the following:
-
The NIF/CIF value is not automatically stored in the customer profile.
-
Custom checkout fields may be saved in:
-
order custom attributes
-
order or customer metafields
-
order note attributes
-
They confirmed that I can retrieve this value from the Order object after the payment is completed via customAttributes. However, there is no clear documentation explaining:
-
How to ensure this value (NIF/CIF) is reliably stored
-
How to persist this value as a customer metafield for future invoices
-
How to work with the Admin GraphQL API to:
-
retrieve NIF/CIF from the order
-
store it in the customer’s metafield
-
access it later when generating invoices
-
What I need to know
-
What is the correct and documented way to access the checkout NIF/CIF attribute from the
Orderobject using GraphQL? -
Does anyone have a working GraphQL mutation example that saves this value into a customer metafield?
Something similar to:
mutation customerUpdate($input: CustomerInput!) {
customerUpdate(input: $input) {
customer {
id
metafields(first: 10) {
edges {
node {
namespace
key
value
}
}
}
}
}
}
- What is the recommended best practice to automate this process, ensuring no manual steps are required?
End goal
To issue legally valid invoices in Spain, I must include the customer’s NIF/CIF. I need to guarantee that this value:
-
is captured correctly at checkout

-
is stored in a persistent way

-
is accessible when generating invoices

If anyone has implemented this, or has official documentation, examples, or guidance, it would be extremely helpful.
Thank you!
Hola, estoy implementando una tienda en Shopify y necesito ayuda técnica con la gestión del NIF/CIF en el checkout para cumplir con la normativa española de facturación.
Actualmente, he añadido un campo obligatorio en el checkout donde el cliente introduce su NIF o CIF. El soporte de Shopify me ha informado lo siguiente:
-
El NIF/CIF no se almacena automáticamente como parte del perfil del cliente.
-
Los campos personalizados del checkout pueden guardarse en:
-
order custom attributes (atributos personalizados del pedido)
-
metafields en el pedido o en el cliente
-
order note attributes
-
Me han confirmado que puedo recuperar estos valores desde el objeto Order una vez completado el pago, a través de customAttributes. Sin embargo, no existe documentación clara para:
-
Cómo asegurar que este dato (NIF/CIF) siempre se guarde de forma persistente
-
Cómo mover ese dato al metafield del cliente de forma automática
-
Cómo usar la Admin GraphQL API para:
-
recuperar el NIF/CIF del pedido
-
guardarlo en el metafield del cliente
-
acceder a dicho metafield al generar una factura
-
Lo que necesito saber
-
¿Cuál es la forma correcta y documentada de acceder al atributo NIF/CIF del checkout desde el objeto
Orderusando GraphQL? -
¿Alguien tiene un ejemplo funcional de mutación GraphQL para guardar ese valor en un metafield de cliente?
Algo como:
mutation customerUpdate($input: CustomerInput!) {
customerUpdate(input: $input) {
customer {
id
metafields(first: 10) {
edges {
node {
namespace
key
value
}
}
}
}
}
}
- ¿Cuál sería la mejor práctica para que este proceso sea automático y no requiera intervención manual?
Objetivo final
Tengo que generar facturas legales en España, y para ello es obligatorio incluir el NIF/CIF del cliente. Necesito garantizar que este valor:
-
se capture correctamente en el checkout

-
se guarde de forma persistente

-
esté accesible al generar la factura en mi flujo de trabajo

Si alguien ha implementado esto o tiene recursos, ejemplos o documentación oficial, cualquier orientación sería de gran ayuda.
¡Muchas gracias!