HomeProduct DocsAPI ReferenceChangelog
RecurlyAPI GuidesRecurly.jsWebhooksAPI ReferenceSupportBook demo
API Reference

Create a new line item for the account

When using the Credit Invoices feature, utilize the purchases endpoint in order to immediately post credit to a credit invoice.

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

Account ID or code. For ID no prefix is used e.g. e28zov4fw0v2. For code use prefix code-, e.g. code-bob.

Body Params
string
required
length ≤ 3

3-letter ISO 4217 currency code. If item_code/item_id is part of the request then currency is optional, if the site has a single default currency. currency is required if item_code/item_id is present, and there are multiple currencies defined on the site. If item_code/item_id is not present currency is required.

float
required

A positive or negative amount with type=charge will result in a positive unit_amount.
A positive or negative amount with type=credit will result in a negative unit_amount.
If item_code/item_id is present, unit_amount can be passed in, to override the
Item's unit_amount. If item_code/item_id is not present then unit_amount is required.

boolean
Defaults to false

Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.

integer
Defaults to 1

This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes.

string
length ≤ 255

Description that appears on the invoice. If item_code/item_id is part of the request then description must be absent.

string
length ≤ 50
/^[a-z0-9_+-]+$/

Unique code to identify an item. Available when the Credit Invoices feature is enabled.

string
length ≤ 13

System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.

string
enum
Allowed:
string
enum
required

Line item type. If item_code/item_id is present then type should not be present. If item_code/item_id is not present then type is required.

Allowed:
string
enum
Defaults to general

The reason the credit was given when line item is type=credit. When the Credit Invoices feature is enabled, the value can be set and will default to general. When the Credit Invoices feature is not enabled, the value will always be null.

Allowed:
string
length ≤ 20
/^[a-z0-9_+-]+$/

Accounting Code for the LineItem. If item_code/item_id is part of the request then accounting_code must be absent.

string
length ≤ 13

The ID of a general ledger account. General ledger accounts are
only accessible as a part of the Recurly RevRec Standard and
Recurly RevRec Advanced features.

string
length ≤ 13

The ID of a general ledger account. General ledger accounts are
only accessible as a part of the Recurly RevRec Standard and
Recurly RevRec Advanced features.

string
length ≤ 13

The ID of a performance obligation. Performance obligations are
only accessible as a part of the Recurly RevRec Standard and
Recurly RevRec Advanced features.

boolean

true exempts tax on charges, false applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.

integer
≥ 0

Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to the documentation for more available t/s types. If an Item is associated to the LineItem, then the avalara_transaction_type must be absent.

integer
≥ 0

Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to the documentation for more available t/s types. If an Item is associated to the LineItem, then the avalara_service_type must be absent.

string
enum

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

Allowed:
string
length ≤ 50

Optional field used by Avalara, Vertex, and Recurly's In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly's In-the-Box tax offering you can also choose to instead use simple values of unknown, physical, or digital tax codes.

string
length ≤ 25
^\d+(\.\d+)*$

The Harmonized System (HS) code is an internationally standardized system of names and numbers to classify traded products. The HS code, sometimes called Commodity Code, is used by customs authorities around the world to identify products when assessing duties and taxes. The HS code may also be referred to as the tariff code or customs code. Values should contain only digits and decimals. If item_code/item_id is part of the request then harmonized_system_code must be absent.

string
length ≤ 50

Optional field to track a product code or SKU for the line item. This can be used to later reporting on product purchases. For Vertex tax calculations, this field will be used as the Vertex product field. If item_code/item_id is part of the request then product_code must be absent.

string
enum

Origin external_gift_card is allowed if the Gift Cards feature is enabled on your site, type is credit and tax_exempt is true if you are using taxes. Set this value in order to track gift card credits from external gift cards (like InComm). It also skips billing information requirements. Origin prepayment is only allowed if type is charge and tax_exempt is left blank or set to true. This origin creates a charge and opposite credit on the account to be used for future invoices.

Allowed:
custom_fields
array of objects

The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.

Custom fields
date-time

If an end date is present, this is value indicates the beginning of a billing time range. If no end date is present it indicates billing for a specific date. Defaults to the current date-time.

date-time

If this date is provided, it indicates the end of a time range.

string
enum
Defaults to origin

The source of the address that will be used as the origin in determining taxes. Available only when the site is on an Elite plan. A value of "origin" refers to the "Business entity tax address". A value of "destination" refers to the "Customer tax address".

Allowed:
string
enum
Defaults to destination

The source of the address that will be used as the destinaion in determining taxes. Available only when the site is on an Elite plan. A value of "destination" refers to the "Customer tax address". A value of "origin" refers to the "Business entity tax address".

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