HomeProduct DocsAPI ReferenceChangelog
RecurlyAPI GuidesRecurly.jsWebhooksAPI ReferenceSupportBook demo
API Reference

Create a new purchase

A purchase is a checkout containing at least one or more subscriptions or one-time charges (line items) and supports both coupon and gift card redemptions. All items purchased will be on one invoice and paid for with one transaction.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

A purchase is only a request data type and is not persistent in Recurly, an InvoiceCollection will be the returned type.

string
required
length ≤ 3

3-letter ISO 4217 currency code.

account
object
required
string

The billing_info_id is the value that represents a specific billing info for an end customer. When billing_info_id is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. billing_info_id can ONLY be used for sites utilizing the Wallet feature.

string

The business_entity_id is the value that represents a specific business entity for an end customer. When business_entity_id is used to assign a business entity to the subscription, all future billing events for the subscription will bill to the specified business entity. Available when the Multiple Business Entities feature is enabled. If both business_entity_id and business_entity_code are present, business_entity_id will be used.

string

The business_entity_code is the value that represents a specific business entity for an end customer. When business_entity_code is used to assign a business entity to the subscription, all future billing events for the subscription will bill to the specified business entity. Available when the Multiple Business Entities feature is enabled. If both business_entity_id and business_entity_code are present, business_entity_id will be used.

string
enum
Defaults to automatic

Must be set to manual in order to preview a purchase for an Account that does not have payment information associated with the Billing Info.

Allowed:
string
length ≤ 50

For manual invoicing, this identifies the PO number associated with the subscription.

integer
≥ 0
Defaults to 0

Integer paired with Net Terms Type and representing the number
of days past the current date (for net Net Terms Type) or days after
the last day of the current month (for eom Net Terms Type) that the
invoice will become past due. For manual collection method, an additional 24 hours is
added to ensure the customer has the entire last day to make payment before
becoming past due. For example:

If an invoice is due net 0, it is due 'On Receipt' and will become past due 24 hours after it's created.
If an invoice is due net 30, it will become past due at 31 days exactly.
If an invoice is due eom 30, it will become past due 31 days from the last day of the current month.

For automatic collection method, the additional 24 hours is not added. For example, On-Receipt is due immediately, and net 30 will become due exactly 30 days from invoice generation, at which point Recurly will attempt collection.
When eom Net Terms Type is passed, the value for Net Terms is restricted to 0, 15, 30, 45, 60, or 90.

For more information on how net terms work with manual collection visit our docs page (https://docs.recurly.com/docs/manual-payments#section-collection-terms)
or visit (https://docs.recurly.com/docs/automatic-invoicing-terms#section-collection-terms) for information about net terms using automatic collection.

string
enum
Defaults to net

Optionally supplied string that may be either net or eom (end-of-month).
When net, an invoice becomes past due the specified number of Net Terms days from the current date.
When eom an invoice becomes past due the specified number of Net Terms days from the last day of the current month.

Allowed:
credit_application_policy_override
object

Controls whether credit invoices are automatically applied to new invoices.
The mode field determines the application behavior. When mode is all,
the optional allowed_origins array can restrict which credit invoice origins
are applied.

string

Terms and conditions to be put on the purchase invoice.

transaction
object

(Transaction Data, Card on File) - Options for flagging transactions as Customer or Merchant Initiated Unscheduled.

string
string

VAT reverse charge notes for cross border European tax settlement.

string
enum

Used by Vertex for tax calculations. Possible values are sale, rental, lease.

Allowed:
string

Notes to be put on the credit invoice resulting from credits in the purchase, if any.

string
length ≤ 13

The default payment gateway identifier to be used for the purchase transaction. This will also be applied as the default for any subscriptions included in the purchase request.

shipping
object
line_items
array of objects

A list of one time charges or credits to be created with the purchase.

Line items
subscriptions
array of objects

A list of subscriptions to be created with the purchase.

Subscriptions
coupon_codes
array of strings

A list of coupon_codes to be redeemed on the subscription or account during the purchase.

Coupon codes
string

A gift card redemption code to be redeemed on the purchase invoice.

string
enum

An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.

Allowed:
Responses

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