Collecting data from Stripe

If you’d like to customize your Stripe integration, to provide yourself and Quaderno with more information about your customers, we’ve made it easy to do!

Customizing the billing info

To customize the billing info on your Quaderno invoices, please use the address and tax info fields available when you create a Customer object on your Stripe account. Here’s an example of us doing this in a Ruby app:
customer = Stripe::Customer.create(
  :name => 'Reynholm Industries',
  :email => 'billing@reynholm.co.uk',
  :address => {
    :line1 => '123 Carenden Road',
    :line2 => 'Suite 201',
    :city => 'London',
    :state => 'London',
    :postal_code => 'EC5M 8AJ',         # Recommended.
    :country => 'GB',                   # Recommended. 2-letter ISO code
  },
  :tax_id_data => [{                    # Optional
    :value => 'GB123456789',
    :type => 'eu_vat'
  }],
  :metadata => {                        # Optional
    :contact_person => 'Maurice Moss'   # Billing contact person (only for businesses)
    :email => 'maurice@reynholm.co.uk', # Overrides billing email
  }
)
Creating a Stripe's Customer object
Overriding the email field inside metadata is a useful way of issue invoices to a different email than the one specified in your Quaderno account as your billing email.
 
⚠️
We recommend sending at least the country and postal_code of your customer to calculate the right tax rates.

Customizing the transaction info

Here’s a Ruby example of how to create charges and subscriptions on Stripe in order to track taxes and issue invoices on Quaderno:
Stripe::Charge.create(
  :amount => 2420, # total amount (taxes included)
  :currency => 'usd',
  :customer => customer.id,
  :description => 'The Neverending Story, Michael Ende (EPUB)',
  :metadata => {
    :tax_rate => 20,
    :sku => 'prod_99999', # use the same product code in Quaderno 
    :ip_address => request.ip, 
  }
)

customer.subscriptions.create(
  :plan => 'awesome',
  :default_tax_rates => ['txr_xxxxxxxxxxxx'], # recommended
  :metadata => {
    :ip_address => request.ip
  }
)
Creating Stripe charges and subscriptions that can track taxes with Quaderno
 
For one-off charges, Quaderno deducts taxes from the charge’s total amount, but we recommend specifying the applied tax rate as Stripe's metadata.
For subscriptions, we support both the tax_percent field (deprecated) and the default_tax_rates array (recommended). If you use the latter, remember you need to create a Tax Rate object first.
In all cases, you can calculate the right tax rate you must apply with our Tax API.
If you sell digital products, we also recommend sending your customer’s IP address as a piece of location confirmation evidence for VAT MOSS. Read more here.

Optional metadata for charges and subscriptions

All metadata for charges and subscriptions are optional. Quaderno can make sense of the following fields inside the metadata field:
Stripe's metadata Quaderno can use
Metadata
Description
Type of transaction: eserviceebooksaas, standardreduced. The default is the type of transaction you’ve selected in your Preferences page.
Unique code of the product or service sold.
Name of the tax, e.g Sales Tax, VAT, GST, etc.
Value of the tax rate, e.g. 20 for a tax rate of 20%.
IP address of the customer
PO number
Any note you want to add to the final invoice
Tag invoices when they are created e.g. tag1,tag2,tag3

Related guides