Save a Invoice to the Finished Order

Topic summary

A developer is working on a custom invoice generation system and needs to attach generated invoices (XML/JSON format) to completed Shopify orders.

Key Points:

  • Shopify does not automatically generate invoices for standard plans (only Shopify Plus with custom automation)
  • The developer already has an external invoice generation system in place

Suggested Solution:

  • Use Order Metafields or Order Notes via GraphQL Admin API to link invoice data to orders
  • Store invoice content (JSON, XML) or file URLs as metafields attached to specific orders
  • For customer-facing invoices, consider sending via custom email automation

Alternative Options:

  • Third-party apps like Sufio or Order Printer Pro
  • Draft Orders API (though not applicable for this use case)

The developer plans to implement the metafields approach.

Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Hey, good day,

Good day, I have a question about how Shopify works (mainly with regard to requisitions and GraphQL). After finalizing an order, I create a system to generate invoices for the order. Does Shopify generate the invoice automatically? If it doesn’t, how can I send the invoice JSON for the specific order via GraphQL?

Hi @flavio_ns

Shopify doesn’t generate invoices automatically for completed orders unless you’re using Shopify Plus with custom automation. However, you can generate invoices using the Draft Orders API or a third-party invoicing app like Sufio or Order Printer Pro.

1 Like

Yeah but, i already got a Invoice generation here that creates it (XML and etcetera), how i can set the Order to the Invoice i got?

Hmm, you can link your generated invoice to the order using Shopify’s Order Metafields or Order Notes. With the GraphQL Admin API, you can store your invoice data (JSON, XML, or a URL) inside a metafield attached to the order. This way, the invoice stays linked and accessible. If you need the invoice to be visible to customers, you can also send it via the Order Email using a custom app or automation.

1 Like

I’ll try, thanks!

1 Like