@openmeter/sdk 1.0.0-beta-b40fd1a9944f → 1.0.0-beta-bc6bd31aa419

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.
@@ -132,9 +132,9 @@ export declare class CustomerApps {
132
132
  } | {
133
133
  id?: string;
134
134
  type: "stripe";
135
- readonly app?: import("./schemas.cjs").components["schemas"]["StripeApp"];
136
135
  stripeCustomerId: string;
137
136
  stripeDefaultPaymentMethodId?: string;
137
+ readonly app?: import("./schemas.cjs").components["schemas"]["StripeApp"];
138
138
  } | {
139
139
  readonly app?: import("./schemas.cjs").components["schemas"]["SandboxApp"];
140
140
  id?: string;
@@ -948,6 +948,56 @@ export interface paths {
948
948
  patch?: never;
949
949
  trace?: never;
950
950
  };
951
+ '/api/v1/customers/{customerIdOrKey}/stripe': {
952
+ parameters: {
953
+ query?: never;
954
+ header?: never;
955
+ path?: never;
956
+ cookie?: never;
957
+ };
958
+ /**
959
+ * Get customer stripe app data
960
+ * @description Get stripe app data for a customer.
961
+ * Only returns data if the customer billing profile is linked to a stripe app.
962
+ */
963
+ get: operations['getCustomerStripeAppData'];
964
+ /**
965
+ * Upsert customer stripe app data
966
+ * @description Upsert stripe app data for a customer.
967
+ * Only updates data if the customer billing profile is linked to a stripe app.
968
+ */
969
+ put: operations['upsertCustomerStripeAppData'];
970
+ post?: never;
971
+ delete?: never;
972
+ options?: never;
973
+ head?: never;
974
+ patch?: never;
975
+ trace?: never;
976
+ };
977
+ '/api/v1/customers/{customerIdOrKey}/stripe/portal': {
978
+ parameters: {
979
+ query?: never;
980
+ header?: never;
981
+ path?: never;
982
+ cookie?: never;
983
+ };
984
+ get?: never;
985
+ put?: never;
986
+ /**
987
+ * Create Stripe customer portal session
988
+ * @description Create Stripe customer portal session.
989
+ * Only returns URL if the customer billing profile is linked to a stripe app and customer.
990
+ *
991
+ * Useful to redirect the customer to the Stripe customer portal to manage their payment methods,
992
+ * change their billing address and access their invoice history.
993
+ */
994
+ post: operations['createCustomerStripePortalSession'];
995
+ delete?: never;
996
+ options?: never;
997
+ head?: never;
998
+ patch?: never;
999
+ trace?: never;
1000
+ };
951
1001
  '/api/v1/customers/{customerIdOrKey}/subscriptions': {
952
1002
  parameters: {
953
1003
  query?: never;
@@ -3380,6 +3430,34 @@ export interface components {
3380
3430
  /** @description Return URL. */
3381
3431
  returnURL?: string;
3382
3432
  };
3433
+ /** @description Stripe customer portal request params. */
3434
+ CreateStripeCustomerPortalSessionParams: {
3435
+ /**
3436
+ * Configuration
3437
+ * @description The ID of an existing configuration to use for this session,
3438
+ * describing its functionality and features.
3439
+ * If not specified, the session uses the default configuration.
3440
+ *
3441
+ * See https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-configuration
3442
+ */
3443
+ configurationId?: string;
3444
+ /**
3445
+ * Locale
3446
+ * @description The IETF language tag of the locale customer portal is displayed in.
3447
+ * If blank or auto, the customer’s preferred_locales or browser’s locale is used.
3448
+ *
3449
+ * See: https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-locale
3450
+ */
3451
+ locale?: string;
3452
+ /**
3453
+ * ReturnUrl
3454
+ * @description The URL to redirect the customer to after they have completed
3455
+ * their requested actions.
3456
+ *
3457
+ * See: https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url
3458
+ */
3459
+ returnUrl?: string;
3460
+ };
3383
3461
  /** @description CreditNoteOriginalInvoiceRef is used to reference the original invoice that a credit note is based on. */
3384
3462
  CreditNoteOriginalInvoiceRef: {
3385
3463
  /**
@@ -8906,8 +8984,15 @@ export interface components {
8906
8984
  * @enum {string}
8907
8985
  */
8908
8986
  type: 'stripe';
8987
+ /** @description The Stripe customer ID. */
8988
+ stripeCustomerId: string;
8989
+ /** @description The Stripe default payment method ID. */
8990
+ stripeDefaultPaymentMethodId?: string;
8909
8991
  /** @description The installed stripe app this data belongs to. */
8910
8992
  readonly app?: components['schemas']['StripeApp'];
8993
+ };
8994
+ /** @description Stripe Customer App Data Base. */
8995
+ StripeCustomerAppDataBase: {
8911
8996
  /** @description The Stripe customer ID. */
8912
8997
  stripeCustomerId: string;
8913
8998
  /** @description The Stripe default payment method ID. */
@@ -8938,6 +9023,47 @@ export interface components {
8938
9023
  /** @description The Stripe default payment method ID. */
8939
9024
  stripeDefaultPaymentMethodId?: string;
8940
9025
  };
9026
+ /** @description Stripe customer portal session.
9027
+ *
9028
+ * See: https://docs.stripe.com/api/customer_portal/sessions/object */
9029
+ StripeCustomerPortalSession: {
9030
+ /** @description The ID of the customer portal session.
9031
+ *
9032
+ * See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-id */
9033
+ id: string;
9034
+ /** @description The ID of the stripe customer. */
9035
+ stripeCustomerId: string;
9036
+ /** @description Configuration used to customize the customer portal.
9037
+ *
9038
+ * See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-configuration */
9039
+ configurationId: string;
9040
+ /** @description Livemode.
9041
+ *
9042
+ * See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-livemode */
9043
+ livemode: boolean;
9044
+ /**
9045
+ * Format: date-time
9046
+ * @description Created at.
9047
+ *
9048
+ * See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-created
9049
+ * @example 2023-01-01T01:01:01.001Z
9050
+ */
9051
+ createdAt: Date;
9052
+ /** @description Return URL.
9053
+ *
9054
+ * See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-return_url */
9055
+ returnUrl: string;
9056
+ /** @description Status.
9057
+ * /**
9058
+ * The IETF language tag of the locale customer portal is displayed in.
9059
+ *
9060
+ * See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-locale */
9061
+ locale: string;
9062
+ /** @description /**
9063
+ * The ID of the customer.The URL to redirect the customer to after they have completed
9064
+ * their requested actions. */
9065
+ url: string;
9066
+ };
8941
9067
  /** @description The tax config for Stripe. */
8942
9068
  StripeTaxConfig: {
8943
9069
  /**
@@ -10348,6 +10474,8 @@ export interface components {
10348
10474
  'PlanOrderByOrdering.order': components['schemas']['SortOrder'];
10349
10475
  /** @description The order by field. */
10350
10476
  'PlanOrderByOrdering.orderBy': components['schemas']['PlanOrderBy'];
10477
+ /** @description Filter customer data by app type. */
10478
+ 'listCustomerAppDataParams.type': components['schemas']['AppType'];
10351
10479
  /** @description What parts of the customer output to expand */
10352
10480
  queryCustomerGet: components['schemas']['CustomerExpand'][];
10353
10481
  /** @description What parts of the list output to expand in listings */
@@ -10368,8 +10496,6 @@ export interface components {
10368
10496
  /** @description Filter customers by usage attribution subject.
10369
10497
  * Case-insensitive partial match. */
10370
10498
  'queryCustomerList.subject': string;
10371
- /** @description Filter customer data by app type. */
10372
- 'queryCustomerList.type': components['schemas']['AppType'];
10373
10499
  /** @description Include deleted meters. */
10374
10500
  'queryMeterList.includeDeleted': boolean;
10375
10501
  };
@@ -10451,6 +10577,7 @@ export type CreateStripeCheckoutSessionRedirectOnCompletion = components['schema
10451
10577
  export type CreateStripeCheckoutSessionRequest = components['schemas']['CreateStripeCheckoutSessionRequest'];
10452
10578
  export type CreateStripeCheckoutSessionRequestOptions = components['schemas']['CreateStripeCheckoutSessionRequestOptions'];
10453
10579
  export type CreateStripeCheckoutSessionResult = components['schemas']['CreateStripeCheckoutSessionResult'];
10580
+ export type CreateStripeCustomerPortalSessionParams = components['schemas']['CreateStripeCustomerPortalSessionParams'];
10454
10581
  export type CreditNoteOriginalInvoiceRef = components['schemas']['CreditNoteOriginalInvoiceRef'];
10455
10582
  export type Currency = components['schemas']['Currency'];
10456
10583
  export type CurrencyCode = components['schemas']['CurrencyCode'];
@@ -10691,7 +10818,9 @@ export type StripeApp = components['schemas']['StripeApp'];
10691
10818
  export type StripeAppReplaceUpdate = components['schemas']['StripeAppReplaceUpdate'];
10692
10819
  export type StripeCheckoutSessionMode = components['schemas']['StripeCheckoutSessionMode'];
10693
10820
  export type StripeCustomerAppData = components['schemas']['StripeCustomerAppData'];
10821
+ export type StripeCustomerAppDataBase = components['schemas']['StripeCustomerAppDataBase'];
10694
10822
  export type StripeCustomerAppDataCreateOrUpdateItem = components['schemas']['StripeCustomerAppDataCreateOrUpdateItem'];
10823
+ export type StripeCustomerPortalSession = components['schemas']['StripeCustomerPortalSession'];
10695
10824
  export type StripeTaxConfig = components['schemas']['StripeTaxConfig'];
10696
10825
  export type StripeWebhookEvent = components['schemas']['StripeWebhookEvent'];
10697
10826
  export type StripeWebhookResponse = components['schemas']['StripeWebhookResponse'];
@@ -10812,6 +10941,7 @@ export type ParameterPlanAddonOrderByOrderingOrder = components['parameters']['P
10812
10941
  export type ParameterPlanAddonOrderByOrderingOrderBy = components['parameters']['PlanAddonOrderByOrdering.orderBy'];
10813
10942
  export type ParameterPlanOrderByOrderingOrder = components['parameters']['PlanOrderByOrdering.order'];
10814
10943
  export type ParameterPlanOrderByOrderingOrderBy = components['parameters']['PlanOrderByOrdering.orderBy'];
10944
+ export type ParameterListCustomerAppDataParamsType = components['parameters']['listCustomerAppDataParams.type'];
10815
10945
  export type ParameterQueryCustomerGet = components['parameters']['queryCustomerGet'];
10816
10946
  export type ParameterQueryCustomerListExpand = components['parameters']['queryCustomerList.expand'];
10817
10947
  export type ParameterQueryCustomerListIncludeDeleted = components['parameters']['queryCustomerList.includeDeleted'];
@@ -10820,7 +10950,6 @@ export type ParameterQueryCustomerListName = components['parameters']['queryCust
10820
10950
  export type ParameterQueryCustomerListPlanKey = components['parameters']['queryCustomerList.planKey'];
10821
10951
  export type ParameterQueryCustomerListPrimaryEmail = components['parameters']['queryCustomerList.primaryEmail'];
10822
10952
  export type ParameterQueryCustomerListSubject = components['parameters']['queryCustomerList.subject'];
10823
- export type ParameterQueryCustomerListType = components['parameters']['queryCustomerList.type'];
10824
10953
  export type ParameterQueryMeterListIncludeDeleted = components['parameters']['queryMeterList.includeDeleted'];
10825
10954
  export type $defs = Record<string, never>;
10826
10955
  export interface operations {
@@ -15038,7 +15167,7 @@ export interface operations {
15038
15167
  * Default is 100. */
15039
15168
  pageSize?: components['parameters']['Pagination.pageSize'];
15040
15169
  /** @description Filter customer data by app type. */
15041
- type?: components['parameters']['queryCustomerList.type'];
15170
+ type?: components['parameters']['listCustomerAppDataParams.type'];
15042
15171
  };
15043
15172
  header?: never;
15044
15173
  path: {
@@ -16290,6 +16419,296 @@ export interface operations {
16290
16419
  };
16291
16420
  };
16292
16421
  };
16422
+ getCustomerStripeAppData: {
16423
+ parameters: {
16424
+ query?: never;
16425
+ header?: never;
16426
+ path: {
16427
+ customerIdOrKey: components['schemas']['ULIDOrExternalKey'];
16428
+ };
16429
+ cookie?: never;
16430
+ };
16431
+ requestBody?: never;
16432
+ responses: {
16433
+ /** @description The request has succeeded. */
16434
+ 200: {
16435
+ headers: {
16436
+ [name: string]: unknown;
16437
+ };
16438
+ content: {
16439
+ 'application/json': components['schemas']['StripeCustomerAppData'];
16440
+ };
16441
+ };
16442
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
16443
+ 400: {
16444
+ headers: {
16445
+ [name: string]: unknown;
16446
+ };
16447
+ content: {
16448
+ 'application/problem+json': components['schemas']['BadRequestProblemResponse'];
16449
+ };
16450
+ };
16451
+ /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
16452
+ 401: {
16453
+ headers: {
16454
+ [name: string]: unknown;
16455
+ };
16456
+ content: {
16457
+ 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'];
16458
+ };
16459
+ };
16460
+ /** @description The server understood the request but refuses to authorize it. */
16461
+ 403: {
16462
+ headers: {
16463
+ [name: string]: unknown;
16464
+ };
16465
+ content: {
16466
+ 'application/problem+json': components['schemas']['ForbiddenProblemResponse'];
16467
+ };
16468
+ };
16469
+ /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
16470
+ 404: {
16471
+ headers: {
16472
+ [name: string]: unknown;
16473
+ };
16474
+ content: {
16475
+ 'application/problem+json': components['schemas']['NotFoundProblemResponse'];
16476
+ };
16477
+ };
16478
+ /** @description One or more conditions given in the request header fields evaluated to false when tested on the server. */
16479
+ 412: {
16480
+ headers: {
16481
+ [name: string]: unknown;
16482
+ };
16483
+ content: {
16484
+ 'application/problem+json': components['schemas']['PreconditionFailedProblemResponse'];
16485
+ };
16486
+ };
16487
+ /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
16488
+ 500: {
16489
+ headers: {
16490
+ [name: string]: unknown;
16491
+ };
16492
+ content: {
16493
+ 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'];
16494
+ };
16495
+ };
16496
+ /** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
16497
+ 503: {
16498
+ headers: {
16499
+ [name: string]: unknown;
16500
+ };
16501
+ content: {
16502
+ 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'];
16503
+ };
16504
+ };
16505
+ /** @description An unexpected error response. */
16506
+ default: {
16507
+ headers: {
16508
+ [name: string]: unknown;
16509
+ };
16510
+ content: {
16511
+ 'application/problem+json': components['schemas']['UnexpectedProblemResponse'];
16512
+ };
16513
+ };
16514
+ };
16515
+ };
16516
+ upsertCustomerStripeAppData: {
16517
+ parameters: {
16518
+ query?: never;
16519
+ header?: never;
16520
+ path: {
16521
+ customerIdOrKey: components['schemas']['ULIDOrExternalKey'];
16522
+ };
16523
+ cookie?: never;
16524
+ };
16525
+ requestBody: {
16526
+ content: {
16527
+ 'application/json': components['schemas']['StripeCustomerAppDataBase'];
16528
+ };
16529
+ };
16530
+ responses: {
16531
+ /** @description The request has succeeded. */
16532
+ 200: {
16533
+ headers: {
16534
+ [name: string]: unknown;
16535
+ };
16536
+ content: {
16537
+ 'application/json': components['schemas']['StripeCustomerAppData'];
16538
+ };
16539
+ };
16540
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
16541
+ 400: {
16542
+ headers: {
16543
+ [name: string]: unknown;
16544
+ };
16545
+ content: {
16546
+ 'application/problem+json': components['schemas']['BadRequestProblemResponse'];
16547
+ };
16548
+ };
16549
+ /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
16550
+ 401: {
16551
+ headers: {
16552
+ [name: string]: unknown;
16553
+ };
16554
+ content: {
16555
+ 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'];
16556
+ };
16557
+ };
16558
+ /** @description The server understood the request but refuses to authorize it. */
16559
+ 403: {
16560
+ headers: {
16561
+ [name: string]: unknown;
16562
+ };
16563
+ content: {
16564
+ 'application/problem+json': components['schemas']['ForbiddenProblemResponse'];
16565
+ };
16566
+ };
16567
+ /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
16568
+ 404: {
16569
+ headers: {
16570
+ [name: string]: unknown;
16571
+ };
16572
+ content: {
16573
+ 'application/problem+json': components['schemas']['NotFoundProblemResponse'];
16574
+ };
16575
+ };
16576
+ /** @description One or more conditions given in the request header fields evaluated to false when tested on the server. */
16577
+ 412: {
16578
+ headers: {
16579
+ [name: string]: unknown;
16580
+ };
16581
+ content: {
16582
+ 'application/problem+json': components['schemas']['PreconditionFailedProblemResponse'];
16583
+ };
16584
+ };
16585
+ /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
16586
+ 500: {
16587
+ headers: {
16588
+ [name: string]: unknown;
16589
+ };
16590
+ content: {
16591
+ 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'];
16592
+ };
16593
+ };
16594
+ /** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
16595
+ 503: {
16596
+ headers: {
16597
+ [name: string]: unknown;
16598
+ };
16599
+ content: {
16600
+ 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'];
16601
+ };
16602
+ };
16603
+ /** @description An unexpected error response. */
16604
+ default: {
16605
+ headers: {
16606
+ [name: string]: unknown;
16607
+ };
16608
+ content: {
16609
+ 'application/problem+json': components['schemas']['UnexpectedProblemResponse'];
16610
+ };
16611
+ };
16612
+ };
16613
+ };
16614
+ createCustomerStripePortalSession: {
16615
+ parameters: {
16616
+ query?: never;
16617
+ header?: never;
16618
+ path: {
16619
+ customerIdOrKey: components['schemas']['ULIDOrExternalKey'];
16620
+ };
16621
+ cookie?: never;
16622
+ };
16623
+ requestBody: {
16624
+ content: {
16625
+ 'application/json': components['schemas']['CreateStripeCustomerPortalSessionParams'];
16626
+ };
16627
+ };
16628
+ responses: {
16629
+ /** @description The request has succeeded. */
16630
+ 200: {
16631
+ headers: {
16632
+ [name: string]: unknown;
16633
+ };
16634
+ content: {
16635
+ 'application/json': components['schemas']['StripeCustomerPortalSession'];
16636
+ };
16637
+ };
16638
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
16639
+ 400: {
16640
+ headers: {
16641
+ [name: string]: unknown;
16642
+ };
16643
+ content: {
16644
+ 'application/problem+json': components['schemas']['BadRequestProblemResponse'];
16645
+ };
16646
+ };
16647
+ /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
16648
+ 401: {
16649
+ headers: {
16650
+ [name: string]: unknown;
16651
+ };
16652
+ content: {
16653
+ 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'];
16654
+ };
16655
+ };
16656
+ /** @description The server understood the request but refuses to authorize it. */
16657
+ 403: {
16658
+ headers: {
16659
+ [name: string]: unknown;
16660
+ };
16661
+ content: {
16662
+ 'application/problem+json': components['schemas']['ForbiddenProblemResponse'];
16663
+ };
16664
+ };
16665
+ /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
16666
+ 404: {
16667
+ headers: {
16668
+ [name: string]: unknown;
16669
+ };
16670
+ content: {
16671
+ 'application/problem+json': components['schemas']['NotFoundProblemResponse'];
16672
+ };
16673
+ };
16674
+ /** @description One or more conditions given in the request header fields evaluated to false when tested on the server. */
16675
+ 412: {
16676
+ headers: {
16677
+ [name: string]: unknown;
16678
+ };
16679
+ content: {
16680
+ 'application/problem+json': components['schemas']['PreconditionFailedProblemResponse'];
16681
+ };
16682
+ };
16683
+ /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
16684
+ 500: {
16685
+ headers: {
16686
+ [name: string]: unknown;
16687
+ };
16688
+ content: {
16689
+ 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'];
16690
+ };
16691
+ };
16692
+ /** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
16693
+ 503: {
16694
+ headers: {
16695
+ [name: string]: unknown;
16696
+ };
16697
+ content: {
16698
+ 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'];
16699
+ };
16700
+ };
16701
+ /** @description An unexpected error response. */
16702
+ default: {
16703
+ headers: {
16704
+ [name: string]: unknown;
16705
+ };
16706
+ content: {
16707
+ 'application/problem+json': components['schemas']['UnexpectedProblemResponse'];
16708
+ };
16709
+ };
16710
+ };
16711
+ };
16293
16712
  listCustomerSubscriptions: {
16294
16713
  parameters: {
16295
16714
  query?: {