Skip to content

Commit

Permalink
Generated Latest Changes for v2021-02-25
Browse files Browse the repository at this point in the history
  • Loading branch information
Recurly Integrations authored Jul 2, 2024
1 parent a45fa73 commit a703b57
Show file tree
Hide file tree
Showing 15 changed files with 1,547 additions and 90 deletions.
524 changes: 453 additions & 71 deletions lib/recurly.d.ts

Large diffs are not rendered by default.

118 changes: 114 additions & 4 deletions lib/recurly/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1963,14 +1963,124 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
* }
*
* @param {string} customFieldDefinitionId - Custom Field Definition ID
* @return {Promise<CustomFieldDefinition>} An custom field definition.
* @return {Promise<CustomFieldDefinition>} A custom field definition.
*/
async getCustomFieldDefinition (customFieldDefinitionId, options = {}) {
let path = '/custom_field_definitions/{custom_field_definition_id}'
path = this._interpolatePath(path, { 'custom_field_definition_id': customFieldDefinitionId })
return this._makeRequest('GET', path, null, options)
}

/**
* Create a new general ledger account
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/create_general_ledger_account}
*
*
* @param {GeneralLedgerAccountCreate} body - The object representing the JSON request to send to the server. It should conform to the schema of {GeneralLedgerAccountCreate}
* @return {Promise<GeneralLedgerAccount>} A new general ledger account.
*/
async createGeneralLedgerAccount (body, options = {}) {
let path = '/general_ledger_accounts'
path = this._interpolatePath(path)
return this._makeRequest('POST', path, body, options)
}

/**
* List a site's general ledger accounts
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_general_ledger_accounts}
*
*
* @param {Object} options - Optional configurations for the request
* @param {Object} options.params - The optional url parameters for this request.
* @param {Array.<string>} options.params.ids - 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:**
*
* * The `ids` parameter cannot be used with any other ordering or filtering
* parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
* * Invalid or unknown IDs will be ignored, so you should check that the
* results correspond to your request.
* * Records are returned in an arbitrary order. Since results are all
* returned at once you can sort the records yourself.
*
* @param {number} options.params.limit - Limit number of records 1-200.
* @param {string} options.params.order - Sort order.
* @param {string} options.params.sort - 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.
*
* @param {string} options.params.accountType - General Ledger Account type by which to filter the response.
* @return {Pager<GeneralLedgerAccount>} A list of the site's general ledger accounts.
*/
listGeneralLedgerAccounts (options = {}) {
let path = '/general_ledger_accounts'
path = this._interpolatePath(path)
return new Pager(this, path, options)
}

/**
* Fetch a general ledger account
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_general_ledger_account}
*
*
* @param {string} generalLedgerAccountId - General Ledger Account ID
* @return {Promise<GeneralLedgerAccount>} A general ledger account.
*/
async getGeneralLedgerAccount (generalLedgerAccountId, options = {}) {
let path = '/general_ledger_accounts/{general_ledger_account_id}'
path = this._interpolatePath(path, { 'general_ledger_account_id': generalLedgerAccountId })
return this._makeRequest('GET', path, null, options)
}

/**
* Update a general ledger account
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/update_general_ledger_account}
*
*
* @param {string} generalLedgerAccountId - General Ledger Account ID
* @param {GeneralLedgerAccountUpdate} body - The object representing the JSON request to send to the server. It should conform to the schema of {GeneralLedgerAccountUpdate}
* @return {Promise<GeneralLedgerAccount>} The updated general ledger account.
*/
async updateGeneralLedgerAccount (generalLedgerAccountId, body, options = {}) {
let path = '/general_ledger_accounts/{general_ledger_account_id}'
path = this._interpolatePath(path, { 'general_ledger_account_id': generalLedgerAccountId })
return this._makeRequest('PUT', path, body, options)
}

/**
* Get a single Performance Obligation.
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_performance_obligation}
*
*
* @param {string} performanceObligationId - Performance Obligation id.
* @return {Promise<PerformanceObligation>} A single Performance Obligation.
*/
async getPerformanceObligation (performanceObligationId, options = {}) {
let path = '/performance_obligations/{performance_obligation_id}'
path = this._interpolatePath(path, { 'performance_obligation_id': performanceObligationId })
return this._makeRequest('GET', path, null, options)
}

/**
* Get a site's Performance Obligations
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_performance_obligations}
*
*
* @return {Pager<PerformanceObligation>} A list of Performance Obligations.
*/
getPerformanceObligations (options = {}) {
let path = '/performance_obligations'
path = this._interpolatePath(path)
return new Pager(this, path, options)
}

/**
* List an invoice template's associated accounts
*
Expand Down Expand Up @@ -2507,7 +2617,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription}
*
*
* @param {string} externalSubscriptionId - External subscription id
* @param {string} externalSubscriptionId - External subscription ID or external_id. For ID no prefix is used e.g. `e28zov4fw0v2`. For external_id use prefix `external-id-`, e.g. `external-id-123456`.
* @return {Promise<ExternalSubscription>} Settings for an external subscription.
*/
async getExternalSubscription (externalSubscriptionId, options = {}) {
Expand Down Expand Up @@ -4978,14 +5088,14 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
}

/**
* Fetch an external payment_phase
* Fetch an external payment phase
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription_external_payment_phase}
*
*
* @param {string} externalSubscriptionId - External subscription id
* @param {string} externalPaymentPhaseId - External payment phase ID, e.g. `a34ypb2ef9w1`.
* @return {Promise<ExternalPaymentPhase>} Details for an external payment_phase.
* @return {Promise<ExternalPaymentPhase>} Details for an external payment phase.
*/
async getExternalSubscriptionExternalPaymentPhase (externalSubscriptionId, externalPaymentPhaseId, options = {}) {
let path = '/external_subscriptions/{external_subscription_id}/external_payment_phases/{external_payment_phase_id}'
Expand Down
6 changes: 6 additions & 0 deletions lib/recurly/resources/AddOn.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ const Resource = require('../Resource')
* @prop {string} externalSku - Optional, stock keeping unit to link the item to other inventory systems.
* @prop {string} id - Add-on ID
* @prop {ItemMini} item - Just the important parts.
* @prop {string} liabilityGlAccountId - 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.
* @prop {string} measuredUnitId - System-generated unique identifier for an measured unit associated with the add-on.
* @prop {string} name - Describes your add-on and will appear in subscribers' invoices.
* @prop {string} object - Object type
* @prop {boolean} optional - 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.
* @prop {Array.<PercentageTiersByCurrency>} percentageTiers - This feature is currently in development and requires approval and enablement, please contact support.
* @prop {string} performanceObligationId - The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
* @prop {string} planId - Plan ID
* @prop {string} revenueGlAccountId - 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.
* @prop {string} revenueScheduleType - 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.
* @prop {string} state - Add-ons can be either active or inactive.
* @prop {string} taxCode - Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
Expand Down Expand Up @@ -58,12 +61,15 @@ class AddOn extends Resource {
externalSku: String,
id: String,
item: 'ItemMini',
liabilityGlAccountId: String,
measuredUnitId: String,
name: String,
object: String,
optional: Boolean,
percentageTiers: ['PercentageTiersByCurrency'],
performanceObligationId: String,
planId: String,
revenueGlAccountId: String,
revenueScheduleType: String,
state: String,
taxCode: String,
Expand Down
8 changes: 8 additions & 0 deletions lib/recurly/resources/BusinessEntity.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ const Resource = require('../Resource')
* @typedef {Object} BusinessEntity
* @prop {string} code - The entity code of the business entity.
* @prop {Date} createdAt - Created at
* @prop {string} defaultLiabilityGlAccountId - 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.
* @prop {string} defaultRegistrationNumber - Registration number for the customer used on the invoice.
* @prop {string} defaultRevenueGlAccountId - 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.
* @prop {string} defaultVatNumber - VAT number for the customer used on the invoice.
* @prop {string} destinationTaxAddressSource - 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".
* @prop {string} id - Business entity ID
* @prop {Address} invoiceDisplayAddress - Address information for the business entity that will appear on the invoice.
* @prop {string} name - This name describes your business entity and will appear on the invoice.
* @prop {string} object - Object type
* @prop {string} originTaxAddressSource - 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".
* @prop {Array.<string>} subscriberLocationCountries - List of countries for which the business entity will be used.
* @prop {Address} taxAddress - Address information for the business entity that will be used for calculating taxes.
* @prop {Date} updatedAt - Last updated at
Expand All @@ -29,12 +33,16 @@ class BusinessEntity extends Resource {
return {
code: String,
createdAt: Date,
defaultLiabilityGlAccountId: String,
defaultRegistrationNumber: String,
defaultRevenueGlAccountId: String,
defaultVatNumber: String,
destinationTaxAddressSource: String,
id: String,
invoiceDisplayAddress: 'Address',
name: String,
object: String,
originTaxAddressSource: String,
subscriberLocationCountries: Array,
taxAddress: 'Address',
updatedAt: Date
Expand Down
2 changes: 0 additions & 2 deletions lib/recurly/resources/ExternalPaymentPhase.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const Resource = require('../Resource')
* @prop {string} currency - 3-letter ISO 4217 currency code.
* @prop {number} endingBillingPeriodIndex - Ending Billing Period Index
* @prop {Date} endsAt - Ends At
* @prop {ExternalSubscription} externalSubscription - Subscription from an external resource such as Apple App Store or Google Play Store.
* @prop {string} id - System-generated unique identifier for an external payment phase ID, e.g. `e28zov4fw0v2`.
* @prop {string} object - Object type
* @prop {string} offerName - Name of the discount offer given, e.g. "introductory"
Expand All @@ -36,7 +35,6 @@ class ExternalPaymentPhase extends Resource {
currency: String,
endingBillingPeriodIndex: Number,
endsAt: Date,
externalSubscription: 'ExternalSubscription',
id: String,
object: String,
offerName: String,
Expand Down
4 changes: 4 additions & 0 deletions lib/recurly/resources/ExternalSubscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ const Resource = require('../Resource')
* @prop {Date} createdAt - When the external subscription was created in Recurly.
* @prop {Date} expiresAt - When the external subscription expires in the external platform.
* @prop {string} externalId - The id of the subscription in the external systems., I.e. Apple App Store or Google Play Store.
* @prop {Array.<ExternalPaymentPhase>} externalPaymentPhases - The phases of the external subscription payment lifecycle.
* @prop {ExternalProductReferenceMini} externalProductReference - External Product Reference details
* @prop {string} id - System-generated unique identifier for an external subscription ID, e.g. `e28zov4fw0v2`.
* @prop {boolean} imported - An indication of whether or not the external subscription was created by a historical data import.
* @prop {boolean} inGracePeriod - An indication of whether or not the external subscription is in a grace period.
* @prop {Date} lastPurchased - When a new billing event occurred on the external subscription in conjunction with a recent billing period, reactivation or upgrade/downgrade.
* @prop {string} object - Object type
Expand All @@ -43,8 +45,10 @@ class ExternalSubscription extends Resource {
createdAt: Date,
expiresAt: Date,
externalId: String,
externalPaymentPhases: ['ExternalPaymentPhase'],
externalProductReference: 'ExternalProductReferenceMini',
id: String,
imported: Boolean,
inGracePeriod: Boolean,
lastPurchased: Date,
object: String,
Expand Down
37 changes: 37 additions & 0 deletions lib/recurly/resources/GeneralLedgerAccount.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* istanbul ignore 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.
*/
'use strict'

const Resource = require('../Resource')

/**
* GeneralLedgerAccount
* @typedef {Object} GeneralLedgerAccount
* @prop {string} accountType
* @prop {string} code - Unique code to identify the ledger account. Each code must start with a letter or number. The following special characters are allowed: `-_.,:`
* @prop {Date} createdAt - Created at
* @prop {string} description - Optional description.
* @prop {string} id - 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.
* @prop {string} object - Object type
* @prop {Date} updatedAt - Last updated at
*/
class GeneralLedgerAccount extends Resource {
static getSchema () {
return {
accountType: String,
code: String,
createdAt: Date,
description: String,
id: String,
object: String,
updatedAt: Date
}
}
}

module.exports = GeneralLedgerAccount
6 changes: 6 additions & 0 deletions lib/recurly/resources/GiftCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ const Resource = require('../Resource')
* @prop {GiftCardDelivery} delivery - The delivery details for the gift card.
* @prop {string} gifterAccountId - The ID of the account that purchased the gift card.
* @prop {string} id - Gift card ID
* @prop {string} liabilityGlAccountId - 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.
* @prop {string} object - Object type
* @prop {string} performanceObligationId - The ID of a performance obligation. Performance obligations are only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
* @prop {string} productCode - The product code or SKU of the gift card product.
* @prop {string} purchaseInvoiceId - The ID of the invoice for the gift card purchase made by the gifter.
* @prop {string} recipientAccountId - The ID of the account that redeemed the gift card redemption code. Does not have a value until gift card is redeemed.
* @prop {Date} redeemedAt - When the gift card was redeemed by the recipient.
* @prop {string} redemptionCode - 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.
* @prop {string} redemptionInvoiceId - The ID of the invoice for the gift card redemption made by the recipient. Does not have a value until gift card is redeemed.
* @prop {string} revenueGlAccountId - 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.
* @prop {number} unitAmount - 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.
* @prop {Date} updatedAt - Last updated at
*/
Expand All @@ -41,13 +44,16 @@ class GiftCard extends Resource {
delivery: 'GiftCardDelivery',
gifterAccountId: String,
id: String,
liabilityGlAccountId: String,
object: String,
performanceObligationId: String,
productCode: String,
purchaseInvoiceId: String,
recipientAccountId: String,
redeemedAt: Date,
redemptionCode: String,
redemptionInvoiceId: String,
revenueGlAccountId: String,
unitAmount: Number,
updatedAt: Date
}
Expand Down
Loading

0 comments on commit a703b57

Please sign in to comment.