Generate Factur-X Invoices with Ruby
Learn how to easily integrate GoFX into your Ruby stack.
Dealing with complex XML generation in Ruby can be extremely tedious. GoFX abstracts all the EN16931 complexity away. Send a simple JSON payload and get a perfectly compliant hybrid PDF back in milliseconds.
Ecosystem Focus
Integrating Factur-X / EN16931 within the Ruby ecosystem is now seamless. Avoid building complex XML DOMs manually and let GoFX handle the heavy lifting. Generate hybrid PDF/A-3 invoices directly via our REST API.
Prerequisites
Ensure you have Ruby 2.7+ configured in your environment to make outbound HTTP POST requests to the GoFX API.
> Code Example
require "uri"
require "net/http"
url = URI("https://api.gofx.app/v1/invoice/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = http.request(request)
File.binwrite("facture.pdf", response.body)