This guide will walk you through enabling automatic billing cycles for you customers. In this example, we will set up a regular billing cycle for a customer and explain how it will automate their invoicing.
Auction Studio's goal is automating your entire Accounts Receivable, especially as it relates to invoicing. As you say in the Getting Started Guide, you can easily generate and issue invoices, but what if you want to automate those steps. Say you know you want your customers invoiced monthly for all outstanding transactions. We should you how to do just that below.
To successfully complete the tutorial, you need to do the following:
To start, we'll need to create a new customer. As in the Getting Started Guide, we will use an External ID. For this example, we assume you have a customer with
id = 652
,
but, again, this could be any number or string that you use to uniquely identify your customer.
One important thing to note, is that in this request, if the customer with the supplied External ID does not exist, we will create one for you with the proper attributes. This makes it convenient and easy to create and update customers without having to keep track of whether or not they already exist. It's also important as you are not required to have an existing customer before creating transactions (as demonstrated in the Getting Started Guide).
Paid.api_key = '{YOUR API KEY}' c = Paid::Customer.by_external_id(652) c.name = 'Awesome Customer' c.email = 'hello@paidlabs.com' c.phone = '4155069330' c.address_line1 = '2261 Market Street' c.address_line2 = '#567' c.address_city = 'San Francisco' c.address_state = 'CA' c.address_zip = '94114' c.billing_cycle = 'monthly' c.save
#<Paid::Customer id=cus_DLjf9aDKE8ekdncz 0x00000a> JSON: { "id": "cus_DLjf9aDKE8ekdncz", "object": "customer", "name": "Awesome Customer", "email": "hello@paidlabs.com", "external_id": "652", "address_line1": "2261 Market Street", "address_line2": "#567", "address_city": "San Francisco", "address_state": "CA", "address_zip": "94114", "phone": "4155069330", "allow_ach": true, "allow_check": true, "allow_credit_card": true, "allow_wire": true, "terms": 30, "billing_type": "invoice", "billing_cycle": "monthly", "stripe_customer_id": nil }
With
billing_cycle = 'monthly'
,
Auction Studio will automatically generate invoices for this customer on the 1st of every month. Now all you need to do is create transactions, being sure to use the same External ID (or Auction Studio customer ID), and Auction Studio will include all those transactions on the following month's invoice.
Auction Studio offers other billing cycles, such as
manual
and
weekly
.
You can customize many things about how the customer is invoiced. For further detail, check out our Full API Reference.