@outseta/api-client 0.3.53 → 0.4.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.
Files changed (49) hide show
  1. package/dist/index.js +667 -1
  2. package/package.json +1 -1
  3. package/src/generated/{billing/billing.ts → billing-v2/billing-v2.ts} +54 -4
  4. package/src/generated/billing-v3/billing-v3.ts +2485 -0
  5. package/src/generated/crm/crm.ts +148 -0
  6. package/src/generated/models/accountExpireCurrentSubscriptionBody.ts +7 -0
  7. package/src/generated/models/accountExtendRenewalBody.ts +7 -0
  8. package/src/generated/models/accountWebhookEntityCurrentStripeProductInstancesItem.ts +0 -11
  9. package/src/generated/models/extendRenewalParams.ts +10 -2
  10. package/src/generated/models/importResult.ts +9 -0
  11. package/src/generated/models/index.ts +38 -0
  12. package/src/generated/models/stripeCouponsCreateBody.ts +7 -0
  13. package/src/generated/models/stripeCouponsGetAll200.ts +8 -0
  14. package/src/generated/models/stripeCouponsGetAllParams.ts +14 -0
  15. package/src/generated/models/stripeCouponsGetRedemptions200.ts +8 -0
  16. package/src/generated/models/stripeCouponsGetRedemptionsParams.ts +14 -0
  17. package/src/generated/models/stripeInvoiceLineItemsGetAll200.ts +8 -0
  18. package/src/generated/models/stripeInvoiceLineItemsGetAllParams.ts +14 -0
  19. package/src/generated/models/stripeInvoicesChangeInvoiceStatusBody.ts +7 -0
  20. package/src/generated/models/stripeInvoicesGetAll200.ts +8 -0
  21. package/src/generated/models/stripeInvoicesGetAllParams.ts +14 -0
  22. package/src/generated/models/stripeInvoicesIssueInvoiceCreditBody.ts +7 -0
  23. package/src/generated/models/stripeInvoicesPostBody.ts +7 -0
  24. package/src/generated/models/stripePaymentMethodsGetAll200.ts +8 -0
  25. package/src/generated/models/stripePaymentMethodsGetAllParams.ts +14 -0
  26. package/src/generated/models/stripePricesGetAll200.ts +8 -0
  27. package/src/generated/models/stripePricesGetAllParams.ts +14 -0
  28. package/src/generated/models/stripeProductAllOf.ts +0 -11
  29. package/src/generated/models/stripeProductFamiliesGetAll200.ts +8 -0
  30. package/src/generated/models/stripeProductFamiliesGetAllParams.ts +14 -0
  31. package/src/generated/models/stripeProductFamiliesPostBody.ts +7 -0
  32. package/src/generated/models/stripeProductFamiliesPutBody.ts +7 -0
  33. package/src/generated/models/stripeProductsGetAll200.ts +8 -0
  34. package/src/generated/models/stripeProductsGetAllParams.ts +14 -0
  35. package/src/generated/models/stripeProductsPostBody.ts +7 -0
  36. package/src/generated/models/stripeProductsPutBody.ts +7 -0
  37. package/src/generated/models/stripePromotionCodesCreateBody.ts +7 -0
  38. package/src/generated/models/stripePromotionCodesGetAll200.ts +8 -0
  39. package/src/generated/models/stripePromotionCodesGetAllParams.ts +14 -0
  40. package/src/generated/models/stripePromotionCodesUpdateBody.ts +7 -0
  41. package/src/generated/models/stripeSubscriptionsChangeBody.ts +7 -0
  42. package/src/generated/models/stripeSubscriptionsCreateBody.ts +7 -0
  43. package/src/generated/models/stripeSubscriptionsExtendTrialBody.ts +7 -0
  44. package/src/generated/models/stripeSubscriptionsGetAll200.ts +8 -0
  45. package/src/generated/models/stripeSubscriptionsGetAllParams.ts +14 -0
  46. package/src/generated/models/stripeSubscriptionsPauseCollectionBody.ts +7 -0
  47. package/src/generated/models/stripeSubscriptionsPreviewChangeBody.ts +7 -0
  48. package/src/generated/public/public.ts +26 -0
  49. package/src/index.ts +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outseta/api-client",
3
- "version": "0.3.53",
3
+ "version": "0.4.0",
4
4
  "description": "Generated API client for the Outseta REST API",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -195,7 +195,11 @@ export const discountCouponGetAllDiscountCoupons = async (params?: DiscountCoupo
195
195
 
196
196
 
197
197
  /**
198
- * Only one of AmountOff or PercentOff should be set.
198
+ * Applies to Outseta billing (v2) only. With Stripe Billing (v3), use coupons and promotion
199
+ codes: POST /billing/stripe/coupons and POST /billing/stripe/promotion-codes. With Stripe
200
+ Billing the request is rejected.
201
+
202
+ Only one of AmountOff or PercentOff should be set.
199
203
  Duration values: 1 = Forever, 2 = Once, 3 = Repeating (DurationInMonths must be set).
200
204
  * @summary Add a new discount coupon.
201
205
  */
@@ -292,6 +296,9 @@ export const discountCouponGetDiscountCoupon = async (discountCouponUid: string
292
296
 
293
297
 
294
298
  /**
299
+ * Applies to Outseta billing (v2) only. With Stripe Billing (v3), coupons are managed with
300
+ the /billing/stripe/coupons and /billing/stripe/promotion-codes endpoints. With Stripe
301
+ Billing the request is rejected.
295
302
  * @summary Update a discount coupon.
296
303
  */
297
304
  export type discountCouponUpdateDiscountCouponResponse200 = {
@@ -1785,11 +1792,26 @@ export const subscriptionFirstTimeSubscriptionPreview = async (subscriptionFirst
1785
1792
 
1786
1793
 
1787
1794
  /**
1788
- * Returns an invoice object with information about the amount outstanding.
1795
+ * Returns the new subscription.
1796
+
1797
+ Outseta sets the subscription's dates itself, except ExpirationDate:
1798
+
1799
+ - RenewalDate is calculated from the plan's trial and the BillingRenewalTerm. A value you send is ignored.
1800
+ - EndDate is set by Outseta when the subscription ends. Don't send it: a subscription with an EndDate is
1801
+ rejected with "The renewal date has to be null if the end date is set."
1802
+ - ExpirationDate gives the subscription a fixed end. Outseta keeps the date you send, doesn't bill past it,
1803
+ and ends the subscription on that date, setting EndDate to it. A free plan with BillingRenewalTerm 1
1804
+ (monthly) renews monthly at no charge until then.
1805
+ - Without an ExpirationDate, the plan decides: its ExpirationDate if it has one, otherwise
1806
+ Plan.ExpiresAfterMonths. 0 means the plan never expires subscriptions; a value N above 0 gives an
1807
+ ExpirationDate of the start date plus the plan's trial days plus N months.
1808
+
1809
+ To set or remove the end date of a subscription that already exists, use
1810
+ PUT /api/v1/crm/accounts/{accountUid}/extend-renewal.
1789
1811
  * @summary Add a subscription to an account for the first time.
1790
1812
  */
1791
1813
  export type subscriptionFirstTimeSubscriptionResponse200 = {
1792
- data: Invoice
1814
+ data: Subscription
1793
1815
  status: 200
1794
1816
  }
1795
1817
 
@@ -1894,7 +1916,23 @@ export const subscriptionChangeSubscriptionPreview = async (subscriptionUid: str
1894
1916
 
1895
1917
 
1896
1918
  /**
1897
- * Returns an invoice object with information about the amount outstanding.
1919
+ * Returns the new subscription; its StartDate is when the change takes effect. When only add-ons
1920
+ change, returns the existing subscription.
1921
+
1922
+ A change of plan, BillingRenewalTerm or quantity ends the current subscription and creates a new
1923
+ subscription record. An upgrade starts immediately. Any other change, for example from one free plan
1924
+ to another at the same price, is scheduled for the current renewal date, unless the account is in a
1925
+ trial or you pass startImmediately=true.
1926
+
1927
+ The dates work as on PUT /api/v1/billing/subscriptions/firsttimesubscription: RenewalDate is
1928
+ calculated by Outseta, EndDate is set by Outseta when the subscription ends and can't be sent, and
1929
+ ExpirationDate gives the new subscription a fixed end. Without an ExpirationDate, the new subscription
1930
+ keeps the current one's expiration date when the plan stays the same; otherwise the plan's
1931
+ ExpirationDate or ExpiresAfterMonths applies.
1932
+
1933
+ A request with the same plan, BillingRenewalTerm and quantity only changes add-ons; it does not change
1934
+ the subscription's dates. To set or remove the end date of the current subscription, use
1935
+ PUT /api/v1/crm/accounts/{accountUid}/extend-renewal.
1898
1936
  * @summary Change a subscription on an account.
1899
1937
  */
1900
1938
  export type subscriptionChangeSubscriptionResponse200 = {
@@ -2000,6 +2038,9 @@ export const planGetAllPlans = async (params?: PlanGetAllPlansParams, options?:
2000
2038
 
2001
2039
 
2002
2040
  /**
2041
+ * Applies to Outseta billing (v2) only. With Stripe Billing (v3), plans are Stripe products
2042
+ and prices: use POST /billing/stripe/products and PUT /billing/stripe/products/{uid}. With
2043
+ Stripe Billing the request is rejected.
2003
2044
  * @summary Add a new plan.
2004
2045
  */
2005
2046
  export type planAddPlanResponse200 = {
@@ -2090,6 +2131,9 @@ export const planGetPlan = async (planUid: string | null, options?: RequestInit)
2090
2131
 
2091
2132
 
2092
2133
  /**
2134
+ * Applies to Outseta billing (v2) only. With Stripe Billing (v3), plans are Stripe products
2135
+ and prices: use POST /billing/stripe/products and PUT /billing/stripe/products/{uid}. With
2136
+ Stripe Billing the request is rejected.
2093
2137
  * @summary Update a plan.
2094
2138
  */
2095
2139
  export type planUpdatePlanResponse200 = {
@@ -2292,6 +2336,9 @@ export const planFamilyGetAllPlanFamilies = async (params?: PlanFamilyGetAllPlan
2292
2336
 
2293
2337
 
2294
2338
  /**
2339
+ * Applies to Outseta billing (v2) only. With Stripe Billing (v3), use product families:
2340
+ POST /billing/stripe/product-families and PUT /billing/stripe/product-families/{productFamilyUid}.
2341
+ With Stripe Billing the request is rejected.
2295
2342
  * @summary Add a new plan family.
2296
2343
  */
2297
2344
  export type planFamilyAddPlanFamilyResponse200 = {
@@ -2387,6 +2434,9 @@ export const planFamilyGetPlanFamily = async (planFamilyUid: string | null, opti
2387
2434
 
2388
2435
 
2389
2436
  /**
2437
+ * Applies to Outseta billing (v2) only. With Stripe Billing (v3), use product families:
2438
+ POST /billing/stripe/product-families and PUT /billing/stripe/product-families/{productFamilyUid}.
2439
+ With Stripe Billing the request is rejected.
2390
2440
  * @summary Update a plan family.
2391
2441
  */
2392
2442
  export type planFamilyUpdatePlanFamilyResponse200 = {