---
title: "Spree Commerce Braintree Recurring Billing and Spree integration"
description: "With Braintree Recurring Billing you can easily accept repeat online payments for software, subscription-based businesses, donations, and more.The benefits of using Braintree Recurring Billing for your ecommerce business: Flexible pricing Create custom pricing plans for your customers. Set up discounts, add-ons, promotional periods, and rewards. Prorated subscriptions Your customers have the ability…"
url: https://spreecommerce.org/integrations/braintree-recurring-billing-and-spree-integration/
---

[Integrations](https://spreecommerce.org/integrations.md)

[Payment](https://spreecommerce.org/integrations-cat/payment.md)[Subscriptions](https://spreecommerce.org/integrations-cat/subscriptions.md)

August 20, 2024

# Braintree Recurring Billing and Spree integration

With [Braintree Recurring Billing](https://www.braintreepayments.com/pl/features/recurring-billing) you can easily accept repeat online payments for software, subscription-based businesses, donations, and more.  
The benefits of using Braintree Recurring Billing for your ecommerce business:

### **Flexible pricing**

Create custom pricing plans for your customers. Set up discounts, add-ons, promotional periods, and rewards.

### **Prorated subscriptions**

Your customers have the ability to upgrade or downgrade their subscriptions at any time.

### **Securely store billing info**

Keep your customers’ information in the [Braintree Vault](https://articles.braintreepayments.com/control-panel/vault/overview) to make repeat billing easy.

### **Help increase successful transactions**

Customize your settings to automatically retry past-due subscriptions and notify customers with custom emails.

### **Reliable reporting**

- **View and manage everything in one place**

Search for plans and subscriptions, and filter by pricing plan, subscription ID, billing periods remaining, and price right from your Control Panel.

- **Stay up to date**

Configure webhooks to receive the status of a subscription and get instant notifications when significant events occur.

## How to integrate Braintree Recurring Billing with Spree

With Braintree’s recurring billing, you can charge your customers automatically in monthly increments.

To set this up, you’ll need to [create a plan](https://articles.braintreepayments.com/guides/recurring-billing/plans) in the Control Panel and [store your customers in the Vault](https://developers.braintreepayments.com/guides/customers/ruby#create). Then use [`Subscription.create()`](https://developers.braintreepayments.com/reference/request/subscription/create/ruby) to associate each customer’s preferred payment method with the plan.

### **Integration steps**

In addition to the steps listed below, you must [create customers with payment methods](https://developers.braintreepayments.com/guides/customers/ruby#create) in the Vault before you can use recurring billing.

1. [Creating plans](https://developers.braintreepayments.com/guides/recurring-billing/plans)
2. [Creating subscriptions](https://developers.braintreepayments.com/guides/recurring-billing/create/ruby)
3. [Managing subscriptions](https://developers.braintreepayments.com/guides/recurring-billing/manage/ruby)

### **Subscription statuses**

![Braintree Recurring Billing integration with Spree Commerce](https://cdn.sanity.io/images/bf8853mr/production/a018ac1ca1f7a011781ef31d4941bf02efc1b1f2-775x677.png?w=1280&auto=format)

### Pending

_Pending_ subscriptions are subscriptions that have not started yet. For example, if you create a subscription with a specific billing date in the future, the subscription will start out as _Pending_.

### Active

_Active_ subscriptions will be charged on the next billing date. You can get the dates from the [subscription object](https://developers.braintreepayments.com/reference/response/subscription/ruby). Subscriptions in a trial period are _Active_.

### Past Due

> NOTE Braintree can send email notifications to your customers when their subscription becomes past due. See this [support article](https://articles.braintreepayments.com/guides/recurring-billing/email-notifications) for more information.

If a payment for a subscription fails, the subscription status will change to _Past Due_. You can manually retry the charge, or you can [set up logic in the Control Panel](https://articles.braintreepayments.com/guides/recurring-billing/recurring-advanced-settings#automatic-retries) to automatically retry a declined or failed charge at specific intervals. Also, a past due subscription will be automatically retried if [the payment method associated with the subscription is updated](https://developers.braintreepayments.com/guides/recurring-billing/manage/ruby#updating-past-due-subscriptions) and you have [proration enabled](https://articles.braintreepayments.com/guides/recurring-billing/recurring-advanced-settings#proration). If the retried transaction is successful and the subscription has not passed its final billing date, the status will change to _Active_.

If a retried transaction is unsuccessful, the balance on the past due subscription will continue to increase every billing cycle, and we’ll continue to retry the transaction each billing cycle, either indefinitely or until the number of cycles in the subscription is reached. If all retries are unsuccessful, the subscription’s status will remain _Past Due_ until the subscription a) reaches the specified [number of billing cycles](https://articles.braintreepayments.com/guides/recurring-billing/billing-cycles#number-of-billing-cycles), and the status changes to _Expired_, or b) is canceled.

### Expired

Subscriptions are _Expired_ when they have reached the specified [number of billing cycles](https://articles.braintreepayments.com/guides/recurring-billing/billing-cycles#number-of-billing-cycles).

### Canceled

If you [cancel](https://developers.braintreepayments.com/reference/request/subscription/cancel/ruby) the subscription, the status will be _Canceled_ and no further billing will occur.

For more information check out [Braintree’s Developer Guides for Recurring Billing](https://developers.braintreepayments.com/guides/recurring-billing/overview).
