This library is published on npm under the name recurly
.
We recommend installing via the command line:
npm install recurly --save-prod
Or manually insert the dependency into the dependencies
section of your package.json
:
Note: We do try to strictly follow SemVer so locking to a major version should be safe.
{
// ...
"recurly" : "^4.56.0"
// ...
}
Note: When upgrading, view the CHANGELOG to see what's changed.
A client object represents a connection to the Recurly API. The client implements
each operation
that can be performed in the API as a method.
To initialize a client, you only need an API key which can be obtained on the API Credentials Page.
To access Recurly API in Europe, you will need to specify the EU Region in the options
.
Note: to import using typescript:
All operations are async
and return promises (except the list*
methods which return Pager
s).
You can handle the promises directly with then
and catch
or use await:
For creating or updating resources, pass a plain object to one of the create* or update* methods.
Note: Keep in mind that the API accepts snake-cased keys but this library expects camel-cased keys. We do the translation for you so this library can conform to js style standards.
All list*
methods on the client return a Pager
. They
are not async
because they are lazy and do not make any
network requests until they are iterated over. There are
two methods on Pager
that return async iterators each
and eachPage
:
each
will give you an iterator over each item that matches your query.eachPage
will give you an iterator over each page that is returned. The result is an array of resources.The Pager class implements a first
method which allows you to fetch just the first or last resource from the server.
On top of being a convenient abstraction, this is implemented efficiently by only asking the server for the 1 item you want.
If you want to fetch the last account in this scenario, invert the order from desc
to asc
The Pager class implements a count
method which allows you to count the resources the pager would return.
It does so by calling the endpoint with HEAD
and parsing and returning the Recurly-Total-Records
header. This
method respects any filtering parameters you apply to the pager, but the sorting parameters will have no effect.
This library currently throws 1 primary class of exceptions, recurly.ApiError. The ApiError comes in a few flavors which help you determine what to do next. To see a full list, view the api_errors module.
Sometimes you might want to get some additional information about the underlying HTTP request and response. Instead of
returning this information directly and forcing the programmer to unwrap it, we inject this metadata into the top level
resource that was returned. You can access the response by calling getResponse()
on any Resource.
Warning: Do not log or render whole requests or responses as they may contain PII or sensitive data.
This also works on Empty responses:
And it can be captured on exceptions through the ApiError object:
Recurly can send webhooks to any publicly accessible server. When an event in Recurly triggers a webhook (e.g., an account is opened), Recurly will attempt to send this notification to the endpoint(s) you specify. You can specify up to 10 endpoints through the application. All notifications will be sent to all configured endpoints for your site.
See our product docs to learn more about webhooks and see our dev docs to learn about what payloads are available.
Although our API is now JSON, our webhook payloads are still formatted as XML for the time being. This library is not yet responsible for handling webhooks. If you do need webhooks, we recommend using a simple XML to Plain Object parser such as xml2js.
You can do this without dependencies, but you'll need to heed warnings about security concerns. Read more about the security implications of parsing untrusted XML in this OWASP cheatsheet.
Client
(apiKey)
parameter | type | description |
---|---|---|
apiKey |
string | The private api key. |
listSites
(options)
List sites
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_sites
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.state | string | Filter by state. |
Pager<Site>
:
A list of sites.
const sites = client.listSites({ params: { limit: 200 } })
for await (const site of sites.each()) {
console.log(site.subdomain)
}
getSite
(siteId, options)
Fetch a site
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_site
parameter | type | description |
---|---|---|
siteId |
string | Site ID or subdomain. For ID no prefix is used e.g.
e28zov4fw0v2
. For subdomain use prefix
subdomain-
, e.g.
subdomain-recurly
.
|
options |
any
= {}
|
Promise<Site>
:
A site.
try {
const site = await client.getSite(siteId)
console.log('Fetched site: ', site)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listAccounts
(options)
List a site's accounts
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_accounts
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.email | string | Filter for accounts with this exact email address. A blank value will return accounts with both
null
and
""
email addresses. Note that multiple accounts can share one email address.
|
options.params.subscriber | boolean | Filter for accounts with or without a subscription in the
active
,
canceled
, or
future
state.
|
options.params.pastDue | string | Filter for accounts with an invoice in the
past_due
state.
|
Pager<Account>
:
A list of the site's accounts.
const accounts = client.listAccounts({ params: { limit: 200 } })
for await (const account of accounts.each()) {
console.log(account.code)
}
createAccount
(body, options)
Create an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_account
parameter | type | description |
---|---|---|
body |
AccountCreate | The object representing the JSON request to send to the server. It should conform to the schema of {AccountCreate} |
options |
any
= {}
|
Promise<Account>
:
An account.
try {
const accountCreate = {
code: accountCode,
firstName: 'Benjamin',
lastName: 'Du Monde',
preferredTimeZone: 'America/Chicago',
address: {
street1: '900 Camp St',
city: 'New Orleans',
region: 'LA',
postalCode: '70115',
country: 'US'
}
}
const account = await client.createAccount(accountCreate)
console.log('Created Account: ', account.code)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getAccount
(accountId, options)
Fetch an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_account
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Promise<Account>
:
An account.
try {
const account = await client.getAccount(accountId)
console.log('Fetched account: ', account.code)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
updateAccount
(accountId, body, options)
Update an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_account
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
AccountUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {AccountUpdate} |
options |
any
= {}
|
Promise<Account>
:
An account.
try {
const accountUpdate = {
firstName: 'Aaron',
lastName: 'Du Monde'
}
const account = await client.updateAccount(accountId, accountUpdate)
console.log('Updated account: ', account)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
deactivateAccount
(accountId, options)
Deactivate an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/deactivate_account
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Promise<Account>
:
An account.
try {
const account = await client.deactivateAccount(accountId)
console.log('Deleted account: ', account.code)
} catch (err) {
if (err && err.type === 'not-found') {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
}
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
throw err
}
getAccountAcquisition
(accountId, options)
Fetch an account's acquisition data
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_account_acquisition
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Promise<AccountAcquisition>
:
An account's acquisition data.
try {
const acquisition = await client.getAccountAcquisition(accountId)
console.log('Fetched account acquisition: ', acquisition.id)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
updateAccountAcquisition
(accountId, body, options)
Update an account's acquisition data
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_account_acquisition
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
AccountAcquisitionUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {AccountAcquisitionUpdate} |
options |
any
= {}
|
Promise<AccountAcquisition>
:
An account's updated acquisition data.
try {
const acquisitionUpdate = {
campaign: "big-event-campaign",
channel: "social_media",
subchannel: "twitter"
}
const accountAcquisition = await client.updateAccountAcquisition(accountId, acquisitionUpdate)
console.log('Edited Account Acquisition: ', accountAcquisition)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
removeAccountAcquisition
(accountId, options)
Remove an account's acquisition data
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_account_acquisition
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Promise<Empty>
:
Acquisition data was succesfully deleted.
try {
await client.removeAccountAcquisition(accountId)
console.log('Removed account acquisition from account: ', accountId)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
reactivateAccount
(accountId, options)
Reactivate an inactive account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/reactivate_account
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Promise<Account>
:
An account.
try {
const account = await client.reactivateAccount(accountId)
console.log('Reactivated account: ', account.code)
} catch (err) {
if (err && err.type === 'not_found') {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
}
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
throw err
}
getAccountBalance
(accountId, options)
Fetch an account's balance and past due status
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_account_balance
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Promise<AccountBalance>
:
An account's balance.
try {
const balance = await client.getAccountBalance(accountId)
console.log('Fetched account balance: ', balance.balances)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getBillingInfo
(accountId, options)
Fetch an account's billing information
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_billing_info
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Promise<BillingInfo>
:
An account's billing information.
try {
const billingInfo = await client.getBillingInfo(accountId)
console.log('Fetched Billing Info: ', billingInfo.id)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
updateBillingInfo
(accountId, body, options)
Set an account's billing information
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_billing_info
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
BillingInfoCreate | The object representing the JSON request to send to the server. It should conform to the schema of {BillingInfoCreate} |
options |
any
= {}
|
Promise<BillingInfo>
:
Updated billing information.
try {
const billingInfoUpdate = {
firstName: 'Aaron',
lastName: 'Du Monde',
}
const billingInfo = await client.updateBillingInfo(accountId, billingInfoUpdate)
console.log('Updated billing info: ', billingInfo.id)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
removeBillingInfo
(accountId, options)
Remove an account's billing information
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_billing_info
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Promise<Empty>
:
Billing information deleted
try {
client.removeBillingInfo(accountId)
console.log('Removed billing info from account: ', accountId)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
verifyBillingInfo
(accountId, options)
Verify an account's credit card billing information
API docs: https://developers.recurly.com/api/v2021-02-25#operation/verify_billing_info
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.body | BillingInfoVerify | The object representing the JSON request to send to the server. It should conform to the schema of {BillingInfoVerify} |
Promise<Transaction>
:
Transaction information from verify.
try {
const transaction = await client.verifyBillingInfo(accountId)
console.log('Fetched Transaction: ', transaction.id)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
verifyBillingInfoCvv
(accountId, body, options)
Verify an account's credit card billing cvv
API docs: https://developers.recurly.com/api/v2021-02-25#operation/verify_billing_info_cvv
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
BillingInfoVerifyCVV | The object representing the JSON request to send to the server. It should conform to the schema of {BillingInfoVerifyCVV} |
options |
any
= {}
|
Promise<Transaction>
:
Transaction information from verify.
listBillingInfos
(accountId, options)
Get the list of billing information associated with an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_billing_infos
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
Pager<BillingInfo>
:
A list of the the billing information for an account's
createBillingInfo
(accountId, body, options)
Add new billing information on an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_billing_info
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
BillingInfoCreate | The object representing the JSON request to send to the server. It should conform to the schema of {BillingInfoCreate} |
options |
any
= {}
|
Promise<BillingInfo>
:
Updated billing information.
getABillingInfo
(accountId, billingInfoId, options)
Fetch a billing info
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_a_billing_info
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
billingInfoId |
string | Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature. |
options |
any
= {}
|
Promise<BillingInfo>
:
A billing info.
updateABillingInfo
(accountId, billingInfoId, body, options)
Update an account's billing information
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_a_billing_info
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
billingInfoId |
string | Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature. |
body |
BillingInfoCreate | The object representing the JSON request to send to the server. It should conform to the schema of {BillingInfoCreate} |
options |
any
= {}
|
Promise<BillingInfo>
:
Updated billing information.
removeABillingInfo
(accountId, billingInfoId, options)
Remove an account's billing information
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_a_billing_info
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
billingInfoId |
string | Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature. |
options |
any
= {}
|
Promise<Empty>
:
Billing information deleted
listAccountCouponRedemptions
(accountId, options)
List the coupon redemptions for an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_coupon_redemptions
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.state | string | Filter by state. |
Pager<CouponRedemption>
:
A list of the the coupon redemptions on an account.
const redemptions = client.listAccountCouponRedemptions(accountId, { params: { limit: 200 } })
for await (const redemption of redemptions.each()) {
console.log(redemption.id)
}
listActiveCouponRedemptions
(accountId, options)
List the coupon redemptions that are active on an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_active_coupon_redemptions
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Pager<CouponRedemption>
:
Active coupon redemptions on an account.
const redemptions = await client.listActiveCouponRedemptions(accountId, { params: { limit: 200 } })
for await (const redemption of redemptions.each()) {
console.log('Fetched coupon redemption: ', redemption.id)
}
createCouponRedemption
(accountId, body, options)
Generate an active coupon redemption on an account or subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_coupon_redemption
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
CouponRedemptionCreate | The object representing the JSON request to send to the server. It should conform to the schema of {CouponRedemptionCreate} |
options |
any
= {}
|
Promise<CouponRedemption>
:
Returns the new coupon redemption.
removeCouponRedemption
(accountId, options)
Delete the active coupon redemption from an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_coupon_redemption
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Promise<CouponRedemption>
:
Coupon redemption deleted.
try {
const redemption = await client.removeCouponRedemption(accountId)
console.log('Removed coupon redemption: ', redemption.id)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listAccountCreditPayments
(accountId, options)
List an account's credit payments
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_credit_payments
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
Pager<CreditPayment>
:
A list of the account's credit payments.
const payments = client.listAccountCreditPayments(accountId, { params: { limit: 200 } })
for await (const payment of payments.each()) {
console.log(payment.uuid)
}
listAccountExternalAccount
(accountId, options)
List external accounts for an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_account
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Pager<ExternalAccount>
:
A list of external accounts on an account.
createAccountExternalAccount
(accountId, body, options)
Create an external account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_account_external_account
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
ExternalAccountCreate | The object representing the JSON request to send to the server. It should conform to the schema of {ExternalAccountCreate} |
options |
any
= {}
|
Promise<ExternalAccount>
:
A representation of the created external_account.
getAccountExternalAccount
(accountId, externalAccountId, options)
Get an external account for an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_account_external_account
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
externalAccountId |
string | External account ID, e.g.
s28zov4fw0cb
.
|
options |
any
= {}
|
Promise<ExternalAccount>
:
A external account on an account.
updateAccountExternalAccount
(accountId, externalAccountId, body, options)
Update an external account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_account_external_account
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
externalAccountId |
string | External account ID, e.g.
s28zov4fw0cb
.
|
body |
ExternalAccountUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {ExternalAccountUpdate} |
options |
any
= {}
|
Promise<ExternalAccount>
:
A representation of the updated external_account.
deleteAccountExternalAccount
(accountId, externalAccountId, options)
Delete an external account for an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/delete_account_external_account
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
externalAccountId |
string | External account ID, e.g.
s28zov4fw0cb
.
|
options |
any
= {}
|
Promise<ExternalAccount>
:
Successful Delete
listAccountExternalInvoices
(accountId, options)
List the external invoices on an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_invoices
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
Pager<ExternalInvoice>
:
A list of the the external_invoices on an account.
listAccountInvoices
(accountId, options)
List an account's invoices
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_invoices
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.state | string | Invoice state. |
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.type | string | Filter by type when:
|
Pager<Invoice>
:
A list of the account's invoices.
const invoices = client.listAccountInvoices(accountId, { params: { limit: 200 } })
for await (const invoice of invoices.each()) {
console.log(invoice.number)
}
createInvoice
(accountId, body, options)
Create an invoice for pending line items
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_invoice
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
InvoiceCreate | The object representing the JSON request to send to the server. It should conform to the schema of {InvoiceCreate} |
options |
any
= {}
|
Promise<InvoiceCollection>
:
Returns the new invoices.
try {
let invoiceCreate = {
currency: 'USD',
collectionMethod: 'automatic'
}
let invoiceCollection = await client.createInvoice(accountId, invoiceCreate)
console.log('Created Invoice')
console.log('Charge Invoice: ', invoiceCollection.chargeInvoice)
console.log('Credit Invoices: ', invoiceCollection.creditInvoices)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
previewInvoice
(accountId, body, options)
Preview new invoice for pending line items
API docs: https://developers.recurly.com/api/v2021-02-25#operation/preview_invoice
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
InvoiceCreate | The object representing the JSON request to send to the server. It should conform to the schema of {InvoiceCreate} |
options |
any
= {}
|
Promise<InvoiceCollection>
:
Returns the invoice previews.
try {
const collection = await client.previewInvoice(accountId, {
currency: "USD",
collectionMethod: "automatic"
})
console.log(`Previewed invoice due at ${collection.chargeInvoice.dueAt}`)
console.log(collection.chargeInvoice)
console.log(collection.creditInvoices)
} catch(err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listAccountLineItems
(accountId, options)
List an account's line items
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_line_items
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.original | string | Filter by original field. |
options.params.state | string | Filter by state field. |
options.params.type | string | Filter by type field. |
Pager<LineItem>
:
A list of the account's line items.
const lineItems = client.listAccountLineItems(accountId, { params: { limit: 200 } })
for await (const lineItem of lineItems.each()) {
console.log(lineItem.id)
}
createLineItem
(accountId, body, options)
Create a new line item for the account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_line_item
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
LineItemCreate | The object representing the JSON request to send to the server. It should conform to the schema of {LineItemCreate} |
options |
any
= {}
|
Promise<LineItem>
:
Returns the new line item.
try {
let lineItemReq = {
currency: 'USD',
unitAmount: 1000,
type: 'charge' // choose "credit" for a credit
}
let lineItem = await client.createLineItem(accountId, lineItemReq)
console.log('Created Line Item: ', lineItem.uuid)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listAccountNotes
(accountId, options)
List an account's notes
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_notes
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
Pager<AccountNote>
:
A list of an account's notes.
const notes = client.listAccountNotes(accountId, { params: { limit: 200 } })
for await (const note of notes.each()) {
console.log(note.message)
}
getAccountNote
(accountId, accountNoteId, options)
Fetch an account note
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_account_note
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
accountNoteId |
string | Account Note ID. |
options |
any
= {}
|
Promise<AccountNote>
:
An account note.
try {
console.log(accountId)
const note = await client.getAccountNote(accountId, accountNoteId)
console.log('Fetched account note: ', note.message)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listShippingAddresses
(accountId, options)
Fetch a list of an account's shipping addresses
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_shipping_addresses
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
Pager<ShippingAddress>
:
A list of an account's shipping addresses.
const addresses = client.listShippingAddresses(accountId, { params: { limit: 200 } })
for await (const address of addresses.each()) {
console.log(address.street1)
}
createShippingAddress
(accountId, body, options)
Create a new shipping address for the account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_address
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
body |
ShippingAddressCreate | The object representing the JSON request to send to the server. It should conform to the schema of {ShippingAddressCreate} |
options |
any
= {}
|
Promise<ShippingAddress>
:
Returns the new shipping address.
try {
const shippingAddressCreate = {
firstName: 'Aaron',
lastName: 'Du Monde',
street1: '900 Camp St.',
city: 'New Orleans',
region: 'LA',
postalCode: '70115',
country: 'US'
}
const address = await client.createShippingAddress(accountId, shippingAddressCreate)
console.log('Created shipping address: ', address.street1)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getShippingAddress
(accountId, shippingAddressId, options)
Fetch an account's shipping address
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_address
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
shippingAddressId |
string | Shipping Address ID. |
options |
any
= {}
|
Promise<ShippingAddress>
:
A shipping address.
try {
const address = await client.getShippingAddress(accountId, shippingAddressId)
console.log('Fetched shipping address: ', address.street1)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
updateShippingAddress
(accountId, shippingAddressId, body, options)
Update an account's shipping address
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_address
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
shippingAddressId |
string | Shipping Address ID. |
body |
ShippingAddressUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {ShippingAddressUpdate} |
options |
any
= {}
|
Promise<ShippingAddress>
:
The updated shipping address.
try {
const shadUpdate = {
firstName: "Benjamin",
lastName: "Du Monde"
}
const address = await client.updateShippingAddress(accountId, shippingAddressId, shadUpdate)
console.log('Updated shipping address: ', address.street1)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
removeShippingAddress
(accountId, shippingAddressId, options)
Remove an account's shipping address
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_shipping_address
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
shippingAddressId |
string | Shipping Address ID. |
options |
any
= {}
|
Promise<Empty>
:
Shipping address deleted.
try {
await client.removeShippingAddress(accountId, shippingAddress.id)
console.log('Removed shipping address: ', shippingAddress.street1)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listAccountSubscriptions
(accountId, options)
List an account's subscriptions
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_subscriptions
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.state | string | Filter by state.
|
Pager<Subscription>
:
A list of the account's subscriptions.
const subscriptions = client.listAccountSubscriptions(accountId, { params: { limit: 200 } })
for await (const subscription of subscriptions.each()) {
console.log(subscription.uuid)
}
listAccountTransactions
(accountId, options)
List an account's transactions
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_transactions
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.type | string | Filter by type field. The value
payment
will return both
purchase
and
capture
transactions.
|
options.params.success | string | Filter by success field. |
Pager<Transaction>
:
A list of the account's transactions.
const transactions = client.listAccountTransactions(accountId, { params: { limit: 200 } })
for await (const transaction of transactions.each()) {
console.log(transaction.uuid)
}
listChildAccounts
(accountId, options)
List an account's child accounts
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_child_accounts
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.email | string | Filter for accounts with this exact email address. A blank value will return accounts with both
null
and
""
email addresses. Note that multiple accounts can share one email address.
|
options.params.subscriber | boolean | Filter for accounts with or without a subscription in the
active
,
canceled
, or
future
state.
|
options.params.pastDue | string | Filter for accounts with an invoice in the
past_due
state.
|
Pager<Account>
:
A list of an account's child accounts.
listAccountAcquisition
(options)
List a site's account acquisition data
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_acquisition
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
Pager<AccountAcquisition>
:
A list of the site's account acquisition data.
const acquisitions = client.listAccountAcquisition({ params: { limit: 200 } })
for await (const acquisition of acquisitions.each()) {
console.log(acquisition.id)
}
listCoupons
(options)
List a site's coupons
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_coupons
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
Pager<Coupon>
:
A list of the site's coupons.
const coupons = client.listCoupons({ params: { limit: 200 } })
for await (const coupon of coupons.each()) {
console.log(coupon.code)
}
createCoupon
(body, options)
Create a new coupon
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_coupon
parameter | type | description |
---|---|---|
body |
CouponCreate | The object representing the JSON request to send to the server. It should conform to the schema of {CouponCreate} |
options |
any
= {}
|
Promise<Coupon>
:
A new coupon.
try {
const couponCreate = {
name: "Promotional Coupon",
code: couponCode,
discount_type: "fixed",
currencies: [{"currency": "USD", "discount": 10}],
}
const coupon = await client.createCoupon(couponCreate)
console.log('Created coupon: ', coupon.id)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getCoupon
(couponId, options)
Fetch a coupon
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_coupon
parameter | type | description |
---|---|---|
couponId |
string | Coupon ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-10off
.
|
options |
any
= {}
|
Promise<Coupon>
:
A coupon.
try {
const coupon = await client.getCoupon(couponId)
console.log('Fetched coupon: ', coupon.code)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
updateCoupon
(couponId, body, options)
Update an active coupon
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_coupon
parameter | type | description |
---|---|---|
couponId |
string | Coupon ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-10off
.
|
body |
CouponUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {CouponUpdate} |
options |
any
= {}
|
Promise<Coupon>
:
The updated coupon.
try {
const couponUpdate = {
name: "New Coupon Name"
}
const coupon = await client.updateCoupon(couponId, couponUpdate)
console.log('Updated coupon: ', coupon)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
deactivateCoupon
(couponId, options)
Expire a coupon
API docs: https://developers.recurly.com/api/v2021-02-25#operation/deactivate_coupon
parameter | type | description |
---|---|---|
couponId |
string | Coupon ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-10off
.
|
options |
any
= {}
|
Promise<Coupon>
:
The expired Coupon
try {
const coupon = await client.deactivateCoupon(couponId)
console.log('Deactivated coupon: ', coupon.code)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
generateUniqueCouponCodes
(couponId, body, options)
Generate unique coupon codes
API docs: https://developers.recurly.com/api/v2021-02-25#operation/generate_unique_coupon_codes
parameter | type | description |
---|---|---|
couponId |
string | Coupon ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-10off
.
|
body |
CouponBulkCreate | The object representing the JSON request to send to the server. It should conform to the schema of {CouponBulkCreate} |
options |
any
= {}
|
Promise<UniqueCouponCodeParams>
:
A set of parameters that can be passed to the
list_unique_coupon_codes
endpoint to obtain only the newly generated
UniqueCouponCodes
.
restoreCoupon
(couponId, body, options)
Restore an inactive coupon
API docs: https://developers.recurly.com/api/v2021-02-25#operation/restore_coupon
parameter | type | description |
---|---|---|
couponId |
string | Coupon ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-10off
.
|
body |
CouponUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {CouponUpdate} |
options |
any
= {}
|
Promise<Coupon>
:
The restored coupon.
listUniqueCouponCodes
(couponId, options)
List unique coupon codes associated with a bulk coupon
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_unique_coupon_codes
parameter | type | description |
---|---|---|
couponId |
string | Coupon ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-10off
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
Pager<UniqueCouponCode>
:
A list of unique coupon codes that were generated
listCreditPayments
(options)
List a site's credit payments
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_credit_payments
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
Pager<CreditPayment>
:
A list of the site's credit payments.
const payments = client.listCreditPayments({ params: { limit: 200 } })
for await (const payment of payments.each()) {
console.log(payment.uuid)
}
getCreditPayment
(creditPaymentId, options)
Fetch a credit payment
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_credit_payment
parameter | type | description |
---|---|---|
creditPaymentId |
string | Credit Payment ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<CreditPayment>
:
A credit payment.
listCustomFieldDefinitions
(options)
List a site's custom field definitions
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_custom_field_definitions
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.relatedType | string | Filter by related type. |
Pager<CustomFieldDefinition>
:
A list of the site's custom field definitions.
const definitions = client.listCustomFieldDefinitions({ params: { limit: 200 } })
for await (const definition of definitions.each()) {
console.log(definition.displayName)
}
getCustomFieldDefinition
(customFieldDefinitionId, options)
Fetch an custom field definition
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_custom_field_definition
parameter | type | description |
---|---|---|
customFieldDefinitionId |
string | Custom Field Definition ID |
options |
any
= {}
|
Promise<CustomFieldDefinition>
:
A custom field definition.
try {
const definition = await client.getCustomFieldDefinition(definitionId)
console.log('Fetched custom field definition: ', definition.displayName)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
createGeneralLedgerAccount
(body, options)
Create a new general ledger account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_general_ledger_account
parameter | type | description |
---|---|---|
body |
GeneralLedgerAccountCreate | The object representing the JSON request to send to the server. It should conform to the schema of {GeneralLedgerAccountCreate} |
options |
any
= {}
|
Promise<GeneralLedgerAccount>
:
A new general ledger account.
listGeneralLedgerAccounts
(options)
List a site's general ledger accounts
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_general_ledger_accounts
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.accountType | string | General Ledger Account type by which to filter the response. |
Pager<GeneralLedgerAccount>
:
A list of the site's general ledger accounts.
getGeneralLedgerAccount
(generalLedgerAccountId, options)
Fetch a general ledger account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_general_ledger_account
parameter | type | description |
---|---|---|
generalLedgerAccountId |
string | General Ledger Account ID |
options |
any
= {}
|
Promise<GeneralLedgerAccount>
:
A general ledger account.
updateGeneralLedgerAccount
(generalLedgerAccountId, body, options)
Update a general ledger account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_general_ledger_account
parameter | type | description |
---|---|---|
generalLedgerAccountId |
string | General Ledger Account ID |
body |
GeneralLedgerAccountUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {GeneralLedgerAccountUpdate} |
options |
any
= {}
|
Promise<GeneralLedgerAccount>
:
The updated general ledger account.
getPerformanceObligation
(performanceObligationId, options)
Get a single Performance Obligation.
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_performance_obligation
parameter | type | description |
---|---|---|
performanceObligationId |
string | Performance Obligation id. |
options |
any
= {}
|
Promise<PerformanceObligation>
:
A single Performance Obligation.
getPerformanceObligations
(options)
Get a site's Performance Obligations
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_performance_obligations
parameter | type | description |
---|---|---|
options |
any
= {}
|
Pager<PerformanceObligation>
:
A list of Performance Obligations.
listInvoiceTemplateAccounts
(invoiceTemplateId, options)
List an invoice template's associated accounts
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_template_accounts
parameter | type | description |
---|---|---|
invoiceTemplateId |
string | Invoice template ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.email | string | Filter for accounts with this exact email address. A blank value will return accounts with both
null
and
""
email addresses. Note that multiple accounts can share one email address.
|
options.params.subscriber | boolean | Filter for accounts with or without a subscription in the
active
,
canceled
, or
future
state.
|
options.params.pastDue | string | Filter for accounts with an invoice in the
past_due
state.
|
Pager<Account>
:
A list of an invoice template's associated accounts.
listItems
(options)
List a site's items
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_items
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.state | string | Filter by state. |
Pager<Item>
:
A list of the site's items.
const items = client.listItems({ params: { limit: 200 } })
for await (const item of items.each()) {
console.log(item.code)
}
createItem
(body, options)
Create a new item
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_item
parameter | type | description |
---|---|---|
body |
ItemCreate | The object representing the JSON request to send to the server. It should conform to the schema of {ItemCreate} |
options |
any
= {}
|
Promise<Item>
:
A new item.
try {
const itemCreate = {
code: itemCode,
name: "Item Name",
description: "Item Description",
external_sku: "a35JE-44",
accounting_code: "item-code-127",
revenue_schedule_type: "at_range_end",
custom_fields: [{
name: "custom-field-1",
value: "Custom Field 1 value"
}]
}
const item = await client.createItem(itemCreate)
console.log('Created Item: ', item.code)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getItem
(itemId, options)
Fetch an item
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_item
parameter | type | description |
---|---|---|
itemId |
string | Item ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-red
.
|
options |
any
= {}
|
Promise<Item>
:
An item.
try {
const item = await client.getItem(itemId)
console.log('Fetched item: ', item.code)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
updateItem
(itemId, body, options)
Update an active item
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_item
parameter | type | description |
---|---|---|
itemId |
string | Item ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-red
.
|
body |
ItemUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {ItemUpdate} |
options |
any
= {}
|
Promise<Item>
:
The updated item.
try {
const itemUpdate = {
name: 'New Item Name',
description: 'New Item Description'
}
const item = await client.updateItem(itemId, itemUpdate)
console.log('Updated item: ', item)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
deactivateItem
(itemId, options)
Deactivate an item
API docs: https://developers.recurly.com/api/v2021-02-25#operation/deactivate_item
parameter | type | description |
---|---|---|
itemId |
string | Item ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-red
.
|
options |
any
= {}
|
Promise<Item>
:
An item.
try {
const item = await client.deactivateItem(itemId)
console.log('Deleted item: ', item.code)
} catch (err) {
if (err && err.type === 'not-found') {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
}
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
throw err
}
reactivateItem
(itemId, options)
Reactivate an inactive item
API docs: https://developers.recurly.com/api/v2021-02-25#operation/reactivate_item
parameter | type | description |
---|---|---|
itemId |
string | Item ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-red
.
|
options |
any
= {}
|
Promise<Item>
:
An item.
try {
const item = await client.reactivateItem(itemId)
console.log('Reactivated item: ', item.code)
} catch (err) {
if (err && err.type === 'not_found') {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
}
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
throw err
}
listMeasuredUnit
(options)
List a site's measured units
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_measured_unit
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.state | string | Filter by state. |
Pager<MeasuredUnit>
:
A list of the site's measured units.
createMeasuredUnit
(body, options)
Create a new measured unit
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_measured_unit
parameter | type | description |
---|---|---|
body |
MeasuredUnitCreate | The object representing the JSON request to send to the server. It should conform to the schema of {MeasuredUnitCreate} |
options |
any
= {}
|
Promise<MeasuredUnit>
:
A new measured unit.
getMeasuredUnit
(measuredUnitId, options)
Fetch a measured unit
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_measured_unit
parameter | type | description |
---|---|---|
measuredUnitId |
string | Measured unit ID or name. For ID no prefix is used e.g.
e28zov4fw0v2
. For name use prefix
name-
, e.g.
name-Storage
.
|
options |
any
= {}
|
Promise<MeasuredUnit>
:
An item.
updateMeasuredUnit
(measuredUnitId, body, options)
Update a measured unit
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_measured_unit
parameter | type | description |
---|---|---|
measuredUnitId |
string | Measured unit ID or name. For ID no prefix is used e.g.
e28zov4fw0v2
. For name use prefix
name-
, e.g.
name-Storage
.
|
body |
MeasuredUnitUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {MeasuredUnitUpdate} |
options |
any
= {}
|
Promise<MeasuredUnit>
:
The updated measured_unit.
removeMeasuredUnit
(measuredUnitId, options)
Remove a measured unit
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_measured_unit
parameter | type | description |
---|---|---|
measuredUnitId |
string | Measured unit ID or name. For ID no prefix is used e.g.
e28zov4fw0v2
. For name use prefix
name-
, e.g.
name-Storage
.
|
options |
any
= {}
|
Promise<MeasuredUnit>
:
A measured unit.
listExternalProducts
(options)
List a site's external products
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_external_products
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
Pager<ExternalProduct>
:
A list of the the external_products on a site.
createExternalProduct
(body, options)
Create an external product
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_external_product
parameter | type | description |
---|---|---|
body |
ExternalProductCreate | The object representing the JSON request to send to the server. It should conform to the schema of {ExternalProductCreate} |
options |
any
= {}
|
Promise<ExternalProduct>
:
Returns the external product
getExternalProduct
(externalProductId, options)
Fetch an external product
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_external_product
parameter | type | description |
---|---|---|
externalProductId |
string | External product id |
options |
any
= {}
|
Promise<ExternalProduct>
:
Settings for an external product.
updateExternalProduct
(externalProductId, body, options)
Update an external product
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_external_product
parameter | type | description |
---|---|---|
externalProductId |
string | External product id |
body |
ExternalProductUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {ExternalProductUpdate} |
options |
any
= {}
|
Promise<ExternalProduct>
:
Settings for an external product.
deactivateExternalProducts
(externalProductId, options)
Deactivate an external product
API docs: https://developers.recurly.com/api/v2021-02-25#operation/deactivate_external_products
parameter | type | description |
---|---|---|
externalProductId |
string | External product id |
options |
any
= {}
|
Promise<ExternalProduct>
:
Deactivated external product.
listExternalProductExternalProductReferences
(externalProductId, options)
List the external product references for an external product
parameter | type | description |
---|---|---|
externalProductId |
string | External product id |
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
Pager<ExternalProductReferenceCollection>
:
A list of the the external product references for an external product.
createExternalProductExternalProductReference
(externalProductId, body, options)
Create an external product reference on an external product
parameter | type | description |
---|---|---|
externalProductId |
string | External product id |
body |
ExternalProductReferenceCreate | The object representing the JSON request to send to the server. It should conform to the schema of {ExternalProductReferenceCreate} |
options |
any
= {}
|
Promise<ExternalProductReferenceMini>
:
Details for the external product reference.
getExternalProductExternalProductReference
(externalProductId, externalProductReferenceId, options)
Fetch an external product reference
parameter | type | description |
---|---|---|
externalProductId |
string | External product id |
externalProductReferenceId |
string | External product reference ID, e.g.
d39iun2fw1v4
.
|
options |
any
= {}
|
Promise<ExternalProductReferenceMini>
:
Details for an external product reference.
deactivateExternalProductExternalProductReference
(externalProductId, externalProductReferenceId, options)
Deactivate an external product reference
parameter | type | description |
---|---|---|
externalProductId |
string | External product id |
externalProductReferenceId |
string | External product reference ID, e.g.
d39iun2fw1v4
.
|
options |
any
= {}
|
Promise<ExternalProductReferenceMini>
:
Details for an external product reference.
listExternalSubscriptions
(options)
List a site's external subscriptions
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscriptions
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
Pager<ExternalSubscription>
:
A list of the the external_subscriptions on a site.
getExternalSubscription
(externalSubscriptionId, options)
Fetch an external subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription
parameter | type | description |
---|---|---|
externalSubscriptionId |
string | External subscription ID, external_id or uuid. For ID no prefix is used e.g.
e28zov4fw0v2
. For external_id use prefix
external-id-
, e.g.
external-id-123456
and for uuid use prefix
uuid-
e.g.
uuid-7293239bae62777d8c1ae044a9843633
.
|
options |
any
= {}
|
Promise<ExternalSubscription>
:
Settings for an external subscription.
listExternalSubscriptionExternalInvoices
(externalSubscriptionId, options)
List the external invoices on an external subscription
parameter | type | description |
---|---|---|
externalSubscriptionId |
string | External subscription id |
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
Pager<ExternalInvoice>
:
A list of the the external_invoices on a site.
listInvoices
(options)
List a site's invoices
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_invoices
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.state | string | Invoice state. |
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.type | string | Filter by type when:
|
Pager<Invoice>
:
A list of the site's invoices.
const invoices = client.listInvoices({ params: { limit: 200 } })
for await (const invoice of invoices.each()) {
console.log(invoice.number)
}
getInvoice
(invoiceId, options)
Fetch an invoice
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_invoice
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
options |
any
= {}
|
Promise<Invoice>
:
An invoice.
try {
const invoice = await client.getInvoice(invoiceId)
console.log('Fetched Invoice: ', invoice.number)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
updateInvoice
(invoiceId, body, options)
Update an invoice
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_invoice
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
body |
InvoiceUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {InvoiceUpdate} |
options |
any
= {}
|
Promise<Invoice>
:
An invoice.
try {
const invoiceUpdate = {
customerNotes: "New notes",
termsAndConditions: "New terms and conditions"
}
const invoice = await client.updateInvoice(invoiceId, invoiceUpdate)
console.log('Edited invoice: ', invoice.number)
} catch(err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getInvoicePdf
(invoiceId, options)
Fetch an invoice as a PDF
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_invoice_pdf
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
options |
any
= {}
|
Promise<BinaryFile>
:
An invoice as a PDF.
try {
const invoice = await client.getInvoicePdf(invoiceId)
console.log('Fetched Invoice: ', invoice)
const filename = `${downloadDirectory}/nodeinvoice-${invoiceId}.pdf`
await fs.writeFile(filename, invoice.data, 'binary', (err) => {
// throws an error, you could also catch it here
if (err) throw err;
// success case, the file was saved
console.log('Saved Invoice PDF to', filename)
})
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
applyCreditBalance
(invoiceId, options)
Apply available credit to a pending or past due charge invoice
API docs: https://developers.recurly.com/api/v2021-02-25#operation/apply_credit_balance
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
options |
any
= {}
|
Promise<Invoice>
:
The updated invoice.
try {
const invoice = await client.applyCreditBalance(invoiceId)
console.log('Applied credit balance to invoice: ', invoice)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
collectInvoice
(invoiceId, options)
Collect a pending or past due, automatic invoice
API docs: https://developers.recurly.com/api/v2021-02-25#operation/collect_invoice
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.body | InvoiceCollect | The object representing the JSON request to send to the server. It should conform to the schema of {InvoiceCollect} |
Promise<Invoice>
:
The updated invoice.
try {
const invoice = await client.collectInvoice(invoiceId)
console.log('Collected invoice: ', invoice.number)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
markInvoiceFailed
(invoiceId, options)
Mark an open invoice as failed
API docs: https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_failed
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
options |
any
= {}
|
Promise<Invoice>
:
The updated invoice.
try {
const invoice = await client.markInvoiceFailed(invoiceId)
console.log('Failed invoice: ', invoice.number)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
markInvoiceSuccessful
(invoiceId, options)
Mark an open invoice as successful
API docs: https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_successful
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
options |
any
= {}
|
Promise<Invoice>
:
The updated invoice.
try {
const invoice = await client.markInvoiceSuccessful(invoiceId)
console.log(`Marked invoice #${invoice.number} successful`)
} catch(err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
reopenInvoice
(invoiceId, options)
Reopen a closed, manual invoice
API docs: https://developers.recurly.com/api/v2021-02-25#operation/reopen_invoice
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
options |
any
= {}
|
Promise<Invoice>
:
The updated invoice.
try {
const invoice = await client.reopenInvoice(invoiceId)
console.log('Reopened invoice: ', invoice.number)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
voidInvoice
(invoiceId, options)
Void a credit invoice.
API docs: https://developers.recurly.com/api/v2021-02-25#operation/void_invoice
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
options |
any
= {}
|
Promise<Invoice>
:
The updated invoice.
try {
const invoice = await client.voidInvoice(invoiceId)
console.log('Voided invoice: ', invoice)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
recordExternalTransaction
(invoiceId, body, options)
Record an external payment for a manual invoices.
API docs: https://developers.recurly.com/api/v2021-02-25#operation/record_external_transaction
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
body |
ExternalTransaction | The object representing the JSON request to send to the server. It should conform to the schema of {ExternalTransaction} |
options |
any
= {}
|
Promise<Transaction>
:
The recorded transaction.
try {
const externalTrx = {
description: "A check collected outside of Recurly",
amount: 10.0,
payment_method: 'check'
}
const transaction = await client.recordExternalTransaction(invoiceId, externalTrx)
console.log('External Transaction: ', transaction)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listInvoiceLineItems
(invoiceId, options)
List an invoice's line items
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_line_items
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.original | string | Filter by original field. |
options.params.state | string | Filter by state field. |
options.params.type | string | Filter by type field. |
Pager<LineItem>
:
A list of the invoice's line items.
const lineItems = client.listInvoiceLineItems(invoiceId, { params: { limit: 200 } })
for await (const lineItem of lineItems.each()) {
console.log(lineItem.id)
}
listInvoiceCouponRedemptions
(invoiceId, options)
List the coupon redemptions applied to an invoice
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_coupon_redemptions
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
Pager<CouponRedemption>
:
A list of the the coupon redemptions associated with the invoice.
const redemptions = client.listInvoiceCouponRedemptions(invoiceId, { params: { limit: 200 } })
for await (const redemption of redemptions.each()) {
console.log(redemption.id)
}
refundInvoice
(invoiceId, body, options)
Refund an invoice
API docs: https://developers.recurly.com/api/v2021-02-25#operation/refund_invoice
parameter | type | description |
---|---|---|
invoiceId |
string | Invoice ID or number. For ID no prefix is used e.g.
e28zov4fw0v2
. For number use prefix
number-
, e.g.
number-1000
.
|
body |
InvoiceRefund | The object representing the JSON request to send to the server. It should conform to the schema of {InvoiceRefund} |
options |
any
= {}
|
Promise<Invoice>
:
Returns the new credit invoice.
try {
const invoiceRefund = {
creditCustomerNotes: "Notes on credits",
type: "amount", // could also be "line_items"
amount: 100
}
const invoice = await client.refundInvoice(invoiceId, invoiceRefund)
console.log('Refunded invoice: ', invoice.number)
} catch(err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listLineItems
(options)
List a site's line items
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_line_items
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.original | string | Filter by original field. |
options.params.state | string | Filter by state field. |
options.params.type | string | Filter by type field. |
Pager<LineItem>
:
A list of the site's line items.
const lineItems = client.listLineItems({ params: { limit: 200 } })
for await (const item of lineItems.each()) {
console.log(`Item ${item.id} for ${item.amount}`)
}
getLineItem
(lineItemId, options)
Fetch a line item
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_line_item
parameter | type | description |
---|---|---|
lineItemId |
string | Line Item ID. |
options |
any
= {}
|
Promise<LineItem>
:
A line item.
try {
const lineItem = await client.getLineItem(lineItemId)
console.log('Fetched line item: ', lineItem.uuid)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
removeLineItem
(lineItemId, options)
Delete an uninvoiced line item
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_line_item
parameter | type | description |
---|---|---|
lineItemId |
string | Line Item ID. |
options |
any
= {}
|
Promise<Empty>
:
Line item deleted.
try {
await client.removeLineItem(lineItemId)
console.log('Removed line item: ', lineItemId)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listPlans
(options)
List a site's plans
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_plans
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.state | string | Filter by state. |
Pager<Plan>
:
A list of plans.
const plans = client.listPlans({ params: { limit: 200 } })
for await (const plan of plans.each()) {
console.log(plan.code)
}
createPlan
(body, options)
Create a plan
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_plan
parameter | type | description |
---|---|---|
body |
PlanCreate | The object representing the JSON request to send to the server. It should conform to the schema of {PlanCreate} |
options |
any
= {}
|
Promise<Plan>
:
A plan.
try {
const planCreate = {
name: 'Monthly Coffee Subscription',
code: planCode,
currencies: [
{
currency: 'USD',
unitAmount: 10000
}
]
}
const plan = await client.createPlan(planCreate)
console.log('Created Plan: ', plan.code)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getPlan
(planId, options)
Fetch a plan
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_plan
parameter | type | description |
---|---|---|
planId |
string | Plan ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
options |
any
= {}
|
Promise<Plan>
:
A plan.
try {
const plan = await client.getPlan(planId)
console.log('Fetched plan: ', plan.code)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
updatePlan
(planId, body, options)
Update a plan
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_plan
parameter | type | description |
---|---|---|
planId |
string | Plan ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
body |
PlanUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {PlanUpdate} |
options |
any
= {}
|
Promise<Plan>
:
A plan.
try {
const planUpdate = {
name: 'New monthly coffee subscription'
}
const plan = await client.updatePlan(planId, planUpdate)
console.log('Updated plan: ', plan.code)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
removePlan
(planId, options)
Remove a plan
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_plan
parameter | type | description |
---|---|---|
planId |
string | Plan ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
options |
any
= {}
|
Promise<Plan>
:
Plan deleted
try {
const plan = await client.removePlan(planId)
console.log('Removed plan: ', plan.code)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listPlanAddOns
(planId, options)
List a plan's add-ons
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_plan_add_ons
parameter | type | description |
---|---|---|
planId |
string | Plan ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.state | string | Filter by state. |
Pager<AddOn>
:
A list of add-ons.
const addOns = client.listPlanAddOns(planId, { params: { limit: 200 } })
for await (const addOn of addOns.each()) {
console.log(addOn.code)
}
createPlanAddOn
(planId, body, options)
Create an add-on
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_plan_add_on
parameter | type | description |
---|---|---|
planId |
string | Plan ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
body |
AddOnCreate | The object representing the JSON request to send to the server. It should conform to the schema of {AddOnCreate} |
options |
any
= {}
|
Promise<AddOn>
:
An add-on.
try {
const addOnCreate = {
code: 'coffee_grinder',
name: 'A quality grinder for your beans',
defaultQuantity: 1,
currencies: [
{
currency: 'USD',
unitAmount: 10000
}
]
}
const addOn = await client.createPlanAddOn(planId, addOnCreate)
console.log('Created add-on: ', addOn.code)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getPlanAddOn
(planId, addOnId, options)
Fetch a plan's add-on
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_plan_add_on
parameter | type | description |
---|---|---|
planId |
string | Plan ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
addOnId |
string | Add-on ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
options |
any
= {}
|
Promise<AddOn>
:
An add-on.
try {
const addOn = await client.getPlanAddOn(planId, addOnId)
console.log('Fetched add-on: ', addOn.code)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
updatePlanAddOn
(planId, addOnId, body, options)
Update an add-on
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_plan_add_on
parameter | type | description |
---|---|---|
planId |
string | Plan ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
addOnId |
string | Add-on ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
body |
AddOnUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {AddOnUpdate} |
options |
any
= {}
|
Promise<AddOn>
:
An add-on.
try {
const addOnUpdate = {
name: 'New AddOn Name',
}
const addOn = await client.updatePlanAddOn(planId, addOnId, addOnUpdate)
console.log('Updated add-on: ', addOn)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
removePlanAddOn
(planId, addOnId, options)
Remove an add-on
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_plan_add_on
parameter | type | description |
---|---|---|
planId |
string | Plan ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
addOnId |
string | Add-on ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
options |
any
= {}
|
Promise<AddOn>
:
Add-on deleted
try {
const addOn = await client.removePlanAddOn(planId, addOnId)
console.log('Removed plan add-on: ', addOn)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listAddOns
(options)
List a site's add-ons
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_add_ons
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.state | string | Filter by state. |
Pager<AddOn>
:
A list of add-ons.
const addOns = client.listAddOns({ params: { limit: 200 } })
for await (const addOn of addOns.each()) {
console.log(addOn.code)
}
getAddOn
(addOnId, options)
Fetch an add-on
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_add_on
parameter | type | description |
---|---|---|
addOnId |
string | Add-on ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
options |
any
= {}
|
Promise<AddOn>
:
An add-on.
try {
const addOn = await client.getAddOn(addOnId)
console.log('Fetched add-on: ', addOn)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
listShippingMethods
(options)
List a site's shipping methods
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_shipping_methods
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
Pager<ShippingMethod>
:
A list of the site's shipping methods.
const methods = client.listShippingMethods({ params: { limit: 200 } })
for await (const method of methods.each()) {
console.log(method.code)
}
createShippingMethod
(body, options)
Create a new shipping method
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_method
parameter | type | description |
---|---|---|
body |
ShippingMethodCreate | The object representing the JSON request to send to the server. It should conform to the schema of {ShippingMethodCreate} |
options |
any
= {}
|
Promise<ShippingMethod>
:
A new shipping method.
getShippingMethod
(shippingMethodId, options)
Fetch a shipping method
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_method
parameter | type | description |
---|---|---|
shippingMethodId |
string | Shipping Method ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-usps_2-day
.
|
options |
any
= {}
|
Promise<ShippingMethod>
:
A shipping method.
updateShippingMethod
(shippingMethodId, body, options)
Update an active Shipping Method
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_method
parameter | type | description |
---|---|---|
shippingMethodId |
string | Shipping Method ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-usps_2-day
.
|
body |
ShippingMethodUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {ShippingMethodUpdate} |
options |
any
= {}
|
Promise<ShippingMethod>
:
The updated shipping method.
deactivateShippingMethod
(shippingMethodId, options)
Deactivate a shipping method
API docs: https://developers.recurly.com/api/v2021-02-25#operation/deactivate_shipping_method
parameter | type | description |
---|---|---|
shippingMethodId |
string | Shipping Method ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-usps_2-day
.
|
options |
any
= {}
|
Promise<ShippingMethod>
:
A shipping method.
listSubscriptions
(options)
List a site's subscriptions
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_subscriptions
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.state | string | Filter by state.
|
Pager<Subscription>
:
A list of the site's subscriptions.
const subscriptions = client.listSubscriptions({ params: { limit: 200 } })
for await (const subscription of subscriptions.each()) {
console.log(subscription.uuid)
}
createSubscription
(body, options)
Create a new subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_subscription
parameter | type | description |
---|---|---|
body |
SubscriptionCreate | The object representing the JSON request to send to the server. It should conform to the schema of {SubscriptionCreate} |
options |
any
= {}
|
Promise<Subscription>
:
A subscription.
try {
let subscriptionReq = {
planCode: planCode,
currency: `USD`,
account: {
code: accountCode
}
}
let sub = await client.createSubscription(subscriptionReq)
console.log('Created subscription: ', sub.uuid)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getSubscription
(subscriptionId, options)
Fetch a subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_subscription
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<Subscription>
:
A subscription.
try {
const subscription = await client.getSubscription(subscriptionId)
console.log('Fetched subscription: ', subscription.uuid)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
updateSubscription
(subscriptionId, body, options)
Update a subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_subscription
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
body |
SubscriptionUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {SubscriptionUpdate} |
options |
any
= {}
|
Promise<Subscription>
:
A subscription.
try {
const update = {
termsAndConditions: "Some new terms and conditions",
customerNotes: "Some new customer notes"
}
const subscription = await client.updateSubscription(subscriptionId, update)
console.log('Modified subscription: ', subscription.uuid)
} catch(err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
terminateSubscription
(subscriptionId, options)
Terminate a subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/terminate_subscription
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.refund | string | The type of refund to perform:
In the event that the most recent invoice is a $0 invoice paid entirely by credit, Recurly will apply the credit back to the customer’s account. You may also terminate a subscription with no refund and then manually refund specific invoices. |
options.params.charge | boolean | Applicable only if the subscription has usage based add-ons and unbilled usage logged for the current billing cycle. If true, current billing cycle unbilled usage is billed on the final invoice. If false, Recurly will create a negative usage record for current billing cycle usage that will zero out the final invoice line items. |
Promise<Subscription>
:
An expired subscription.
try {
const subscription = await client.terminateSubscription(subscriptionId)
console.log('Terminated subscription: ', subscription.uuid)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
cancelSubscription
(subscriptionId, options)
Cancel a subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/cancel_subscription
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.body | SubscriptionCancel | The object representing the JSON request to send to the server. It should conform to the schema of {SubscriptionCancel} |
Promise<Subscription>
:
A canceled or failed subscription.
try {
let expiredSub = await client.cancelSubscription(subscriptionId)
console.log('Canceled Subscription: ', expiredSub.uuid)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
reactivateSubscription
(subscriptionId, options)
Reactivate a canceled subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/reactivate_subscription
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<Subscription>
:
An active subscription.
try {
const subscription = await client.reactivateSubscription(subscriptionId)
console.log('Reactivated subscription: ', subscription.uuid)
} catch(err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
pauseSubscription
(subscriptionId, body, options)
Pause subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/pause_subscription
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
body |
SubscriptionPause | The object representing the JSON request to send to the server. It should conform to the schema of {SubscriptionPause} |
options |
any
= {}
|
Promise<Subscription>
:
A subscription.
try {
let pauseReq = {
remaining_pause_cycles: 2,
}
const subscription = await client.pauseSubscription(subscriptionId, pauseReq)
console.log('Paused subscription: ', subscription.id)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
resumeSubscription
(subscriptionId, options)
Resume subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/resume_subscription
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<Subscription>
:
A subscription.
try {
const subscription = await client.resumeSubscription(subscriptionId)
console.log('Resumed subscription: ', subscription.id)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
convertTrial
(subscriptionId, options)
Convert trial subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/convert_trial
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<Subscription>
:
A subscription.
getPreviewRenewal
(subscriptionId, options)
Fetch a preview of a subscription's renewal invoice(s)
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_preview_renewal
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<InvoiceCollection>
:
A preview of the subscription's renewal invoice(s).
try {
const invoiceCollection = await client.getPreviewRenewal(subscriptionId)
console.log('Fetched Renewal Preview with total: ', invoiceCollection.chargeInvoice.total)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getSubscriptionChange
(subscriptionId, options)
Fetch a subscription's pending change
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_change
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<SubscriptionChange>
:
A subscription's pending change.
try {
const change = await client.getSubscriptionChange(subscriptionId)
console.log('Fetched subscription change: ', change.id)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
createSubscriptionChange
(subscriptionId, body, options)
Create a new subscription change
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_subscription_change
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
body |
SubscriptionChangeCreate | The object representing the JSON request to send to the server. It should conform to the schema of {SubscriptionChangeCreate} |
options |
any
= {}
|
Promise<SubscriptionChange>
:
A subscription change.
try {
const subscriptionChangeCreate = {
planCode: newPlanCode,
timeframe: 'now'
}
const change = await client.createSubscriptionChange(subscriptionId, subscriptionChangeCreate)
console.log('Created subscription change: ', change.id)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
removeSubscriptionChange
(subscriptionId, options)
Delete the pending subscription change
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_subscription_change
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<Empty>
:
Subscription change was deleted.
try {
await client.removeSubscriptionChange(subscriptionId)
console.log('Removed subscription change: ', subscriptionId)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
previewSubscriptionChange
(subscriptionId, body, options)
Preview a new subscription change
API docs: https://developers.recurly.com/api/v2021-02-25#operation/preview_subscription_change
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
body |
SubscriptionChangeCreate | The object representing the JSON request to send to the server. It should conform to the schema of {SubscriptionChangeCreate} |
options |
any
= {}
|
Promise<SubscriptionChange>
:
A subscription change.
listSubscriptionInvoices
(subscriptionId, options)
List a subscription's invoices
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_invoices
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.state | string | Invoice state. |
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.type | string | Filter by type when:
|
Pager<Invoice>
:
A list of the subscription's invoices.
const invoices = client.listSubscriptionInvoices(subscriptionId, { params: { limit: 200 } })
for await (const invoice of invoices.each()) {
console.log(invoice.number)
}
listSubscriptionLineItems
(subscriptionId, options)
List a subscription's line items
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_line_items
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.original | string | Filter by original field. |
options.params.state | string | Filter by state field. |
options.params.type | string | Filter by type field. |
Pager<LineItem>
:
A list of the subscription's line items.
const lineItems = client.listSubscriptionLineItems(subscriptionId, { params: { limit: 200 } })
for await (const lineItem of lineItems.each()) {
console.log(lineItem.id)
}
listSubscriptionCouponRedemptions
(subscriptionId, options)
List the coupon redemptions for a subscription
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_coupon_redemptions
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
Pager<CouponRedemption>
:
A list of the the coupon redemptions on a subscription.
const redemptions = client.listSubscriptionCouponRedemptions(subscriptionId, { params: { limit: 200 } })
for await (const redemption of redemptions.each()) {
console.log(redemption.id)
}
listUsage
(subscriptionId, addOnId, options)
List a subscription add-on's usage records
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_usage
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
addOnId |
string | Add-on ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
usage_timestamp
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=usage_timestamp
or
sort=recorded_timestamp
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=usage_timestamp
or
sort=recorded_timestamp
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.billingStatus | string | Filter by usage record's billing status |
Pager<Usage>
:
A list of the subscription add-on's usage records.
createUsage
(subscriptionId, addOnId, body, options)
Log a usage record on this subscription add-on
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_usage
parameter | type | description |
---|---|---|
subscriptionId |
string | Subscription ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
addOnId |
string | Add-on ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-gold
.
|
body |
UsageCreate | The object representing the JSON request to send to the server. It should conform to the schema of {UsageCreate} |
options |
any
= {}
|
Promise<Usage>
:
The created usage record.
getUsage
(usageId, options)
Get a usage record
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_usage
parameter | type | description |
---|---|---|
usageId |
string | Usage Record ID. |
options |
any
= {}
|
Promise<Usage>
:
The usage record.
updateUsage
(usageId, body, options)
Update a usage record
API docs: https://developers.recurly.com/api/v2021-02-25#operation/update_usage
parameter | type | description |
---|---|---|
usageId |
string | Usage Record ID. |
body |
UsageCreate | The object representing the JSON request to send to the server. It should conform to the schema of {UsageCreate} |
options |
any
= {}
|
Promise<Usage>
:
The updated usage record.
removeUsage
(usageId, options)
Delete a usage record.
API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_usage
parameter | type | description |
---|---|---|
usageId |
string | Usage Record ID. |
options |
any
= {}
|
Promise<Empty>
:
Usage was successfully deleted.
listTransactions
(options)
List a site's transactions
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_transactions
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.type | string | Filter by type field. The value
payment
will return both
purchase
and
capture
transactions.
|
options.params.success | string | Filter by success field. |
Pager<Transaction>
:
A list of the site's transactions.
const transactions = client.listTransactions({ params: { limit: 200 } })
for await (const transaction of transactions.each()) {
console.log(transaction.uuid)
}
getTransaction
(transactionId, options)
Fetch a transaction
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_transaction
parameter | type | description |
---|---|---|
transactionId |
string | Transaction ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<Transaction>
:
A transaction.
try {
const transaction = await client.getTransaction(transactionId)
console.log('Fetched transaction: ', transaction.uuid)
} catch (err) {
if (err instanceof recurly.errors.NotFoundError) {
// If the request was not found, you may want to alert the user or
// just return null
console.log('Resource Not Found')
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
getUniqueCouponCode
(uniqueCouponCodeId, options)
Fetch a unique coupon code
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_unique_coupon_code
parameter | type | description |
---|---|---|
uniqueCouponCodeId |
string | Unique Coupon Code ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-abc-8dh2-def
.
|
options |
any
= {}
|
Promise<UniqueCouponCode>
:
A unique coupon code.
deactivateUniqueCouponCode
(uniqueCouponCodeId, options)
Deactivate a unique coupon code
API docs: https://developers.recurly.com/api/v2021-02-25#operation/deactivate_unique_coupon_code
parameter | type | description |
---|---|---|
uniqueCouponCodeId |
string | Unique Coupon Code ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-abc-8dh2-def
.
|
options |
any
= {}
|
Promise<UniqueCouponCode>
:
A unique coupon code.
reactivateUniqueCouponCode
(uniqueCouponCodeId, options)
Restore a unique coupon code
API docs: https://developers.recurly.com/api/v2021-02-25#operation/reactivate_unique_coupon_code
parameter | type | description |
---|---|---|
uniqueCouponCodeId |
string | Unique Coupon Code ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-abc-8dh2-def
.
|
options |
any
= {}
|
Promise<UniqueCouponCode>
:
A unique coupon code.
createPurchase
(body, options)
Create a new purchase
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_purchase
parameter | type | description |
---|---|---|
body |
PurchaseCreate | The object representing the JSON request to send to the server. It should conform to the schema of {PurchaseCreate} |
options |
any
= {}
|
Promise<InvoiceCollection>
:
Returns the new invoices
try {
let purchaseReq = {
currency: 'USD',
account: {
code: accountCode,
firstName: 'Benjamin',
lastName: 'Du Monde',
billingInfo: {
tokenId: rjsTokenId
}
},
subscriptions: [
{ planCode: planCode },
]
}
let invoiceCollection = await client.createPurchase(purchaseReq)
console.log('Created Charge Invoice: ', invoiceCollection.chargeInvoice)
console.log('Created Credit Invoices: ', invoiceCollection.creditInvoices)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
previewPurchase
(body, options)
Preview a new purchase
API docs: https://developers.recurly.com/api/v2021-02-25#operation/preview_purchase
parameter | type | description |
---|---|---|
body |
PurchaseCreate | The object representing the JSON request to send to the server. It should conform to the schema of {PurchaseCreate} |
options |
any
= {}
|
Promise<InvoiceCollection>
:
Returns preview of the new invoices
try {
let purchaseReq = {
currency: 'USD',
account: {
firstName: 'Benjamin',
lastName: 'Du Monde',
code: accountCode,
billingInfo: {
tokenId: rjsTokenId
}
},
subscriptions: [
{ planCode: planCode },
]
}
let invoiceCollection = await client.previewPurchase(purchaseReq)
console.log('Preview Charge Invoice: ', invoiceCollection.chargeInvoice)
console.log('Preview Credit Invoices: ', invoiceCollection.creditInvoices)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
createPendingPurchase
(body, options)
Create a pending purchase
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_pending_purchase
parameter | type | description |
---|---|---|
body |
PurchaseCreate | The object representing the JSON request to send to the server. It should conform to the schema of {PurchaseCreate} |
options |
any
= {}
|
Promise<InvoiceCollection>
:
Returns the pending invoice
try {
const purchaseReq = {
currency: 'EUR',
account: {
code: accountCode,
email: 'example@recurly.com',
billingInfo: {
firstName: 'Benjamin',
lastName: 'Du Monde',
onlineBankingPaymentType: 'ideal'
},
},
lineItems: [
{
currency: 'EUR',
unitAmount: 1000,
type: 'charge'
}
]
};
const invoiceCollection = await client.createPendingPurchase(purchaseReq)
console.log('Created ChargeInvoice with UUID: ', invoiceCollection.chargeInvoice.uuid)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
createCapturePurchase
(transactionId, options)
Capture a purchase
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_capture_purchase
parameter | type | description |
---|---|---|
transactionId |
string | Transaction ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<InvoiceCollection>
:
Returns the captured invoice
cancelpurchase
(transactionId, options)
Cancel Purchase
API docs: https://developers.recurly.com/api/v2021-02-25#operation/cancelPurchase
parameter | type | description |
---|---|---|
transactionId |
string | Transaction ID or UUID. For ID no prefix is used e.g.
e28zov4fw0v2
. For UUID use prefix
uuid-
, e.g.
uuid-123457890
.
|
options |
any
= {}
|
Promise<InvoiceCollection>
:
Returns the cancelled invoice
getExportDates
(options)
List the dates that have an available export to download.
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_export_dates
parameter | type | description |
---|---|---|
options |
any
= {}
|
Promise<ExportDates>
:
Returns a list of dates.
try {
const export_dates = await client.getExportDates()
export_dates.dates.forEach(date => {
console.log(`Exports are available for: ${date}`)
})
} catch (err) {
if (err instanceof recurly.ApiError) {
console.log('Unexpected error', err)
}
}
getExportFiles
(exportDate, options)
List of the export files that are available to download.
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_export_files
parameter | type | description |
---|---|---|
exportDate |
string | Date for which to get a list of available automated export files. Date must be in YYYY-MM-DD format. |
options |
any
= {}
|
Promise<ExportFiles>
:
Returns a list of export files to download.
try {
const export_files = await client.getExportFiles(export_date)
export_files.files.forEach(file => {
console.log(`Export file download URL: ${file.href}`)
})
} catch (err) {
if (err instanceof recurly.ApiError) {
console.log('Unexpected error', err)
}
}
listDunningCampaigns
(options)
List the dunning campaigns for a site
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_dunning_campaigns
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
Pager<DunningCampaign>
:
A list of the the dunning_campaigns on an account.
getDunningCampaign
(dunningCampaignId, options)
Fetch a dunning campaign
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_dunning_campaign
parameter | type | description |
---|---|---|
dunningCampaignId |
string | Dunning Campaign ID, e.g.
e28zov4fw0v2
.
|
options |
any
= {}
|
Promise<DunningCampaign>
:
Settings for a dunning campaign.
putDunningCampaignBulkUpdate
(dunningCampaignId, body, options)
Assign a dunning campaign to multiple plans
API docs: https://developers.recurly.com/api/v2021-02-25#operation/put_dunning_campaign_bulk_update
parameter | type | description |
---|---|---|
dunningCampaignId |
string | Dunning Campaign ID, e.g.
e28zov4fw0v2
.
|
body |
DunningCampaignsBulkUpdate | The object representing the JSON request to send to the server. It should conform to the schema of {DunningCampaignsBulkUpdate} |
options |
any
= {}
|
Promise<DunningCampaignsBulkUpdateResponse>
:
A list of updated plans.
listInvoiceTemplates
(options)
Show the invoice templates for a site
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_templates
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
Pager<InvoiceTemplate>
:
A list of the the invoice templates on a site.
getInvoiceTemplate
(invoiceTemplateId, options)
Fetch an invoice template
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_invoice_template
parameter | type | description |
---|---|---|
invoiceTemplateId |
string | Invoice template ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
any
= {}
|
Promise<InvoiceTemplate>
:
Settings for an invoice template.
listExternalInvoices
(options)
List the external invoices on a site
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_external_invoices
parameter | type | description |
---|---|---|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
Pager<ExternalInvoice>
:
A list of the the external_invoices on a site.
showExternalInvoice
(externalInvoiceId, options)
Fetch an external invoice
API docs: https://developers.recurly.com/api/v2021-02-25#operation/show_external_invoice
parameter | type | description |
---|---|---|
externalInvoiceId |
string | External invoice ID, e.g.
e28zov4fw0v2
.
|
options |
any
= {}
|
Promise<ExternalInvoice>
:
Returns the external invoice
listExternalSubscriptionExternalPaymentPhases
(externalSubscriptionId, options)
List the external payment phases on an external subscription
parameter | type | description |
---|---|---|
externalSubscriptionId |
string | External subscription id |
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
Pager<ExternalPaymentPhase>
:
A list of the the external_payment_phases on a site.
getExternalSubscriptionExternalPaymentPhase
(externalSubscriptionId, externalPaymentPhaseId, options)
Fetch an external payment phase
parameter | type | description |
---|---|---|
externalSubscriptionId |
string | External subscription id |
externalPaymentPhaseId |
string | External payment phase ID, e.g.
a34ypb2ef9w1
.
|
options |
any
= {}
|
Promise<ExternalPaymentPhase>
:
Details for an external payment phase.
listEntitlements
(accountId, options)
List entitlements granted to an account
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_entitlements
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.state | string | Filter the entitlements based on the state of the applicable subscription.
|
Pager<Entitlements>
:
A list of the entitlements granted to an account.
listAccountExternalSubscriptions
(accountId, options)
List an account's external subscriptions
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_subscriptions
parameter | type | description |
---|---|---|
accountId |
string | Account ID or code. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-bob
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
Pager<ExternalSubscription>
:
A list of the the external_subscriptions on an account.
getBusinessEntity
(businessEntityId, options)
Fetch a business entity
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_business_entity
parameter | type | description |
---|---|---|
businessEntityId |
string | Business Entity ID. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-entity1
.
|
options |
any
= {}
|
Promise<BusinessEntity>
:
Business entity details
listBusinessEntities
(options)
List business entities
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_business_entities
parameter | type | description |
---|---|---|
options |
any
= {}
|
Pager<BusinessEntity>
:
List of all business entities on your site.
listGiftCards
(options)
List gift cards
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_gift_cards
parameter | type | description |
---|---|---|
options |
any
= {}
|
Pager<GiftCard>
:
List of all created gift cards on your site.
createGiftCard
(body, options)
Create gift card
API docs: https://developers.recurly.com/api/v2021-02-25#operation/create_gift_card
parameter | type | description |
---|---|---|
body |
GiftCardCreate | The object representing the JSON request to send to the server. It should conform to the schema of {GiftCardCreate} |
options |
any
= {}
|
Promise<GiftCard>
:
Returns the gift card
getGiftCard
(giftCardId, options)
Fetch a gift card
API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_gift_card
parameter | type | description |
---|---|---|
giftCardId |
string | Gift Card ID, e.g.
e28zov4fw0v2
.
|
options |
any
= {}
|
Promise<GiftCard>
:
Gift card details
previewGiftCard
(body, options)
Preview gift card
API docs: https://developers.recurly.com/api/v2021-02-25#operation/preview_gift_card
parameter | type | description |
---|---|---|
body |
GiftCardCreate | The object representing the JSON request to send to the server. It should conform to the schema of {GiftCardCreate} |
options |
any
= {}
|
Promise<GiftCard>
:
Returns the gift card
redeemGiftCard
(redemptionCode, body, options)
Redeem gift card
API docs: https://developers.recurly.com/api/v2021-02-25#operation/redeem_gift_card
parameter | type | description |
---|---|---|
redemptionCode |
string | Gift Card redemption code, e.g.,
N1A2T8IRXSCMO40V
.
|
body |
GiftCardRedeem | The object representing the JSON request to send to the server. It should conform to the schema of {GiftCardRedeem} |
options |
any
= {}
|
Promise<GiftCard>
:
Redeems and returns the gift card
listBusinessEntityInvoices
(businessEntityId, options)
List a business entity's invoices
API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_business_entity_invoices
parameter | type | description |
---|---|---|
businessEntityId |
string | Business Entity ID. For ID no prefix is used e.g.
e28zov4fw0v2
. For code use prefix
code-
, e.g.
code-entity1
.
|
options |
Object
= {}
|
Optional configurations for the request |
options.params | Object | The optional url parameters for this request. |
options.params.ids | Array<string> | Filter results by their IDs. Up to 200 IDs can be passed at once using
commas as separators, e.g.
ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6
.
Important notes:
|
options.params.state | string | Invoice state. |
options.params.limit | number | Limit number of records 1-200. |
options.params.order | string | Sort order. |
options.params.sort | string | Sort field. You
really
only want to sort by
updated_at
in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
|
options.params.beginTime | Date | Inclusively filter by begin_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.endTime | Date | Inclusively filter by end_time when
sort=created_at
or
sort=updated_at
.
Note:
this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
options.params.type | string | Filter by type when:
|
Pager<Invoice>
:
A list of the business entity's invoices.
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Response
()
This class contains the metadata from the HTTP response from Recurly.
property | type | description |
---|---|---|
request | Request | : The request responsible for this response. |
body | Object | : The parsed JSON response body. |
statusCode | number | : The HTTP status code. |
contentType | string | : The HTTP content type. |
requestId | string | : The unique id Recurly assigned to this request. Keep this for support. |
rateLimit | number | : The max rate limit. |
rateLimitRemaining | number | : The number of requests remaining until limit is reached. |
rateLimitReset | Date | : The datetime in which the rate limiter will be reset. |
apiDeprecated | boolean | : true if you are using a deprecated version of the API. |
apiSunsetDate | string | : The date in which this version will be sunset. |
date | string | : The date time from the server. |
proxyMetadata | Object | : Metadata from the proxy (e.g. cloudflare). Can be useful for debugging. |
Request
(method, path, body)
This class contains the metadata from the HTTP request sent to Recurly.
parameter | type | description |
---|---|---|
method |
string | The HTTP method of the request. |
path |
string | The path of the request. |
body |
Object
= null
|
The JSON body of the request (optional). |
Pager
(client, path, options)
The class responsible for pagination.
parameter | type | description |
---|---|---|
client |
Client | |
path |
string | |
options |
Object |
eachPage
()
Returns an async iterator over each page of results.
each
()
Returns an async iterator over each resource in results.
count
()
Count the number of resources that match this Pager's filters
Number
:
The count of resources
first
()
Return only the first item. This is efficient because it tells
the server to only return 1 item. You can also use this method
to get the last resource by inverting the order
parameter.
Object
:
The first resource in the list
getResponse
()
This allows you to inspect the underlying HTTP metadata which created this resoource.
Response
:
The underlying HTTP response.
getCompiledSchema
()
Holds a cached copy of the compiled Schema object for this Resource.
cast
(v)
Can cast a plain js Object to a Resource of this class type
parameter | type | description |
---|---|---|
v |
Object | The plain js Object to cast |
Empty
()
A special resource for an empty response
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Account
()
Account
Type: Object
property | type | description |
---|---|---|
address | Address | |
billTo | string | : An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay. |
billingInfo | BillingInfo | |
ccEmails | string | : Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the
email
field also receives.
|
code | string | : The unique identifier of the account. This cannot be changed once the account is created. |
company | string | |
createdAt | Date | : When the account was created. |
customFields | Array<CustomField> | : 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. |
deletedAt | Date | : If present, when the account was last marked inactive. |
dunningCampaignId | string | : Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used. |
string | : The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique. | |
entityUseCode | string | : The Avalara AvaTax value that can be passed to identify the customer type for tax purposes. The range of values can be A - R (more info at Avalara). Value is case-sensitive. |
exemptionCertificate | string | : The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account. |
externalAccounts | Array<ExternalAccount> | : The external accounts belonging to this account |
firstName | string | |
hasActiveSubscription | boolean | : Indicates if the account has an active subscription. |
hasCanceledSubscription | boolean | : Indicates if the account has a canceled subscription. |
hasFutureSubscription | boolean | : Indicates if the account has a future subscription. |
hasLiveSubscription | boolean | : Indicates if the account has a subscription that is either active, canceled, future, or paused. |
hasPastDueInvoice | boolean | : Indicates if the account has a past due invoice. |
hasPausedSubscription | boolean | : Indicates if the account has a paused subscription. |
hostedLoginToken | string | : The unique token for automatically logging the account in to the hosted management pages. You may automatically log the user into their hosted management pages by directing the user to:
https://{subdomain}.recurly.com/account/{hosted_login_token}
.
|
id | string | |
invoiceTemplateId | string | : Unique ID to identify an invoice template. Available when the site is on a Pro or Elite plan. Used to specify if a non-default invoice template will be used to generate invoices for the account. For sites without multiple invoice templates enabled, the default template will always be used. |
lastName | string | |
object | string | : Object type |
overrideBusinessEntityId | string | : Unique ID to identify the business entity assigned to the account. Available when the
Multiple Business Entities
feature is enabled.
|
parentAccountId | string | : The UUID of the parent account associated with this account. |
preferredLocale | string | : Used to determine the language and locale of emails sent on behalf of the merchant to the customer. |
preferredTimeZone | string | : The IANA time zone name used to determine the time zone of emails sent on behalf of the merchant to the customer. |
shippingAddresses | Array<ShippingAddress> | : The shipping addresses on the account. |
state | string | : Accounts can be either active or inactive. |
taxExempt | boolean | : The tax status of the account.
true
exempts tax on the account,
false
applies tax on the account.
|
updatedAt | Date | : When the account was last changed. |
username | string | : A secondary value for the account. |
vatNumber | string | : The VAT number of the account (to avoid having the VAT applied). This is only used for manually collected invoices. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
AccountAcquisition
()
AccountAcquisition
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : Account mini details |
campaign | string | : An arbitrary identifier for the marketing campaign that led to the acquisition of this account. |
channel | string | : The channel through which the account was acquired. |
cost | AccountAcquisitionCost | : Account balance |
createdAt | Date | : When the account acquisition data was created. |
id | string | |
object | string | : Object type |
subchannel | string | : An arbitrary subchannel string representing a distinction/subcategory within a broader channel. |
updatedAt | Date | : When the account acquisition data was last changed. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
AccountAcquisitionCost
()
AccountAcquisitionCost
Type: Object
property | type | description |
---|---|---|
amount | number | : The amount of the corresponding currency used to acquire the account. |
currency | string | : 3-letter ISO 4217 currency code. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
AccountBalance
()
AccountBalance
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : Account mini details |
balances | Array<AccountBalanceAmount> | |
object | string | : Object type |
pastDue | boolean |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
AccountBalanceAmount
()
AccountBalanceAmount
Type: Object
property | type | description |
---|---|---|
amount | number | : Total amount the account is past due. |
availableCreditAmount | number | : Total amount of the open balances on credit invoices for the account. |
currency | string | : 3-letter ISO 4217 currency code. |
processingPrepaymentAmount | number | : Total amount for the prepayment credit invoices in a
processing
state on the account.
|
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
AccountMini
()
AccountMini
Type: Object
property | type | description |
---|---|---|
billTo | string | |
code | string | : The unique identifier of the account. |
company | string | |
dunningCampaignId | string | : Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used. |
string | : The email address used for communicating with this customer. | |
firstName | string | |
id | string | |
lastName | string | |
object | string | : Object type |
parentAccountId | string |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
AccountNote
()
AccountNote
Type: Object
property | type | description |
---|---|---|
accountId | string | |
createdAt | Date | |
id | string | |
message | string | |
object | string | : Object type |
user | User |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
AddOn
()
AddOn
Type: Object
property | type | description |
---|---|---|
accountingCode | string | : Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code. |
addOnType | string | : Whether the add-on type is fixed, or usage-based. |
avalaraServiceType | number | : Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to the documentation for more available t/s types. |
avalaraTransactionType | number | : Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to the documentation for more available t/s types. |
code | string | : The unique identifier for the add-on within its plan. |
createdAt | Date | : Created at |
currencies | Array<AddOnPricing> | : Add-on pricing |
defaultQuantity | number | : Default quantity for the hosted pages. |
deletedAt | Date | : Deleted at |
displayQuantity | boolean | : Determines if the quantity field is displayed on the hosted pages for the add-on. |
externalSku | string | : Optional, stock keeping unit to link the item to other inventory systems. |
id | string | : Add-on ID |
item | ItemMini | : Just the important parts. |
liabilityGlAccountId | string | : 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. |
measuredUnitId | string | : System-generated unique identifier for an measured unit associated with the add-on. |
name | string | : Describes your add-on and will appear in subscribers' invoices. |
object | string | : Object type |
optional | boolean | : Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. If false, the add-on will be included when a subscription is created through the Recurly UI. However, the add-on will not be included when a subscription is created through the API. |
percentageTiers | Array<PercentageTiersByCurrency> | : This feature is currently in development and requires approval and enablement, please contact support. |
performanceObligationId | string | : The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features. |
planId | string | : Plan ID |
revenueGlAccountId | string | : 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. |
revenueScheduleType | string | : When this add-on is invoiced, the line item will use this revenue schedule. If
item_code
/
item_id
is part of the request then
revenue_schedule_type
must be absent in the request as the value will be set from the item.
|
state | string | : Add-ons can be either active or inactive. |
taxCode | string | : 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. If
item_code
/
item_id
is part of the request then
tax_code
must be absent.
|
tierType | string | : The pricing model for the add-on. For more information, click here . See our Guide for an overview of how to configure quantity-based pricing models. |
tiers | Array<Tier> | : Tiers |
updatedAt | Date | : Last updated at |
usageCalculationType | string | : The type of calculation to be employed for an add-on. Cumulative billing will sum all usage records created in the current billing cycle. Last-in-period billing will apply only the most recent usage record in the billing period. If no value is specified, cumulative billing will be used. |
usagePercentage | number | : The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. |
usageTimeframe | string | : The time at which usage totals are reset for billing purposes. |
usageType | string | : Type of usage, returns usage type if
add_on_type
is
usage
.
|
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
AddOnMini
()
AddOnMini
Type: Object
property | type | description |
---|---|---|
accountingCode | string | : Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code. |
addOnType | string | : Whether the add-on type is fixed, or usage-based. |
code | string | : The unique identifier for the add-on within its plan. |
externalSku | string | : Optional, stock keeping unit to link the item to other inventory systems. |
id | string | : Add-on ID |
itemId | string | : Item ID |
measuredUnitId | string | : System-generated unique identifier for an measured unit associated with the add-on. |
name | string | : Describes your add-on and will appear in subscribers' invoices. |
object | string | : Object type |
usagePercentage | number | : The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. |
usageType | string | : Type of usage, returns usage type if
add_on_type
is
usage
.
|
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
AddOnPricing
()
AddOnPricing
Type: Object
property | type | description |
---|---|---|
currency | string | : 3-letter ISO 4217 currency code. |
taxInclusive | boolean | : This field is deprecated. Please do not use it. |
unitAmount | number | : Allows up to 2 decimal places. Required unless
unit_amount_decimal
is provided.
|
unitAmountDecimal | string | : Allows up to 9 decimal places. Only supported when
add_on_type
=
usage
. If
unit_amount_decimal
is provided,
unit_amount
cannot be provided.
|
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Address
()
Address
Type: Object
property | type | description |
---|---|---|
city | string | : City |
country | string | : Country, 2-letter ISO 3166-1 alpha-2 code. |
geoCode | string | : Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration |
phone | string | : Phone number |
postalCode | string | : Zip or postal code. |
region | string | : State or province. |
street1 | string | : Street 1 |
street2 | string | : Street 2 |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
AddressWithName
()
AddressWithName
Type: Object
property | type | description |
---|---|---|
city | string | : City |
country | string | : Country, 2-letter ISO 3166-1 alpha-2 code. |
firstName | string | : First name |
geoCode | string | : Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration |
lastName | string | : Last name |
phone | string | : Phone number |
postalCode | string | : Zip or postal code. |
region | string | : State or province. |
street1 | string | : Street 1 |
street2 | string | : Street 2 |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
BillingInfo
()
BillingInfo
Type: Object
property | type | description |
---|---|---|
accountId | string | |
address | Address | |
backupPaymentMethod | boolean | : The
backup_payment_method
field is used to indicate a billing info as a backup on the account that will be tried if the initial billing info used for an invoice is declined.
|
company | string | |
createdAt | Date | : When the billing information was created. |
firstName | string | |
fraud | FraudInfo | : Most recent fraud result. |
id | string | |
lastName | string | |
object | string | : Object type |
paymentMethod | PaymentMethod | |
primaryPaymentMethod | boolean | : The
primary_payment_method
field is used to indicate the primary billing info on the account. The first billing info created on an account will always become primary. This payment method will be used
|
updatedAt | Date | : When the billing information was last changed. |
updatedBy | BillingInfoUpdatedBy | |
valid | boolean | |
vatNumber | string | : Customer's VAT number (to avoid having the VAT applied). This is only used for automatically collected invoices. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
BillingInfoUpdatedBy
()
BillingInfoUpdatedBy
Type: Object
property | type | description |
---|---|---|
country | string | : Country, 2-letter ISO 3166-1 alpha-2 code matching the origin IP address, if known by Recurly. |
ip | string | : Customer's IP address when updating their billing information. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
BinaryFile
()
BinaryFile
Type: Object
property | type | description |
---|---|---|
data | string |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
BusinessEntity
()
BusinessEntity
Type: Object
property | type | description |
---|---|---|
code | string | : The entity code of the business entity. |
createdAt | Date | : Created at |
defaultLiabilityGlAccountId | string | : 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. |
defaultRegistrationNumber | string | : Registration number for the customer used on the invoice. |
defaultRevenueGlAccountId | string | : 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. |
defaultVatNumber | string | : VAT number for the customer used on the invoice. |
destinationTaxAddressSource | string | : 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". |
id | string | : Business entity ID |
invoiceDisplayAddress | Address | : Address information for the business entity that will appear on the invoice. |
name | string | : This name describes your business entity and will appear on the invoice. |
object | string | : Object type |
originTaxAddressSource | string | : 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". |
subscriberLocationCountries | Array<string> | : List of countries for which the business entity will be used. |
taxAddress | Address | : Address information for the business entity that will be used for calculating taxes. |
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Coupon
()
Coupon
Type: Object
property | type | description |
---|---|---|
appliesToAllItems | boolean | : The coupon is valid for all items if true. If false then
items
will list the applicable items.
|
appliesToAllPlans | boolean | : The coupon is valid for all plans if true. If false then
plans
will list the applicable plans.
|
appliesToNonPlanCharges | boolean | : The coupon is valid for one-time, non-plan charges if true. |
code | string | : The code the customer enters to redeem the coupon. |
couponType | string | : Whether the coupon is "single_code" or "bulk". Bulk coupons will require a
unique_code_template
and will generate unique codes through the
/generate
endpoint.
|
createdAt | Date | : Created at |
discount | CouponDiscount | : Details of the discount a coupon applies. Will contain a
type
property and one of the following properties:
percent
,
fixed
,
trial
.
|
duration | string | :
|
expiredAt | Date | : The date and time the coupon was expired early or reached its
max_redemptions
.
|
freeTrialAmount | number | : Sets the duration of time the
free_trial_unit
is for.
|
freeTrialUnit | string | : Description of the unit of time the coupon is for. Used with
free_trial_amount
to determine the duration of time the coupon is for.
|
hostedPageDescription | string | : This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page. |
id | string | : Coupon ID |
invoiceDescription | string | : Description of the coupon on the invoice. |
items | Array<ItemMini> | : A list of items for which this coupon applies. This will be
null
if
applies_to_all_items=true
.
|
maxRedemptions | number | : A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions. |
maxRedemptionsPerAccount | number | : Redemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to
1
if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign.
|
name | string | : The internal name for the coupon. |
object | string | : Object type |
plans | Array<PlanMini> | : A list of plans for which this coupon applies. This will be
null
if
applies_to_all_plans=true
.
|
redeemBy | Date | : The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time. |
redemptionResource | string | : Whether the discount is for all eligible charges on the account, or only a specific subscription. |
state | string | : Indicates if the coupon is redeemable, and if it is not, why. |
temporalAmount | number | : If
duration
is "temporal" than
temporal_amount
is an integer which is multiplied by
temporal_unit
to define the duration that the coupon will be applied to invoices for.
|
temporalUnit | string | : If
duration
is "temporal" than
temporal_unit
is multiplied by
temporal_amount
to define the duration that the coupon will be applied to invoices for.
|
uniqueCodeTemplate | string | : On a bulk coupon, the template from which unique coupon codes are generated. |
uniqueCouponCode | Object | : Will be populated when the Coupon being returned is a
UniqueCouponCode
.
|
uniqueCouponCodesCount | number | : When this number reaches
max_redemptions
the coupon will no longer be redeemable.
|
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
CouponDiscount
()
CouponDiscount
Type: Object
property | type | description |
---|---|---|
currencies | Array<CouponDiscountPricing> | : This is only present when
type=fixed
.
|
percent | number | : This is only present when
type=percent
.
|
trial | CouponDiscountTrial | : This is only present when
type=free_trial
.
|
type | string |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
CouponDiscountPricing
()
CouponDiscountPricing
Type: Object
property | type | description |
---|---|---|
amount | number | : Value of the fixed discount that this coupon applies. |
currency | string | : 3-letter ISO 4217 currency code. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
CouponDiscountTrial
()
CouponDiscountTrial
Type: Object
property | type | description |
---|---|---|
length | number | : Trial length measured in the units specified by the sibling
unit
property
|
unit | string | : Temporal unit of the free trial |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
CouponMini
()
CouponMini
Type: Object
property | type | description |
---|---|---|
code | string | : The code the customer enters to redeem the coupon. |
couponType | string | : Whether the coupon is "single_code" or "bulk". Bulk coupons will require a
unique_code_template
and will generate unique codes through the
/generate
endpoint.
|
discount | CouponDiscount | : Details of the discount a coupon applies. Will contain a
type
property and one of the following properties:
percent
,
fixed
,
trial
.
|
expiredAt | Date | : The date and time the coupon was expired early or reached its
max_redemptions
.
|
id | string | : Coupon ID |
name | string | : The internal name for the coupon. |
object | string | : Object type |
state | string | : Indicates if the coupon is redeemable, and if it is not, why. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
CouponRedemption
()
CouponRedemption
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : The Account on which the coupon was applied. |
coupon | Coupon | |
createdAt | Date | : Created at |
currency | string | : 3-letter ISO 4217 currency code. |
discounted | number | : The amount that was discounted upon the application of the coupon, formatted with the currency. |
id | string | : Coupon Redemption ID |
object | string | : Will always be
coupon
.
|
removedAt | Date | : The date and time the redemption was removed from the account (un-redeemed). |
state | string | : Coupon Redemption state |
subscriptionId | string | : Subscription ID |
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
CouponRedemptionMini
()
CouponRedemptionMini
Type: Object
property | type | description |
---|---|---|
coupon | CouponMini | |
createdAt | Date | : Created at |
discounted | number | : The amount that was discounted upon the application of the coupon, formatted with the currency. |
id | string | : Coupon Redemption ID |
object | string | : Will always be
coupon
.
|
state | string | : Invoice state |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
CreditPayment
()
CreditPayment
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : Account mini details |
action | string | : The action for which the credit was created. |
amount | number | : Total credit payment amount applied to the charge invoice. |
appliedToInvoice | InvoiceMini | : Invoice mini details |
createdAt | Date | : Created at |
currency | string | : 3-letter ISO 4217 currency code. |
id | string | : Credit Payment ID |
object | string | : Object type |
originalCreditPaymentId | string | : For credit payments with action
refund
, this is the credit payment that was refunded.
|
originalInvoice | InvoiceMini | : Invoice mini details |
refundTransaction | Transaction | |
updatedAt | Date | : Last updated at |
uuid | string | : The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI. |
voidedAt | Date | : Voided at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
CustomerPermission
()
CustomerPermission
Type: Object
property | type | description |
---|---|---|
code | string | : Customer permission code. |
description | string | : Description of customer permission. |
id | string | : Customer permission ID. |
name | string | : Customer permission name. |
object | string | : It will always be "customer_permission". |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
CustomField
()
CustomField
Type: Object
property | type | description |
---|---|---|
name | string | : Fields must be created in the UI before values can be assigned to them. |
value | string | : Any values that resemble a credit card number or security code (CVV/CVC) will be rejected. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
CustomFieldDefinition
()
CustomFieldDefinition
Type: Object
property | type | description |
---|---|---|
createdAt | Date | : Created at |
deletedAt | Date | : Definitions are initially soft deleted, and once all the values are removed from the accouts or subscriptions, will be hard deleted an no longer visible. |
displayName | string | : Used to label the field when viewing and editing the field in Recurly's admin UI. |
id | string | : Custom field definition ID |
name | string | : Used by the API to identify the field or reading and writing. The name can only be used once per Recurly object type. |
object | string | : Object type |
relatedType | string | : Related Recurly object type |
tooltip | string | : Displayed as a tooltip when editing the field in the Recurly admin UI. |
updatedAt | Date | : Last updated at |
userAccess | string | : The access control applied inside Recurly's admin UI: -
api_only
- No one will be able to view or edit this field's data via the admin UI. -
read_only
- Users with the Customers role will be able to view this field's data via the admin UI, but editing will only be available via the API. -
write
- Users with the Customers role will be able to view and edit this field's data via the admin UI. -
set_only
- Users with the Customers role will be able to set this field's data via the admin console.
|
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
DunningCampaign
()
DunningCampaign
Type: Object
property | type | description |
---|---|---|
code | string | : Campaign code. |
createdAt | Date | : When the current campaign was created in Recurly. |
defaultCampaign | boolean | : Whether or not this is the default campaign for accounts or plans without an assigned dunning campaign. |
deletedAt | Date | : When the current campaign was deleted in Recurly. |
description | string | : Campaign description. |
dunningCycles | Array<DunningCycle> | : Dunning Cycle settings. |
id | string | |
name | string | : Campaign name. |
object | string | : Object type |
updatedAt | Date | : When the current campaign was updated in Recurly. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
DunningCampaignsBulkUpdateResponse
()
DunningCampaignsBulkUpdateResponse
Type: Object
property | type | description |
---|---|---|
object | string | : Object type |
plans | Array<Plan> | : An array containing all of the
Plan
resources that have been updated.
|
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
DunningCycle
()
DunningCycle
Type: Object
property | type | description |
---|---|---|
appliesToManualTrial | boolean | : Whether the dunning settings will be applied to manual trials. Only applies to trial cycles. |
createdAt | Date | : When the current settings were created in Recurly. |
expireSubscription | boolean | : Whether the subscription(s) should be cancelled at the end of the dunning cycle. |
failInvoice | boolean | : Whether the invoice should be failed at the end of the dunning cycle. |
firstCommunicationInterval | number | : The number of days after a transaction failure before the first dunning email is sent. |
intervals | Array<DunningInterval> | : Dunning intervals. |
sendImmediatelyOnHardDecline | boolean | : Whether or not to send an extra email immediately to customers whose initial payment attempt fails with either a hard decline or invalid billing info. |
totalDunningDays | number | : The number of days between the first dunning email being sent and the end of the dunning cycle. |
totalRecyclingDays | number | : The number of days between a transaction failure and the end of the dunning cycle. |
type | string | : The type of invoice this cycle applies to. |
updatedAt | Date | : When the current settings were updated in Recurly. |
version | number | : Current campaign version. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
DunningInterval
()
DunningInterval
Type: Object
property | type | description |
---|---|---|
days | number | : Number of days before sending the next email. |
emailTemplate | string | : Email template being used. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Entitlement
()
Entitlement
Type: Object
property | type | description |
---|---|---|
createdAt | Date | : Time object was created. |
customerPermission | CustomerPermission | |
grantedBy | Array<GrantedBy> | : Subscription or item that granted the customer permission. |
object | string | : Entitlement |
updatedAt | Date | : Time the object was last updated |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Entitlements
()
Entitlements
Type: Object
property | type | description |
---|---|---|
data | Array<Entitlement> | |
hasMore | boolean | : Indicates there are more results on subsequent pages. |
next | string | : Path to subsequent page of results. |
object | string | : Object Type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Error
()
Error
Type: Object
property | type | description |
---|---|---|
message | string | : Message |
params | Array<Object> | : Parameter specific errors |
type | string | : Type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ErrorMayHaveTransaction
()
ErrorMayHaveTransaction
Type: Object
property | type | description |
---|---|---|
message | string | : Message |
params | Array<Object> | : Parameter specific errors |
transactionError | TransactionError | : This is only included on errors with
type=transaction
.
|
type | string | : Type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExportDates
()
ExportDates
Type: Object
property | type | description |
---|---|---|
dates | Array<string> | : An array of dates that have available exports. |
object | string | : Object type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExportFile
()
ExportFile
Type: Object
property | type | description |
---|---|---|
href | string | : A presigned link to download the export file. |
md5sum | string | : MD5 hash of the export file. |
name | string | : Name of the export file. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExportFiles
()
ExportFiles
Type: Object
property | type | description |
---|---|---|
files | Array<ExportFile> | |
object | string | : Object type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExternalAccount
()
ExternalAccount
Type: Object
property | type | description |
---|---|---|
createdAt | Date | : Created at |
externalAccountCode | string | : Represents the account code for the external account. |
externalConnectionType | string | : Represents the connection type.
AppleAppStore
or
GooglePlayStore
|
id | string | : UUID of the external_account . |
object | string | |
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExternalCharge
()
ExternalCharge
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : Account mini details |
createdAt | Date | : When the external charge was created in Recurly. |
currency | string | : 3-letter ISO 4217 currency code. |
description | string | |
externalProductReference | ExternalProductReferenceMini | : External Product Reference details |
id | string | : System-generated unique identifier for an external charge ID, e.g.
e28zov4fw0v2
.
|
object | string | : Object type |
quantity | number | |
unitAmount | string | : Unit Amount |
updatedAt | Date | : When the external charge was updated in Recurly. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExternalInvoice
()
ExternalInvoice
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : Account mini details |
createdAt | Date | : When the external invoice was created in Recurly. |
currency | string | : 3-letter ISO 4217 currency code. |
externalId | string | : An identifier which associates the external invoice to a corresponding object in an external platform. |
externalSubscription | ExternalSubscription | : Subscription from an external resource such as Apple App Store or Google Play Store. |
id | string | : System-generated unique identifier for an external invoice ID, e.g.
e28zov4fw0v2
.
|
lineItems | Array<ExternalCharge> | |
object | string | : Object type |
purchasedAt | Date | : When the invoice was created in the external platform. |
state | string | |
total | string | : Total |
updatedAt | Date | : When the external invoice was updated in Recurly. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExternalPaymentPhase
()
ExternalPaymentPhase
Type: Object
property | type | description |
---|---|---|
amount | string | : Allows up to 9 decimal places |
createdAt | Date | : When the external subscription was created in Recurly. |
currency | string | : 3-letter ISO 4217 currency code. |
endingBillingPeriodIndex | number | : Ending Billing Period Index |
endsAt | Date | : Ends At |
id | string | : System-generated unique identifier for an external payment phase ID, e.g.
e28zov4fw0v2
.
|
object | string | : Object type |
offerName | string | : Name of the discount offer given, e.g. "introductory" |
offerType | string | : Type of discount offer given, e.g. "FREE_TRIAL" |
periodCount | number | : Number of billing periods |
periodLength | string | : Billing cycle length |
startedAt | Date | : Started At |
startingBillingPeriodIndex | number | : Starting Billing Period Index |
updatedAt | Date | : When the external subscription was updated in Recurly. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExternalProduct
()
ExternalProduct
Type: Object
property | type | description |
---|---|---|
createdAt | Date | : When the external product was created in Recurly. |
externalProductReferences | Array<ExternalProductReferenceMini> | : List of external product references of the external product. |
id | string | : System-generated unique identifier for an external product ID, e.g.
e28zov4fw0v2
.
|
name | string | : Name to identify the external product in Recurly. |
object | string | : Object type |
plan | PlanMini | : Just the important parts. |
updatedAt | Date | : When the external product was updated in Recurly. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExternalProductReferenceCollection
()
ExternalProductReferenceCollection
Type: Object
property | type | description |
---|---|---|
data | Array<ExternalProductReferenceMini> | |
hasMore | boolean | : Indicates there are more results on subsequent pages. |
next | string | : Path to subsequent page of results. |
object | string | : Will always be List. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExternalProductReferenceMini
()
ExternalProductReferenceMini
Type: Object
property | type | description |
---|---|---|
createdAt | Date | : When the external product was created in Recurly. |
externalConnectionType | string | : Source connection platform. |
id | string | : System-generated unique identifier for an external product ID, e.g.
e28zov4fw0v2
.
|
object | string | : object |
referenceCode | string | : A code which associates the external product to a corresponding object or resource in an external platform like the Apple App Store or Google Play Store. |
updatedAt | Date | : When the external product was updated in Recurly. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ExternalSubscription
()
ExternalSubscription
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : Account mini details |
activatedAt | Date | : When the external subscription was activated in the external platform. |
appIdentifier | string | : Identifier of the app that generated the external subscription. |
autoRenew | boolean | : An indication of whether or not the external subscription will auto-renew at the expiration date. |
canceledAt | Date | : When the external subscription was canceled in the external platform. |
createdAt | Date | : When the external subscription was created in Recurly. |
expiresAt | Date | : When the external subscription expires in the external platform. |
externalId | string | : The id of the subscription in the external systems., I.e. Apple App Store or Google Play Store. |
externalPaymentPhases | Array<ExternalPaymentPhase> | : The phases of the external subscription payment lifecycle. |
externalProductReference | ExternalProductReferenceMini | : External Product Reference details |
id | string | : System-generated unique identifier for an external subscription ID, e.g.
e28zov4fw0v2
.
|
imported | boolean | : An indication of whether or not the external subscription was created by a historical data import. |
inGracePeriod | boolean | : An indication of whether or not the external subscription is in a grace period. |
lastPurchased | Date | : When a new billing event occurred on the external subscription in conjunction with a recent billing period, reactivation or upgrade/downgrade. |
object | string | : Object type |
quantity | number | : An indication of the quantity of a subscribed item's quantity. |
state | string | : External subscriptions can be active, canceled, expired, past_due, voided, revoked, or paused. |
test | boolean | : An indication of whether or not the external subscription was purchased in a sandbox environment. |
trialEndsAt | Date | : When the external subscription trial period ends in the external platform. |
trialStartedAt | Date | : When the external subscription trial period started in the external platform. |
updatedAt | Date | : When the external subscription was updated in Recurly. |
uuid | string | : Universally Unique Identifier created automatically. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
FraudInfo
()
FraudInfo
Type: Object
property | type | description |
---|---|---|
decision | string | : Kount decision |
riskRulesTriggered | Object | : Kount rules |
score | number | : Kount score |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
FraudRiskRule
()
FraudRiskRule
Type: Object
property | type | description |
---|---|---|
code | string | : The Kount rule number. |
message | string | : Description of why the rule was triggered |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
GatewayAttributes
()
GatewayAttributes
Type: Object
property | type | description |
---|---|---|
accountReference | string | : Used by Adyen and Braintree gateways. For Adyen the Shopper Reference value used when the external token was created. For Braintree the PayPal PayerID is populated in the response. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
GeneralLedgerAccount
()
GeneralLedgerAccount
Type: Object
property | type | description |
---|---|---|
accountType | string | |
code | string | : Unique code to identify the ledger account. Each code must start with a letter or number. The following special characters are allowed:
-_.,:
|
createdAt | Date | : Created at |
description | string | : Optional description. |
id | string | : 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. |
object | string | : Object type |
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
GiftCard
()
GiftCard
Type: Object
property | type | description |
---|---|---|
balance | number | : The remaining credit on the recipient account associated with this gift card. Only has a value once the gift card has been redeemed. Can be used to create gift card balance displays for your customers. |
canceledAt | Date | : When the gift card was canceled. |
createdAt | Date | : Created at |
currency | string | : 3-letter ISO 4217 currency code. |
deliveredAt | Date | : When the gift card was sent to the recipient by Recurly via email, if method was email and the "Gift Card Delivery" email template was enabled. This will be empty for post delivery or email delivery where the email template was disabled. |
delivery | GiftCardDelivery | : The delivery details for the gift card. |
gifterAccountId | string | : The ID of the account that purchased the gift card. |
id | string | : Gift card ID |
liabilityGlAccountId | string | : 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. |
object | string | : Object type |
performanceObligationId | string | : The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features. |
productCode | string | : The product code or SKU of the gift card product. |
purchaseInvoiceId | string | : The ID of the invoice for the gift card purchase made by the gifter. |
recipientAccountId | string | : The ID of the account that redeemed the gift card redemption code. Does not have a value until gift card is redeemed. |
redeemedAt | Date | : When the gift card was redeemed by the recipient. |
redemptionCode | string | : The unique redemption code for the gift card, generated by Recurly. Will be 16 characters, alphanumeric, displayed uppercase, but accepted in any case at redemption. Used by the recipient account to create a credit in the amount of the
unit_amount
on their account.
|
redemptionInvoiceId | string | : The ID of the invoice for the gift card redemption made by the recipient. Does not have a value until gift card is redeemed. |
revenueGlAccountId | string | : 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. |
unitAmount | number | : The amount of the gift card, which is the amount of the charge to the gifter account and the amount of credit that is applied to the recipient account upon successful redemption. |
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
GiftCardDelivery
()
GiftCardDelivery
Type: Object
property | type | description |
---|---|---|
deliverAt | Date | : When the gift card should be delivered to the recipient. If null, the gift card will be delivered immediately. If a datetime is provided, the delivery will be in an hourly window, rounding down. For example, 6:23 pm will be in the 6:00 pm hourly batch. |
emailAddress | string | : The email address of the recipient. |
firstName | string | : The first name of the recipient. |
gifterName | string | : The name of the gifter for the purpose of a message displayed to the recipient. |
lastName | string | : The last name of the recipient. |
method | string | : Whether the delivery method is email or postal service. |
personalMessage | string | : The personal message from the gifter to the recipient. |
recipientAddress | Address | : Address information for the recipient. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
GrantedBy
()
GrantedBy
Type: Object
property | type | description |
---|---|---|
id | string | : The ID of the subscription or external subscription that grants the permission to the account. |
object | string | : Object Type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Invoice
()
Invoice
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : Account mini details |
address | InvoiceAddress | |
balance | number | : The outstanding balance remaining on this invoice. |
billingInfoId | 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.
|
businessEntityId | string | : Unique ID to identify the business entity assigned to the invoice. Available when the
Multiple Business Entities
feature is enabled.
|
closedAt | Date | : Date invoice was marked paid or failed. |
collectionMethod | string | : An automatic invoice means a corresponding transaction is run using the account's billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment. |
createdAt | Date | : Created at |
creditPayments | Array<CreditPayment> | : Credit payments |
currency | string | : 3-letter ISO 4217 currency code. |
customerNotes | string | : This will default to the Customer Notes text specified on the Invoice Settings. Specify custom notes to add or override Customer Notes. |
discount | number | : Total discounts applied to this invoice. |
dueAt | Date | : Date invoice is due. This is the date the net terms are reached. |
dunningCampaignId | string | : Unique ID to identify the dunning campaign used when dunning the invoice. For sites without multiple dunning campaigns enabled, this will always be the default dunning campaign. |
dunningEventsSent | number | : Number of times the event was sent. |
finalDunningEvent | boolean | : Last communication attempt. |
hasMoreLineItems | boolean | : Identifies if the invoice has more line items than are returned in
line_items
. If
has_more_line_items
is
true
, then a request needs to be made to the
list_invoice_line_items
endpoint.
|
id | string | : Invoice ID |
lineItems | Array<LineItem> | : Line Items |
netTerms | number | : 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.
|
netTermsType | string | : 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.
|
number | string | : If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence. |
object | string | : Object type |
origin | string | : The event that created the invoice. |
paid | number | : The total amount of successful payments transaction on this invoice. |
poNumber | string | : For manual invoicing, this identifies the PO number associated with the subscription. |
previousInvoiceId | string | : On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from. This field is only populated for sites without the Only Bill What Changed feature enabled. Sites with Only Bill What Changed enabled should use the related_invoices endpoint to see purchase invoices refunded by this invoice. |
refundableAmount | number | : The refundable amount on a charge invoice. It will be null for all other invoices. |
shippingAddress | ShippingAddress | |
state | string | : Invoice state |
subscriptionIds | Array<string> | : If the invoice is charging or refunding for one or more subscriptions, these are their IDs. |
subtotal | number | : The summation of charges and credits, before discounts and taxes. |
tax | number | : The total tax on this invoice. |
taxInfo | TaxInfo | : Only for merchants using Recurly's In-The-Box taxes. |
termsAndConditions | string | : This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions. |
total | number | : The final total on this invoice. The summation of invoice charges, discounts, credits, and tax. |
transactions | Array<Transaction> | : Transactions |
type | string | : Invoices are either charge, credit, or legacy invoices. |
updatedAt | Date | : Last updated at |
usedTaxService | boolean | : Will be
true
when the invoice had a successful response from the tax service and
false
when the invoice was not sent to tax service due to a lack of address or enabled jurisdiction or was processed without tax due to a non-blocking error returned from the tax service.
|
uuid | string | : Invoice UUID |
vatNumber | string | : VAT registration number for the customer on this invoice. This will come from the VAT Number field in the Billing Info or the Account Info depending on your tax settings and the invoice collection method. |
vatReverseChargeNotes | string | : VAT Reverse Charge Notes only appear if you have EU VAT enabled or are using your own Avalara AvaTax account and the customer is in the EU, has a VAT number, and is in a different country than your own. This will default to the VAT Reverse Charge Notes text specified on the Tax Settings page in your Recurly admin, unless custom notes were created with the original subscription. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
InvoiceAddress
()
InvoiceAddress
Type: Object
property | type | description |
---|---|---|
city | string | : City |
company | string | : Company |
country | string | : Country, 2-letter ISO 3166-1 alpha-2 code. |
firstName | string | : First name |
geoCode | string | : Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration |
lastName | string | : Last name |
nameOnAccount | string | : Name on account |
phone | string | : Phone number |
postalCode | string | : Zip or postal code. |
region | string | : State or province. |
street1 | string | : Street 1 |
street2 | string | : Street 2 |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
InvoiceCollection
()
InvoiceCollection
Type: Object
property | type | description |
---|---|---|
chargeInvoice | Invoice | |
creditInvoices | Array<Invoice> | : Credit invoices |
object | string | : Object type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
InvoiceMini
()
InvoiceMini
Type: Object
property | type | description |
---|---|---|
businessEntityId | string | : Unique ID to identify the business entity assigned to the invoice. Available when the
Multiple Business Entities
feature is enabled.
|
id | string | : Invoice ID |
number | string | : Invoice number |
object | string | : Object type |
state | string | : Invoice state |
type | string | : Invoice type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
InvoiceTemplate
()
InvoiceTemplate
Type: Object
property | type | description |
---|---|---|
code | string | : Invoice template code. |
createdAt | Date | : When the invoice template was created in Recurly. |
description | string | : Invoice template description. |
id | string | |
name | string | : Invoice template name. |
updatedAt | Date | : When the invoice template was updated in Recurly. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Item
()
Item
Type: Object
property | type | description |
---|---|---|
accountingCode | string | : Accounting code for invoice line items. |
avalaraServiceType | number | : Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to the documentation for more available t/s types. |
avalaraTransactionType | number | : Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to the documentation for more available t/s types. |
code | string | : Unique code to identify the item. |
createdAt | Date | : Created at |
currencies | Array<Pricing> | : Item Pricing |
customFields | Array<CustomField> | : 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. |
deletedAt | Date | : Deleted at |
description | string | : Optional, description. |
externalSku | string | : Optional, stock keeping unit to link the item to other inventory systems. |
id | string | : Item ID |
liabilityGlAccountId | string | : 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. |
name | string | : This name describes your item and will appear on the invoice when it's purchased on a one time basis. |
object | string | : Object type |
performanceObligationId | string | : The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features. |
revenueGlAccountId | string | : 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. |
revenueScheduleType | string | : Revenue schedule type |
state | string | : The current state of the item. |
taxCode | string | : 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.
|
taxExempt | boolean | : true
exempts tax on the item,
false
applies tax on the item.
|
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ItemMini
()
ItemMini
Type: Object
property | type | description |
---|---|---|
code | string | : Unique code to identify the item. |
description | string | : Optional, description. |
id | string | : Item ID |
name | string | : This name describes your item and will appear on the invoice when it's purchased on a one time basis. |
object | string | : Object type |
state | string | : The current state of the item. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
LineItem
()
LineItem
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : Account mini details |
accountingCode | string | : Internal accounting code to help you reconcile your revenue to the correct ledger. Line items created as part of a subscription invoice will use the plan or add-on's accounting code, otherwise the value will only be present if you define an accounting code when creating the line item. |
addOnCode | string | : If the line item is a charge or credit for an add-on, this is its code. |
addOnId | string | : If the line item is a charge or credit for an add-on this is its ID. |
amount | number | : (quantity * unit_amount) - (discount + tax)
|
avalaraServiceType | number | : 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. |
avalaraTransactionType | number | : 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. |
billForAccountId | string | : The UUID of the account responsible for originating the line item. |
createdAt | Date | : When the line item was created. |
creditApplied | number | : The amount of credit from this line item that was applied to the invoice. |
creditReasonCode | string | : The reason the credit was given when line item is
type=credit
.
|
currency | string | : 3-letter ISO 4217 currency code. |
customFields | Array<CustomField> | : 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. |
description | string | : Description that appears on the invoice. For subscription related items this will be filled in automatically. |
destinationTaxAddressSource | string | : 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". |
discount | number | : The discount applied to the line item. |
endDate | Date | : If this date is provided, it indicates the end of a time range. |
externalSku | string | : Optional Stock Keeping Unit assigned to an item. Available when the Credit Invoices feature is enabled. |
id | string | : Line item ID |
invoiceId | string | : Once the line item has been invoiced this will be the invoice's ID. |
invoiceNumber | string | : Once the line item has been invoiced this will be the invoice's number. If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence. |
itemCode | string | : Unique code to identify an item. Available when the Credit Invoices feature is enabled. |
itemId | string | : System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled. |
legacyCategory | string | : Category to describe the role of a line item on a legacy invoice: - "charges" refers to charges being billed for on this invoice. - "credits" refers to refund or proration credits. This portion of the invoice can be considered a credit memo. - "applied_credits" refers to previous credits applied to this invoice. See their original_line_item_id to determine where the credit first originated. - "carryforwards" can be ignored. They exist to consume any remaining credit balance. A new credit with the same amount will be created and placed back on the account. |
liabilityGlAccountCode | string | : Unique code to identify the ledger account. Each code must start with a letter or number. The following special characters are allowed:
-_.,:
|
object | string | : Object type |
origin | string | : A credit created from an original charge will have the value of the charge's origin. |
originTaxAddressSource | string | : 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". |
originalLineItemInvoiceId | string | : The invoice where the credit originated. Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund. |
performanceObligationId | string | : The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features. |
planCode | string | : If the line item is a charge or credit for a plan or add-on, this is the plan's code. |
planId | string | : If the line item is a charge or credit for a plan or add-on, this is the plan's ID. |
previousLineItemId | string | : Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund. |
productCode | string | : For plan-related line items this will be the plan's code, for add-on related line items it will be the add-on's code. For item-related line items it will be the item's
external_sku
.
|
prorationRate | number | : When a line item has been prorated, this is the rate of the proration. Proration rates were made available for line items created after March 30, 2017. For line items created prior to that date, the proration rate will be
null
, even if the line item was prorated.
|
quantity | number | : This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes. |
quantityDecimal | string | : A floating-point alternative to Quantity. If this value is present, it will be used in place of Quantity for calculations, and Quantity will be the rounded integer value of this number. This field supports up to 9 decimal places. The Decimal Quantity feature must be enabled to utilize this field. |
refund | boolean | : Refund? |
refundedQuantity | number | : For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds). |
refundedQuantityDecimal | string | : A floating-point alternative to Refunded Quantity. For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds). The Decimal Quantity feature must be enabled to utilize this field. |
revenueGlAccountCode | string | : Unique code to identify the ledger account. Each code must start with a letter or number. The following special characters are allowed:
-_.,:
|
revenueScheduleType | string | : Revenue schedule type |
shippingAddress | ShippingAddress | |
startDate | Date | : 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. |
state | string | : Pending line items are charges or credits on an account that have not been applied to an invoice yet. Invoiced line items will always have an
invoice_id
value.
|
subscriptionId | string | : If the line item is a charge or credit for a subscription, this is its ID. |
subtotal | number | : quantity * unit_amount
|
tax | number | : The tax amount for the line item. |
taxCode | string | : 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.
|
taxExempt | 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.
|
taxInclusive | boolean | : 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 utilize this flag. |
taxInfo | TaxInfo | : Only for merchants using Recurly's In-The-Box taxes. |
taxable | boolean | : true
if the line item is taxable,
false
if it is not.
|
type | string | : Charges are positive line items that debit the account. Credits are negative line items that credit the account. |
unitAmount | number | : Positive amount for a charge, negative amount for a credit. |
unitAmountDecimal | string | : Positive amount for a charge, negative amount for a credit. |
updatedAt | Date | : When the line item was last changed. |
uuid | string | : The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
MeasuredUnit
()
MeasuredUnit
Type: Object
property | type | description |
---|---|---|
createdAt | Date | : Created at |
deletedAt | Date | : Deleted at |
description | string | : Optional internal description. |
displayName | string | : Display name for the measured unit. Can only contain spaces, underscores and must be alphanumeric. |
id | string | : Item ID |
name | string | : Unique internal name of the measured unit on your site. |
object | string | : Object type |
state | string | : The current state of the measured unit. |
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
PaymentMethod
()
PaymentMethod
Type: Object
property | type | description |
---|---|---|
accountType | string | : The bank account type. Only present for ACH payment methods. |
billingAgreementId | string | : Billing Agreement identifier. Only present for Amazon or Paypal payment methods. |
cardNetworkPreference | string | : Represents the card network preference associated with the billing info for dual badged cards. Must be a supported card network. |
cardType | string | : Visa, MasterCard, American Express, Discover, JCB, etc. |
ccBinCountry | string | : The 2-letter ISO 3166-1 alpha-2 country code associated with the credit card BIN, if known by Recurly. Available on the BillingInfo object only. Available when the BIN country lookup feature is enabled. |
expMonth | number | : Expiration month. |
expYear | number | : Expiration year. |
firstSix | string | : Credit card number's first six digits. |
gatewayAttributes | GatewayAttributes | : Gateway specific attributes associated with this PaymentMethod |
gatewayCode | string | : An identifier for a specific payment gateway. |
gatewayToken | string | : A token used in place of a credit card in order to perform transactions. |
lastFour | string | : Credit card number's last four digits. Will refer to bank account if payment method is ACH. |
lastTwo | string | : The IBAN bank account's last two digits. |
nameOnAccount | string | : The name associated with the bank account. |
object | string | |
routingNumber | string | : The bank account's routing number. Only present for ACH payment methods. |
routingNumberBank | string | : The bank name of this routing number. |
username | string | : Username of the associated payment method. Currently only associated with Venmo. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
PercentageTier
()
PercentageTier
Type: Object
property | type | description |
---|---|---|
endingAmount | number | : Ending amount for the tier. Allows up to 2 decimal places. Must be left empty if it is the final tier. |
usagePercentage | string | : The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places represented as a string. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
PercentageTiersByCurrency
()
PercentageTiersByCurrency
Type: Object
property | type | description |
---|---|---|
currency | string | : 3-letter ISO 4217 currency code. |
tiers | Array<PercentageTier> | : Tiers |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
PerformanceObligation
()
PerformanceObligation
Type: Object
property | type | description |
---|---|---|
createdAt | Date | : Created At |
id | string | : The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features. |
name | string | : Performance Obligation Name |
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Plan
()
Plan
Type: Object
property | type | description |
---|---|---|
accountingCode | string | : Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code. |
allowAnyItemOnSubscriptions | boolean | : Used to determine whether items can be assigned as add-ons to individual subscriptions. If
true
, items can be assigned as add-ons to individual subscription add-ons. If
false
, only plan add-ons can be used.
|
autoRenew | boolean | : Subscriptions will automatically inherit this value once they are active. If
auto_renew
is
true
, then a subscription will automatically renew its term at renewal. If
auto_renew
is
false
, then a subscription will expire at the end of its term.
auto_renew
can be overridden on the subscription record itself.
|
avalaraServiceType | number | : Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to the documentation for more available t/s types. |
avalaraTransactionType | number | : Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to the documentation for more available t/s types. |
code | string | : Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports. |
createdAt | Date | : Created at |
currencies | Array<PlanPricing> | : Pricing |
customFields | Array<CustomField> | : 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. |
deletedAt | Date | : Deleted at |
description | string | : Optional description, not displayed. |
dunningCampaignId | string | : Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used. |
hostedPages | PlanHostedPages | : Hosted pages settings |
id | string | : Plan ID |
intervalLength | number | : Length of the plan's billing interval in
interval_unit
.
|
intervalUnit | string | : Unit for the plan's billing interval. |
name | string | : This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice. |
object | string | : Object type |
pricingModel | string | : A fixed pricing model has the same price for each billing period. A ramp pricing model defines a set of Ramp Intervals, where a subscription changes price on a specified cadence of billing periods. The price change could be an increase or decrease. |
rampIntervals | Array<PlanRampInterval> | : Ramp Intervals |
revenueScheduleType | string | : Revenue schedule type |
setupFeeAccountingCode | string | : Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code. |
setupFeeRevenueScheduleType | string | : Setup fee revenue schedule type |
state | string | : The current state of the plan. |
taxCode | string | : 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.
|
taxExempt | boolean | : true
exempts tax on the plan,
false
applies tax on the plan.
|
totalBillingCycles | number | : Automatically terminate subscriptions after a defined number of billing cycles. Number of billing cycles before the plan automatically stops renewing, defaults to
null
for continuous, automatic renewal.
|
trialLength | number | : Length of plan's trial period in
trial_units
.
0
means
no trial
.
|
trialRequiresBillingInfo | boolean | : Allow free trial subscriptions to be created without billing info. Should not be used if billing info is needed for initial invoice due to existing uninvoiced charges or setup fee. |
trialUnit | string | : Units for the plan's trial period. |
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
PlanHostedPages
()
PlanHostedPages
Type: Object
property | type | description |
---|---|---|
bypassConfirmation | boolean | : If
true
, the customer will be sent directly to your
success_url
after a successful signup, bypassing Recurly's hosted confirmation page.
|
cancelUrl | string | : URL to redirect to on canceled signup on the hosted payment pages. |
displayQuantity | boolean | : Determines if the quantity field is displayed on the hosted pages for the plan. |
successUrl | string | : URL to redirect to after signup on the hosted payment pages. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
PlanMini
()
PlanMini
Type: Object
property | type | description |
---|---|---|
code | string | : Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports. |
id | string | : Plan ID |
name | string | : This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice. |
object | string | : Object type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
PlanPricing
()
PlanPricing
Type: Object
property | type | description |
---|---|---|
currency | string | : 3-letter ISO 4217 currency code. |
setupFee | number | : Amount of one-time setup fee automatically charged at the beginning of a subscription billing cycle. For subscription plans with a trial, the setup fee will be charged at the time of signup. Setup fees do not increase with the quantity of a subscription plan. |
taxInclusive | boolean | : This field is deprecated. Please do not use it. |
unitAmount | number | : This field should not be sent when the pricing model is 'ramp'. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
PlanRampInterval
()
PlanRampInterval
Type: Object
property | type | description |
---|---|---|
currencies | Array<PlanRampPricing> | : Represents the price for the ramp interval. |
startingBillingCycle | number | : Represents the billing cycle where a ramp interval starts. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
PlanRampPricing
()
PlanRampPricing
Type: Object
property | type | description |
---|---|---|
currency | string | : 3-letter ISO 4217 currency code. |
unitAmount | number | : Represents the price for the Ramp Interval. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Pricing
()
Pricing
Type: Object
property | type | description |
---|---|---|
currency | string | : 3-letter ISO 4217 currency code. |
taxInclusive | boolean | : This field is deprecated. Please do not use it. |
unitAmount | number | : Unit price |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Settings
()
Settings
Type: Object
property | type | description |
---|---|---|
acceptedCurrencies | Array<string> | |
billingAddressRequirement | string | :
|
defaultCurrency | string | : The default 3-letter ISO 4217 currency code. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ShippingAddress
()
ShippingAddress
Type: Object
property | type | description |
---|---|---|
accountId | string | : Account ID |
city | string | |
company | string | |
country | string | : Country, 2-letter ISO 3166-1 alpha-2 code. |
createdAt | Date | : Created at |
string | ||
firstName | string | |
geoCode | string | : Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration |
id | string | : Shipping Address ID |
lastName | string | |
nickname | string | |
object | string | : Object type |
phone | string | |
postalCode | string | : Zip or postal code. |
region | string | : State or province. |
street1 | string | |
street2 | string | |
updatedAt | Date | : Updated at |
vatNumber | string |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ShippingMethod
()
ShippingMethod
Type: Object
property | type | description |
---|---|---|
accountingCode | string | : Accounting code for shipping method. |
code | string | : The internal name used identify the shipping method. |
createdAt | Date | : Created at |
deletedAt | Date | : Deleted at |
id | string | : Shipping Method ID |
liabilityGlAccountId | string | : 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. |
name | string | : The name of the shipping method displayed to customers. |
object | string | : Object type |
performanceObligationId | string | : The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features. |
revenueGlAccountId | string | : 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. |
taxCode | string | : Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax code values are specific to each tax system. If you are using Recurly’s built-in taxes the values are: -
FR
– Common Carrier FOB Destination -
FR022000
– Common Carrier FOB Origin -
FR020400
– Non Common Carrier FOB Destination -
FR020500
– Non Common Carrier FOB Origin -
FR010100
– Delivery by Company Vehicle Before Passage of Title -
FR010200
– Delivery by Company Vehicle After Passage of Title -
NT
– Non-Taxable
|
updatedAt | Date | : Last updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
ShippingMethodMini
()
ShippingMethodMini
Type: Object
property | type | description |
---|---|---|
code | string | : The internal name used identify the shipping method. |
id | string | : Shipping Method ID |
name | string | : The name of the shipping method displayed to customers. |
object | string | : Object type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Site
()
Site
Type: Object
property | type | description |
---|---|---|
address | Address | |
createdAt | Date | : Created at |
deletedAt | Date | : Deleted at |
features | Array<string> | : A list of features enabled for the site. |
id | string | : Site ID |
mode | string | : Mode |
object | string | : Object type |
publicApiKey | string | : This value is used to configure RecurlyJS to submit tokenized billing information. |
settings | Settings | |
subdomain | string | |
updatedAt | Date | : Updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Subscription
()
Subscription
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : Account mini details |
actionResult | Object | : Action result params to be used in Recurly-JS to complete a payment when using asynchronous payment methods, e.g., Boleto, iDEAL and Sofort. |
activatedAt | Date | : Activated at |
activeInvoiceId | string | : The invoice ID of the latest invoice created for an active subscription. |
addOns | Array<SubscriptionAddOn> | : Add-ons |
addOnsTotal | number | : Total price of add-ons |
autoRenew | boolean | : Whether the subscription renews at the end of its term. |
bankAccountAuthorizedAt | Date | : Recurring subscriptions paid with ACH will have this attribute set. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared. |
billingInfoId | string | : Billing Info ID. |
canceledAt | Date | : Canceled at |
collectionMethod | string | : Collection method |
convertedAt | Date | : When the subscription was converted from a gift card. |
couponRedemptions | Array<CouponRedemptionMini> | : Returns subscription level coupon redemptions that are tied to this subscription. |
createdAt | Date | : Created at |
currency | string | : 3-letter ISO 4217 currency code. |
currentPeriodEndsAt | Date | : Current billing period ends at |
currentPeriodStartedAt | Date | : Current billing period started at |
currentTermEndsAt | Date | : When the term ends. This is calculated by a plan's interval and
total_billing_cycles
in a term. Subscription changes with a
timeframe=renewal
will be applied on this date.
|
currentTermStartedAt | Date | : The start date of the term when the first billing period starts. The subscription term is the length of time that a customer will be committed to a subscription. A term can span multiple billing periods. |
customFields | Array<CustomField> | : 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. |
customerNotes | string | : Customer notes |
expirationReason | string | : Expiration reason |
expiresAt | Date | : Expires at |
gatewayCode | string | : If present, this subscription's transactions will use the payment gateway with this code. |
id | string | : Subscription ID |
netTerms | number | : 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.
|
netTermsType | string | : 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.
|
object | string | : Object type |
pausedAt | Date | : Null unless subscription is paused or will pause at the end of the current billing period. |
pendingChange | SubscriptionChange | : Subscription Change |
plan | PlanMini | : Just the important parts. |
poNumber | string | : For manual invoicing, this identifies the PO number associated with the subscription. |
quantity | number | : Subscription quantity |
rampIntervals | Array<SubscriptionRampIntervalResponse> | : The ramp intervals representing the pricing schedule for the subscription. |
remainingBillingCycles | number | : The remaining billing cycles in the current term. |
remainingPauseCycles | number | : Null unless subscription is paused or will pause at the end of the current billing period. |
renewalBillingCycles | number | : If
auto_renew=true
, when a term completes,
total_billing_cycles
takes this value as the length of subsequent terms. Defaults to the plan's
total_billing_cycles
.
|
revenueScheduleType | string | : Revenue schedule type |
shipping | SubscriptionShipping | : Subscription shipping details |
startedWithGift | boolean | : Whether the subscription was started with a gift certificate. |
state | string | : State |
subtotal | number | : Estimated total, before tax. |
tax | number | : Only for merchants using Recurly's In-The-Box taxes. |
taxInclusive | boolean | : 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 utilize this flag. |
taxInfo | TaxInfo | : Only for merchants using Recurly's In-The-Box taxes. |
termsAndConditions | string | : Terms and conditions |
total | number | : Estimated total |
totalBillingCycles | number | : The number of cycles/billing periods in a term. When
remaining_billing_cycles=0
, if
auto_renew=true
the subscription will renew and a new term will begin, otherwise the subscription will expire.
|
trialEndsAt | Date | : Trial period ends at |
trialStartedAt | Date | : Trial period started at |
unitAmount | number | : Subscription unit price |
updatedAt | Date | : Last updated at |
uuid | string | : The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
SubscriptionAddOn
()
SubscriptionAddOn
Type: Object
property | type | description |
---|---|---|
addOn | AddOnMini | : Just the important parts. |
addOnSource | string | : Used to determine where the associated add-on data is pulled from. If this value is set to
plan_add_on
or left blank, then add-on data will be pulled from the plan's add-ons. If the associated
plan
has
allow_any_item_on_subscriptions
set to
true
and this field is set to
item
, then the associated add-on data will be pulled from the site's item catalog.
|
createdAt | Date | : Created at |
expiredAt | Date | : Expired at |
id | string | : Subscription Add-on ID |
object | string | : Object type |
percentageTiers | Array<SubscriptionAddOnPercentageTier> | : If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage. There must be one tier without an
ending_amount
value which represents the final tier. This feature is currently in development and requires approval and enablement, please contact support.
|
quantity | number | : Add-on quantity |
revenueScheduleType | string | : Revenue schedule type |
subscriptionId | string | : Subscription ID |
tierType | string | : The pricing model for the add-on. For more information, click here . See our Guide for an overview of how to configure quantity-based pricing models. |
tiers | Array<SubscriptionAddOnTier> | : If tiers are provided in the request, all existing tiers on the Subscription Add-on will be removed and replaced by the tiers in the request. If add_on.tier_type is tiered or volume and add_on.usage_type is percentage use percentage_tiers instead. There must be one tier without an
ending_quantity
value which represents the final tier.
|
unitAmount | number | : Supports up to 2 decimal places. |
unitAmountDecimal | string | : Supports up to 9 decimal places. |
updatedAt | Date | : Updated at |
usageCalculationType | string | : The type of calculation to be employed for an add-on. Cumulative billing will sum all usage records created in the current billing cycle. Last-in-period billing will apply only the most recent usage record in the billing period. If no value is specified, cumulative billing will be used. |
usagePercentage | number | : The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if add_on_type is usage and usage_type is percentage. |
usageTimeframe | string | : The time at which usage totals are reset for billing purposes. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
SubscriptionAddOnPercentageTier
()
SubscriptionAddOnPercentageTier
Type: Object
property | type | description |
---|---|---|
endingAmount | number | : Ending amount for the tier. Allows up to 2 decimal places. Must be left empty if it is the final tier. |
usagePercentage | string | : The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places represented as a string. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
SubscriptionAddOnTier
()
SubscriptionAddOnTier
Type: Object
property | type | description |
---|---|---|
endingQuantity | number | : Ending quantity for the tier. This represents a unit amount for unit-priced add ons. Must be left empty if it is the final tier. |
unitAmount | number | : Allows up to 2 decimal places. Optionally, override the tiers' default unit amount. If add-on's
add_on_type
is
usage
and
usage_type
is
percentage
, cannot be provided.
|
unitAmountDecimal | string | : Allows up to 9 decimal places. Optionally, override tiers' default unit amount. If
unit_amount_decimal
is provided,
unit_amount
cannot be provided. If add-on's
add_on_type
is
usage
and
usage_type
is
percentage
, cannot be provided.
|
usagePercentage | string | : (deprecated) -- Use the percentage_tiers object instead. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
SubscriptionChange
()
SubscriptionChange
Type: Object
property | type | description |
---|---|---|
activateAt | Date | : Activated at |
activated | boolean | : Returns
true
if the subscription change is activated.
|
addOns | Array<SubscriptionAddOn> | : These add-ons will be used when the subscription renews. |
billingInfo | SubscriptionChangeBillingInfo | : Accept nested attributes for three_d_secure_action_result_token_id |
createdAt | Date | : Created at |
customFields | Array<CustomField> | : 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. |
deletedAt | Date | : Deleted at |
id | string | : The ID of the Subscription Change. |
invoiceCollection | InvoiceCollection | : Invoice Collection |
object | string | : Object type |
plan | PlanMini | : Just the important parts. |
quantity | number | : Subscription quantity |
rampIntervals | Array<SubscriptionRampIntervalResponse> | : The ramp intervals representing the pricing schedule for the subscription. |
revenueScheduleType | string | : Revenue schedule type |
shipping | SubscriptionShipping | : Subscription shipping details |
subscriptionId | string | : The ID of the subscription that is going to be changed. |
taxInclusive | boolean | : This field is deprecated. Please do not use it. |
unitAmount | number | : Unit amount |
updatedAt | Date | : Updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
SubscriptionChangeBillingInfo
()
SubscriptionChangeBillingInfo
Type: Object
property | type | description |
---|---|---|
threeDSecureActionResultTokenId | string | : A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
SubscriptionRampIntervalResponse
()
SubscriptionRampIntervalResponse
Type: Object
property | type | description |
---|---|---|
endingOn | Date | : Date the ramp interval ends |
remainingBillingCycles | number | : Represents how many billing cycles are left in a ramp interval. |
startingBillingCycle | number | : Represents the billing cycle where a ramp interval starts. |
startingOn | Date | : Date the ramp interval starts |
unitAmount | number | : Represents the price for the ramp interval. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
SubscriptionShipping
()
SubscriptionShipping
Type: Object
property | type | description |
---|---|---|
address | ShippingAddress | |
amount | number | : Subscription's shipping cost |
method | ShippingMethodMini | |
object | string | : Object type |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
TaxDetail
()
TaxDetail
Type: Object
property | type | description |
---|---|---|
billable | boolean | : Whether or not the line item is taxable. Only populated for a single LineItem fetch when Avalara for Communications is enabled. |
level | string | : Provides the jurisdiction level for the Communications tax applied. Example values include city, state and federal. Present only when Avalara for Communications is enabled. |
name | string | : Provides the name of the Communications tax applied. Present only when Avalara for Communications is enabled. |
rate | number | : Provides the tax rate for the region. |
region | string | : Provides the tax region applied on an invoice. For Canadian Sales Tax, this will be either the 2 letter province code or country code. Not present when Avalara for Communications is enabled. |
tax | number | : The total tax applied for this tax type. |
type | string | : Provides the tax type for the region or type of Comminications tax when Avalara for Communications is enabled. For Canadian Sales Tax, this will be GST, HST, QST or PST. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
TaxInfo
()
TaxInfo
Type: Object
property | type | description |
---|---|---|
rate | number | : The combined tax rate. Not present when Avalara for Communications is enabled. |
region | string | : Provides the tax region applied on an invoice. For U.S. Sales Tax, this will be the 2 letter state code. For EU VAT this will be the 2 letter country code. For all country level tax types, this will display the regional tax, like VAT, GST, or PST. Not present when Avalara for Communications is enabled. |
taxDetails | Array<TaxDetail> | : Provides additional tax details for Communications taxes when Avalara for Communications is enabled or Canadian Sales Tax when there is tax applied at both the country and province levels. This will only be populated for the Invoice response when fetching a single invoice and not for the InvoiceList or LineItemList. Only populated for a single LineItem fetch when Avalara for Communications is enabled. |
type | string | : Provides the tax type as "vat" for EU VAT, "usst" for U.S. Sales Tax, or the 2 letter country code for country level tax types like Canada, Australia, New Zealand, Israel, and all non-EU European countries. Not present when Avalara for Communications is enabled. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Tier
()
Tier
Type: Object
property | type | description |
---|---|---|
currencies | Array<TierPricing> | : Tier pricing |
endingQuantity | number | : Ending quantity for the tier. This represents a unit amount for unit-priced add ons. Must be left empty if it is the final tier. |
usagePercentage | string | : (deprecated) -- Use the percentage_tiers object instead. |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
TierPricing
()
TierPricing
Type: Object
property | type | description |
---|---|---|
currency | string | : 3-letter ISO 4217 currency code. |
unitAmount | number | : Allows up to 2 decimal places. Required unless
unit_amount_decimal
is provided.
|
unitAmountDecimal | string | : Allows up to 9 decimal places. Only supported when
add_on_type
=
usage
. If
unit_amount_decimal
is provided,
unit_amount
cannot be provided.
|
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Transaction
()
Transaction
Type: Object
property | type | description |
---|---|---|
account | AccountMini | : Account mini details |
actionResult | Object | : Action result params to be used in Recurly-JS to complete a payment when using asynchronous payment methods, e.g., Boleto, iDEAL and Sofort. |
amount | number | : Total transaction amount sent to the payment gateway. |
avsCheck | string | : When processed, result from checking the overall AVS on the transaction. |
backupPaymentMethodUsed | boolean | : Indicates if the transaction was completed using a backup payment |
billingAddress | AddressWithName | |
collectedAt | Date | : Collected at, or if not collected yet, the time the transaction was created. |
collectionMethod | string | : The method by which the payment was collected. |
createdAt | Date | : Created at |
currency | string | : 3-letter ISO 4217 currency code. |
customerMessage | string | : For declined (
success=false
) transactions, the message displayed to the customer.
|
customerMessageLocale | string | : Language code for the message |
cvvCheck | string | : When processed, result from checking the CVV/CVC value on the transaction. |
fraudInfo | TransactionFraudInfo | : Fraud information |
gatewayApprovalCode | string | : Transaction approval code from the payment gateway. |
gatewayMessage | string | : Transaction message from the payment gateway. |
gatewayReference | string | : Transaction reference number from the payment gateway. |
gatewayResponseCode | string | : For declined transactions (
success=false
), this field lists the gateway error code.
|
gatewayResponseTime | number | : Time, in seconds, for gateway to process the transaction. |
gatewayResponseValues | Object | : The values in this field will vary from gateway to gateway. |
id | string | : Transaction ID |
invoice | InvoiceMini | : Invoice mini details |
ipAddressCountry | string | : Origin IP address country, 2-letter ISO 3166-1 alpha-2 code, if known by Recurly. |
ipAddressV4 | string | : IP address provided when the billing information was collected: - When the customer enters billing information into the Recurly.js or Hosted Payment Pages, Recurly records the IP address. - When the merchant enters billing information using the API, the merchant may provide an IP address. - When the merchant enters billing information using the UI, no IP address is recorded. |
object | string | : Object type |
origin | string | : Describes how the transaction was triggered. |
originalTransactionId | string | : If this transaction is a refund (
type=refund
), this will be the ID of the original transaction on the invoice being refunded.
|
paymentGateway | TransactionPaymentGateway | |
paymentMethod | PaymentMethod | |
refunded | boolean | : Indicates if part or all of this transaction was refunded. |
status | string | : The current transaction status. Note that the status may change, e.g. a
pending
transaction may become
declined
or
success
may later become
void
.
|
statusCode | string | : Status code |
statusMessage | string | : For declined (
success=false
) transactions, the message displayed to the merchant.
|
subscriptionIds | Array<string> | : If the transaction is charging or refunding for one or more subscriptions, these are their IDs. |
success | boolean | : Did this transaction complete successfully? |
type | string | :
|
updatedAt | Date | : Updated at |
uuid | string | : The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI. |
vatNumber | string | : VAT number for the customer on this transaction. If the customer's Billing Info country is BR or AR, then this will be their Tax Identifier. For all other countries this will come from the VAT Number field in the Billing Info. |
voidedAt | Date | : Voided at |
voidedByInvoice | InvoiceMini | : Invoice mini details |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
TransactionError
()
TransactionError
Type: Object
property | type | description |
---|---|---|
category | string | : Category |
code | string | : Code |
declineCode | string | : Decline code |
fraudInfo | TransactionFraudInfo | : Fraud information |
merchantAdvice | string | : Merchant message |
message | string | : Customer message |
object | string | : Object type |
threeDSecureActionTokenId | string | : Returned when 3-D Secure authentication is required for a transaction. Pass this value to Recurly.js so it can continue the challenge flow. |
transactionId | string | : Transaction ID |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
TransactionFraudInfo
()
TransactionFraudInfo
Type: Object
property | type | description |
---|---|---|
decision | string | : Kount decision |
object | string | : Object type |
reference | string | : Kount transaction reference ID |
riskRulesTriggered | Array<FraudRiskRule> | : A list of fraud risk rules that were triggered for the transaction. |
score | number | : Kount score |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
TransactionPaymentGateway
()
TransactionPaymentGateway
Type: Object
property | type | description |
---|---|---|
id | string | |
name | string | |
object | string | : Object type |
type | string |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
UniqueCouponCode
()
UniqueCouponCode
Type: Object
property | type | description |
---|---|---|
bulkCouponCode | string | : The Coupon code of the parent Bulk Coupon |
bulkCouponId | string | : The Coupon ID of the parent Bulk Coupon |
code | string | : The code the customer enters to redeem the coupon. |
createdAt | Date | : Created at |
expiredAt | Date | : The date and time the coupon was expired early or reached its
max_redemptions
.
|
id | string | : Unique Coupon Code ID |
object | string | : Object type |
redeemedAt | Date | : The date and time the unique coupon code was redeemed. |
state | string | : Indicates if the unique coupon code is redeemable or why not. |
updatedAt | Date | : Updated at |
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
UniqueCouponCodeParams
()
UniqueCouponCodeParams
Type: Object
property | type | description |
---|---|---|
beginTime | Date | : The date-time to be included when listing UniqueCouponCodes |
limit | number | : The number of UniqueCouponCodes that will be generated |
order | string | : Sort order to list newly generated UniqueCouponCodes (should always be
asc
)
|
sort | string | : Sort field to list newly generated UniqueCouponCodes (should always be
created_at
)
|
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
Usage
()
Usage
Type: Object
property | type | description |
---|---|---|
amount | number | : The amount of usage. Can be positive, negative, or 0. If the Decimal Quantity feature is enabled, this value will be rounded to nine decimal places. Otherwise, all digits after the decimal will be stripped. If the usage-based add-on is billed with a percentage, your usage should be a monetary amount formatted in cents (e.g., $5.00 is "500"). |
billedAt | Date | : When the usage record was billed on an invoice. |
createdAt | Date | : When the usage record was created in Recurly. |
id | string | |
measuredUnitId | string | : The ID of the measured unit associated with the add-on the usage record is for. |
merchantTag | string | : Custom field for recording the id in your own system associated with the usage, so you can provide auditable usage displays to your customers using a GET on this endpoint. |
object | string | : Object type |
percentageTiers | Array<SubscriptionAddOnPercentageTier> | : The percentage tiers of the subscription based on the usage_timestamp. If tier_type = flat, percentage_tiers = []. This feature is currently in development and requires approval and enablement, please contact support. |
recordingTimestamp | Date | : When the usage was recorded in your system. |
tierType | string | : The pricing model for the add-on. For more information, click here . See our Guide for an overview of how to configure quantity-based pricing models. |
tiers | Array<SubscriptionAddOnTier> | : The tiers and prices of the subscription based on the usage_timestamp. If tier_type = flat, tiers = [] |
unitAmount | number | : Unit price |
unitAmountDecimal | string | : Unit price that can optionally support a sub-cent value. |
updatedAt | Date | : When the usage record was billed on an invoice. |
usagePercentage | number | : The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. |
usageTimestamp | Date | : When the usage actually happened. This will define the line item dates this usage is billed under and is important for revenue recognition. |
usageType | string | : Type of usage, returns usage type if
add_on_type
is
usage
.
|
()
This file is automatically created by Recurly's OpenAPI generation process and thus any edits you make by hand will be lost. If you wish to make a change to this file, please create a Github issue explaining the changes you need and we will usher them to the appropriate places.
User
()
User
Type: Object
property | type | description |
---|---|---|
createdAt | Date | |
deletedAt | Date | |
string | ||
firstName | string | |
id | string | |
lastName | string | |
object | string | : Object type |
timeZone | string |
PrimitiveProperty
()
Represents a primitive:
DateProperty
()
Represents a Date in the schema
ResourceProperty
(type)
Represents an embedded Resource in the schema
parameter | type | description |
---|---|---|
type |
any |
ArrayProperty
(type)
Represents an array of other schema properties.
parameter | type | description |
---|---|---|
type |
Property | Should be Property for element type |
build
(typeSig)
Factory method to build a Property from a type signature. You should only create Properties through this method.
parameter | type | description |
---|---|---|
typeSig |
any |
Schema
(resourceType)
The class responsible a compiled schema.
parameter | type | description |
---|---|---|
resourceType |
Resource | the resource type |