Customize 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 billing info

To customise 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', :country => 'GB', # 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) } )
Code language: PHP (php)

We recommend that you at least send the country and postal code of your customer to calculate the right tax rates.

Customising 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 } )
Code language: PHP (php)

For one-off charges, Quaderno deducts taxes from the charge’s total amount, but we recommend specifying the applied tax rate as 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.

Metadata

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

MetadataDescription
transaction_typeType of transaction: eservice, ebook, saas, standard, reduced.
The default is the type of transaction you’ve selected in your Preferences page.
skuUnique code of the product or service sold.
tax_nameName of the tax, e.g Sales Tax, VAT, GST, etc.
tax_rateValue of the tax rate, e.g. 20 for a tax rate of 20%.
ip_addressIP address of the customer
po_numberPO number
notesAny note you want to add to the final invoice
tagsTag invoices when they are created e.g. tag1,tag2,tag3

Still need help? Contact us

Updated on