Recurly

Billing Info API

Table of Contents

Lookup an account's billing info

Returns only the account's current billing information.

GET https://:subdomain.recurly.com/v2/accounts/:account_code/billing_info

Attributes

Attribute Description
first_name First name
last_name Last name
address1 Address line 1
address2 Address line 2
city City
state State
country Country, 2-letter ISO code
zip Zip or postal code
phone Phone number
vat_number Customer's VAT Number
ip_address Customer's IP address when updating their billing information
ip_address_country Country of IP address, if known by Recurly
Credit Card Attributes Description
first_six Credit card number, first six digits
last_four Credit card number, last four digits
card_type Visa, MasterCard, American Express, Discover, JCB, etc
month Expiration month
year Expiration year
PayPal Attribute Description
paypal_billing_agreement_id PayPal Billing Agreement ID
Amazon Attribute Description
amazon_billing_agreement_id Amazon Billing Agreement ID
Bank Account Attributes Description
name_on_account The name associated with the account. This may be a person's full name or a business name. name_on_account is used instead of first_name and last_name if the payment method is Bank Account.
routing_number U.S. bank account routing number
account_number Bank account number
account_type Either 'checking' or 'savings'

Example

Response with credit card info

Status: 200 OK
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<billing_info href="http://api.test.host/v2/accounts/1/billing_info" type="credit_card">
  <account href="http://api.test.host/v2/accounts/1"/>
  <first_name>Verena</first_name>
  <last_name>Example</last_name>
  <company nil="nil"></company>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <phone nil="nil"></phone>
  <vat_number>US1234567890</vat_number>
  <ip_address>127.0.0.1</ip_address>
  <ip_address_country>US</ip_address_country>
  <card_type>Visa</card_type>
  <year type="integer">2015</year>
  <month type="integer">11</month>
  <first_six>411111</first_six>
  <last_four>1111</last_four>
</billing_info>

Response with PayPal info

Status: 200 OK
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<billing_info href="http://api.test.host/v2/accounts/1/billing_info" type="paypal">
  <account href="http://api.test.host/v2/accounts/1"/>
  <first_name>Verena</first_name>
  <last_name>Example</last_name>
  <company nil="nil"></company>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <phone nil="nil"></phone>
  <vat_number>US1234567890</vat_number>
  <ip_address>127.0.0.1</ip_address>
  <ip_address_country>US</ip_address_country>
  <paypal_billing_agreement_id>B-1234567890</paypal_billing_agreement_id>
</billing_info>
try {
  $billing_info = Recurly_BillingInfo::get('1');
  print "Billing Info: $billing_info\n";
} catch (Recurly_NotFoundError $e) {
  print "No billing information.\n";
}
account = Recurly::Account.find('1')
billing_info = account.billing_info
account = Account.get('1')
billing_info = account.billing_info
var account = Accounts.Get("1");
var info = account.BillingInfo;

Create an account's billing info (Token)

Creates an account's Billing Information using a token generated by Recurly.js. Returns the account's created Billing Information.

POST https://:subdomain.recurly.com/v2/accounts/:account_code/billing_info

Recurly.js allows you to collect customer Billing Information and tokenize it, preventing your servers from having to handle credit card information. When you send these tokens to Recurly through our API, we unpack the token and update Billing Information accordingly.

When Billing Information is created, it is only saved if valid. If the account has a past due invoice, the outstanding balance will be collected to validate the Billing Information.

If you want to create an account at the same time, you should use the Account API end-point instead and include billing info with your request.

Billing Information Attributes

Parameter Description
token_id A token generated by Recurly.js.

Example

Request

Location: https://your-subdomain.recurly.com/accounts/1/billing_info
Accept: application/xml
Content-Type: application/xml; charset=utf-8
<billing_info>
  <token_id>TOKEN_ID</token_id>
</billing_info>

Response

Status: 200 OK
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<billing_info href="http://api.test.host/v2/accounts/1/billing_info" type="credit_card">
  <account href="http://api.test.host/v2/accounts/1"/>
  <first_name>Verena</first_name>
  <last_name>Example</last_name>
  <company nil="nil"></company>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <phone nil="nil"></phone>
  <card_type>Visa</card_type>
  <year type="integer">2015</year>
  <month type="integer">11</month>
  <first_six>411111</first_six>
  <last_four>1111</last_four>
</billing_info>
$billing_info = new Recurly_BillingInfo();
$billing_info->account_code = '1';
$billing_info->token_id = 'TOKEN_ID';
$billing_info->create();
account = Recurly::Account.find('1')
account.billing_info = {
  token_id: 'TOKEN_ID'
}
account.billing_info.create
account = Account.get('1')
billing_info = account.billing_info
billing_info.token_id = 'TOKEN_ID'
billing_info.save()
var account = Accounts.Get("1");
var info = new BillingInfo(account);
info.TokenId = "TOKEN_ID";
info.Create();

Create an account's billing info (Credit Card)

Creates the account's Billing Information.

POST https://:subdomain.recurly.com/v2/accounts/:account_code/billing_info

Instead of using a token generated by Recurly.js, you can instead submit full credit card and address information when creating Billing Information.

When Billing Information is submitted, it is only saved if valid. If the account has a past due invoice, the outstanding balance will be collected to validate the Billing Information.

If you want to create an account at the same time, you should use the Account API end-point instead and include Billing Information with your request.

The required address fields will correspond to the address requirements configured for your site.

Please note: this API end-point may be used to import Billing Information without security codes (CVV). Recurly recommends requiring CVV from your customers when collecting new or updated Billing Information.

Please note: Recurly strongly recommends using a token generated by Recurly.js rather than directly handling your customer's credit card details.

Billing Information Attributes

Billing Address Parameter Description
first_name First name Required
last_name Last name Required
address1 Address line 1, recommended for address validation
address2 Address line 2
city City
state State
country Country, 2-letter ISO code Strongly Recommended
zip Zip or postal code, recommended for address validation
phone Phone number
vat_number Customer's VAT Number
ip_address Customer's IP address when updating their Billing Information Strongly Recommended
Credit Card Parameter Description
number Credit card number, spaces and dashes are accepted Required
month Expiration month Required
year Expiration year Required
verification_value Security code or CVV, 3-4 digits Strongly Recommended

Example

Request

Location: https://your-subdomain.recurly.com/accounts/1/billing_info
Accept: application/xml
Content-Type: application/xml; charset=utf-8
<billing_info>
  <first_name>Verena</first_name>
  <last_name>Example</last_name>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <number>4111-1111-1111-1111</number>
  <verification_value>123</verification_value>
  <month>11</month>
  <year>2015</year>
</billing_info>

Response

Status: 200 OK
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<billing_info href="http://api.test.host/v2/accounts/1/billing_info" type="credit_card">
  <account href="http://api.test.host/v2/accounts/1"/>
  <first_name>Verena</first_name>
  <last_name>Example</last_name>
  <company nil="nil"></company>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <phone nil="nil"></phone>
  <card_type>Visa</card_type>
  <year type="integer">2015</year>
  <month type="integer">11</month>
  <first_six>411111</first_six>
  <last_four>1111</last_four>
</billing_info>
$billing_info = new Recurly_BillingInfo();
$billing_info->account_code = '1';
$billing_info->first_name = 'Verena';
$billing_info->last_name = 'Example';
$billing_info->number = '4111-1111-1111-1111';
$billing_info->verification_value = '123';
$billing_info->month = 11;
$billing_info->year = 2015;
$billing_info->create();
account = Recurly::Account.find('1')
account.billing_info = {
  :first_name         => 'Verena',
  :last_name          => 'Example',
  :number             => '4111-1111-1111-1111',
  :verification_value => '123',
  :month              => 11,
  :year               => 2015
}
account.billing_info.create
account = Account.get('1')
billing_info = account.billing_info
billing_info.first_name = 'Verena'
billing_info.last_name = 'Example'
billing_info.number = '4111-1111-1111-1111'
billing_info.verification_value = '123'
billing_info.month = 11
billing_info.year = 2015
billing_info.save()
var account = Accounts.Get("1");
var info = account.BillingInfo;
info.FirstName = "Verana";
info.LastName = "Example";
info.PhoneNumber = "111-111-1111";
info.VerificationValue = "123";
info.ExpirationMonth = 11;
info.ExpirationYear = 2015;
info.Create();

Create an account's billing info (Bank Account)

Creates the account's Billing Information with Bank Account details. You will need to have the ACH feature on your site for this call to work.

POST https://:subdomain.recurly.com/v2/accounts/:account_code/billing_info

Instead of using a token generated by Recurly.js, you can instead submit full bank account and address information when creating Billing Information.

When Billing Information is submitted, it is only saved if the required fields are provided and they meet the field validation requirements. If the account has a past due invoice, the outstanding balance will be collected when the Billing Information is updated.

If you want to create an account at the same time, you should use the Account API end-point instead and include Billing Information with your request.

The required address fields will correspond to the address requirements configured for your site.

If you need to set a back dated subscription authorziation date for the NACHA three year re-authorization rule, do so on the Create Subscription call using the "bank_account_authorized_at" attribute.

Please note: Recurly strongly recommends using a token generated by Recurly.js rather than directly handling your customer's bank account details.

Billing Information Attributes

Billing Address Parameter Description
name_on_account The name associated with the account. This may be a person's full name or a business name. This field must be 1 to 50 characters and can include: letters digits space . ' & , - Required
address1 Address line 1, recommended for address validation. This field has a 50 character max and can include: letters digits space . # / , -
address2 Address line 2, this field has a 50 character max and can include: letters digits space . # / , -
city City, this field has a 50 character max and can include: letters digits space . , -
state State, this field has a 2 character max and can be lowercase or uppercase.
country Country, 2-letter ISO code. Strongly Recommended
zip Zip or postal code, recommended for address validation. This field can be just 5 digits or can have an optional additional 4 digits separated by a hyphen (e.g. 12345-6789).
phone Phone number, this field can be 10 digits.
vat_number Customer's VAT Number
ip_address Customer's IP address when updating their Billing Information Strongly Recommended
Bank Account Parameter Description
routing_number Must be a real U.S. bank account routing number. All routing numbers are 9 digits. Required
account_number Bank account number between 4 and 17 digits. We do not validate this number until the first transaction, so we recommend you have the customer confirm their account number. Required
account_type Either 'checking' or 'savings' Required

Example

Request

Location: https://your-subdomain.recurly.com/accounts/1/billing_info
Accept: application/xml
Content-Type: application/xml; charset=utf-8
<billing_info>
  <name_on_account>Acme, Inc.</name_on_account>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <routing_number>065400137</routing_number>
  <account_number>4444000000005555</account_number>
  <account_type>checking</account_type>
</billing_info>

Response

Status: 200 OK
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<billing_info href="http://api.test.host/v2/accounts/1/billing_info" type="bank_account">
  <account href="http://api.test.host/v2/accounts/1"/>
  <name_on_account>Acme, Inc.</name_on_account>
  <first_name nil="nil"></first_name>
  <last_name nil="nil"></last_name>
  <company nil="nil"></company>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <phone></phone>
  <vat_number></vat_number>
  <ip_address nil="nil"></ip_address>
  <ip_address_country nil="nil"></ip_address_country>
  <account_type>checking</account_type>
  <last_four>5555</last_four>
  <routing_number>065400137</routing_number>
</billing_info>
$billing_info = new Recurly_BillingInfo();
$billing_info->account_code = '1';
$billing_info->name_on_account = 'Acme Inc.';
$billing_info->routing_number = '065400137';
$billing_info->account_number = '4444000000005555';
$billing_info->account_type = 'checking';
$billing_info->address1 = '123 Main St.';
$billing_info->city = 'San Francisco';
$billing_info->state ='CA';
$billing_info->country = 'US';
$billing_info->zip = '94105';
$billing_info->create();
account = Recurly::Account.find('1')
account.billing_info = {
  name_on_account: 'Acme, Inc.',
  routing_number: '065400137',
  account_number: '4444000000005555',
  address1: '123 Main St.',
  city: 'San Francisco',
  state: 'CA',
  country: 'US',
  zip: '94105'
}
account.billing_info.create
account = Account.get('1')
billing_info = recurly.BillingInfo(
  name_on_account = 'Acme, Inc.',
  routing_number = '065400137',
  account_number = '4444000000005555',
  account_type = 'checking',
  address1 = '123 Main St.',
  city = 'San Francisco',
  state ='CA',
  country = 'US',
  zip = '94105'
  )
account.update_billing_info(billing_info)
var account = Accounts.Get("1");
var info = new BillingInfo(account);
info.NameOnAccount = "Acme, Inc.";
info.RoutingNumber = "065400137";
info.AccountNumber = "4444000000005555";
info.AccountType = BillingInfo.BankAccountType.Checking;
info.Address1 = "123 Main St.";
info.City = "San Francisco";
info.State = "CA";
info.Country = "US";
info.PostalCode = "94105";
info.Create();

Update an account's billing info (Token)

Updates an account's Billing Information using a token generated by Recurly.js. Returns the account's current Billing Information.

PUT https://:subdomain.recurly.com/v2/accounts/:account_code/billing_info

Recurly.js allows you to collect customer Billing Information and tokenize it, preventing your servers from having to handle credit card information. When you send these tokens to Recurly through our API, we unpack the token and update Billing Information accordingly.

When Billing Information is updated, it is only saved if valid. If the account has a past due invoice, the outstanding balance will be collected to validate the Billing Information.

If you want to create an account at the same time, you should use the Account API end-point instead and include billing info with your request.

Billing Information Attributes

Parameter Description
token_id A token generated by Recurly.js.

Example

Request

Location: https://your-subdomain.recurly.com/accounts/1/billing_info
Accept: application/xml
Content-Type: application/xml; charset=utf-8
<billing_info>
  <token_id>TOKEN_ID</token_id>
</billing_info>

Response

Status: 200 OK
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<billing_info href="http://api.test.host/v2/accounts/1/billing_info" type="credit_card">
  <account href="http://api.test.host/v2/accounts/1"/>
  <first_name>Verena</first_name>
  <last_name>Example</last_name>
  <company nil="nil"></company>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <phone nil="nil"></phone>
  <card_type>Visa</card_type>
  <year type="integer">2015</year>
  <month type="integer">11</month>
  <first_six>411111</first_six>
  <last_four>1111</last_four>
</billing_info>
$billing_info = new Recurly_BillingInfo();
$billing_info->account_code = '1';
$billing_info->token_id = 'TOKEN_ID';
$billing_info->update();
account = Recurly::Account.find('1')
account.billing_info.token_id = 'TOKEN_ID'
account.billing_info.save
account = Account.get('1')
billing_info = account.billing_info
billing_info.token_id = 'TOKEN_ID'
billing_info.save()
var account = Accounts.Get("1");
var info = new BillingInfo(account);
info.TokenId = "TOKEN_ID";
info.Update();

Update an account's billing info (Credit Card)

Returns the account's updated Billing Information.

PUT https://:subdomain.recurly.com/v2/accounts/:account_code/billing_info

Instead of using a token generated by Recurly.js, you can instead submit full credit card and address information when updating Billing Information. Non PCI sensitive billing info can be updated by api without re-submitting the token. This can be done in two ways: 1)Through the billing info api (docs. link: https://docs.recurly.com/api/billing-info#update-billing-info-credit-card ) whereby you submit only the information that needs to be updated. In that way, all other information remains unchanged on the account. 2) Providing the end user a unique url link to their billing info page, where they can update their own billing info securly. This link can be found in the configuration window of the subscriber's account. https://SUBDOMAIN.recurly.com/accounts/:account_code/edit. You will see a hosted billing information URL that takes the user to their billing site hosted by Recurly.

When Billing Information is updated, it is only saved if valid. If the account has a past due invoice, the outstanding balance will be collected to validate the Billing Information.

If you want to create an account at the same time, you should use the Account API end-point instead and include Billing Information with your request.

Please note: this API end-point may be used to import Billing Information without security codes (CVV). Recurly recommends requiring CVV from your customers when collecting new or updated Billing Information.

Please note: Recurly strongly recommends using a token generated by Recurly.js rather than directly handling your customer's credit card details. You can, however, use this API call to update the billing address associated with an account.

Billing Information Attributes

Billing Address Parameter Description
first_name First name
last_name Last name
address1 Address line 1, recommended for address validation
address2 Address line 2
city City
state State
country Country, 2-letter ISO code Strongly Recommended
zip Zip or postal code, recommended for address validation
phone Phone number
vat_number Customer's VAT Number
ip_address Customer's IP address when updating their Billing Information Strongly Recommended
Credit Card Parameter Description
number Credit card number, spaces and dashes are accepted
month Expiration month
year Expiration year
verification_value Security code or CVV, 3-4 digits Strongly Recommended

Example

Request

Location: https://your-subdomain.recurly.com/accounts/1/billing_info
Accept: application/xml
Content-Type: application/xml; charset=utf-8
<billing_info>
  <first_name>Verena</first_name>
  <last_name>Example</last_name>
  <number>4111-1111-1111-1111</number>
  <verification_value>123</verification_value>
  <month>11</month>
  <year>2015</year>
</billing_info>

Response

Status: 200 OK
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<billing_info href="http://api.test.host/v2/accounts/1/billing_info" type="credit_card">
  <account href="http://api.test.host/v2/accounts/1"/>
  <first_name>Verena</first_name>
  <last_name>Example</last_name>
  <company nil="nil"></company>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <phone nil="nil"></phone>
  <card_type>Visa</card_type>
  <year type="integer">2015</year>
  <month type="integer">11</month>
  <first_six>411111</first_six>
  <last_four>1111</last_four>
</billing_info>
$billing_info = new Recurly_BillingInfo();
$billing_info->account_code = '1';
$billing_info->first_name = 'Verena';
$billing_info->last_name = 'Example';
$billing_info->number = '4111-1111-1111-1111';
$billing_info->verification_value = '123';
$billing_info->month = 11;
$billing_info->year = 2015;
$billing_info->update();
account = Recurly::Account.find('1')
account.billing_info = {
  :first_name         => 'Verena',
  :last_name          => 'Example',
  :number             => '4111-1111-1111-1111',
  :verification_value => '123',
  :month              => 11,
  :year               => 2015
}
account.billing_info.save
account = Account.get('1')
billing_info = account.billing_info
billing_info.first_name = 'Verena'
billing_info.last_name = 'Example'
billing_info.number = '4111-1111-1111-1111'
billing_info.verification_value = '123'
billing_info.month = 11
billing_info.year = 2015
billing_info.save()
var account = Accounts.Get("1");
var info = account.BillingInfo;
info.FirstName = "Verana";
info.LastName = "Example";
info.PhoneNumber = "111-111-1111";
info.VerificationValue = "123";
info.ExpirationMonth = 11;
info.ExpirationYear = 2015;
info.Update();

Update an account's billing info (Bank Account)

Returns the account's updated Billing Information. You will need to have the ACH feature on your site for this call to work.

PUT https://:subdomain.recurly.com/v2/accounts/:account_code/billing_info

Instead of using a token generated by Recurly.js, you can instead submit full bank account and address information when updating Billing Information.

When Billing Information is updated, it is only saved if the required fields are provided and they meet the field validation requirements. If the account has a past due invoice, the outstanding balance will be collected when the Billing Information is updated.

If you want to create an account at the same time, you should use the Account API end-point instead and include Billing Information with your request.

If you need to set a back dated subscription authorziation date for the NACHA three year re-authorization rule, do so on the Create Subscription call using the "bank_account_authorized_at" attribute.

Please note: Recurly strongly recommends using a token generated by Recurly.js rather than directly handling your customer's bank account details. You can, however, use this API call to update the billing address associated with an account.

Billing Information Attributes

Billing Address Parameter Description
name_on_account The name associated with the account. This may be a person's full name or a business name. This field must be 1 to 50 characters and can include: letters digits space . ' & , - Required
address1 Address line 1, recommended for address validation. This field has a 50 character max and can include: letters digits space . # / , -
address2 Address line 2, this field has a 50 character max and can include: letters digits space . # / , -
city City, this field has a 50 character max and can include: letters digits space . , -
state State, this field has a 2 character max and can be lowercase or uppercase.
country Country, 2-letter ISO code. Strongly Recommended
zip Zip or postal code, recommended for address validation. This field can be just 5 digits or can have an optional additional 4 digits separated by a hyphen (e.g. 12345-6789).
phone Phone number, this field can be 10 digits.
vat_number Customer's VAT Number
ip_address Customer's IP address when updating their Billing Information Strongly Recommended
Bank Account Parameter Description
routing_number Must be a real U.S. bank account routing number. All routing numbers are 9 digits. Required
account_number Bank account number between 4 and 17 digits. We do not validate this number until the first transaction, so we recommend you have the customer confirm their account number. Required
account_type Either 'checking' or 'savings' Required

Example

Request

Location: https://your-subdomain.recurly.com/accounts/1/billing_info
Accept: application/xml
Content-Type: application/xml; charset=utf-8
<billing_info>
  <name_on_account>Acme, Inc.</name_on_account>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <routing_number>065400137</routing_number>
  <account_number>4444000000005555</account_number>
  <account_type>checking</account_type>
</billing_info>

Response

Status: 200 OK
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<billing_info href="http://api.test.host/v2/accounts/1/billing_info" type="bank_account">
  <account href="http://api.test.host/v2/accounts/1"/>
  <name_on_account>Acme, Inc.</name_on_account>
  <first_name nil="nil"></first_name>
  <last_name nil="nil"></last_name>
  <company nil="nil"></company>
  <address1>123 Main St.</address1>
  <address2 nil="nil"></address2>
  <city>San Francisco</city>
  <state>CA</state>
  <zip>94105</zip>
  <country>US</country>
  <phone></phone>
  <vat_number></vat_number>
  <ip_address nil="nil"></ip_address>
  <ip_address_country nil="nil"></ip_address_country>
  <account_type>checking</account_type>
  <last_four>5555</last_four>
  <routing_number>065400137</routing_number>
</billing_info>
$billing_info = new Recurly_BillingInfo();
$billing_info->account_code = '1';
$billing_info->name_on_account = 'Acme Inc.';
$billing_info->routing_number = '065400137';
$billing_info->account_number = '4444000000005555';
$billing_info->account_type = 'checking';
$billing_info->address1 = '123 Main St.';
$billing_info->city = 'San Francisco';
$billing_info->state ='CA';
$billing_info->country = 'US';
$billing_info->zip = '94105';
$billing_info->update();
account = Recurly::Account.find('1')
account.billing_info = {
  name_on_account: 'Acme, Inc.',
  routing_number: '065400137',
  account_number: '4444000000005555',
  address1: '123 Main St.',
  city: 'San Francisco',
  state: 'CA',
  country: 'US',
  zip: '94105'
}
account.billing_info.save
account = Account.get('1')
billing_info = account.billing_info
billing_info.name_on_account = 'Acme, Inc.'
billing_info.routing_number = '065400137'
billing_info.account_number = '4444000000005555'
billing_info.account_type = 'checking'
billing_info.address1 = '123 Main St.'
billing_info.city = 'San Francisco'
billing_info.state ='CA'
billing_info.country = 'US'
billing_info.zip = '94105'
billing_info.save()
var account = Accounts.Get("1");
var info = account.BillingInfo;
info.NameOnAccount = "Acme, Inc.";
info.RoutingNumber = "065400137";
info.AccountNumber = "4444000000005555";
info.AccountType = BillingInfo.BankAccountType.Checking;
info.Address1 = "123 Main St.";
info.City = "San Francisco";
info.State = "CA";
info.Country = "US";
info.PostalCode = "94105";
info.Update();

Clear an account's billing info

You may remove any stored billing information for an account. If the account has a subscription, the renewal will go into past due unless you update the billing info before the renewal occurs.

DELETE https://:subdomain.recurly.com/v2/accounts/:account_code/billing_info

Example

Response

Status: 204 No Content
$billing_info = Recurly_BillingInfo::get('1');
$billing_info->delete();

// Or, in a single API request:
// Recurly_BillingInfo::deleteForAccount('1');
account = Recurly::Account.find('1')
if billing_info = account.billing_info
  billing_info.destroy
end
account = Account.get('1')
billing_info = account.billing_info
if billing_info
  billing_info.delete()
var account = Accounts.Get("1");
account.DeleteBillingInfo();