@outseta/react 0.5.10 → 0.5.12
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outseta/react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
4
4
|
"description": "React hooks and components for the Outseta API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@outseta/api-client": "0.4.
|
|
21
|
+
"@outseta/api-client": "0.4.12"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^18.0.0 || ^19.0.0"
|
|
@@ -2268,6 +2268,11 @@ export const useSubscriptionSetSubscriptionUpgradeRequired = <TError = void,
|
|
|
2268
2268
|
were to register with this subscription. BillingRenewalTerm values: 1 = Monthly,
|
|
2269
2269
|
2 = Yearly, 3 = Quarterly, 4 = OneTime. Pass asOf=renewal to see the renewal invoice
|
|
2270
2270
|
instead of the initial invoice.
|
|
2271
|
+
|
|
2272
|
+
To redeem a coupon, send its code in DiscountCouponSubscriptions:
|
|
2273
|
+
"DiscountCouponSubscriptions": [{ "DiscountCoupon": { "UniqueIdentifier": "CODE" } }].
|
|
2274
|
+
DiscountCoupon.UniqueIdentifier is the coupon's code, not its Uid. The invoice then shows the
|
|
2275
|
+
discount. Subscription.DiscountCode is read-only and ignored here.
|
|
2271
2276
|
* @summary Preview the initial or renewal invoice for a hypothetical subscription.
|
|
2272
2277
|
*/
|
|
2273
2278
|
export const subscriptionFirstTimeSubscriptionPreview = (
|
|
@@ -2353,6 +2358,14 @@ Outseta sets the subscription's dates itself, except ExpirationDate:
|
|
|
2353
2358
|
|
|
2354
2359
|
To set or remove the end date of a subscription that already exists, use
|
|
2355
2360
|
PUT /api/v1/crm/accounts/{accountUid}/extend-renewal.
|
|
2361
|
+
|
|
2362
|
+
To redeem a coupon, send its code in DiscountCouponSubscriptions:
|
|
2363
|
+
"DiscountCouponSubscriptions": [{ "DiscountCoupon": { "UniqueIdentifier": "CODE" } }].
|
|
2364
|
+
DiscountCoupon.UniqueIdentifier is the coupon's code, not its Uid. An unknown code, or a
|
|
2365
|
+
DiscountCoupon sent with only a Uid, is rejected with "No discount coupon found for code [...]". The
|
|
2366
|
+
coupon must be active, within its redeem-by date and maximum redemptions, apply to the plan, and not
|
|
2367
|
+
have been redeemed by the account before. Subscription.DiscountCode is read-only: it is ignored on
|
|
2368
|
+
writes, so a coupon sent there is not applied.
|
|
2356
2369
|
* @summary Add a subscription to an account for the first time.
|
|
2357
2370
|
*/
|
|
2358
2371
|
export const subscriptionFirstTimeSubscription = (
|
|
@@ -2418,6 +2431,15 @@ export const useSubscriptionFirstTimeSubscription = <TError = void,
|
|
|
2418
2431
|
/**
|
|
2419
2432
|
* Returns an invoice object with information about the amount outstanding. This method
|
|
2420
2433
|
does not commit the subscription change.
|
|
2434
|
+
|
|
2435
|
+
Takes the same body as PUT /api/v1/billing/subscriptions/{subscriptionUid}/changesubscription. A coupon
|
|
2436
|
+
sent in DiscountCouponSubscriptions[].DiscountCoupon.UniqueIdentifier (the coupon's code, not its Uid)
|
|
2437
|
+
shows on the invoice as a discount, together with the credit for the unused part of the current plan,
|
|
2438
|
+
capped as described there. Subscription.DiscountCode is read-only and ignored here. Like
|
|
2439
|
+
changesubscription, the preview rejects a coupon that is inactive, past its redeem-by date or maximum
|
|
2440
|
+
redemptions, or doesn't apply to the new plan. It doesn't reject a coupon the account has redeemed
|
|
2441
|
+
before (a one-time coupon the account was already invoiced for is left off the invoice), while
|
|
2442
|
+
changesubscription rejects it when the plan changes.
|
|
2421
2443
|
* @summary Preview the invoice for a subscription change.
|
|
2422
2444
|
*/
|
|
2423
2445
|
export const subscriptionChangeSubscriptionPreview = (
|
|
@@ -2504,6 +2526,21 @@ ExpirationDate or ExpiresAfterMonths applies.
|
|
|
2504
2526
|
A request with the same plan, BillingRenewalTerm and quantity only changes add-ons; it does not change
|
|
2505
2527
|
the subscription's dates. To set or remove the end date of the current subscription, use
|
|
2506
2528
|
PUT /api/v1/crm/accounts/{accountUid}/extend-renewal.
|
|
2529
|
+
|
|
2530
|
+
To redeem a coupon, send its code in DiscountCouponSubscriptions:
|
|
2531
|
+
"DiscountCouponSubscriptions": [{ "DiscountCoupon": { "UniqueIdentifier": "CODE" } }].
|
|
2532
|
+
DiscountCoupon.UniqueIdentifier is the coupon's code, not its Uid. A DiscountCoupon sent with
|
|
2533
|
+
only a Uid is rejected with "Each DiscountCouponSubscription requires DiscountCoupon.UniqueIdentifier.",
|
|
2534
|
+
an unknown code with "No discount coupon found for code [CODE]". Subscription.DiscountCode is read-only:
|
|
2535
|
+
it is ignored on writes, so a coupon sent there is not applied and the new plan is billed in full.
|
|
2536
|
+
The coupon must be active, within its redeem-by date and maximum redemptions, and apply to the new
|
|
2537
|
+
plan; when the plan changes, the account must not have redeemed it before ("This discount code has
|
|
2538
|
+
already been redeemed.").
|
|
2539
|
+
|
|
2540
|
+
When the new plan is billed right away, the invoice credits the unused part of the current plan. That
|
|
2541
|
+
credit is capped at the amount due on the invoice after the discount; the rest is not carried over.
|
|
2542
|
+
Send the same body to PUT /api/v1/billing/subscriptions/{subscriptionUid}/changesubscriptionpreview to
|
|
2543
|
+
see the invoice first.
|
|
2507
2544
|
* @summary Change a subscription on an account.
|
|
2508
2545
|
*/
|
|
2509
2546
|
export const subscriptionChangeSubscription = (
|
|
@@ -1505,6 +1505,9 @@ export type StripeProductFamilyAllOf = {
|
|
|
1505
1505
|
/** @nullable */
|
|
1506
1506
|
BillingCycleAnchorMonth?: number | null;
|
|
1507
1507
|
/** @nullable */
|
|
1508
|
+
ExpirationDate?: string | null;
|
|
1509
|
+
ExpiresAfterMonths?: number;
|
|
1510
|
+
/** @nullable */
|
|
1508
1511
|
StripeProducts?: StripeProduct[] | null;
|
|
1509
1512
|
[key: string]: unknown | null;
|
|
1510
1513
|
};
|
|
@@ -1640,6 +1643,9 @@ export type StripeSubscriptionAllOf = {
|
|
|
1640
1643
|
/** @nullable */
|
|
1641
1644
|
Account?: StripeSubscriptionAllOfAccount;
|
|
1642
1645
|
/** @nullable */
|
|
1646
|
+
ExpirationDate?: string | null;
|
|
1647
|
+
IsCancelling?: boolean;
|
|
1648
|
+
/** @nullable */
|
|
1643
1649
|
AccountUid?: string | null;
|
|
1644
1650
|
/** @nullable */
|
|
1645
1651
|
CollectionMethod?: string | null;
|
|
@@ -2286,7 +2292,7 @@ export type SubscriptionAllOf = {
|
|
|
2286
2292
|
/** @nullable */
|
|
2287
2293
|
DiscountCouponSubscriptions?: DiscountCouponSubscription[] | null;
|
|
2288
2294
|
/** @nullable */
|
|
2289
|
-
DiscountCode?: string | null;
|
|
2295
|
+
readonly DiscountCode?: string | null;
|
|
2290
2296
|
/** @nullable */
|
|
2291
2297
|
DiscountCouponExpirationDate?: string | null;
|
|
2292
2298
|
/** @nullable */
|
|
@@ -5339,6 +5345,7 @@ export interface SetupIntent {
|
|
|
5339
5345
|
FirstName?: string | null;
|
|
5340
5346
|
/** @nullable */
|
|
5341
5347
|
InvoiceUid?: string | null;
|
|
5348
|
+
IsNewPaymentMethod?: boolean;
|
|
5342
5349
|
IsSetupIntent?: boolean;
|
|
5343
5350
|
IsPaymentAuthentication?: boolean;
|
|
5344
5351
|
/** @nullable */
|
|
@@ -5452,6 +5459,8 @@ export type ActivityAllOf = {
|
|
|
5452
5459
|
EntityType?: EntityType;
|
|
5453
5460
|
/** @nullable */
|
|
5454
5461
|
EntityUid?: string | null;
|
|
5462
|
+
/** @nullable */
|
|
5463
|
+
Message?: string | null;
|
|
5455
5464
|
};
|
|
5456
5465
|
|
|
5457
5466
|
export type Activity = AbstractQcountBean & ActivityAllOf;
|
|
@@ -6015,6 +6024,9 @@ export type AccountWebhookEntityStripeSubscriptionsItem = {
|
|
|
6015
6024
|
/** @nullable */
|
|
6016
6025
|
TrialEnd?: string | null;
|
|
6017
6026
|
/** @nullable */
|
|
6027
|
+
ExpirationDate?: string | null;
|
|
6028
|
+
IsCancelling?: boolean;
|
|
6029
|
+
/** @nullable */
|
|
6018
6030
|
AccountUid?: string | null;
|
|
6019
6031
|
/** @nullable */
|
|
6020
6032
|
CollectionMethod?: string | null;
|
|
@@ -7770,6 +7782,9 @@ export type AccountWebhookEntityPrimaryStripeSubscription = {
|
|
|
7770
7782
|
/** @nullable */
|
|
7771
7783
|
TrialEnd?: string | null;
|
|
7772
7784
|
/** @nullable */
|
|
7785
|
+
ExpirationDate?: string | null;
|
|
7786
|
+
IsCancelling?: boolean;
|
|
7787
|
+
/** @nullable */
|
|
7773
7788
|
AccountUid?: string | null;
|
|
7774
7789
|
/** @nullable */
|
|
7775
7790
|
CollectionMethod?: string | null;
|
|
@@ -8879,6 +8894,8 @@ export type PersonSupportTicketCreatedWebhookPayload = PersonWebhookEntity & Per
|
|
|
8879
8894
|
export interface PersonSupportTicketUpdatedActivityData {
|
|
8880
8895
|
/** @nullable */
|
|
8881
8896
|
CaseUid?: string | null;
|
|
8897
|
+
/** @nullable */
|
|
8898
|
+
CaseHistoryUid?: string | null;
|
|
8882
8899
|
}
|
|
8883
8900
|
|
|
8884
8901
|
export type PersonSupportTicketUpdatedWebhookPayloadAllOf = {
|