@outseta/api-client 0.4.11 → 0.4.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/api-client",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "description": "Generated API client for the Outseta REST API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1764,6 +1764,11 @@ export const subscriptionSetSubscriptionUpgradeRequired = async (subscriptionUid
1764
1764
  were to register with this subscription. BillingRenewalTerm values: 1 = Monthly,
1765
1765
  2 = Yearly, 3 = Quarterly, 4 = OneTime. Pass asOf=renewal to see the renewal invoice
1766
1766
  instead of the initial invoice.
1767
+
1768
+ To redeem a coupon, send its code in DiscountCouponSubscriptions:
1769
+ "DiscountCouponSubscriptions": [{ "DiscountCoupon": { "UniqueIdentifier": "CODE" } }].
1770
+ DiscountCoupon.UniqueIdentifier is the coupon's code, not its Uid. The invoice then shows the
1771
+ discount. Subscription.DiscountCode is read-only and ignored here.
1767
1772
  * @summary Preview the initial or renewal invoice for a hypothetical subscription.
1768
1773
  */
1769
1774
  export type subscriptionFirstTimeSubscriptionPreviewResponse200 = {
@@ -1827,6 +1832,14 @@ Outseta sets the subscription's dates itself, except ExpirationDate:
1827
1832
 
1828
1833
  To set or remove the end date of a subscription that already exists, use
1829
1834
  PUT /api/v1/crm/accounts/{accountUid}/extend-renewal.
1835
+
1836
+ To redeem a coupon, send its code in DiscountCouponSubscriptions:
1837
+ "DiscountCouponSubscriptions": [{ "DiscountCoupon": { "UniqueIdentifier": "CODE" } }].
1838
+ DiscountCoupon.UniqueIdentifier is the coupon's code, not its Uid. An unknown code, or a
1839
+ DiscountCoupon sent with only a Uid, is rejected with "No discount coupon found for code [...]". The
1840
+ coupon must be active, within its redeem-by date and maximum redemptions, apply to the plan, and not
1841
+ have been redeemed by the account before. Subscription.DiscountCode is read-only: it is ignored on
1842
+ writes, so a coupon sent there is not applied.
1830
1843
  * @summary Add a subscription to an account for the first time.
1831
1844
  */
1832
1845
  export type subscriptionFirstTimeSubscriptionResponse200 = {
@@ -1872,6 +1885,15 @@ export const subscriptionFirstTimeSubscription = async (subscriptionFirstTimeSub
1872
1885
  /**
1873
1886
  * Returns an invoice object with information about the amount outstanding. This method
1874
1887
  does not commit the subscription change.
1888
+
1889
+ Takes the same body as PUT /api/v1/billing/subscriptions/{subscriptionUid}/changesubscription. A coupon
1890
+ sent in DiscountCouponSubscriptions[].DiscountCoupon.UniqueIdentifier (the coupon's code, not its Uid)
1891
+ shows on the invoice as a discount, together with the credit for the unused part of the current plan,
1892
+ capped as described there. Subscription.DiscountCode is read-only and ignored here. Like
1893
+ changesubscription, the preview rejects a coupon that is inactive, past its redeem-by date or maximum
1894
+ redemptions, or doesn't apply to the new plan. It doesn't reject a coupon the account has redeemed
1895
+ before (a one-time coupon the account was already invoiced for is left off the invoice), while
1896
+ changesubscription rejects it when the plan changes.
1875
1897
  * @summary Preview the invoice for a subscription change.
1876
1898
  */
1877
1899
  export type subscriptionChangeSubscriptionPreviewResponse200 = {
@@ -1955,6 +1977,21 @@ ExpirationDate or ExpiresAfterMonths applies.
1955
1977
  A request with the same plan, BillingRenewalTerm and quantity only changes add-ons; it does not change
1956
1978
  the subscription's dates. To set or remove the end date of the current subscription, use
1957
1979
  PUT /api/v1/crm/accounts/{accountUid}/extend-renewal.
1980
+
1981
+ To redeem a coupon, send its code in DiscountCouponSubscriptions:
1982
+ "DiscountCouponSubscriptions": [{ "DiscountCoupon": { "UniqueIdentifier": "CODE" } }].
1983
+ DiscountCoupon.UniqueIdentifier is the coupon's code, not its Uid. A DiscountCoupon sent with
1984
+ only a Uid is rejected with "Each DiscountCouponSubscription requires DiscountCoupon.UniqueIdentifier.",
1985
+ an unknown code with "No discount coupon found for code [CODE]". Subscription.DiscountCode is read-only:
1986
+ it is ignored on writes, so a coupon sent there is not applied and the new plan is billed in full.
1987
+ The coupon must be active, within its redeem-by date and maximum redemptions, and apply to the new
1988
+ plan; when the plan changes, the account must not have redeemed it before ("This discount code has
1989
+ already been redeemed.").
1990
+
1991
+ When the new plan is billed right away, the invoice credits the unused part of the current plan. That
1992
+ credit is capped at the amount due on the invoice after the discount; the rest is not carried over.
1993
+ Send the same body to PUT /api/v1/billing/subscriptions/{subscriptionUid}/changesubscriptionpreview to
1994
+ see the invoice first.
1958
1995
  * @summary Change a subscription on an account.
1959
1996
  */
1960
1997
  export type subscriptionChangeSubscriptionResponse200 = {
@@ -19,6 +19,7 @@ export interface SetupIntent {
19
19
  FirstName?: string | null;
20
20
  /** @nullable */
21
21
  InvoiceUid?: string | null;
22
+ IsNewPaymentMethod?: boolean;
22
23
  IsSetupIntent?: boolean;
23
24
  IsPaymentAuthentication?: boolean;
24
25
  /** @nullable */
@@ -35,7 +35,7 @@ export type SubscriptionAllOf = {
35
35
  /** @nullable */
36
36
  DiscountCouponSubscriptions?: DiscountCouponSubscription[] | null;
37
37
  /** @nullable */
38
- DiscountCode?: string | null;
38
+ readonly DiscountCode?: string | null;
39
39
  /** @nullable */
40
40
  DiscountCouponExpirationDate?: string | null;
41
41
  /** @nullable */