Customising your Stripe integration

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

Customising the customer billing info

You might want to customise the billing info on your Stripe-generated invoices. You can do this in two main ways (with a bonus third way just for Quaderno customers!).

1. On the front-end

You can add extra info when you tokenise the card in the  custom form on your front-end, like so:

stripe = Stripe(stripePublishableKey);
stripeCardElement = elements.create('card')

stripe.createToken(stripeCardElement, {
  name: $('#customer-name').val(),
  address_line1: $('#address').val(),
  address_city: $('#city').val(),
  address_zip: $('#postal-code').val(),
  address_country: $('#country').val(),

Here we have added the customer's name and address information while creating the token, so that in Stripe's backend the auto-created customer will have all the right information.

2. On the back-end

You can also use the metadata fields available when you create the Stripe Customer on your back end. We're a Ruby shop, so here's an example of us doing this in a Rails back-end:

customer = Stripe::Customer.create(
  :email => '',
  :business_vat_id => 'GB123456789' # optional,
  :shipping => { # optional
    :name => 'Reynholm Industries',
    :address => {
      :line1 => '123 Carenden Road',
      :line2 => 'Suite 201',
      :city => 'London',
      :state => 'London',
      :postal_code => 'EC5M 8AJ',
      :country => 'GB', # 2-letter ISO code
  :metadata => { # optional
    :contact_person => 'Maurice Moss' # billing contact person (only for businesses)
  :source => 'tok_103NCO2eZvKYlo2Cc4lerc1E' # obtained with Stripe.js

We recommend that you at least send the country and postal code of your customer to comply with digital VAT legislation.

3. (Bonus) Use Quaderno Checkout

Quaderno Checkout is the best billing flow for web or mobile, and it builds on top of Quaderno.js to provide your uses with a streamlined, mobile-ready payment experience that is constantly improving. Using Quaderno Checkout, it's easy to add some custom customer billing info as needed. Check it out  here.

Customising the transaction

You might also want to customise both your charges and your subscriptions on Stripe. We are all for it, allowing you to set the tax rates you want to apply and to send us the IP address of the customer, as another piece of location confirmation evidence.

Here's a Rails example of us adding some relevant metadata to a couple of charges while creating them in Stripe:

  :amount => 2420, # total amount (taxes included)
  :currency => 'usd',
  :customer =>,
  :description => 'The Neverending Story, Michael Ende (EPUB)',
  :metadata => {
    :tax_rate => 20,
    :ip_address => request.ip

  :plan => 'awesome',
  :tax_percent => 20,
  :metadata => {
    :ip_address => request.ip

In this case, you can even calculate the taxes with our  Tax API.

All the metadata for charges and subscriptions is optional. Quaderno can make sense of the following fields:

Metadata Description
transaction_type Type of transaction: eservice, ebook or standard. The default is the type of transaction you've select on Quaderno > Preferences.
tax_name Name of the tax, e.g VAT or GST
tax_rate Value of the tax rate, e.g. 20 for a tax rate of 20%.
extra_tax_name Name of a secondary tax for the same charge, e.g. PST
extra_tax_rate Value of a secondary rate for the same charge.
ip_address IP address of the customer
po_number PO number
notes Any note you want to add to the final invoice
tags Tag invoices when they are created e.g. tag1,tag2,tag3