HomeProduct DocsAPI ReferenceChangelog
RecurlyAPI GuidesRecurly.jsWebhooksAPI ReferenceSupportBook demo
API Reference

Create Transaction

The Recurly API provides a shortcut for creating an invoice, charge, and optionally account, and processing the payment immediately. When creating an account all of the required account attributes must be supplied. When charging an existing account only the account_code must be supplied.

Using stored billing info

You may create a transaction without specifying billing information if an account already has stored billing information.

xml

PHP

Ruby

Python

text

<transaction>
  <amount_in_cents>100</amount_in_cents>
  <currency>USD</currency>
  <account>
    <account_code>1</account_code>
  </account>
</transaction>
$transaction = new Recurly_Transaction();
$transaction->amount_in_cents = 100; // $1.00
$transaction->currency = 'USD';

$transaction->account = new Recurly_Account();
$transaction->account->account_code = '1';

$transaction->create();
transaction = account.transactions.create(
  :amount_in_cents => 1_00,
  :currency        => 'USD',
  :account         => { :account_code => '1' }
)
transaction = Transaction(
  amount_in_cents=100,
  currency='USD',
  account=Account(account_code='1')
)
transaction.save()
var transaction = new Transaction("1", 100, "USD"); // account code, unit amount in cents, currency
transaction.Create();
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
integer

Amount of the transaction in cents. Max 10000000.

string

3-letter currency for the transaction

string

A description for the transaction. Description is added to the invoiced charge, and not the transaction object

account
object

nested attributes (see below)

string

A unique identifier used by your application to identify the account. This code may only contain the following characters: [a-z A-Z 0-9 @ - _ .]. Max of 50 characters.

string

Username, ignore if you do not use usernames

string

Email address

string

First Name. Max 50 characters.

string

Last Name. Max 50 characters.

string

Company name. Max of 50 characters.

string

An ISO 639-1 language code from the user's browser, indicating their preferred language and locale.

billing_info
object

account->billing_info nested attributes (see below)

string

Company name. Max of 50 characters.

string

Address line 1, recommended for address validation. Max 50 characters.

string

Address line 2. Max 50 characters.

string

City. Max 50 characters.

string

State or Province, 2-letters preferred

string

Country, 2-letter ISO code. Strongly Recommended

string

Zip or postal code, recommended for address validation. Strongly Recommended

string

Phone number

string

Customer's VAT Number

string

Customer's IP address when updating their billing information. Strongly Recommended.

string

Credit card number, spaces and dashes are accepted.

string

Expiration Month

string

Expiration Year

string

Security code or CVV, 3-4 digits. Strongly Recommended.

Response

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/xml