Skip to content

Commit 66f48ee

Browse files
authored
Merge pull request #364 from recurly/v3-v2021-02-25-21650785939
Generated Latest Changes for v2021-02-25
2 parents 2c758ee + ae4a357 commit 66f48ee

File tree

7 files changed

+319
-10
lines changed

7 files changed

+319
-10
lines changed

lib/recurly.d.ts

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,10 @@ export declare class CouponRedemption {
983983
* Will always be `coupon`.
984984
*/
985985
object?: string | null;
986+
/**
987+
* The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
988+
*/
989+
uuid?: string | null;
986990
/**
987991
* The Account on which the coupon was applied.
988992
*/
@@ -2110,6 +2114,10 @@ export declare class InvoiceCollection {
21102114
* Credit invoices
21112115
*/
21122116
creditInvoices?: Invoice[] | null;
2117+
/**
2118+
* Verification transactions (used for free trial payment method validation)
2119+
*/
2120+
verificationTransactions?: Transaction[] | null;
21132121

21142122
}
21152123

@@ -2295,7 +2303,7 @@ export declare class Subscription {
22952303
*/
22962304
netTermsType?: string | null;
22972305
/**
2298-
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior.
2306+
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior. When mode is `all`, the optional `allowed_origins` array can restrict which credit invoice origins are applied.
22992307
*/
23002308
creditApplicationPolicy?: CreditApplicationPolicy | null;
23012309
/**
@@ -2765,6 +2773,10 @@ export declare class CreditApplicationPolicy {
27652773
* Determines which credit invoices are applied to invoices: - `all`: All available credit invoices are applied (default) - `none`: No credit invoices are applied automatically
27662774
*/
27672775
mode?: string | null;
2776+
/**
2777+
* Optional array of credit invoice origin types to allow when mode is `all`. If not specified when mode is `all`, credits from all origins are applied. Only valid when mode is `all`.
2778+
*/
2779+
allowedOrigins?: string[] | null;
27682780

27692781
}
27702782

@@ -4737,7 +4749,7 @@ export interface InvoiceCreate {
47374749
*/
47384750
netTermsType?: string | null;
47394751
/**
4740-
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior.
4752+
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior. When mode is `all`, the optional `allowed_origins` array can restrict which credit invoice origins are applied.
47414753
*/
47424754
creditApplicationPolicy?: CreditApplicationPolicy | null;
47434755
/**
@@ -4764,6 +4776,10 @@ export interface CreditApplicationPolicy {
47644776
* Determines which credit invoices are applied to invoices: - `all`: All available credit invoices are applied (default) - `none`: No credit invoices are applied automatically
47654777
*/
47664778
mode?: string | null;
4779+
/**
4780+
* Optional array of credit invoice origin types to allow when mode is `all`. If not specified when mode is `all`, credits from all origins are applied. Only valid when mode is `all`.
4781+
*/
4782+
allowedOrigins?: string[] | null;
47674783

47684784
}
47694785

@@ -6538,7 +6554,7 @@ export interface SubscriptionCreate {
65386554
*/
65396555
netTermsType?: string | null;
65406556
/**
6541-
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior.
6557+
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior. When mode is `all`, the optional `allowed_origins` array can restrict which credit invoice origins are applied.
65426558
*/
65436559
creditApplicationPolicy?: CreditApplicationPolicy | null;
65446560
/**
@@ -6735,7 +6751,7 @@ export interface SubscriptionUpdate {
67356751
*/
67366752
netTermsType?: string | null;
67376753
/**
6738-
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior.
6754+
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior. When mode is `all`, the optional `allowed_origins` array can restrict which credit invoice origins are applied.
67396755
*/
67406756
creditApplicationPolicy?: CreditApplicationPolicy | null;
67416757
/**
@@ -7019,7 +7035,7 @@ export interface PurchaseCreate {
70197035
*/
70207036
netTermsType?: string | null;
70217037
/**
7022-
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior.
7038+
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior. When mode is `all`, the optional `allowed_origins` array can restrict which credit invoice origins are applied.
70237039
*/
70247040
creditApplicationPolicyOverride?: CreditApplicationPolicy | null;
70257041
/**
@@ -7263,7 +7279,7 @@ export interface SubscriptionPurchase {
72637279
*/
72647280
rampIntervals?: SubscriptionRampInterval[] | null;
72657281
/**
7266-
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior.
7282+
* Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior. When mode is `all`, the optional `allowed_origins` array can restrict which credit invoice origins are applied.
72677283
*/
72687284
creditApplicationPolicy?: CreditApplicationPolicy | null;
72697285
/**
@@ -8062,6 +8078,28 @@ export declare class Client {
80628078
* @return {Promise<CouponRedemption>} Coupon redemption deleted.
80638079
*/
80648080
removeCouponRedemption(accountId: string): Promise<CouponRedemption>;
8081+
/**
8082+
* Show the coupon redemption
8083+
*
8084+
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_coupon_redemption
8085+
*
8086+
*
8087+
* @param {string} accountId - Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
8088+
* @param {string} couponRedemptionId - Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
8089+
* @return {Promise<CouponRedemption>} A coupon redemption.
8090+
*/
8091+
getCouponRedemption(accountId: string, couponRedemptionId: string): Promise<CouponRedemption>;
8092+
/**
8093+
* Delete the coupon redemption
8094+
*
8095+
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_coupon_redemption_by_id
8096+
*
8097+
*
8098+
* @param {string} accountId - Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
8099+
* @param {string} couponRedemptionId - Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
8100+
* @return {Promise<CouponRedemption>} Coupon redemption deleted.
8101+
*/
8102+
removeCouponRedemptionById(accountId: string, couponRedemptionId: string): Promise<CouponRedemption>;
80658103
/**
80668104
* List an account's credit payments
80678105
*
@@ -11243,6 +11281,28 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
1124311281
* @return {Pager<CouponRedemption>} A list of the the coupon redemptions on a subscription.
1124411282
*/
1124511283
listSubscriptionCouponRedemptions(subscriptionId: string, options?: object): Pager<CouponRedemption>;
11284+
/**
11285+
* Show the coupon redemption for a subscription
11286+
*
11287+
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_coupon_redemption
11288+
*
11289+
*
11290+
* @param {string} subscriptionId - Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
11291+
* @param {string} couponRedemptionId - Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
11292+
* @return {Promise<CouponRedemption>} The coupon redemption on a subscription.
11293+
*/
11294+
getSubscriptionCouponRedemption(subscriptionId: string, couponRedemptionId: string): Promise<CouponRedemption>;
11295+
/**
11296+
* Delete the coupon redemption from a subscription
11297+
*
11298+
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/remove_subscription_coupon_redemption
11299+
*
11300+
*
11301+
* @param {string} subscriptionId - Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
11302+
* @param {string} couponRedemptionId - Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
11303+
* @return {Promise<CouponRedemption>} Coupon redemption deleted.
11304+
*/
11305+
removeSubscriptionCouponRedemption(subscriptionId: string, couponRedemptionId: string): Promise<CouponRedemption>;
1124611306
/**
1124711307
* List a subscription add-on's usage records
1124811308
*

lib/recurly/Client.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,38 @@ class Client extends BaseClient {
833833
return this._makeRequest('DELETE', path, null, options)
834834
}
835835

836+
/**
837+
* Show the coupon redemption
838+
*
839+
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_coupon_redemption}
840+
*
841+
*
842+
* @param {string} accountId - Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
843+
* @param {string} couponRedemptionId - Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
844+
* @return {Promise<CouponRedemption>} A coupon redemption.
845+
*/
846+
async getCouponRedemption (accountId, couponRedemptionId, options = {}) {
847+
let path = '/accounts/{account_id}/coupon_redemptions/{coupon_redemption_id}'
848+
path = this._interpolatePath(path, { 'account_id': accountId, 'coupon_redemption_id': couponRedemptionId })
849+
return this._makeRequest('GET', path, null, options)
850+
}
851+
852+
/**
853+
* Delete the coupon redemption
854+
*
855+
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/remove_coupon_redemption_by_id}
856+
*
857+
*
858+
* @param {string} accountId - Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
859+
* @param {string} couponRedemptionId - Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
860+
* @return {Promise<CouponRedemption>} Coupon redemption deleted.
861+
*/
862+
async removeCouponRedemptionById (accountId, couponRedemptionId, options = {}) {
863+
let path = '/accounts/{account_id}/coupon_redemptions/{coupon_redemption_id}'
864+
path = this._interpolatePath(path, { 'account_id': accountId, 'coupon_redemption_id': couponRedemptionId })
865+
return this._makeRequest('DELETE', path, null, options)
866+
}
867+
836868
/**
837869
* List an account's credit payments
838870
*
@@ -4642,6 +4674,38 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
46424674
return new Pager(this, path, options)
46434675
}
46444676

4677+
/**
4678+
* Show the coupon redemption for a subscription
4679+
*
4680+
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_coupon_redemption}
4681+
*
4682+
*
4683+
* @param {string} subscriptionId - Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
4684+
* @param {string} couponRedemptionId - Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
4685+
* @return {Promise<CouponRedemption>} The coupon redemption on a subscription.
4686+
*/
4687+
async getSubscriptionCouponRedemption (subscriptionId, couponRedemptionId, options = {}) {
4688+
let path = '/subscriptions/{subscription_id}/coupon_redemptions/{coupon_redemption_id}'
4689+
path = this._interpolatePath(path, { 'subscription_id': subscriptionId, 'coupon_redemption_id': couponRedemptionId })
4690+
return this._makeRequest('GET', path, null, options)
4691+
}
4692+
4693+
/**
4694+
* Delete the coupon redemption from a subscription
4695+
*
4696+
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/remove_subscription_coupon_redemption}
4697+
*
4698+
*
4699+
* @param {string} subscriptionId - Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
4700+
* @param {string} couponRedemptionId - Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
4701+
* @return {Promise<CouponRedemption>} Coupon redemption deleted.
4702+
*/
4703+
async removeSubscriptionCouponRedemption (subscriptionId, couponRedemptionId, options = {}) {
4704+
let path = '/subscriptions/{subscription_id}/coupon_redemptions/{coupon_redemption_id}'
4705+
path = this._interpolatePath(path, { 'subscription_id': subscriptionId, 'coupon_redemption_id': couponRedemptionId })
4706+
return this._makeRequest('DELETE', path, null, options)
4707+
}
4708+
46454709
/**
46464710
* List a subscription add-on's usage records
46474711
*

lib/recurly/resources/CouponRedemption.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const Resource = require('../Resource')
2323
* @prop {string} state - Coupon Redemption state
2424
* @prop {string} subscriptionId - Subscription ID
2525
* @prop {Date} updatedAt - Last updated at
26+
* @prop {string} uuid - The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
2627
*/
2728
class CouponRedemption extends Resource {
2829
static getSchema () {
@@ -37,7 +38,8 @@ class CouponRedemption extends Resource {
3738
removedAt: Date,
3839
state: String,
3940
subscriptionId: String,
40-
updatedAt: Date
41+
updatedAt: Date,
42+
uuid: String
4143
}
4244
}
4345
}

lib/recurly/resources/CreditApplicationPolicy.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ const Resource = require('../Resource')
1212
/**
1313
* CreditApplicationPolicy
1414
* @typedef {Object} CreditApplicationPolicy
15+
* @prop {Array.<string>} allowedOrigins - Optional array of credit invoice origin types to allow when mode is `all`. If not specified when mode is `all`, credits from all origins are applied. Only valid when mode is `all`.
1516
* @prop {string} mode - Determines which credit invoices are applied to invoices: - `all`: All available credit invoices are applied (default) - `none`: No credit invoices are applied automatically
1617
*/
1718
class CreditApplicationPolicy extends Resource {
1819
static getSchema () {
1920
return {
21+
allowedOrigins: Array,
2022
mode: String
2123
}
2224
}

lib/recurly/resources/InvoiceCollection.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ const Resource = require('../Resource')
1515
* @prop {Invoice} chargeInvoice
1616
* @prop {Array.<Invoice>} creditInvoices - Credit invoices
1717
* @prop {string} object - Object type
18+
* @prop {Array.<Transaction>} verificationTransactions - Verification transactions (used for free trial payment method validation)
1819
*/
1920
class InvoiceCollection extends Resource {
2021
static getSchema () {
2122
return {
2223
chargeInvoice: 'Invoice',
2324
creditInvoices: ['Invoice'],
24-
object: String
25+
object: String,
26+
verificationTransactions: ['Transaction']
2527
}
2628
}
2729
}

lib/recurly/resources/Subscription.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Resource = require('../Resource')
2727
* @prop {Date} convertedAt - When the subscription was converted from a gift card.
2828
* @prop {Array.<CouponRedemptionMini>} couponRedemptions - Returns subscription level coupon redemptions that are tied to this subscription.
2929
* @prop {Date} createdAt - Created at
30-
* @prop {CreditApplicationPolicy} creditApplicationPolicy - Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior.
30+
* @prop {CreditApplicationPolicy} creditApplicationPolicy - Controls whether credit invoices are automatically applied to new invoices. The `mode` field determines the application behavior. When mode is `all`, the optional `allowed_origins` array can restrict which credit invoice origins are applied.
3131
* @prop {string} currency - 3-letter ISO 4217 currency code.
3232
* @prop {Date} currentPeriodEndsAt - Current billing period ends at
3333
* @prop {Date} currentPeriodStartedAt - Current billing period started at

0 commit comments

Comments
 (0)