@usehercules/sdk 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +125 -0
- package/README.md +14 -20
- package/client.d.mts +6 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -3
- package/client.d.ts.map +1 -1
- package/client.js +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/beta/beta.d.mts +4 -4
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +4 -4
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +4 -4
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +4 -4
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -1
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +3 -3
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/pay/coupons.d.mts +156 -0
- package/resources/beta/pay/coupons.d.mts.map +1 -0
- package/resources/beta/pay/coupons.d.ts +156 -0
- package/resources/beta/pay/coupons.d.ts.map +1 -0
- package/resources/beta/pay/coupons.js +51 -0
- package/resources/beta/pay/coupons.js.map +1 -0
- package/resources/beta/pay/coupons.mjs +47 -0
- package/resources/beta/pay/coupons.mjs.map +1 -0
- package/resources/beta/pay/customers.d.mts +160 -0
- package/resources/beta/pay/customers.d.mts.map +1 -0
- package/resources/beta/pay/customers.d.ts +160 -0
- package/resources/beta/pay/customers.d.ts.map +1 -0
- package/resources/beta/pay/customers.js +60 -0
- package/resources/beta/pay/customers.js.map +1 -0
- package/resources/beta/pay/customers.mjs +56 -0
- package/resources/beta/pay/customers.mjs.map +1 -0
- package/resources/beta/pay/entitlements.d.mts +94 -0
- package/resources/beta/pay/entitlements.d.mts.map +1 -0
- package/resources/beta/pay/entitlements.d.ts +94 -0
- package/resources/beta/pay/entitlements.d.ts.map +1 -0
- package/resources/beta/pay/entitlements.js +42 -0
- package/resources/beta/pay/entitlements.js.map +1 -0
- package/resources/beta/pay/entitlements.mjs +38 -0
- package/resources/beta/pay/entitlements.mjs.map +1 -0
- package/resources/beta/pay/index.d.mts +6 -0
- package/resources/beta/pay/index.d.mts.map +1 -0
- package/resources/beta/pay/index.d.ts +6 -0
- package/resources/beta/pay/index.d.ts.map +1 -0
- package/resources/beta/{subscriptions → pay}/index.js +5 -5
- package/resources/beta/pay/index.js.map +1 -0
- package/resources/beta/{subscriptions → pay}/index.mjs +2 -2
- package/resources/beta/pay/index.mjs.map +1 -0
- package/resources/beta/{subscriptions/subscriptions.d.mts → pay/pay.d.mts} +48 -32
- package/resources/beta/pay/pay.d.mts.map +1 -0
- package/resources/beta/{subscriptions/subscriptions.d.ts → pay/pay.d.ts} +48 -32
- package/resources/beta/pay/pay.d.ts.map +1 -0
- package/resources/beta/pay/pay.js +54 -0
- package/resources/beta/pay/pay.js.map +1 -0
- package/resources/beta/pay/pay.mjs +49 -0
- package/resources/beta/pay/pay.mjs.map +1 -0
- package/resources/beta/pay/products/entitlements.d.mts +53 -0
- package/resources/beta/pay/products/entitlements.d.mts.map +1 -0
- package/resources/beta/pay/products/entitlements.d.ts +53 -0
- package/resources/beta/pay/products/entitlements.d.ts.map +1 -0
- package/resources/beta/pay/products/entitlements.js +38 -0
- package/resources/beta/pay/products/entitlements.js.map +1 -0
- package/resources/beta/pay/products/entitlements.mjs +34 -0
- package/resources/beta/pay/products/entitlements.mjs.map +1 -0
- package/resources/beta/pay/products/index.d.mts +3 -0
- package/resources/beta/pay/products/index.d.mts.map +1 -0
- package/resources/beta/pay/products/index.d.ts +3 -0
- package/resources/beta/pay/products/index.d.ts.map +1 -0
- package/resources/beta/{subscriptions/plans → pay/products}/index.js +3 -3
- package/resources/beta/pay/products/index.js.map +1 -0
- package/resources/beta/{subscriptions/plans → pay/products}/index.mjs +1 -1
- package/resources/beta/pay/products/index.mjs.map +1 -0
- package/resources/beta/pay/products/products.d.mts +152 -0
- package/resources/beta/pay/products/products.d.mts.map +1 -0
- package/resources/beta/pay/products/products.d.ts +152 -0
- package/resources/beta/pay/products/products.d.ts.map +1 -0
- package/resources/beta/pay/products/products.js +57 -0
- package/resources/beta/pay/products/products.js.map +1 -0
- package/resources/beta/pay/products/products.mjs +52 -0
- package/resources/beta/pay/products/products.mjs.map +1 -0
- package/resources/beta/pay/products.d.mts +2 -0
- package/resources/beta/pay/products.d.mts.map +1 -0
- package/resources/beta/pay/products.d.ts +2 -0
- package/resources/beta/pay/products.d.ts.map +1 -0
- package/resources/beta/{subscriptions/plans.js → pay/products.js} +2 -2
- package/resources/beta/pay/products.js.map +1 -0
- package/resources/beta/{subscriptions.mjs → pay/products.mjs} +2 -2
- package/resources/beta/pay/products.mjs.map +1 -0
- package/resources/beta/pay.d.mts +2 -0
- package/resources/beta/pay.d.mts.map +1 -0
- package/resources/beta/pay.d.ts +2 -0
- package/resources/beta/pay.d.ts.map +1 -0
- package/resources/beta/{subscriptions.js → pay.js} +2 -2
- package/resources/beta/pay.js.map +1 -0
- package/resources/beta/{subscriptions/plans.mjs → pay.mjs} +2 -2
- package/resources/beta/pay.mjs.map +1 -0
- package/src/client.ts +6 -4
- package/src/resources/beta/beta.ts +18 -18
- package/src/resources/beta/index.ts +8 -8
- package/src/resources/beta/pay/coupons.ts +218 -0
- package/src/resources/beta/pay/customers.ts +229 -0
- package/src/resources/beta/pay/entitlements.ts +135 -0
- package/src/resources/beta/{subscriptions → pay}/index.ts +15 -17
- package/src/resources/beta/{subscriptions/subscriptions.ts → pay/pay.ts} +70 -59
- package/src/resources/beta/{subscriptions/plans → pay/products}/entitlements.ts +26 -21
- package/src/resources/beta/{subscriptions/plans → pay/products}/index.ts +9 -9
- package/src/resources/beta/pay/products/products.ts +224 -0
- package/src/resources/beta/{subscriptions.ts → pay/products.ts} +1 -1
- package/src/resources/beta/{subscriptions/plans.ts → pay.ts} +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/beta/subscriptions/coupons.d.mts +0 -151
- package/resources/beta/subscriptions/coupons.d.mts.map +0 -1
- package/resources/beta/subscriptions/coupons.d.ts +0 -151
- package/resources/beta/subscriptions/coupons.d.ts.map +0 -1
- package/resources/beta/subscriptions/coupons.js +0 -51
- package/resources/beta/subscriptions/coupons.js.map +0 -1
- package/resources/beta/subscriptions/coupons.mjs +0 -47
- package/resources/beta/subscriptions/coupons.mjs.map +0 -1
- package/resources/beta/subscriptions/customers.d.mts +0 -93
- package/resources/beta/subscriptions/customers.d.mts.map +0 -1
- package/resources/beta/subscriptions/customers.d.ts +0 -93
- package/resources/beta/subscriptions/customers.d.ts.map +0 -1
- package/resources/beta/subscriptions/customers.js +0 -57
- package/resources/beta/subscriptions/customers.js.map +0 -1
- package/resources/beta/subscriptions/customers.mjs +0 -53
- package/resources/beta/subscriptions/customers.mjs.map +0 -1
- package/resources/beta/subscriptions/entitlements.d.mts +0 -70
- package/resources/beta/subscriptions/entitlements.d.mts.map +0 -1
- package/resources/beta/subscriptions/entitlements.d.ts +0 -70
- package/resources/beta/subscriptions/entitlements.d.ts.map +0 -1
- package/resources/beta/subscriptions/entitlements.js +0 -38
- package/resources/beta/subscriptions/entitlements.js.map +0 -1
- package/resources/beta/subscriptions/entitlements.mjs +0 -34
- package/resources/beta/subscriptions/entitlements.mjs.map +0 -1
- package/resources/beta/subscriptions/index.d.mts +0 -6
- package/resources/beta/subscriptions/index.d.mts.map +0 -1
- package/resources/beta/subscriptions/index.d.ts +0 -6
- package/resources/beta/subscriptions/index.d.ts.map +0 -1
- package/resources/beta/subscriptions/index.js.map +0 -1
- package/resources/beta/subscriptions/index.mjs.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.d.mts +0 -48
- package/resources/beta/subscriptions/plans/entitlements.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.d.ts +0 -48
- package/resources/beta/subscriptions/plans/entitlements.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.js +0 -34
- package/resources/beta/subscriptions/plans/entitlements.js.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.mjs +0 -30
- package/resources/beta/subscriptions/plans/entitlements.mjs.map +0 -1
- package/resources/beta/subscriptions/plans/index.d.mts +0 -3
- package/resources/beta/subscriptions/plans/index.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans/index.d.ts +0 -3
- package/resources/beta/subscriptions/plans/index.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans/index.js.map +0 -1
- package/resources/beta/subscriptions/plans/index.mjs.map +0 -1
- package/resources/beta/subscriptions/plans/plans.d.mts +0 -87
- package/resources/beta/subscriptions/plans/plans.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans/plans.d.ts +0 -87
- package/resources/beta/subscriptions/plans/plans.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans/plans.js +0 -49
- package/resources/beta/subscriptions/plans/plans.js.map +0 -1
- package/resources/beta/subscriptions/plans/plans.mjs +0 -44
- package/resources/beta/subscriptions/plans/plans.mjs.map +0 -1
- package/resources/beta/subscriptions/plans.d.mts +0 -2
- package/resources/beta/subscriptions/plans.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans.d.ts +0 -2
- package/resources/beta/subscriptions/plans.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans.js.map +0 -1
- package/resources/beta/subscriptions/plans.mjs.map +0 -1
- package/resources/beta/subscriptions/subscriptions.d.mts.map +0 -1
- package/resources/beta/subscriptions/subscriptions.d.ts.map +0 -1
- package/resources/beta/subscriptions/subscriptions.js +0 -47
- package/resources/beta/subscriptions/subscriptions.js.map +0 -1
- package/resources/beta/subscriptions/subscriptions.mjs +0 -42
- package/resources/beta/subscriptions/subscriptions.mjs.map +0 -1
- package/resources/beta/subscriptions.d.mts +0 -2
- package/resources/beta/subscriptions.d.mts.map +0 -1
- package/resources/beta/subscriptions.d.ts +0 -2
- package/resources/beta/subscriptions.d.ts.map +0 -1
- package/resources/beta/subscriptions.js.map +0 -1
- package/resources/beta/subscriptions.mjs.map +0 -1
- package/src/resources/beta/subscriptions/coupons.ts +0 -221
- package/src/resources/beta/subscriptions/customers.ts +0 -168
- package/src/resources/beta/subscriptions/entitlements.ts +0 -113
- package/src/resources/beta/subscriptions/plans/plans.ts +0 -159
package/resources/beta/beta.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
2
|
+
import * as PayAPI from "./pay/pay.js";
|
|
3
|
+
import { Pay, PayCancelParams, PayCancelResponse, PayCheckParams, PayCheckResponse, PayCheckoutParams, PayCheckoutResponse } from "./pay/pay.js";
|
|
4
4
|
export declare class Beta extends APIResource {
|
|
5
|
-
|
|
5
|
+
pay: PayAPI.Pay;
|
|
6
6
|
}
|
|
7
7
|
export declare namespace Beta {
|
|
8
|
-
export {
|
|
8
|
+
export { Pay as Pay, type PayCancelResponse as PayCancelResponse, type PayCheckResponse as PayCheckResponse, type PayCheckoutResponse as PayCheckoutResponse, type PayCancelParams as PayCancelParams, type PayCheckParams as PayCheckParams, type PayCheckoutParams as PayCheckoutParams, };
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=beta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,
|
|
1
|
+
{"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EACL,GAAG,EACH,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAgC;CAChD;AAID,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,GAAG,IAAI,GAAG,EACV,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
package/resources/beta/beta.js
CHANGED
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.Beta = void 0;
|
|
5
5
|
const tslib_1 = require("../../internal/tslib.js");
|
|
6
6
|
const resource_1 = require("../../core/resource.js");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const PayAPI = tslib_1.__importStar(require("./pay/pay.js"));
|
|
8
|
+
const pay_1 = require("./pay/pay.js");
|
|
9
9
|
class Beta extends resource_1.APIResource {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
|
-
this.
|
|
12
|
+
this.pay = new PayAPI.Pay(this._client);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
exports.Beta = Beta;
|
|
16
|
-
Beta.
|
|
16
|
+
Beta.Pay = pay_1.Pay;
|
|
17
17
|
//# sourceMappingURL=beta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6DAAoC;AACpC,sCAQmB;AAEnB,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,QAAG,GAAe,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;CAAA;AAFD,oBAEC;AAED,IAAI,CAAC,GAAG,GAAG,SAAG,CAAC"}
|
package/resources/beta/beta.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
3
|
+
import * as PayAPI from "./pay/pay.mjs";
|
|
4
|
+
import { Pay, } from "./pay/pay.mjs";
|
|
5
5
|
export class Beta extends APIResource {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
this.
|
|
8
|
+
this.pay = new PayAPI.Pay(this._client);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
Beta.
|
|
11
|
+
Beta.Pay = Pay;
|
|
12
12
|
//# sourceMappingURL=beta.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,
|
|
1
|
+
{"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EACL,GAAG,GAOJ;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,QAAG,GAAe,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;CAAA;AAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Beta } from "./beta.mjs";
|
|
2
|
-
export {
|
|
2
|
+
export { Pay, type PayCancelResponse, type PayCheckResponse, type PayCheckoutResponse, type PayCancelParams, type PayCheckParams, type PayCheckoutParams, } from "./pay/index.mjs";
|
|
3
3
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,GAAG,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Beta } from "./beta.js";
|
|
2
|
-
export {
|
|
2
|
+
export { Pay, type PayCancelResponse, type PayCheckResponse, type PayCheckoutResponse, type PayCancelParams, type PayCheckParams, type PayCheckoutParams, } from "./pay/index.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,GAAG,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB"}
|
package/resources/beta/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.Pay = exports.Beta = void 0;
|
|
5
5
|
var beta_1 = require("./beta.js");
|
|
6
6
|
Object.defineProperty(exports, "Beta", { enumerable: true, get: function () { return beta_1.Beta; } });
|
|
7
|
-
var index_1 = require("./
|
|
8
|
-
Object.defineProperty(exports, "
|
|
7
|
+
var index_1 = require("./pay/index.js");
|
|
8
|
+
Object.defineProperty(exports, "Pay", { enumerable: true, get: function () { return index_1.Pay; } });
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,wCAQqB;AAPnB,4FAAA,GAAG,OAAA"}
|
package/resources/beta/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,EACL,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,EACL,GAAG,GAOJ"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
export declare class Coupons extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a discount coupon with a promo code. Coupons can offer percentage or
|
|
8
|
+
* fixed-amount discounts and can be limited by redemption count or expiration
|
|
9
|
+
* date. Customers can apply coupons during checkout.
|
|
10
|
+
*/
|
|
11
|
+
create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon>;
|
|
12
|
+
/**
|
|
13
|
+
* Updates an existing coupon. Use this to modify the display name or deactivate
|
|
14
|
+
* the coupon. Discount amounts and codes cannot be changed after creation.
|
|
15
|
+
*/
|
|
16
|
+
update(couponID: string, body?: CouponUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Coupon>;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves a paginated list of all coupons. Coupons provide discounts that
|
|
19
|
+
* customers can apply during checkout using a promo code.
|
|
20
|
+
*/
|
|
21
|
+
list(query?: CouponListParams | null | undefined, options?: RequestOptions): PagePromise<CouponsCursorIDPage, Coupon>;
|
|
22
|
+
/**
|
|
23
|
+
* Permanently deletes a coupon. The promo code can no longer be used. Existing
|
|
24
|
+
* discounts applied to active subscriptions are not affected.
|
|
25
|
+
*/
|
|
26
|
+
delete(couponID: string, options?: RequestOptions): APIPromise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves a coupon by ID. Returns the coupon object including discount details
|
|
29
|
+
* and redemption statistics.
|
|
30
|
+
*/
|
|
31
|
+
get(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
|
|
32
|
+
}
|
|
33
|
+
export type CouponsCursorIDPage = CursorIDPage<Coupon>;
|
|
34
|
+
/**
|
|
35
|
+
* A discount coupon that customers can apply during checkout using a promo code
|
|
36
|
+
*/
|
|
37
|
+
export interface Coupon {
|
|
38
|
+
/**
|
|
39
|
+
* Unique identifier for the entitlement
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the coupon is currently active and can be redeemed
|
|
44
|
+
*/
|
|
45
|
+
active: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The promo code customers enter to apply the discount
|
|
48
|
+
*/
|
|
49
|
+
code: string;
|
|
50
|
+
/**
|
|
51
|
+
* Timestamp when the coupon was created
|
|
52
|
+
*/
|
|
53
|
+
created: string;
|
|
54
|
+
/**
|
|
55
|
+
* How long the discount applies: once (first payment only), repeating (for
|
|
56
|
+
* duration_in_months), or forever
|
|
57
|
+
*/
|
|
58
|
+
duration: 'once' | 'repeating' | 'forever';
|
|
59
|
+
/**
|
|
60
|
+
* Number of times this coupon has been successfully redeemed
|
|
61
|
+
*/
|
|
62
|
+
times_redeemed: number;
|
|
63
|
+
/**
|
|
64
|
+
* Fixed discount amount in the smallest currency unit (e.g., cents). Mutually
|
|
65
|
+
* exclusive with percent_off.
|
|
66
|
+
*/
|
|
67
|
+
amount_off?: number | null;
|
|
68
|
+
/**
|
|
69
|
+
* Three-letter ISO currency code for amount_off discounts
|
|
70
|
+
*/
|
|
71
|
+
currency?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* Number of months the discount applies when duration is 'repeating'
|
|
74
|
+
*/
|
|
75
|
+
duration_in_months?: number | null;
|
|
76
|
+
/**
|
|
77
|
+
* Maximum number of times this coupon can be redeemed across all customers
|
|
78
|
+
*/
|
|
79
|
+
max_redemptions?: number | null;
|
|
80
|
+
/**
|
|
81
|
+
* Display name for the coupon (shown to customers)
|
|
82
|
+
*/
|
|
83
|
+
name?: string | null;
|
|
84
|
+
/**
|
|
85
|
+
* Percentage discount (1-100). Mutually exclusive with amount_off.
|
|
86
|
+
*/
|
|
87
|
+
percent_off?: number | null;
|
|
88
|
+
/**
|
|
89
|
+
* Expiration date after which the coupon can no longer be redeemed
|
|
90
|
+
*/
|
|
91
|
+
redeem_by?: string | null;
|
|
92
|
+
}
|
|
93
|
+
export interface CouponCreateParams {
|
|
94
|
+
/**
|
|
95
|
+
* The promo code customers will enter to apply the discount
|
|
96
|
+
*/
|
|
97
|
+
code: string;
|
|
98
|
+
/**
|
|
99
|
+
* Optional custom ID for the coupon. If not provided, one will be generated.
|
|
100
|
+
*/
|
|
101
|
+
id?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Fixed discount in the smallest currency unit (e.g., cents). Mutually exclusive
|
|
104
|
+
* with percent_off.
|
|
105
|
+
*/
|
|
106
|
+
amount_off?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Three-letter ISO currency code for amount_off discounts
|
|
109
|
+
*/
|
|
110
|
+
currency?: string;
|
|
111
|
+
/**
|
|
112
|
+
* How long the discount applies: once (first payment only), repeating (for
|
|
113
|
+
* duration_in_months), or forever
|
|
114
|
+
*/
|
|
115
|
+
duration?: 'once' | 'repeating' | 'forever';
|
|
116
|
+
/**
|
|
117
|
+
* Number of months the discount applies when duration is 'repeating'
|
|
118
|
+
*/
|
|
119
|
+
duration_in_months?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Maximum number of times this coupon can be redeemed
|
|
122
|
+
*/
|
|
123
|
+
max_redemptions?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Display name for the coupon (shown to customers)
|
|
126
|
+
*/
|
|
127
|
+
name?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Percentage discount (1-100). Mutually exclusive with amount_off.
|
|
130
|
+
*/
|
|
131
|
+
percent_off?: number;
|
|
132
|
+
/**
|
|
133
|
+
* Expiration date after which the coupon can no longer be redeemed
|
|
134
|
+
*/
|
|
135
|
+
redeem_by?: string;
|
|
136
|
+
}
|
|
137
|
+
export interface CouponUpdateParams {
|
|
138
|
+
/**
|
|
139
|
+
* Whether the coupon is active and can be redeemed
|
|
140
|
+
*/
|
|
141
|
+
active?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Display name for the coupon
|
|
144
|
+
*/
|
|
145
|
+
name?: string;
|
|
146
|
+
}
|
|
147
|
+
export interface CouponListParams extends CursorIDPageParams {
|
|
148
|
+
/**
|
|
149
|
+
* Filter by active status
|
|
150
|
+
*/
|
|
151
|
+
active?: boolean;
|
|
152
|
+
}
|
|
153
|
+
export declare namespace Coupons {
|
|
154
|
+
export { type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=coupons.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupons.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/pay/coupons.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OAEtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;OAGG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;IAIrB;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,mBAAmB,EAAE,MAAM,CAAC;IAI3C;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOpE;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,M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IAEzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
+
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
5
|
+
export declare class Coupons extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a discount coupon with a promo code. Coupons can offer percentage or
|
|
8
|
+
* fixed-amount discounts and can be limited by redemption count or expiration
|
|
9
|
+
* date. Customers can apply coupons during checkout.
|
|
10
|
+
*/
|
|
11
|
+
create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon>;
|
|
12
|
+
/**
|
|
13
|
+
* Updates an existing coupon. Use this to modify the display name or deactivate
|
|
14
|
+
* the coupon. Discount amounts and codes cannot be changed after creation.
|
|
15
|
+
*/
|
|
16
|
+
update(couponID: string, body?: CouponUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Coupon>;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves a paginated list of all coupons. Coupons provide discounts that
|
|
19
|
+
* customers can apply during checkout using a promo code.
|
|
20
|
+
*/
|
|
21
|
+
list(query?: CouponListParams | null | undefined, options?: RequestOptions): PagePromise<CouponsCursorIDPage, Coupon>;
|
|
22
|
+
/**
|
|
23
|
+
* Permanently deletes a coupon. The promo code can no longer be used. Existing
|
|
24
|
+
* discounts applied to active subscriptions are not affected.
|
|
25
|
+
*/
|
|
26
|
+
delete(couponID: string, options?: RequestOptions): APIPromise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves a coupon by ID. Returns the coupon object including discount details
|
|
29
|
+
* and redemption statistics.
|
|
30
|
+
*/
|
|
31
|
+
get(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
|
|
32
|
+
}
|
|
33
|
+
export type CouponsCursorIDPage = CursorIDPage<Coupon>;
|
|
34
|
+
/**
|
|
35
|
+
* A discount coupon that customers can apply during checkout using a promo code
|
|
36
|
+
*/
|
|
37
|
+
export interface Coupon {
|
|
38
|
+
/**
|
|
39
|
+
* Unique identifier for the entitlement
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the coupon is currently active and can be redeemed
|
|
44
|
+
*/
|
|
45
|
+
active: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The promo code customers enter to apply the discount
|
|
48
|
+
*/
|
|
49
|
+
code: string;
|
|
50
|
+
/**
|
|
51
|
+
* Timestamp when the coupon was created
|
|
52
|
+
*/
|
|
53
|
+
created: string;
|
|
54
|
+
/**
|
|
55
|
+
* How long the discount applies: once (first payment only), repeating (for
|
|
56
|
+
* duration_in_months), or forever
|
|
57
|
+
*/
|
|
58
|
+
duration: 'once' | 'repeating' | 'forever';
|
|
59
|
+
/**
|
|
60
|
+
* Number of times this coupon has been successfully redeemed
|
|
61
|
+
*/
|
|
62
|
+
times_redeemed: number;
|
|
63
|
+
/**
|
|
64
|
+
* Fixed discount amount in the smallest currency unit (e.g., cents). Mutually
|
|
65
|
+
* exclusive with percent_off.
|
|
66
|
+
*/
|
|
67
|
+
amount_off?: number | null;
|
|
68
|
+
/**
|
|
69
|
+
* Three-letter ISO currency code for amount_off discounts
|
|
70
|
+
*/
|
|
71
|
+
currency?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* Number of months the discount applies when duration is 'repeating'
|
|
74
|
+
*/
|
|
75
|
+
duration_in_months?: number | null;
|
|
76
|
+
/**
|
|
77
|
+
* Maximum number of times this coupon can be redeemed across all customers
|
|
78
|
+
*/
|
|
79
|
+
max_redemptions?: number | null;
|
|
80
|
+
/**
|
|
81
|
+
* Display name for the coupon (shown to customers)
|
|
82
|
+
*/
|
|
83
|
+
name?: string | null;
|
|
84
|
+
/**
|
|
85
|
+
* Percentage discount (1-100). Mutually exclusive with amount_off.
|
|
86
|
+
*/
|
|
87
|
+
percent_off?: number | null;
|
|
88
|
+
/**
|
|
89
|
+
* Expiration date after which the coupon can no longer be redeemed
|
|
90
|
+
*/
|
|
91
|
+
redeem_by?: string | null;
|
|
92
|
+
}
|
|
93
|
+
export interface CouponCreateParams {
|
|
94
|
+
/**
|
|
95
|
+
* The promo code customers will enter to apply the discount
|
|
96
|
+
*/
|
|
97
|
+
code: string;
|
|
98
|
+
/**
|
|
99
|
+
* Optional custom ID for the coupon. If not provided, one will be generated.
|
|
100
|
+
*/
|
|
101
|
+
id?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Fixed discount in the smallest currency unit (e.g., cents). Mutually exclusive
|
|
104
|
+
* with percent_off.
|
|
105
|
+
*/
|
|
106
|
+
amount_off?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Three-letter ISO currency code for amount_off discounts
|
|
109
|
+
*/
|
|
110
|
+
currency?: string;
|
|
111
|
+
/**
|
|
112
|
+
* How long the discount applies: once (first payment only), repeating (for
|
|
113
|
+
* duration_in_months), or forever
|
|
114
|
+
*/
|
|
115
|
+
duration?: 'once' | 'repeating' | 'forever';
|
|
116
|
+
/**
|
|
117
|
+
* Number of months the discount applies when duration is 'repeating'
|
|
118
|
+
*/
|
|
119
|
+
duration_in_months?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Maximum number of times this coupon can be redeemed
|
|
122
|
+
*/
|
|
123
|
+
max_redemptions?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Display name for the coupon (shown to customers)
|
|
126
|
+
*/
|
|
127
|
+
name?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Percentage discount (1-100). Mutually exclusive with amount_off.
|
|
130
|
+
*/
|
|
131
|
+
percent_off?: number;
|
|
132
|
+
/**
|
|
133
|
+
* Expiration date after which the coupon can no longer be redeemed
|
|
134
|
+
*/
|
|
135
|
+
redeem_by?: string;
|
|
136
|
+
}
|
|
137
|
+
export interface CouponUpdateParams {
|
|
138
|
+
/**
|
|
139
|
+
* Whether the coupon is active and can be redeemed
|
|
140
|
+
*/
|
|
141
|
+
active?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Display name for the coupon
|
|
144
|
+
*/
|
|
145
|
+
name?: string;
|
|
146
|
+
}
|
|
147
|
+
export interface CouponListParams extends CursorIDPageParams {
|
|
148
|
+
/**
|
|
149
|
+
* Filter by active status
|
|
150
|
+
*/
|
|
151
|
+
active?: boolean;
|
|
152
|
+
}
|
|
153
|
+
export declare namespace Coupons {
|
|
154
|
+
export { type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=coupons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupons.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/pay/coupons.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,k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kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Coupons = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
8
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
9
|
+
class Coupons extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a discount coupon with a promo code. Coupons can offer percentage or
|
|
12
|
+
* fixed-amount discounts and can be limited by redemption count or expiration
|
|
13
|
+
* date. Customers can apply coupons during checkout.
|
|
14
|
+
*/
|
|
15
|
+
create(body, options) {
|
|
16
|
+
return this._client.post('/v1/pay/coupons', { body, ...options });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Updates an existing coupon. Use this to modify the display name or deactivate
|
|
20
|
+
* the coupon. Discount amounts and codes cannot be changed after creation.
|
|
21
|
+
*/
|
|
22
|
+
update(couponID, body = {}, options) {
|
|
23
|
+
return this._client.patch((0, path_1.path) `/v1/pay/coupons/${couponID}`, { body, ...options });
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves a paginated list of all coupons. Coupons provide discounts that
|
|
27
|
+
* customers can apply during checkout using a promo code.
|
|
28
|
+
*/
|
|
29
|
+
list(query = {}, options) {
|
|
30
|
+
return this._client.getAPIList('/v1/pay/coupons', (pagination_1.CursorIDPage), { query, ...options });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Permanently deletes a coupon. The promo code can no longer be used. Existing
|
|
34
|
+
* discounts applied to active subscriptions are not affected.
|
|
35
|
+
*/
|
|
36
|
+
delete(couponID, options) {
|
|
37
|
+
return this._client.delete((0, path_1.path) `/v1/pay/coupons/${couponID}`, {
|
|
38
|
+
...options,
|
|
39
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Retrieves a coupon by ID. Returns the coupon object including discount details
|
|
44
|
+
* and redemption statistics.
|
|
45
|
+
*/
|
|
46
|
+
get(couponID, options) {
|
|
47
|
+
return this._client.get((0, path_1.path) `/v1/pay/coupons/${couponID}`, options);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.Coupons = Coupons;
|
|
51
|
+
//# sourceMappingURL=coupons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupons.js","sourceRoot":"","sources":["../../../src/resources/beta/pay/coupons.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,4DAA8F;AAC9F,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;OAIG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;OAGG;IACH,MAAM,CACJ,QAAgB,EAChB,OAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,mBAAmB,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;OAGG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAA,yBAAoB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,mBAAmB,QAAQ,EAAE,EAAE;YAC5D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,QAAgB,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,mBAAmB,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;CACF;AAnDD,0BAmDC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { CursorIDPage } from "../../../core/pagination.mjs";
|
|
4
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
5
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
6
|
+
export class Coupons extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a discount coupon with a promo code. Coupons can offer percentage or
|
|
9
|
+
* fixed-amount discounts and can be limited by redemption count or expiration
|
|
10
|
+
* date. Customers can apply coupons during checkout.
|
|
11
|
+
*/
|
|
12
|
+
create(body, options) {
|
|
13
|
+
return this._client.post('/v1/pay/coupons', { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Updates an existing coupon. Use this to modify the display name or deactivate
|
|
17
|
+
* the coupon. Discount amounts and codes cannot be changed after creation.
|
|
18
|
+
*/
|
|
19
|
+
update(couponID, body = {}, options) {
|
|
20
|
+
return this._client.patch(path `/v1/pay/coupons/${couponID}`, { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves a paginated list of all coupons. Coupons provide discounts that
|
|
24
|
+
* customers can apply during checkout using a promo code.
|
|
25
|
+
*/
|
|
26
|
+
list(query = {}, options) {
|
|
27
|
+
return this._client.getAPIList('/v1/pay/coupons', (CursorIDPage), { query, ...options });
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Permanently deletes a coupon. The promo code can no longer be used. Existing
|
|
31
|
+
* discounts applied to active subscriptions are not affected.
|
|
32
|
+
*/
|
|
33
|
+
delete(couponID, options) {
|
|
34
|
+
return this._client.delete(path `/v1/pay/coupons/${couponID}`, {
|
|
35
|
+
...options,
|
|
36
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves a coupon by ID. Returns the coupon object including discount details
|
|
41
|
+
* and redemption statistics.
|
|
42
|
+
*/
|
|
43
|
+
get(couponID, options) {
|
|
44
|
+
return this._client.get(path `/v1/pay/coupons/${couponID}`, options);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=coupons.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupons.mjs","sourceRoot":"","sources":["../../../src/resources/beta/pay/coupons.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAwC;OACtD,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;OAIG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC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