@linqapp/sdk 0.50.1 → 0.51.1
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 +14 -0
- package/client.d.mts +40 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +40 -0
- package/client.d.ts.map +1 -1
- package/client.js +40 -0
- package/client.js.map +1 -1
- package/client.mjs +40 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/chats/messages.d.mts +1 -0
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +1 -0
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js +1 -0
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs +1 -0
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/chats/polls.d.mts +1 -0
- package/resources/chats/polls.d.mts.map +1 -1
- package/resources/chats/polls.d.ts +1 -0
- package/resources/chats/polls.d.ts.map +1 -1
- package/resources/chats/polls.js +1 -0
- package/resources/chats/polls.js.map +1 -1
- package/resources/chats/polls.mjs +1 -0
- package/resources/chats/polls.mjs.map +1 -1
- package/resources/messages/messages.d.mts +1 -0
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +1 -0
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +1 -0
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +1 -0
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/messages/poll.d.mts +1 -0
- package/resources/messages/poll.d.mts.map +1 -1
- package/resources/messages/poll.d.ts +1 -0
- package/resources/messages/poll.d.ts.map +1 -1
- package/resources/messages/poll.js +1 -0
- package/resources/messages/poll.js.map +1 -1
- package/resources/messages/poll.mjs +1 -0
- package/resources/messages/poll.mjs.map +1 -1
- package/resources/payment-requests.d.mts +89 -3
- package/resources/payment-requests.d.mts.map +1 -1
- package/resources/payment-requests.d.ts +89 -3
- package/resources/payment-requests.d.ts.map +1 -1
- package/resources/payment-requests.js +39 -0
- package/resources/payment-requests.js.map +1 -1
- package/resources/payment-requests.mjs +39 -0
- package/resources/payment-requests.mjs.map +1 -1
- package/src/client.ts +40 -0
- package/src/resources/chats/messages.ts +1 -0
- package/src/resources/chats/polls.ts +1 -0
- package/src/resources/messages/messages.ts +1 -0
- package/src/resources/messages/poll.ts +1 -0
- package/src/resources/payment-requests.ts +97 -3
- 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
|
@@ -63,6 +63,45 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
63
63
|
* the Customer and Subscription, so correlating in either direction is
|
|
64
64
|
* trivial. There are no renewal webhooks from Linq by design.
|
|
65
65
|
*
|
|
66
|
+
* ### Discounts
|
|
67
|
+
*
|
|
68
|
+
* Pass a `discount` with a **coupon** or **promotion code** from your
|
|
69
|
+
* connected Stripe account to apply it to the subscription. Create either in
|
|
70
|
+
* your Stripe Dashboard under Product catalog → Coupons; Linq only forwards
|
|
71
|
+
* the id.
|
|
72
|
+
*
|
|
73
|
+
* ```json
|
|
74
|
+
* {
|
|
75
|
+
* "mode": "subscription",
|
|
76
|
+
* "price_id": "price_1QAbCdEfGhIjKlMn",
|
|
77
|
+
* "discount": {
|
|
78
|
+
* "coupon": "7fKCMvBh",
|
|
79
|
+
* "label": "50% OFF FIRST MONTH"
|
|
80
|
+
* }
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* Stripe applies the coupon and prices the first invoice; the `amount` we
|
|
85
|
+
* return is that invoice's amount due, so a `$50.00/month` price with a
|
|
86
|
+
* 50%-off-first-month coupon comes back as `2500` and the recipient is
|
|
87
|
+
* charged **$25.00** at checkout. A coupon that covers the whole first
|
|
88
|
+
* invoice returns `amount: 0`; checkout shows $0.00 and collects the card for
|
|
89
|
+
* the renewal rather than charging now. Renewals bill at the full price
|
|
90
|
+
* automatically — how long a discount lasts is the coupon's `duration`,
|
|
91
|
+
* enforced by Stripe on your account, and Linq never re-prices anything.
|
|
92
|
+
*
|
|
93
|
+
* Use `promotion_code` instead of `coupon` to apply a promotion code by id
|
|
94
|
+
* (`promo_...`, not the customer-facing code string); pass one or the other,
|
|
95
|
+
* never both.
|
|
96
|
+
*
|
|
97
|
+
* `label` is the customer-facing promotion name displayed at checkout instead
|
|
98
|
+
* of the coupon or promotion code ID. The label is displayed exactly as
|
|
99
|
+
* provided, so include important terms such as "FIRST MONTH" or
|
|
100
|
+
* "FIRST 3 MONTHS" when applicable. These terms are not displayed elsewhere
|
|
101
|
+
* on the checkout screen.
|
|
102
|
+
*
|
|
103
|
+
* If omitted, Stripe uses the coupon's name as the promotion label.
|
|
104
|
+
*
|
|
66
105
|
* ### Free trials
|
|
67
106
|
*
|
|
68
107
|
* Add `trial_period_days` (or a fixed `trial_end` timestamp) to start the
|
|
@@ -220,9 +259,10 @@ export interface PaymentRequest {
|
|
|
220
259
|
*/
|
|
221
260
|
id: string;
|
|
222
261
|
/**
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
262
|
+
* What the recipient is charged at checkout, in the currency's minor units. In
|
|
263
|
+
* `subscription` mode this is the first invoice's amount due — all items after any
|
|
264
|
+
* discounts are applied — so a discount that covers the whole invoice returns `0`
|
|
265
|
+
* and checkout shows $0.00.
|
|
226
266
|
*/
|
|
227
267
|
amount: number;
|
|
228
268
|
/**
|
|
@@ -243,6 +283,10 @@ export interface PaymentRequest {
|
|
|
243
283
|
*/
|
|
244
284
|
status: 'requested' | 'succeeded' | 'canceled' | 'expired';
|
|
245
285
|
description?: string;
|
|
286
|
+
/**
|
|
287
|
+
* Subscription mode — the discount applied, as Stripe applied it.
|
|
288
|
+
*/
|
|
289
|
+
discount?: PaymentRequest.Discount;
|
|
246
290
|
/**
|
|
247
291
|
* When an unpaid request auto-expires.
|
|
248
292
|
*/
|
|
@@ -294,6 +338,23 @@ export interface PaymentRequest {
|
|
|
294
338
|
updated_at?: string;
|
|
295
339
|
}
|
|
296
340
|
export declare namespace PaymentRequest {
|
|
341
|
+
/**
|
|
342
|
+
* Subscription mode — the discount applied, as Stripe applied it.
|
|
343
|
+
*/
|
|
344
|
+
interface Discount {
|
|
345
|
+
/**
|
|
346
|
+
* The ID of the coupon applied.
|
|
347
|
+
*/
|
|
348
|
+
coupon?: string;
|
|
349
|
+
/**
|
|
350
|
+
* The customer-facing discount description shown at checkout.
|
|
351
|
+
*/
|
|
352
|
+
label?: string;
|
|
353
|
+
/**
|
|
354
|
+
* The ID of the promotion code applied, if you passed one.
|
|
355
|
+
*/
|
|
356
|
+
promotion_code?: string;
|
|
357
|
+
}
|
|
297
358
|
/**
|
|
298
359
|
* Natural-rail join keys, present when `rail: natural`.
|
|
299
360
|
*/
|
|
@@ -363,6 +424,11 @@ export interface PaymentRequestCreateParams {
|
|
|
363
424
|
* Body param: Optional description shown to the recipient at checkout.
|
|
364
425
|
*/
|
|
365
426
|
description?: string;
|
|
427
|
+
/**
|
|
428
|
+
* Body param: Subscription mode only. The coupon or promotion code to apply to
|
|
429
|
+
* this subscription payment. Currently, only accept one coupon or one promo code.
|
|
430
|
+
*/
|
|
431
|
+
discount?: PaymentRequestCreateParams.Discount;
|
|
366
432
|
/**
|
|
367
433
|
* Body param: Required for `rail: natural`. The line the request is sent from, in
|
|
368
434
|
* E.164 format. Must be a phone number your organization owns.
|
|
@@ -428,6 +494,26 @@ export interface PaymentRequestCreateParams {
|
|
|
428
494
|
*/
|
|
429
495
|
'Idempotency-Key'?: string;
|
|
430
496
|
}
|
|
497
|
+
export declare namespace PaymentRequestCreateParams {
|
|
498
|
+
/**
|
|
499
|
+
* Subscription mode only. The coupon or promotion code to apply to this
|
|
500
|
+
* subscription payment. Currently, only accept one coupon or one promo code.
|
|
501
|
+
*/
|
|
502
|
+
interface Discount {
|
|
503
|
+
/**
|
|
504
|
+
* The ID of the coupon to apply to this subscription.
|
|
505
|
+
*/
|
|
506
|
+
coupon?: string;
|
|
507
|
+
/**
|
|
508
|
+
* Name of the coupon/promo code displayed to customers.
|
|
509
|
+
*/
|
|
510
|
+
label?: string;
|
|
511
|
+
/**
|
|
512
|
+
* The ID of a promotion code to apply to this subscription.
|
|
513
|
+
*/
|
|
514
|
+
promotion_code?: string;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
431
517
|
export interface PaymentRequestListParams {
|
|
432
518
|
/**
|
|
433
519
|
* Max results to return (default 20, max 100).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-requests.d.ts","sourceRoot":"","sources":["../src/resources/payment-requests.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D
|
|
1
|
+
{"version":3,"file":"payment-requests.d.ts","sourceRoot":"","sources":["../src/resources/payment-requests.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0LG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAC9C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CAAC,MAAM,EAAE,0BAA0B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAYhG;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,EA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BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -67,6 +67,45 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
67
67
|
* the Customer and Subscription, so correlating in either direction is
|
|
68
68
|
* trivial. There are no renewal webhooks from Linq by design.
|
|
69
69
|
*
|
|
70
|
+
* ### Discounts
|
|
71
|
+
*
|
|
72
|
+
* Pass a `discount` with a **coupon** or **promotion code** from your
|
|
73
|
+
* connected Stripe account to apply it to the subscription. Create either in
|
|
74
|
+
* your Stripe Dashboard under Product catalog → Coupons; Linq only forwards
|
|
75
|
+
* the id.
|
|
76
|
+
*
|
|
77
|
+
* ```json
|
|
78
|
+
* {
|
|
79
|
+
* "mode": "subscription",
|
|
80
|
+
* "price_id": "price_1QAbCdEfGhIjKlMn",
|
|
81
|
+
* "discount": {
|
|
82
|
+
* "coupon": "7fKCMvBh",
|
|
83
|
+
* "label": "50% OFF FIRST MONTH"
|
|
84
|
+
* }
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* Stripe applies the coupon and prices the first invoice; the `amount` we
|
|
89
|
+
* return is that invoice's amount due, so a `$50.00/month` price with a
|
|
90
|
+
* 50%-off-first-month coupon comes back as `2500` and the recipient is
|
|
91
|
+
* charged **$25.00** at checkout. A coupon that covers the whole first
|
|
92
|
+
* invoice returns `amount: 0`; checkout shows $0.00 and collects the card for
|
|
93
|
+
* the renewal rather than charging now. Renewals bill at the full price
|
|
94
|
+
* automatically — how long a discount lasts is the coupon's `duration`,
|
|
95
|
+
* enforced by Stripe on your account, and Linq never re-prices anything.
|
|
96
|
+
*
|
|
97
|
+
* Use `promotion_code` instead of `coupon` to apply a promotion code by id
|
|
98
|
+
* (`promo_...`, not the customer-facing code string); pass one or the other,
|
|
99
|
+
* never both.
|
|
100
|
+
*
|
|
101
|
+
* `label` is the customer-facing promotion name displayed at checkout instead
|
|
102
|
+
* of the coupon or promotion code ID. The label is displayed exactly as
|
|
103
|
+
* provided, so include important terms such as "FIRST MONTH" or
|
|
104
|
+
* "FIRST 3 MONTHS" when applicable. These terms are not displayed elsewhere
|
|
105
|
+
* on the checkout screen.
|
|
106
|
+
*
|
|
107
|
+
* If omitted, Stripe uses the coupon's name as the promotion label.
|
|
108
|
+
*
|
|
70
109
|
* ### Free trials
|
|
71
110
|
*
|
|
72
111
|
* Add `trial_period_days` (or a fixed `trial_end` timestamp) to start the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-requests.js","sourceRoot":"","sources":["../src/resources/payment-requests.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C
|
|
1
|
+
{"version":3,"file":"payment-requests.js","sourceRoot":"","sources":["../src/resources/payment-requests.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0LG;AACH,MAAa,eAAgB,SAAQ,sBAAW;IAC9C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CAAC,MAAkC,EAAE,OAAwB;QACjE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE;YAC/C,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACnF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,gBAAwB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,wBAAwB,gBAAgB,EAAE,EAAE,OAAO,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAAqD,EAAE,EACvD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,gBAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,wBAAwB,gBAAgB,SAAS,EAAE,OAAO,CAAC,CAAC;IAC3F,CAAC;CACF;AAtFD,0CAsFC"}
|
|
@@ -64,6 +64,45 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
64
64
|
* the Customer and Subscription, so correlating in either direction is
|
|
65
65
|
* trivial. There are no renewal webhooks from Linq by design.
|
|
66
66
|
*
|
|
67
|
+
* ### Discounts
|
|
68
|
+
*
|
|
69
|
+
* Pass a `discount` with a **coupon** or **promotion code** from your
|
|
70
|
+
* connected Stripe account to apply it to the subscription. Create either in
|
|
71
|
+
* your Stripe Dashboard under Product catalog → Coupons; Linq only forwards
|
|
72
|
+
* the id.
|
|
73
|
+
*
|
|
74
|
+
* ```json
|
|
75
|
+
* {
|
|
76
|
+
* "mode": "subscription",
|
|
77
|
+
* "price_id": "price_1QAbCdEfGhIjKlMn",
|
|
78
|
+
* "discount": {
|
|
79
|
+
* "coupon": "7fKCMvBh",
|
|
80
|
+
* "label": "50% OFF FIRST MONTH"
|
|
81
|
+
* }
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* Stripe applies the coupon and prices the first invoice; the `amount` we
|
|
86
|
+
* return is that invoice's amount due, so a `$50.00/month` price with a
|
|
87
|
+
* 50%-off-first-month coupon comes back as `2500` and the recipient is
|
|
88
|
+
* charged **$25.00** at checkout. A coupon that covers the whole first
|
|
89
|
+
* invoice returns `amount: 0`; checkout shows $0.00 and collects the card for
|
|
90
|
+
* the renewal rather than charging now. Renewals bill at the full price
|
|
91
|
+
* automatically — how long a discount lasts is the coupon's `duration`,
|
|
92
|
+
* enforced by Stripe on your account, and Linq never re-prices anything.
|
|
93
|
+
*
|
|
94
|
+
* Use `promotion_code` instead of `coupon` to apply a promotion code by id
|
|
95
|
+
* (`promo_...`, not the customer-facing code string); pass one or the other,
|
|
96
|
+
* never both.
|
|
97
|
+
*
|
|
98
|
+
* `label` is the customer-facing promotion name displayed at checkout instead
|
|
99
|
+
* of the coupon or promotion code ID. The label is displayed exactly as
|
|
100
|
+
* provided, so include important terms such as "FIRST MONTH" or
|
|
101
|
+
* "FIRST 3 MONTHS" when applicable. These terms are not displayed elsewhere
|
|
102
|
+
* on the checkout screen.
|
|
103
|
+
*
|
|
104
|
+
* If omitted, Stripe uses the coupon's name as the promotion label.
|
|
105
|
+
*
|
|
67
106
|
* ### Free trials
|
|
68
107
|
*
|
|
69
108
|
* Add `trial_period_days` (or a fixed `trial_end` timestamp) to start the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-requests.mjs","sourceRoot":"","sources":["../src/resources/payment-requests.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C
|
|
1
|
+
{"version":3,"file":"payment-requests.mjs","sourceRoot":"","sources":["../src/resources/payment-requ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GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,gBAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,wBAAwB,gBAAgB,SAAS,EAAE,OAAO,CAAC,CAAC;IAC3F,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -990,6 +990,7 @@ export class LinqAPIV3 {
|
|
|
990
990
|
*
|
|
991
991
|
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time. If you need it, compute `created_at + 24h` yourself.
|
|
992
992
|
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
993
|
+
* - **The backstop governs Linq storage.** API retrievability (the `404` behavior above) and CDN media expire at the 24-hour mark. Removal of the corresponding entries from the sending device happens asynchronously and can complete after the backstop.
|
|
993
994
|
* - **Delivery is unaffected.** Ephemeral messages send, deliver, and fire the usual `message.sent` / `message.received` and status webhooks exactly like standard messages. Only retention changes.
|
|
994
995
|
*
|
|
995
996
|
* **When to choose ephemeral:**
|
|
@@ -1306,6 +1307,45 @@ export class LinqAPIV3 {
|
|
|
1306
1307
|
* the Customer and Subscription, so correlating in either direction is
|
|
1307
1308
|
* trivial. There are no renewal webhooks from Linq by design.
|
|
1308
1309
|
*
|
|
1310
|
+
* ### Discounts
|
|
1311
|
+
*
|
|
1312
|
+
* Pass a `discount` with a **coupon** or **promotion code** from your
|
|
1313
|
+
* connected Stripe account to apply it to the subscription. Create either in
|
|
1314
|
+
* your Stripe Dashboard under Product catalog → Coupons; Linq only forwards
|
|
1315
|
+
* the id.
|
|
1316
|
+
*
|
|
1317
|
+
* ```json
|
|
1318
|
+
* {
|
|
1319
|
+
* "mode": "subscription",
|
|
1320
|
+
* "price_id": "price_1QAbCdEfGhIjKlMn",
|
|
1321
|
+
* "discount": {
|
|
1322
|
+
* "coupon": "7fKCMvBh",
|
|
1323
|
+
* "label": "50% OFF FIRST MONTH"
|
|
1324
|
+
* }
|
|
1325
|
+
* }
|
|
1326
|
+
* ```
|
|
1327
|
+
*
|
|
1328
|
+
* Stripe applies the coupon and prices the first invoice; the `amount` we
|
|
1329
|
+
* return is that invoice's amount due, so a `$50.00/month` price with a
|
|
1330
|
+
* 50%-off-first-month coupon comes back as `2500` and the recipient is
|
|
1331
|
+
* charged **$25.00** at checkout. A coupon that covers the whole first
|
|
1332
|
+
* invoice returns `amount: 0`; checkout shows $0.00 and collects the card for
|
|
1333
|
+
* the renewal rather than charging now. Renewals bill at the full price
|
|
1334
|
+
* automatically — how long a discount lasts is the coupon's `duration`,
|
|
1335
|
+
* enforced by Stripe on your account, and Linq never re-prices anything.
|
|
1336
|
+
*
|
|
1337
|
+
* Use `promotion_code` instead of `coupon` to apply a promotion code by id
|
|
1338
|
+
* (`promo_...`, not the customer-facing code string); pass one or the other,
|
|
1339
|
+
* never both.
|
|
1340
|
+
*
|
|
1341
|
+
* `label` is the customer-facing promotion name displayed at checkout instead
|
|
1342
|
+
* of the coupon or promotion code ID. The label is displayed exactly as
|
|
1343
|
+
* provided, so include important terms such as "FIRST MONTH" or
|
|
1344
|
+
* "FIRST 3 MONTHS" when applicable. These terms are not displayed elsewhere
|
|
1345
|
+
* on the checkout screen.
|
|
1346
|
+
*
|
|
1347
|
+
* If omitted, Stripe uses the coupon's name as the promotion label.
|
|
1348
|
+
*
|
|
1309
1349
|
* ### Free trials
|
|
1310
1350
|
*
|
|
1311
1351
|
* Add `trial_period_days` (or a fixed `trial_end` timestamp) to start the
|
|
@@ -64,6 +64,7 @@ import { path } from '../../internal/utils/path';
|
|
|
64
64
|
*
|
|
65
65
|
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time. If you need it, compute `created_at + 24h` yourself.
|
|
66
66
|
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
67
|
+
* - **The backstop governs Linq storage.** API retrievability (the `404` behavior above) and CDN media expire at the 24-hour mark. Removal of the corresponding entries from the sending device happens asynchronously and can complete after the backstop.
|
|
67
68
|
* - **Delivery is unaffected.** Ephemeral messages send, deliver, and fire the usual `message.sent` / `message.received` and status webhooks exactly like standard messages. Only retention changes.
|
|
68
69
|
*
|
|
69
70
|
* **When to choose ephemeral:**
|
|
@@ -56,6 +56,7 @@ import { path } from '../../internal/utils/path';
|
|
|
56
56
|
*
|
|
57
57
|
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time. If you need it, compute `created_at + 24h` yourself.
|
|
58
58
|
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
59
|
+
* - **The backstop governs Linq storage.** API retrievability (the `404` behavior above) and CDN media expire at the 24-hour mark. Removal of the corresponding entries from the sending device happens asynchronously and can complete after the backstop.
|
|
59
60
|
* - **Delivery is unaffected.** Ephemeral messages send, deliver, and fire the usual `message.sent` / `message.received` and status webhooks exactly like standard messages. Only retention changes.
|
|
60
61
|
*
|
|
61
62
|
* **When to choose ephemeral:**
|
|
@@ -66,6 +66,7 @@ import { path } from '../../internal/utils/path';
|
|
|
66
66
|
*
|
|
67
67
|
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time. If you need it, compute `created_at + 24h` yourself.
|
|
68
68
|
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
69
|
+
* - **The backstop governs Linq storage.** API retrievability (the `404` behavior above) and CDN media expire at the 24-hour mark. Removal of the corresponding entries from the sending device happens asynchronously and can complete after the backstop.
|
|
69
70
|
* - **Delivery is unaffected.** Ephemeral messages send, deliver, and fire the usual `message.sent` / `message.received` and status webhooks exactly like standard messages. Only retention changes.
|
|
70
71
|
*
|
|
71
72
|
* **When to choose ephemeral:**
|
|
@@ -56,6 +56,7 @@ import { path } from '../../internal/utils/path';
|
|
|
56
56
|
*
|
|
57
57
|
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time. If you need it, compute `created_at + 24h` yourself.
|
|
58
58
|
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
59
|
+
* - **The backstop governs Linq storage.** API retrievability (the `404` behavior above) and CDN media expire at the 24-hour mark. Removal of the corresponding entries from the sending device happens asynchronously and can complete after the backstop.
|
|
59
60
|
* - **Delivery is unaffected.** Ephemeral messages send, deliver, and fire the usual `message.sent` / `message.received` and status webhooks exactly like standard messages. Only retention changes.
|
|
60
61
|
*
|
|
61
62
|
* **When to choose ephemeral:**
|
|
@@ -68,6 +68,45 @@ import { path } from '../internal/utils/path';
|
|
|
68
68
|
* the Customer and Subscription, so correlating in either direction is
|
|
69
69
|
* trivial. There are no renewal webhooks from Linq by design.
|
|
70
70
|
*
|
|
71
|
+
* ### Discounts
|
|
72
|
+
*
|
|
73
|
+
* Pass a `discount` with a **coupon** or **promotion code** from your
|
|
74
|
+
* connected Stripe account to apply it to the subscription. Create either in
|
|
75
|
+
* your Stripe Dashboard under Product catalog → Coupons; Linq only forwards
|
|
76
|
+
* the id.
|
|
77
|
+
*
|
|
78
|
+
* ```json
|
|
79
|
+
* {
|
|
80
|
+
* "mode": "subscription",
|
|
81
|
+
* "price_id": "price_1QAbCdEfGhIjKlMn",
|
|
82
|
+
* "discount": {
|
|
83
|
+
* "coupon": "7fKCMvBh",
|
|
84
|
+
* "label": "50% OFF FIRST MONTH"
|
|
85
|
+
* }
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* Stripe applies the coupon and prices the first invoice; the `amount` we
|
|
90
|
+
* return is that invoice's amount due, so a `$50.00/month` price with a
|
|
91
|
+
* 50%-off-first-month coupon comes back as `2500` and the recipient is
|
|
92
|
+
* charged **$25.00** at checkout. A coupon that covers the whole first
|
|
93
|
+
* invoice returns `amount: 0`; checkout shows $0.00 and collects the card for
|
|
94
|
+
* the renewal rather than charging now. Renewals bill at the full price
|
|
95
|
+
* automatically — how long a discount lasts is the coupon's `duration`,
|
|
96
|
+
* enforced by Stripe on your account, and Linq never re-prices anything.
|
|
97
|
+
*
|
|
98
|
+
* Use `promotion_code` instead of `coupon` to apply a promotion code by id
|
|
99
|
+
* (`promo_...`, not the customer-facing code string); pass one or the other,
|
|
100
|
+
* never both.
|
|
101
|
+
*
|
|
102
|
+
* `label` is the customer-facing promotion name displayed at checkout instead
|
|
103
|
+
* of the coupon or promotion code ID. The label is displayed exactly as
|
|
104
|
+
* provided, so include important terms such as "FIRST MONTH" or
|
|
105
|
+
* "FIRST 3 MONTHS" when applicable. These terms are not displayed elsewhere
|
|
106
|
+
* on the checkout screen.
|
|
107
|
+
*
|
|
108
|
+
* If omitted, Stripe uses the coupon's name as the promotion label.
|
|
109
|
+
*
|
|
71
110
|
* ### Free trials
|
|
72
111
|
*
|
|
73
112
|
* Add `trial_period_days` (or a fixed `trial_end` timestamp) to start the
|
|
@@ -249,9 +288,10 @@ export interface PaymentRequest {
|
|
|
249
288
|
id: string;
|
|
250
289
|
|
|
251
290
|
/**
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
291
|
+
* What the recipient is charged at checkout, in the currency's minor units. In
|
|
292
|
+
* `subscription` mode this is the first invoice's amount due — all items after any
|
|
293
|
+
* discounts are applied — so a discount that covers the whole invoice returns `0`
|
|
294
|
+
* and checkout shows $0.00.
|
|
255
295
|
*/
|
|
256
296
|
amount: number;
|
|
257
297
|
|
|
@@ -280,6 +320,11 @@ export interface PaymentRequest {
|
|
|
280
320
|
|
|
281
321
|
description?: string;
|
|
282
322
|
|
|
323
|
+
/**
|
|
324
|
+
* Subscription mode — the discount applied, as Stripe applied it.
|
|
325
|
+
*/
|
|
326
|
+
discount?: PaymentRequest.Discount;
|
|
327
|
+
|
|
283
328
|
/**
|
|
284
329
|
* When an unpaid request auto-expires.
|
|
285
330
|
*/
|
|
@@ -341,6 +386,26 @@ export interface PaymentRequest {
|
|
|
341
386
|
}
|
|
342
387
|
|
|
343
388
|
export namespace PaymentRequest {
|
|
389
|
+
/**
|
|
390
|
+
* Subscription mode — the discount applied, as Stripe applied it.
|
|
391
|
+
*/
|
|
392
|
+
export interface Discount {
|
|
393
|
+
/**
|
|
394
|
+
* The ID of the coupon applied.
|
|
395
|
+
*/
|
|
396
|
+
coupon?: string;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* The customer-facing discount description shown at checkout.
|
|
400
|
+
*/
|
|
401
|
+
label?: string;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* The ID of the promotion code applied, if you passed one.
|
|
405
|
+
*/
|
|
406
|
+
promotion_code?: string;
|
|
407
|
+
}
|
|
408
|
+
|
|
344
409
|
/**
|
|
345
410
|
* Natural-rail join keys, present when `rail: natural`.
|
|
346
411
|
*/
|
|
@@ -422,6 +487,12 @@ export interface PaymentRequestCreateParams {
|
|
|
422
487
|
*/
|
|
423
488
|
description?: string;
|
|
424
489
|
|
|
490
|
+
/**
|
|
491
|
+
* Body param: Subscription mode only. The coupon or promotion code to apply to
|
|
492
|
+
* this subscription payment. Currently, only accept one coupon or one promo code.
|
|
493
|
+
*/
|
|
494
|
+
discount?: PaymentRequestCreateParams.Discount;
|
|
495
|
+
|
|
425
496
|
/**
|
|
426
497
|
* Body param: Required for `rail: natural`. The line the request is sent from, in
|
|
427
498
|
* E.164 format. Must be a phone number your organization owns.
|
|
@@ -495,6 +566,29 @@ export interface PaymentRequestCreateParams {
|
|
|
495
566
|
'Idempotency-Key'?: string;
|
|
496
567
|
}
|
|
497
568
|
|
|
569
|
+
export namespace PaymentRequestCreateParams {
|
|
570
|
+
/**
|
|
571
|
+
* Subscription mode only. The coupon or promotion code to apply to this
|
|
572
|
+
* subscription payment. Currently, only accept one coupon or one promo code.
|
|
573
|
+
*/
|
|
574
|
+
export interface Discount {
|
|
575
|
+
/**
|
|
576
|
+
* The ID of the coupon to apply to this subscription.
|
|
577
|
+
*/
|
|
578
|
+
coupon?: string;
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Name of the coupon/promo code displayed to customers.
|
|
582
|
+
*/
|
|
583
|
+
label?: string;
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* The ID of a promotion code to apply to this subscription.
|
|
587
|
+
*/
|
|
588
|
+
promotion_code?: string;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
498
592
|
export interface PaymentRequestListParams {
|
|
499
593
|
/**
|
|
500
594
|
* Max results to return (default 20, max 100).
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.51.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.51.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.51.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.51.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|