@openmeter/client 1.0.0-beta-7280f75db66f → 1.0.0-beta-05de7df7a13f

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.
@@ -411,9 +411,12 @@ export const stringFieldFilterExact = z
411
411
  }),
412
412
  ])
413
413
  .describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
414
+ export const creditGrantVoidPaymentAdjustment = z
415
+ .enum(['none'])
416
+ .describe('Describes how voiding a credit grant adjusts related payment state. - `none`: Voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state.');
414
417
  export const creditTransactionType = z
415
- .enum(['funded', 'consumed', 'expired'])
416
- .describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used.');
418
+ .enum(['funded', 'consumed', 'expired', 'voided'])
419
+ .describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used. - `voided`: Credit removed because the grant was voided before being used.');
417
420
  export const chargesExpand = z
418
421
  .enum(['real_time_usage'])
419
422
  .describe("Expands for customer charges. Values: - `real_time_usage`: The charge's real-time usage.");
@@ -1931,6 +1934,13 @@ export const listPlansParamsFilter = z
1931
1934
  currency: stringFieldFilterExact.optional(),
1932
1935
  })
1933
1936
  .describe('Filter options for listing plans.');
1937
+ export const voidCreditGrantRequest = z
1938
+ .object({
1939
+ paymentAdjustment: creditGrantVoidPaymentAdjustment
1940
+ .optional()
1941
+ .default('none'),
1942
+ })
1943
+ .describe('Request body for voiding a credit grant.');
1934
1944
  export const subscriptionCreate = z
1935
1945
  .object({
1936
1946
  labels: labels.optional(),
@@ -4364,6 +4374,12 @@ export const createCreditAdjustmentPathParams = z.object({
4364
4374
  });
4365
4375
  export const createCreditAdjustmentBody = createCreditAdjustmentRequest;
4366
4376
  export const createCreditAdjustmentResponse = creditAdjustment;
4377
+ export const voidCreditGrantPathParams = z.object({
4378
+ customerId: ulid,
4379
+ creditGrantId: ulid,
4380
+ });
4381
+ export const voidCreditGrantBody = voidCreditGrantRequest;
4382
+ export const voidCreditGrantResponse = creditGrant;
4367
4383
  export const updateCreditGrantExternalSettlementPathParams = z.object({
4368
4384
  customerId: ulid,
4369
4385
  creditGrantId: ulid,
@@ -4534,6 +4550,37 @@ export const updateBillingProfileResponse = profile;
4534
4550
  export const deleteBillingProfilePathParams = z.object({
4535
4551
  id: ulid,
4536
4552
  });
4553
+ export const listInvoicesQueryParams = z.object({
4554
+ page: z
4555
+ .object({
4556
+ size: z.coerce
4557
+ .number()
4558
+ .int()
4559
+ .optional()
4560
+ .describe('The number of items to include per page.'),
4561
+ number: z.coerce.number().int().optional().describe('The page number.'),
4562
+ })
4563
+ .optional()
4564
+ .describe('Determines which page of the collection to retrieve.'),
4565
+ sort: sortQuery.optional(),
4566
+ filter: listInvoicesParamsFilter.optional(),
4567
+ });
4568
+ export const listInvoicesResponse = z.object({
4569
+ data: z.array(invoice),
4570
+ meta: paginatedMeta,
4571
+ });
4572
+ export const getInvoicePathParams = z.object({
4573
+ invoiceId: ulid,
4574
+ });
4575
+ export const getInvoiceResponse = invoice;
4576
+ export const updateInvoicePathParams = z.object({
4577
+ invoiceId: ulid,
4578
+ });
4579
+ export const updateInvoiceBody = updateInvoiceRequest;
4580
+ export const updateInvoiceResponse = invoice;
4581
+ export const deleteInvoicePathParams = z.object({
4582
+ invoiceId: ulid,
4583
+ });
4537
4584
  export const createTaxCodeBody = createTaxCodeRequest;
4538
4585
  export const createTaxCodeResponse = taxCode;
4539
4586
  export const getTaxCodePathParams = z.object({
@@ -4825,6 +4872,11 @@ export const deletePlanAddonPathParams = z.object({
4825
4872
  export const getOrganizationDefaultTaxCodesResponse = organizationDefaultTaxCodes;
4826
4873
  export const updateOrganizationDefaultTaxCodesBody = updateOrganizationDefaultTaxCodesRequest;
4827
4874
  export const updateOrganizationDefaultTaxCodesResponse = organizationDefaultTaxCodes;
4875
+ export const queryGovernanceAccessQueryParams = z.object({
4876
+ page: cursorPaginationQueryPage.optional(),
4877
+ });
4878
+ export const queryGovernanceAccessBody = governanceQueryRequest;
4879
+ export const queryGovernanceAccessResponse = governanceQueryResponse;
4828
4880
  export const labelsWire = z
4829
4881
  .record(z.string(), z.string())
4830
4882
  .describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
@@ -5237,9 +5289,12 @@ export const stringFieldFilterExactWire = z
5237
5289
  }),
5238
5290
  ])
5239
5291
  .describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
5292
+ export const creditGrantVoidPaymentAdjustmentWire = z
5293
+ .enum(['none'])
5294
+ .describe('Describes how voiding a credit grant adjusts related payment state. - `none`: Voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state.');
5240
5295
  export const creditTransactionTypeWire = z
5241
- .enum(['funded', 'consumed', 'expired'])
5242
- .describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used.');
5296
+ .enum(['funded', 'consumed', 'expired', 'voided'])
5297
+ .describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used. - `voided`: Credit removed because the grant was voided before being used.');
5243
5298
  export const chargesExpandWire = z
5244
5299
  .enum(['real_time_usage'])
5245
5300
  .describe("Expands for customer charges. Values: - `real_time_usage`: The charge's real-time usage.");
@@ -6757,6 +6812,13 @@ export const listPlansParamsFilterWire = z
6757
6812
  currency: stringFieldFilterExactWire.optional(),
6758
6813
  })
6759
6814
  .describe('Filter options for listing plans.');
6815
+ export const voidCreditGrantRequestWire = z
6816
+ .strictObject({
6817
+ payment_adjustment: creditGrantVoidPaymentAdjustmentWire
6818
+ .optional()
6819
+ .default('none'),
6820
+ })
6821
+ .describe('Request body for voiding a credit grant.');
6760
6822
  export const subscriptionCreateWire = z
6761
6823
  .strictObject({
6762
6824
  labels: labelsWire.optional(),
@@ -9208,6 +9270,12 @@ export const createCreditAdjustmentPathParamsWire = z.object({
9208
9270
  });
9209
9271
  export const createCreditAdjustmentBodyWire = createCreditAdjustmentRequestWire;
9210
9272
  export const createCreditAdjustmentResponseWire = creditAdjustmentWire;
9273
+ export const voidCreditGrantPathParamsWire = z.object({
9274
+ customerId: ulidWire,
9275
+ creditGrantId: ulidWire,
9276
+ });
9277
+ export const voidCreditGrantBodyWire = voidCreditGrantRequestWire;
9278
+ export const voidCreditGrantResponseWire = creditGrantWire;
9211
9279
  export const updateCreditGrantExternalSettlementPathParamsWire = z.object({
9212
9280
  customerId: ulidWire,
9213
9281
  creditGrantId: ulidWire,
@@ -9378,6 +9446,37 @@ export const updateBillingProfileResponseWire = profileWire;
9378
9446
  export const deleteBillingProfilePathParamsWire = z.object({
9379
9447
  id: ulidWire,
9380
9448
  });
9449
+ export const listInvoicesQueryParamsWire = z.object({
9450
+ page: z
9451
+ .strictObject({
9452
+ size: z.coerce
9453
+ .number()
9454
+ .int()
9455
+ .optional()
9456
+ .describe('The number of items to include per page.'),
9457
+ number: z.coerce.number().int().optional().describe('The page number.'),
9458
+ })
9459
+ .optional()
9460
+ .describe('Determines which page of the collection to retrieve.'),
9461
+ sort: sortQueryWire.optional(),
9462
+ filter: listInvoicesParamsFilterWire.optional(),
9463
+ });
9464
+ export const listInvoicesResponseWire = z.strictObject({
9465
+ data: z.array(invoiceWire),
9466
+ meta: paginatedMetaWire,
9467
+ });
9468
+ export const getInvoicePathParamsWire = z.object({
9469
+ invoiceId: ulidWire,
9470
+ });
9471
+ export const getInvoiceResponseWire = invoiceWire;
9472
+ export const updateInvoicePathParamsWire = z.object({
9473
+ invoiceId: ulidWire,
9474
+ });
9475
+ export const updateInvoiceBodyWire = updateInvoiceRequestWire;
9476
+ export const updateInvoiceResponseWire = invoiceWire;
9477
+ export const deleteInvoicePathParamsWire = z.object({
9478
+ invoiceId: ulidWire,
9479
+ });
9381
9480
  export const createTaxCodeBodyWire = createTaxCodeRequestWire;
9382
9481
  export const createTaxCodeResponseWire = taxCodeWire;
9383
9482
  export const getTaxCodePathParamsWire = z.object({
@@ -9669,3 +9768,8 @@ export const deletePlanAddonPathParamsWire = z.object({
9669
9768
  export const getOrganizationDefaultTaxCodesResponseWire = organizationDefaultTaxCodesWire;
9670
9769
  export const updateOrganizationDefaultTaxCodesBodyWire = updateOrganizationDefaultTaxCodesRequestWire;
9671
9770
  export const updateOrganizationDefaultTaxCodesResponseWire = organizationDefaultTaxCodesWire;
9771
+ export const queryGovernanceAccessQueryParamsWire = z.object({
9772
+ page: cursorPaginationQueryPageWire.optional(),
9773
+ });
9774
+ export const queryGovernanceAccessBodyWire = governanceQueryRequestWire;
9775
+ export const queryGovernanceAccessResponseWire = governanceQueryResponseWire;
@@ -1632,6 +1632,17 @@ export interface ListPlansParamsFilter {
1632
1632
  status?: StringFieldFilterExact;
1633
1633
  currency?: StringFieldFilterExact;
1634
1634
  }
1635
+ /** Request body for voiding a credit grant. */
1636
+ export interface VoidCreditGrantRequest {
1637
+ /**
1638
+ * How voiding adjusts payment state related to the grant.
1639
+ *
1640
+ * Currently only `none` is supported: voiding does not adjust invoices, payment
1641
+ * authorization, settlement, payment intents, or external collection state. If
1642
+ * payment later completes, the original invoiced amount may still be collected.
1643
+ */
1644
+ paymentAdjustment: 'none';
1645
+ }
1635
1646
  /** Subscription create request. */
1636
1647
  export interface SubscriptionCreate {
1637
1648
  labels?: Labels;
@@ -2039,7 +2050,7 @@ export interface CreateCreditAdjustmentRequest {
2039
2050
  /** Filter options for listing credit transactions. */
2040
2051
  export interface ListCreditTransactionsParamsFilter {
2041
2052
  /** Filter credit transactions by type. */
2042
- type?: 'funded' | 'consumed' | 'expired';
2053
+ type?: 'funded' | 'consumed' | 'expired' | 'voided';
2043
2054
  /** Filter credit transactions by currency. */
2044
2055
  currency?: BillingCurrencyCode;
2045
2056
  /**
@@ -2075,7 +2086,7 @@ export interface CreditTransaction {
2075
2086
  /** The date and time the transaction was booked. */
2076
2087
  bookedAt: Date;
2077
2088
  /** The type of credit transaction. */
2078
- type: 'funded' | 'consumed' | 'expired';
2089
+ type: 'funded' | 'consumed' | 'expired' | 'voided';
2079
2090
  /** Currency of the balance affected by the transaction. */
2080
2091
  currency: BillingCurrencyCode;
2081
2092
  /**
@@ -3098,7 +3109,7 @@ export interface UpdateBillingInvoiceWorkflow {
3098
3109
  /** Invoicing settings for this invoice. */
3099
3110
  invoicing?: UpdateBillingInvoiceWorkflowInvoicingSettings;
3100
3111
  /** Payment settings for this invoice. */
3101
- payment?: UpdateBillingWorkflowPaymentChargeAutomaticallySettings | UpdateBillingWorkflowPaymentSendInvoiceSettings;
3112
+ payment?: UpdateBillingWorkflowPaymentSettings;
3102
3113
  }
3103
3114
  /** Access status for a single feature. */
3104
3115
  export interface GovernanceFeatureAccess {
@@ -4127,7 +4138,7 @@ export interface InvoiceLineRateCard {
4127
4138
  /** Rate card configuration snapshot for a usage-based invoice line. */
4128
4139
  export interface UpdateInvoiceLineRateCard {
4129
4140
  /** The price definition used to calculate charges for this line. */
4130
- price: UpdatePriceFree | UpdatePriceFlat | UpdatePriceUnit | UpdatePriceGraduated | UpdatePriceVolume;
4141
+ price: UpdatePrice;
4131
4142
  /** Tax configuration snapshot for this line. */
4132
4143
  taxConfig?: UpdateRateCardTaxConfig;
4133
4144
  /** The feature key associated with this line's rate card. */
@@ -4850,7 +4861,7 @@ export interface InvoiceStandard {
4850
4861
  * from the update request are deleted. Detailed (child) lines are always computed
4851
4862
  * and cannot be edited directly.
4852
4863
  */
4853
- lines?: InvoiceStandardLine[];
4864
+ lines?: InvoiceLine[];
4854
4865
  }
4855
4866
  /** InvoiceStandard update request. */
4856
4867
  export interface UpdateInvoiceStandardRequest {
@@ -4881,11 +4892,11 @@ export interface UpdateInvoiceStandardRequest {
4881
4892
  * from the update request are deleted. Detailed (child) lines are always computed
4882
4893
  * and cannot be edited directly.
4883
4894
  */
4884
- lines?: UpdateInvoiceStandardLine[];
4895
+ lines?: UpdateInvoiceLine[];
4885
4896
  }
4886
4897
  /** Page paginated response. */
4887
4898
  export interface InvoicePagePaginatedResponse {
4888
- data: InvoiceStandard[];
4899
+ data: Invoice[];
4889
4900
  meta: PaginatedMeta;
4890
4901
  }
4891
4902
  /**
@@ -4954,6 +4965,8 @@ export type DateTimeFieldFilter = Date | {
4954
4965
  export type SubscriptionEditTiming = 'immediate' | 'next_billing_cycle' | Date;
4955
4966
  /** Payment settings for a billing workflow. */
4956
4967
  export type WorkflowPaymentSettings = WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettings;
4968
+ /** Payment settings for a billing workflow. */
4969
+ export type UpdateBillingWorkflowPaymentSettings = UpdateBillingWorkflowPaymentChargeAutomaticallySettings | UpdateBillingWorkflowPaymentSendInvoiceSettings;
4957
4970
  /** A parameter that failed validation. */
4958
4971
  export type InvalidParameter = InvalidParameterStandard | InvalidParameterMinimumLength | InvalidParameterMaximumLength | InvalidParameterChoiceItem | InvalidParameterDependentItem;
4959
4972
  /**
@@ -4980,10 +4993,38 @@ export type WorkflowCollectionAlignment = WorkflowCollectionAlignmentSubscriptio
4980
4993
  export type App = AppStripe | AppSandbox | AppExternalInvoicing;
4981
4994
  /** Price. */
4982
4995
  export type Price = PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
4996
+ /** Price. */
4997
+ export type UpdatePrice = UpdatePriceFree | UpdatePriceFlat | UpdatePriceUnit | UpdatePriceGraduated | UpdatePriceVolume;
4983
4998
  /** Customer charge. */
4984
4999
  export type CreateChargeRequest = CreateChargeFlatFeeRequest | CreateChargeUsageBasedRequest;
4985
5000
  /** Customer charge. */
4986
5001
  export type Charge = ChargeFlatFee | ChargeUsageBased;
5002
+ /**
5003
+ * A top-level line item on an invoice.
5004
+ *
5005
+ * Each line represents a single charge, typically associated with a rate card from
5006
+ * a subscription. Detailed (child) lines are nested under `detailed_lines` when
5007
+ * present.
5008
+ */
5009
+ export type InvoiceLine = InvoiceStandardLine;
5010
+ /**
5011
+ * A top-level line item on an invoice.
5012
+ *
5013
+ * Each line represents a single charge, typically associated with a rate card from
5014
+ * a subscription. Detailed (child) lines are nested under `detailed_lines` when
5015
+ * present.
5016
+ */
5017
+ export type UpdateInvoiceLine = UpdateInvoiceStandardLine;
5018
+ /**
5019
+ * An invoice issued to a customer.
5020
+ *
5021
+ * The `type` field determines the concrete variant:
5022
+ *
5023
+ * - `standard`: a standard invoice for charges owed.
5024
+ */
5025
+ export type Invoice = InvoiceStandard;
5026
+ /** UpdateInvoiceRequest update request. */
5027
+ export type UpdateInvoiceRequest = UpdateInvoiceStandardRequest;
4987
5028
  /**
4988
5029
  * Sort query.
4989
5030
  *
@@ -5237,6 +5278,17 @@ export interface CreditGrantPurchaseInput {
5237
5278
  /** Current payment settlement status. */
5238
5279
  settlementStatus?: 'pending' | 'authorized' | 'settled';
5239
5280
  }
5281
+ /** Request body for voiding a credit grant. */
5282
+ export interface VoidCreditGrantRequestInput {
5283
+ /**
5284
+ * How voiding adjusts payment state related to the grant.
5285
+ *
5286
+ * Currently only `none` is supported: voiding does not adjust invoices, payment
5287
+ * authorization, settlement, payment intents, or external collection state. If
5288
+ * payment later completes, the original invoiced amount may still be collected.
5289
+ */
5290
+ paymentAdjustment?: 'none';
5291
+ }
5240
5292
  /**
5241
5293
  * Unit conversion configuration.
5242
5294
  *
@@ -5383,7 +5435,7 @@ export interface UpdateBillingInvoiceWorkflowInput {
5383
5435
  /** Invoicing settings for this invoice. */
5384
5436
  invoicing?: UpdateBillingInvoiceWorkflowInvoicingSettingsInput;
5385
5437
  /** Payment settings for this invoice. */
5386
- payment?: UpdateBillingWorkflowPaymentChargeAutomaticallySettings | UpdateBillingWorkflowPaymentSendInvoiceSettingsInput;
5438
+ payment?: UpdateBillingWorkflowPaymentSettingsInput;
5387
5439
  }
5388
5440
  /** CreditGrant create request. */
5389
5441
  export interface CreateCreditGrantRequestInput {
@@ -6416,7 +6468,7 @@ export interface InvoiceStandardInput {
6416
6468
  * from the update request are deleted. Detailed (child) lines are always computed
6417
6469
  * and cannot be edited directly.
6418
6470
  */
6419
- lines?: InvoiceStandardLineInput[];
6471
+ lines?: InvoiceLineInput[];
6420
6472
  }
6421
6473
  /** InvoiceStandard update request. */
6422
6474
  export interface UpdateInvoiceStandardRequestInput {
@@ -6447,17 +6499,37 @@ export interface UpdateInvoiceStandardRequestInput {
6447
6499
  * from the update request are deleted. Detailed (child) lines are always computed
6448
6500
  * and cannot be edited directly.
6449
6501
  */
6450
- lines?: UpdateInvoiceStandardLine[];
6502
+ lines?: UpdateInvoiceLine[];
6451
6503
  }
6452
6504
  /** Page paginated response. */
6453
6505
  export interface InvoicePagePaginatedResponseInput {
6454
- data: InvoiceStandardInput[];
6506
+ data: InvoiceInput[];
6455
6507
  meta: PaginatedMeta;
6456
6508
  }
6457
6509
  /** Payment settings for a billing workflow. */
6458
6510
  export type WorkflowPaymentSettingsInput = WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettingsInput;
6511
+ /** Payment settings for a billing workflow. */
6512
+ export type UpdateBillingWorkflowPaymentSettingsInput = UpdateBillingWorkflowPaymentChargeAutomaticallySettings | UpdateBillingWorkflowPaymentSendInvoiceSettingsInput;
6459
6513
  /**
6460
6514
  * Entitlement template configured on a rate card. The feature is taken from the
6461
6515
  * rate card itself, so it is omitted here.
6462
6516
  */
6463
6517
  export type RateCardEntitlementInput = RateCardMeteredEntitlementInput | RateCardStaticEntitlement | RateCardBooleanEntitlement;
6518
+ /**
6519
+ * A top-level line item on an invoice.
6520
+ *
6521
+ * Each line represents a single charge, typically associated with a rate card from
6522
+ * a subscription. Detailed (child) lines are nested under `detailed_lines` when
6523
+ * present.
6524
+ */
6525
+ export type InvoiceLineInput = InvoiceStandardLineInput;
6526
+ /**
6527
+ * An invoice issued to a customer.
6528
+ *
6529
+ * The `type` field determines the concrete variant:
6530
+ *
6531
+ * - `standard`: a standard invoice for charges owed.
6532
+ */
6533
+ export type InvoiceInput = InvoiceStandardInput;
6534
+ /** UpdateInvoiceRequest update request. */
6535
+ export type UpdateInvoiceRequestInput = UpdateInvoiceStandardRequestInput;
@@ -1,6 +1,6 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
- import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
3
+ import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
4
4
  import type { Charge, CreditGrant, CreditTransaction, Customer } from '../models/types.js';
5
5
  export declare class Customers {
6
6
  private readonly _client;
@@ -153,6 +153,22 @@ export declare class CustomersCreditsGrants {
153
153
  * GET /openmeter/customers/{customerId}/credits/grants
154
154
  */
155
155
  listAll(request: ListCreditGrantsRequest, options?: RequestOptions): AsyncIterable<CreditGrant>;
156
+ /**
157
+ * Void credit grant
158
+ *
159
+ * Void a credit grant, forfeiting the remaining unused balance.
160
+ *
161
+ * Voiding is a forward-looking, irreversible operation. Credits already consumed
162
+ * by usage remain unaffected — only the remaining balance is forfeited. The grant
163
+ * reads as `voided` status afterwards. Payment state is not adjusted when
164
+ * `payment_adjustment` is `none`, so invoice-backed or externally collected
165
+ * payments may still collect the original amount. Only `active` grants can be
166
+ * voided; voiding a pending, expired, or fully consumed grant returns a conflict.
167
+ * Retrying a successful void is an idempotent success.
168
+ *
169
+ * POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
170
+ */
171
+ void(request: VoidCreditGrantRequest, options?: RequestOptions): Promise<VoidCreditGrantResponse>;
156
172
  /**
157
173
  * Update credit grant external settlement status
158
174
  *
@@ -1,7 +1,7 @@
1
1
  // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
2
2
  import { unwrap } from '../lib/types.js';
3
3
  import { paginateCursor, paginatePages } from '../lib/paginate.js';
4
- import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, updateCreditGrantExternalSettlement, listCreditTransactions, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
4
+ import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, voidCreditGrant, updateCreditGrantExternalSettlement, listCreditTransactions, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
5
5
  export class Customers {
6
6
  _client;
7
7
  constructor(_client) {
@@ -205,6 +205,24 @@ export class CustomersCreditsGrants {
205
205
  listAll(request, options) {
206
206
  return paginatePages((req, opts) => listCreditGrants(this._client, req, opts), request, options);
207
207
  }
208
+ /**
209
+ * Void credit grant
210
+ *
211
+ * Void a credit grant, forfeiting the remaining unused balance.
212
+ *
213
+ * Voiding is a forward-looking, irreversible operation. Credits already consumed
214
+ * by usage remain unaffected — only the remaining balance is forfeited. The grant
215
+ * reads as `voided` status afterwards. Payment state is not adjusted when
216
+ * `payment_adjustment` is `none`, so invoice-backed or externally collected
217
+ * payments may still collect the original amount. Only `active` grants can be
218
+ * voided; voiding a pending, expired, or fully consumed grant returns a conflict.
219
+ * Retrying a successful void is an idempotent success.
220
+ *
221
+ * POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
222
+ */
223
+ async void(request, options) {
224
+ return unwrap(await voidCreditGrant(this._client, request, options));
225
+ }
208
226
  /**
209
227
  * Update credit grant external settlement status
210
228
  *
@@ -1,8 +1,10 @@
1
1
  import { type Client } from '../core.js';
2
2
  import { type RequestOptions } from '../lib/types.js';
3
3
  import type { CreateSubscriptionAddonRequest, CreateSubscriptionAddonResponse } from '../models/operations/subscriptions.js';
4
+ import type { ListInvoicesRequest, ListInvoicesResponse, GetInvoiceRequest, GetInvoiceResponse, UpdateInvoiceRequest, UpdateInvoiceResponse, DeleteInvoiceRequest, DeleteInvoiceResponse } from '../models/operations/invoices.js';
4
5
  import type { ListCurrenciesRequest, ListCurrenciesResponse, CreateCustomCurrencyRequest, CreateCustomCurrencyResponse, ListCostBasesRequest, ListCostBasesResponse, CreateCostBasisRequest, CreateCostBasisResponse } from '../models/operations/currencies.js';
5
- import type { CostBasis, Currency } from '../models/types.js';
6
+ import type { QueryGovernanceAccessRequest, QueryGovernanceAccessResponse } from '../models/operations/governance.js';
7
+ import type { CostBasis, Currency, Invoice } from '../models/types.js';
6
8
  /**
7
9
  * Operations marked internal in the API definition. They are not part of
8
10
  * the customer surface: they may require additional permissions, and they
@@ -13,8 +15,12 @@ export declare class Internal {
13
15
  constructor(_client: Client);
14
16
  private _subscriptions?;
15
17
  get subscriptions(): InternalSubscriptions;
18
+ private _invoices?;
19
+ get invoices(): InternalInvoices;
16
20
  private _currencies?;
17
21
  get currencies(): InternalCurrencies;
22
+ private _governance?;
23
+ get governance(): InternalGovernance;
18
24
  }
19
25
  export declare class InternalSubscriptions {
20
26
  private readonly _client;
@@ -28,6 +34,72 @@ export declare class InternalSubscriptions {
28
34
  */
29
35
  createAddon(request: CreateSubscriptionAddonRequest, options?: RequestOptions): Promise<CreateSubscriptionAddonResponse>;
30
36
  }
37
+ export declare class InternalInvoices {
38
+ private readonly _client;
39
+ constructor(_client: Client);
40
+ /**
41
+ * List billing invoices
42
+ *
43
+ * List billing invoices.
44
+ *
45
+ * Returns a page of invoices. Gathering invoices are never included. Use `filter`
46
+ * to narrow by status, customer, dates, or service period start. Use `sort` to
47
+ * control ordering.
48
+ *
49
+ * GET /openmeter/billing/invoices
50
+ */
51
+ list(request?: ListInvoicesRequest, options?: RequestOptions): Promise<ListInvoicesResponse>;
52
+ /**
53
+ * List billing invoices
54
+ *
55
+ * List billing invoices.
56
+ *
57
+ * Returns a page of invoices. Gathering invoices are never included. Use `filter`
58
+ * to narrow by status, customer, dates, or service period start. Use `sort` to
59
+ * control ordering.
60
+ *
61
+ * Iterates every item across all pages, fetching more as the returned iterable is consumed.
62
+ *
63
+ * GET /openmeter/billing/invoices
64
+ */
65
+ listAll(request?: ListInvoicesRequest, options?: RequestOptions): AsyncIterable<Invoice>;
66
+ /**
67
+ * Get a billing invoice
68
+ *
69
+ * Get a billing invoice by ID.
70
+ *
71
+ * Returns the full invoice resource including line items, status details, totals,
72
+ * and workflow configuration snapshot.
73
+ *
74
+ * GET /openmeter/billing/invoices/{invoiceId}
75
+ */
76
+ get(request: GetInvoiceRequest, options?: RequestOptions): Promise<GetInvoiceResponse>;
77
+ /**
78
+ * Update a billing invoice
79
+ *
80
+ * Update a billing invoice.
81
+ *
82
+ * Only the mutable fields of the invoice can be edited: description, labels,
83
+ * supplier, customer, workflow settings, and top-level lines. Top-level lines are
84
+ * matched by `id`; lines without an `id` are created, and existing lines omitted
85
+ * from `lines` are deleted. Detailed (child) lines are always computed and cannot
86
+ * be edited directly. Only invoices in draft status can be updated.
87
+ *
88
+ * PUT /openmeter/billing/invoices/{invoiceId}
89
+ */
90
+ update(request: UpdateInvoiceRequest, options?: RequestOptions): Promise<UpdateInvoiceResponse>;
91
+ /**
92
+ * Delete a billing invoice
93
+ *
94
+ * Delete a billing invoice.
95
+ *
96
+ * Only standard invoices in draft status can be deleted. Deleting an invoice will
97
+ * also delete all associated line items and workflow configuration.
98
+ *
99
+ * DELETE /openmeter/billing/invoices/{invoiceId}
100
+ */
101
+ delete(request: DeleteInvoiceRequest, options?: RequestOptions): Promise<DeleteInvoiceResponse>;
102
+ }
31
103
  export declare class InternalCurrencies {
32
104
  private readonly _client;
33
105
  constructor(_client: Client);
@@ -87,3 +159,22 @@ export declare class InternalCurrencies {
87
159
  */
88
160
  createCostBasis(request: CreateCostBasisRequest, options?: RequestOptions): Promise<CreateCostBasisResponse>;
89
161
  }
162
+ export declare class InternalGovernance {
163
+ private readonly _client;
164
+ constructor(_client: Client);
165
+ /**
166
+ * Query governance access
167
+ *
168
+ * Query feature access for a list of customers.
169
+ *
170
+ * The endpoint resolves each provided identifier to a customer and returns the
171
+ * access status for the requested features, plus optional credit balance
172
+ * availability.
173
+ *
174
+ * _Designed to be called on a fixed refresh interval and the query response is
175
+ * intended to be cached._
176
+ *
177
+ * POST /openmeter/governance/query
178
+ */
179
+ queryAccess(request: QueryGovernanceAccessRequest, options?: RequestOptions): Promise<QueryGovernanceAccessResponse>;
180
+ }