The endpoint 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.
Deprecated in favor of Purchases
We recommend use the Create Purchase endpoint instead of this one. With it you can create an account, billing info, multiple charges, credits and subscriptions, and invoice and collect payment processed in one step.
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
Dotnet
<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();Using Existing Billing Info
After a successful transaction, the billing information will be saved with the account for future purchases. If the account already has stored billing info, the billing info from the last transaction overwrite the previous values.
xml
PHP
Ruby
Python
Dotnet
<transaction>
<amount_in_cents>1000</amount_in_cents>
<currency>USD</currency>
<account>
<account_code>1</account_code>
<billing_info>
<first_name>Verena</first_name>
<last_name>Example</last_name>
<address1>123 Main St.</address1>
<city>San Francisco</city>
<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>
</account>
</transaction>$transaction = new Recurly_Transaction();
$transaction->amount_in_cents = 1000; // $10.00.
$transaction->currency = 'USD';
$account = new Recurly_Account();
$account->account_code = '1';
$billing_info = new Recurly_BillingInfo();
$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;
$account->billing_info = $billing_info;
$transaction->account = $account;
$transaction->create();transaction = Recurly::Transaction.create(
:amount_in_cents => 10_00,
:currency => 'USD',
:account => {
:account_code => '1',
:billing_info => {
:first_name => 'Verena',
:last_name => 'Example',
:number => '4111-1111-1111-1111',
:verification_value => '123',
:month => 11,
:year => 2015
}
}
)transaction = Transaction(
amount_in_cents=1000,
currency='USD',
account=Account(
account_code=account_code,
billing_info=BillingInfo(
first_name='Verena',
last_name='Example',
number='4111-1111-1111-1111',
verification_value='123',
year=2015',
month=11
)
)
)
transaction.save()var account = Accounts.Get("1");
account.BillingInfo = new BillingInfo(account.AccountCode)
{
FirstName = "Verana",
LastName = "Example",
CreditCardNumber = "4111-1111-1111-1111",
VerificationValue = "123",
ExpirationYear = 2015,
ExpirationMonth = 11
};
var transaction = new Transaction(account, 100, "USD");
transaction.Create();| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||