@openmeter/client 1.0.0-beta-cba0a6656233 → 1.0.0-beta-02013cc147e9

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.
@@ -1585,6 +1585,11 @@ export const createResourceReference = z
1585
1585
  id: ulid,
1586
1586
  })
1587
1587
  .describe('TaxCode reference.');
1588
+ export const currencyCustomReference = z
1589
+ .object({
1590
+ id: ulid,
1591
+ })
1592
+ .describe('CurrencyCustom reference.');
1588
1593
  export const chargeCostBasisPinned = z
1589
1594
  .object({
1590
1595
  type: z
@@ -1610,11 +1615,6 @@ export const creditGrantInvoiceReference = z
1610
1615
  .describe('Identifier of the invoice line associated with the grant.'),
1611
1616
  })
1612
1617
  .describe('Invoice references for the grant.');
1613
- export const currencyCustomReference = z
1614
- .object({
1615
- id: ulid,
1616
- })
1617
- .describe('CurrencyCustom reference.');
1618
1618
  export const subscriptionCostBasisPin = z
1619
1619
  .object({
1620
1620
  customCurrencyId: ulid,
@@ -2420,14 +2420,6 @@ export const creditGrantPlanFilter = z
2420
2420
  version: versionFilter.optional(),
2421
2421
  })
2422
2422
  .describe('A plan key and an optional version constraint for matching credit grants.');
2423
- export const listCreditGrantsParamsFilter = z
2424
- .object({
2425
- status: creditGrantStatus.optional(),
2426
- currency: currencyCode.optional(),
2427
- key: stringFieldFilter.optional(),
2428
- featureKey: stringFieldFilter.optional(),
2429
- })
2430
- .describe('Filter options for listing credit grants.');
2431
2423
  export const validationIssue = z
2432
2424
  .object({
2433
2425
  code: z.string().describe('Machine-readable error code.'),
@@ -2865,6 +2857,14 @@ export const creditAdjustment = z
2865
2857
  labels: labels.optional(),
2866
2858
  })
2867
2859
  .describe("A credit adjustment can be used to make manual adjustments to a customer's credit balance. Supported use-cases: - Usage correction");
2860
+ export const listCreditGrantsParamsFilter = z
2861
+ .object({
2862
+ status: creditGrantStatus.optional(),
2863
+ currency: billingCurrencyCode.optional(),
2864
+ key: stringFieldFilter.optional(),
2865
+ featureKey: stringFieldFilter.optional(),
2866
+ })
2867
+ .describe('Filter options for listing credit grants.');
2868
2868
  export const createCreditAdjustmentRequest = z
2869
2869
  .object({
2870
2870
  name: z
@@ -3090,42 +3090,6 @@ export const createTaxCodeConfig = z
3090
3090
  code: createResourceReference.optional(),
3091
3091
  })
3092
3092
  .describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
3093
- export const chargeCostBasis = z
3094
- .discriminatedUnion('type', [
3095
- chargeCostBasisDynamic,
3096
- chargeCostBasisPinned,
3097
- chargeCostBasisManual,
3098
- ])
3099
- .describe('Cost basis selection for a custom-currency charge. The variant chosen fixes when and how the conversion rate is determined.');
3100
- export const taxCodeConfig = z
3101
- .object({
3102
- behavior: taxBehavior.optional(),
3103
- code: taxCodeReference.optional(),
3104
- })
3105
- .describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
3106
- export const taxConfig = z
3107
- .object({
3108
- behavior: taxBehavior.optional(),
3109
- stripe: taxConfigStripe.optional(),
3110
- externalInvoicing: taxConfigExternalInvoicing.optional(),
3111
- taxCodeId: ulid.optional(),
3112
- taxCode: taxCodeReference.optional(),
3113
- })
3114
- .describe('Set of provider specific tax configs.');
3115
- export const organizationDefaultTaxCodes = z
3116
- .object({
3117
- invoicingTaxCode: taxCodeReference,
3118
- creditGrantTaxCode: taxCodeReference,
3119
- createdAt: dateTime,
3120
- updatedAt: dateTime,
3121
- })
3122
- .describe('Organization-level default tax code references. Stores the default tax codes applied to specific billing contexts for this organization. Provisioned automatically when the organization is created.');
3123
- export const updateOrganizationDefaultTaxCodesRequest = z
3124
- .object({
3125
- invoicingTaxCode: taxCodeReference.optional(),
3126
- creditGrantTaxCode: taxCodeReference.optional(),
3127
- })
3128
- .describe('OrganizationDefaultTaxCodes update request.');
3129
3093
  export const creditBalance = z
3130
3094
  .object({
3131
3095
  currency: billingCurrencyCode,
@@ -3165,6 +3129,42 @@ export const creditTransaction = z
3165
3129
  .describe('The booked credit balance before and after the transaction, including credit-only advance debt.'),
3166
3130
  })
3167
3131
  .describe("A credit transaction represents a single credit movement on the customer's balance. Credit transactions are immutable.");
3132
+ export const chargeCostBasis = z
3133
+ .discriminatedUnion('type', [
3134
+ chargeCostBasisDynamic,
3135
+ chargeCostBasisPinned,
3136
+ chargeCostBasisManual,
3137
+ ])
3138
+ .describe('Cost basis selection for a custom-currency charge. The variant chosen fixes when and how the conversion rate is determined.');
3139
+ export const taxCodeConfig = z
3140
+ .object({
3141
+ behavior: taxBehavior.optional(),
3142
+ code: taxCodeReference.optional(),
3143
+ })
3144
+ .describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
3145
+ export const taxConfig = z
3146
+ .object({
3147
+ behavior: taxBehavior.optional(),
3148
+ stripe: taxConfigStripe.optional(),
3149
+ externalInvoicing: taxConfigExternalInvoicing.optional(),
3150
+ taxCodeId: ulid.optional(),
3151
+ taxCode: taxCodeReference.optional(),
3152
+ })
3153
+ .describe('Set of provider specific tax configs.');
3154
+ export const organizationDefaultTaxCodes = z
3155
+ .object({
3156
+ invoicingTaxCode: taxCodeReference,
3157
+ creditGrantTaxCode: taxCodeReference,
3158
+ createdAt: dateTime,
3159
+ updatedAt: dateTime,
3160
+ })
3161
+ .describe('Organization-level default tax code references. Stores the default tax codes applied to specific billing contexts for this organization. Provisioned automatically when the organization is created.');
3162
+ export const updateOrganizationDefaultTaxCodesRequest = z
3163
+ .object({
3164
+ invoicingTaxCode: taxCodeReference.optional(),
3165
+ creditGrantTaxCode: taxCodeReference.optional(),
3166
+ })
3167
+ .describe('OrganizationDefaultTaxCodes update request.');
3168
3168
  export const invoiceWorkflowAppsReferences = z
3169
3169
  .object({
3170
3170
  tax: appReference,
@@ -4382,6 +4382,18 @@ export const createCreditGrantPurchase = z
4382
4382
  .default('on_creation'),
4383
4383
  })
4384
4384
  .describe('Purchase and payment terms of the grant.');
4385
+ export const creditBalances = z
4386
+ .object({
4387
+ retrievedAt: dateTime,
4388
+ balances: z.array(creditBalance).describe('The balances by currencies.'),
4389
+ })
4390
+ .describe('The balances of the credits of a customer.');
4391
+ export const creditTransactionPaginatedResponse = z
4392
+ .object({
4393
+ data: z.array(creditTransaction),
4394
+ meta: cursorMeta,
4395
+ })
4396
+ .describe('Cursor paginated response.');
4385
4397
  export const creditGrantPurchase = z
4386
4398
  .object({
4387
4399
  currency: currencyCode,
@@ -4442,18 +4454,6 @@ export const workflowTaxSettings = z
4442
4454
  defaultTaxConfig: taxConfig.optional(),
4443
4455
  })
4444
4456
  .describe('Tax settings for a billing workflow.');
4445
- export const creditBalances = z
4446
- .object({
4447
- retrievedAt: dateTime,
4448
- balances: z.array(creditBalance).describe('The balances by currencies.'),
4449
- })
4450
- .describe('The balances of the credits of a customer.');
4451
- export const creditTransactionPaginatedResponse = z
4452
- .object({
4453
- data: z.array(creditTransaction),
4454
- meta: cursorMeta,
4455
- })
4456
- .describe('Cursor paginated response.');
4457
4457
  export const planAddonPagePaginatedResponse = z
4458
4458
  .object({
4459
4459
  data: z.array(planAddon),
@@ -5081,6 +5081,7 @@ export const creditGrant = z
5081
5081
  deletedAt: dateTime.optional(),
5082
5082
  fundingMethod: creditFundingMethod,
5083
5083
  currency: billingCurrencyCode,
5084
+ customCurrency: currencyCustomReference.optional(),
5084
5085
  amount: numeric,
5085
5086
  purchase: creditGrantPurchase.optional(),
5086
5087
  taxConfig: taxCodeConfig.optional(),
@@ -8823,6 +8824,11 @@ export const createResourceReferenceWire = z
8823
8824
  id: ulidWire,
8824
8825
  })
8825
8826
  .describe('TaxCode reference.');
8827
+ export const currencyCustomReferenceWire = z
8828
+ .strictObject({
8829
+ id: ulidWire,
8830
+ })
8831
+ .describe('CurrencyCustom reference.');
8826
8832
  export const chargeCostBasisPinnedWire = z
8827
8833
  .strictObject({
8828
8834
  type: z
@@ -8848,11 +8854,6 @@ export const creditGrantInvoiceReferenceWire = z
8848
8854
  .describe('Identifier of the invoice line associated with the grant.'),
8849
8855
  })
8850
8856
  .describe('Invoice references for the grant.');
8851
- export const currencyCustomReferenceWire = z
8852
- .strictObject({
8853
- id: ulidWire,
8854
- })
8855
- .describe('CurrencyCustom reference.');
8856
8857
  export const subscriptionCostBasisPinWire = z
8857
8858
  .strictObject({
8858
8859
  custom_currency_id: ulidWire,
@@ -9646,14 +9647,6 @@ export const creditGrantPlanFilterWire = z
9646
9647
  version: versionFilterWire.optional(),
9647
9648
  })
9648
9649
  .describe('A plan key and an optional version constraint for matching credit grants.');
9649
- export const listCreditGrantsParamsFilterWire = z
9650
- .strictObject({
9651
- status: creditGrantStatusWire.optional(),
9652
- currency: currencyCodeWire.optional(),
9653
- key: stringFieldFilterWire.optional(),
9654
- feature_key: stringFieldFilterWire.optional(),
9655
- })
9656
- .describe('Filter options for listing credit grants.');
9657
9650
  export const validationIssueWire = z
9658
9651
  .strictObject({
9659
9652
  code: z.string().describe('Machine-readable error code.'),
@@ -10081,6 +10074,14 @@ export const creditAdjustmentWire = z
10081
10074
  labels: labelsWire.optional(),
10082
10075
  })
10083
10076
  .describe("A credit adjustment can be used to make manual adjustments to a customer's credit balance. Supported use-cases: - Usage correction");
10077
+ export const listCreditGrantsParamsFilterWire = z
10078
+ .strictObject({
10079
+ status: creditGrantStatusWire.optional(),
10080
+ currency: billingCurrencyCodeWire.optional(),
10081
+ key: stringFieldFilterWire.optional(),
10082
+ feature_key: stringFieldFilterWire.optional(),
10083
+ })
10084
+ .describe('Filter options for listing credit grants.');
10084
10085
  export const createCreditAdjustmentRequestWire = z
10085
10086
  .strictObject({
10086
10087
  name: z
@@ -10306,42 +10307,6 @@ export const createTaxCodeConfigWire = z
10306
10307
  code: createResourceReferenceWire.optional(),
10307
10308
  })
10308
10309
  .describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
10309
- export const chargeCostBasisWire = z
10310
- .discriminatedUnion('type', [
10311
- chargeCostBasisDynamicWire,
10312
- chargeCostBasisPinnedWire,
10313
- chargeCostBasisManualWire,
10314
- ])
10315
- .describe('Cost basis selection for a custom-currency charge. The variant chosen fixes when and how the conversion rate is determined.');
10316
- export const taxCodeConfigWire = z
10317
- .strictObject({
10318
- behavior: taxBehaviorWire.optional(),
10319
- code: taxCodeReferenceWire.optional(),
10320
- })
10321
- .describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
10322
- export const taxConfigWire = z
10323
- .strictObject({
10324
- behavior: taxBehaviorWire.optional(),
10325
- stripe: taxConfigStripeWire.optional(),
10326
- external_invoicing: taxConfigExternalInvoicingWire.optional(),
10327
- tax_code_id: ulidWire.optional(),
10328
- tax_code: taxCodeReferenceWire.optional(),
10329
- })
10330
- .describe('Set of provider specific tax configs.');
10331
- export const organizationDefaultTaxCodesWire = z
10332
- .strictObject({
10333
- invoicing_tax_code: taxCodeReferenceWire,
10334
- credit_grant_tax_code: taxCodeReferenceWire,
10335
- created_at: dateTimeWire,
10336
- updated_at: dateTimeWire,
10337
- })
10338
- .describe('Organization-level default tax code references. Stores the default tax codes applied to specific billing contexts for this organization. Provisioned automatically when the organization is created.');
10339
- export const updateOrganizationDefaultTaxCodesRequestWire = z
10340
- .strictObject({
10341
- invoicing_tax_code: taxCodeReferenceWire.optional(),
10342
- credit_grant_tax_code: taxCodeReferenceWire.optional(),
10343
- })
10344
- .describe('OrganizationDefaultTaxCodes update request.');
10345
10310
  export const creditBalanceWire = z
10346
10311
  .strictObject({
10347
10312
  currency: billingCurrencyCodeWire,
@@ -10381,6 +10346,42 @@ export const creditTransactionWire = z
10381
10346
  .describe('The booked credit balance before and after the transaction, including credit-only advance debt.'),
10382
10347
  })
10383
10348
  .describe("A credit transaction represents a single credit movement on the customer's balance. Credit transactions are immutable.");
10349
+ export const chargeCostBasisWire = z
10350
+ .discriminatedUnion('type', [
10351
+ chargeCostBasisDynamicWire,
10352
+ chargeCostBasisPinnedWire,
10353
+ chargeCostBasisManualWire,
10354
+ ])
10355
+ .describe('Cost basis selection for a custom-currency charge. The variant chosen fixes when and how the conversion rate is determined.');
10356
+ export const taxCodeConfigWire = z
10357
+ .strictObject({
10358
+ behavior: taxBehaviorWire.optional(),
10359
+ code: taxCodeReferenceWire.optional(),
10360
+ })
10361
+ .describe('Tax configuration for a billable resource. Applies a tax code and tax behavior to the resulting invoice line items. When not set, the applicable default is used: the billing profile default tax configuration, then the organization default tax code.');
10362
+ export const taxConfigWire = z
10363
+ .strictObject({
10364
+ behavior: taxBehaviorWire.optional(),
10365
+ stripe: taxConfigStripeWire.optional(),
10366
+ external_invoicing: taxConfigExternalInvoicingWire.optional(),
10367
+ tax_code_id: ulidWire.optional(),
10368
+ tax_code: taxCodeReferenceWire.optional(),
10369
+ })
10370
+ .describe('Set of provider specific tax configs.');
10371
+ export const organizationDefaultTaxCodesWire = z
10372
+ .strictObject({
10373
+ invoicing_tax_code: taxCodeReferenceWire,
10374
+ credit_grant_tax_code: taxCodeReferenceWire,
10375
+ created_at: dateTimeWire,
10376
+ updated_at: dateTimeWire,
10377
+ })
10378
+ .describe('Organization-level default tax code references. Stores the default tax codes applied to specific billing contexts for this organization. Provisioned automatically when the organization is created.');
10379
+ export const updateOrganizationDefaultTaxCodesRequestWire = z
10380
+ .strictObject({
10381
+ invoicing_tax_code: taxCodeReferenceWire.optional(),
10382
+ credit_grant_tax_code: taxCodeReferenceWire.optional(),
10383
+ })
10384
+ .describe('OrganizationDefaultTaxCodes update request.');
10384
10385
  export const invoiceWorkflowAppsReferencesWire = z
10385
10386
  .strictObject({
10386
10387
  tax: appReferenceWire,
@@ -11590,6 +11591,20 @@ export const createCreditGrantPurchaseWire = z
11590
11591
  availability_policy: creditAvailabilityPolicyWire.optional(),
11591
11592
  })
11592
11593
  .describe('Purchase and payment terms of the grant.');
11594
+ export const creditBalancesWire = z
11595
+ .strictObject({
11596
+ retrieved_at: dateTimeWire,
11597
+ balances: z
11598
+ .array(creditBalanceWire)
11599
+ .describe('The balances by currencies.'),
11600
+ })
11601
+ .describe('The balances of the credits of a customer.');
11602
+ export const creditTransactionPaginatedResponseWire = z
11603
+ .strictObject({
11604
+ data: z.array(creditTransactionWire),
11605
+ meta: cursorMetaWire,
11606
+ })
11607
+ .describe('Cursor paginated response.');
11593
11608
  export const creditGrantPurchaseWire = z
11594
11609
  .strictObject({
11595
11610
  currency: currencyCodeWire,
@@ -11646,20 +11661,6 @@ export const workflowTaxSettingsWire = z
11646
11661
  default_tax_config: taxConfigWire.optional(),
11647
11662
  })
11648
11663
  .describe('Tax settings for a billing workflow.');
11649
- export const creditBalancesWire = z
11650
- .strictObject({
11651
- retrieved_at: dateTimeWire,
11652
- balances: z
11653
- .array(creditBalanceWire)
11654
- .describe('The balances by currencies.'),
11655
- })
11656
- .describe('The balances of the credits of a customer.');
11657
- export const creditTransactionPaginatedResponseWire = z
11658
- .strictObject({
11659
- data: z.array(creditTransactionWire),
11660
- meta: cursorMetaWire,
11661
- })
11662
- .describe('Cursor paginated response.');
11663
11664
  export const planAddonPagePaginatedResponseWire = z
11664
11665
  .strictObject({
11665
11666
  data: z.array(planAddonWire),
@@ -12284,6 +12285,7 @@ export const creditGrantWire = z
12284
12285
  deleted_at: dateTimeWire.optional(),
12285
12286
  funding_method: creditFundingMethodWire,
12286
12287
  currency: billingCurrencyCodeWire,
12288
+ custom_currency: currencyCustomReferenceWire.optional(),
12287
12289
  amount: numericWire,
12288
12290
  purchase: creditGrantPurchaseWire.optional(),
12289
12291
  tax_config: taxCodeConfigWire.optional(),
@@ -983,6 +983,10 @@ export interface CreateChargeCostBasisPinned {
983
983
  export interface CreateResourceReference {
984
984
  id: string;
985
985
  }
986
+ /** CurrencyCustom reference. */
987
+ export interface CurrencyCustomReference {
988
+ id: string;
989
+ }
986
990
  /** Cost basis pinned to a specific cost basis resource of the custom currency. */
987
991
  export interface ChargeCostBasisPinned {
988
992
  /** Discriminator selecting the cost basis mode. */
@@ -1005,10 +1009,6 @@ export interface CreditGrantInvoiceReference {
1005
1009
  id: string;
1006
1010
  };
1007
1011
  }
1008
- /** CurrencyCustom reference. */
1009
- export interface CurrencyCustomReference {
1010
- id: string;
1011
- }
1012
1012
  /** A cost basis pinned to a custom-currency pair for the subscription. */
1013
1013
  export interface SubscriptionCostBasisPin {
1014
1014
  /** The managed custom currency ID. */
@@ -2022,22 +2022,6 @@ export interface CreditGrantPlanFilter {
2022
2022
  /** Omission matches all versions, including future versions. */
2023
2023
  version?: VersionFilter;
2024
2024
  }
2025
- /** Filter options for listing credit grants. */
2026
- export interface ListCreditGrantsParamsFilter {
2027
- /** Filter credit grants by status. */
2028
- status?: 'pending' | 'active' | 'expired' | 'voided';
2029
- /** Filter credit grants by currency. */
2030
- currency?: string;
2031
- /** Filter credit grants by key. */
2032
- key?: StringFieldFilter;
2033
- /**
2034
- * Select grants spendable on any requested feature, including grants without
2035
- * feature restrictions. Keys are case-sensitive. Supports `eq` (or shorthand) and
2036
- * `oeq` with comma-separated keys. Omit to include all features; use
2037
- * `exists=false` for grants without feature restrictions.
2038
- */
2039
- featureKey?: StringFieldFilter;
2040
- }
2041
2025
  /** A validation issue found while processing a billing resource. */
2042
2026
  export interface ValidationIssue {
2043
2027
  /** Machine-readable error code. */
@@ -2571,6 +2555,22 @@ export interface CreditAdjustment {
2571
2555
  description?: string;
2572
2556
  labels?: Labels;
2573
2557
  }
2558
+ /** Filter options for listing credit grants. */
2559
+ export interface ListCreditGrantsParamsFilter {
2560
+ /** Filter credit grants by status. */
2561
+ status?: 'pending' | 'active' | 'expired' | 'voided';
2562
+ /** Filter credit grants by fiat or custom currency code. */
2563
+ currency?: BillingCurrencyCode;
2564
+ /** Filter credit grants by key. */
2565
+ key?: StringFieldFilter;
2566
+ /**
2567
+ * Select grants spendable on any requested feature, including grants without
2568
+ * feature restrictions. Keys are case-sensitive. Supports `eq` (or shorthand) and
2569
+ * `oeq` with comma-separated keys. Omit to include all features; use
2570
+ * `exists=false` for grants without feature restrictions.
2571
+ */
2572
+ featureKey?: StringFieldFilter;
2573
+ }
2574
2574
  /** CreditAdjustment create request. */
2575
2575
  export interface CreateCreditAdjustmentRequest {
2576
2576
  /**
@@ -2912,73 +2912,6 @@ export interface CreateTaxCodeConfig {
2912
2912
  /** Tax code applied to the invoice line item. */
2913
2913
  code?: CreateResourceReference;
2914
2914
  }
2915
- /**
2916
- * Tax configuration for a billable resource.
2917
- *
2918
- * Applies a tax code and tax behavior to the resulting invoice line items. When
2919
- * not set, the applicable default is used: the billing profile default tax
2920
- * configuration, then the organization default tax code.
2921
- */
2922
- export interface TaxCodeConfig {
2923
- /**
2924
- * Tax behavior.
2925
- *
2926
- * This enum is used to specify whether tax is included in the price or excluded
2927
- * from the price. If not specified, the billing profile is used to determine the
2928
- * tax behavior. If not specified in the billing profile, the provider's default
2929
- * behavior is used.
2930
- */
2931
- behavior?: 'inclusive' | 'exclusive';
2932
- /** Tax code applied to the invoice line item. */
2933
- code?: TaxCodeReference;
2934
- }
2935
- /** Set of provider specific tax configs. */
2936
- export interface TaxConfig {
2937
- /**
2938
- * Tax behavior.
2939
- *
2940
- * If not specified the billing profile is used to determine the tax behavior. If
2941
- * not specified in the billing profile, the provider's default behavior is used.
2942
- */
2943
- behavior?: 'inclusive' | 'exclusive';
2944
- /** Stripe tax config. */
2945
- stripe?: TaxConfigStripe;
2946
- /** External invoicing tax config. */
2947
- externalInvoicing?: TaxConfigExternalInvoicing;
2948
- /** Tax code ID. */
2949
- taxCodeId?: string;
2950
- /**
2951
- * Tax code reference.
2952
- *
2953
- * When both `tax_code` and `tax_code_id` are provided, `tax_code` takes
2954
- * precedence. When `stripe.code` is also provided, `tax_code` still wins and
2955
- * `stripe.code` is ignored.
2956
- */
2957
- taxCode?: TaxCodeReference;
2958
- }
2959
- /**
2960
- * Organization-level default tax code references.
2961
- *
2962
- * Stores the default tax codes applied to specific billing contexts for this
2963
- * organization. Provisioned automatically when the organization is created.
2964
- */
2965
- export interface OrganizationDefaultTaxCodes {
2966
- /** Default tax code for invoicing. */
2967
- invoicingTaxCode: TaxCodeReference;
2968
- /** Default tax code for credit grants. */
2969
- creditGrantTaxCode: TaxCodeReference;
2970
- /** Timestamp of creation. */
2971
- createdAt: Date;
2972
- /** Timestamp of last update. */
2973
- updatedAt: Date;
2974
- }
2975
- /** OrganizationDefaultTaxCodes update request. */
2976
- export interface UpdateOrganizationDefaultTaxCodesRequest {
2977
- /** Default tax code for invoicing. */
2978
- invoicingTaxCode?: TaxCodeReference;
2979
- /** Default tax code for credit grants. */
2980
- creditGrantTaxCode?: TaxCodeReference;
2981
- }
2982
2915
  /** The credit balance by currency. */
2983
2916
  export interface CreditBalance {
2984
2917
  currency: BillingCurrencyCode;
@@ -3057,6 +2990,73 @@ export interface CreditTransaction {
3057
2990
  after: string;
3058
2991
  };
3059
2992
  }
2993
+ /**
2994
+ * Tax configuration for a billable resource.
2995
+ *
2996
+ * Applies a tax code and tax behavior to the resulting invoice line items. When
2997
+ * not set, the applicable default is used: the billing profile default tax
2998
+ * configuration, then the organization default tax code.
2999
+ */
3000
+ export interface TaxCodeConfig {
3001
+ /**
3002
+ * Tax behavior.
3003
+ *
3004
+ * This enum is used to specify whether tax is included in the price or excluded
3005
+ * from the price. If not specified, the billing profile is used to determine the
3006
+ * tax behavior. If not specified in the billing profile, the provider's default
3007
+ * behavior is used.
3008
+ */
3009
+ behavior?: 'inclusive' | 'exclusive';
3010
+ /** Tax code applied to the invoice line item. */
3011
+ code?: TaxCodeReference;
3012
+ }
3013
+ /** Set of provider specific tax configs. */
3014
+ export interface TaxConfig {
3015
+ /**
3016
+ * Tax behavior.
3017
+ *
3018
+ * If not specified the billing profile is used to determine the tax behavior. If
3019
+ * not specified in the billing profile, the provider's default behavior is used.
3020
+ */
3021
+ behavior?: 'inclusive' | 'exclusive';
3022
+ /** Stripe tax config. */
3023
+ stripe?: TaxConfigStripe;
3024
+ /** External invoicing tax config. */
3025
+ externalInvoicing?: TaxConfigExternalInvoicing;
3026
+ /** Tax code ID. */
3027
+ taxCodeId?: string;
3028
+ /**
3029
+ * Tax code reference.
3030
+ *
3031
+ * When both `tax_code` and `tax_code_id` are provided, `tax_code` takes
3032
+ * precedence. When `stripe.code` is also provided, `tax_code` still wins and
3033
+ * `stripe.code` is ignored.
3034
+ */
3035
+ taxCode?: TaxCodeReference;
3036
+ }
3037
+ /**
3038
+ * Organization-level default tax code references.
3039
+ *
3040
+ * Stores the default tax codes applied to specific billing contexts for this
3041
+ * organization. Provisioned automatically when the organization is created.
3042
+ */
3043
+ export interface OrganizationDefaultTaxCodes {
3044
+ /** Default tax code for invoicing. */
3045
+ invoicingTaxCode: TaxCodeReference;
3046
+ /** Default tax code for credit grants. */
3047
+ creditGrantTaxCode: TaxCodeReference;
3048
+ /** Timestamp of creation. */
3049
+ createdAt: Date;
3050
+ /** Timestamp of last update. */
3051
+ updatedAt: Date;
3052
+ }
3053
+ /** OrganizationDefaultTaxCodes update request. */
3054
+ export interface UpdateOrganizationDefaultTaxCodesRequest {
3055
+ /** Default tax code for invoicing. */
3056
+ invoicingTaxCode?: TaxCodeReference;
3057
+ /** Default tax code for credit grants. */
3058
+ creditGrantTaxCode?: TaxCodeReference;
3059
+ }
3060
3060
  /**
3061
3061
  * BillingInvoiceWorkflowAppsReferences represents the references (id) to the apps
3062
3062
  * used by a billing profile
@@ -4714,6 +4714,18 @@ export interface CreateCreditGrantPurchase {
4714
4714
  */
4715
4715
  availabilityPolicy: 'on_creation';
4716
4716
  }
4717
+ /** The balances of the credits of a customer. */
4718
+ export interface CreditBalances {
4719
+ /** The timestamp of the balance retrieval. */
4720
+ retrievedAt: Date;
4721
+ /** The balances by currencies. */
4722
+ balances: CreditBalance[];
4723
+ }
4724
+ /** Cursor paginated response. */
4725
+ export interface CreditTransactionPaginatedResponse {
4726
+ data: CreditTransaction[];
4727
+ meta: CursorMeta;
4728
+ }
4717
4729
  /** Purchase and payment terms of the grant. */
4718
4730
  export interface CreditGrantPurchase {
4719
4731
  /**
@@ -4829,18 +4841,6 @@ export interface WorkflowTaxSettings {
4829
4841
  */
4830
4842
  defaultTaxConfig?: TaxConfig;
4831
4843
  }
4832
- /** The balances of the credits of a customer. */
4833
- export interface CreditBalances {
4834
- /** The timestamp of the balance retrieval. */
4835
- retrievedAt: Date;
4836
- /** The balances by currencies. */
4837
- balances: CreditBalance[];
4838
- }
4839
- /** Cursor paginated response. */
4840
- export interface CreditTransactionPaginatedResponse {
4841
- data: CreditTransaction[];
4842
- meta: CursorMeta;
4843
- }
4844
4844
  /** Page paginated response. */
4845
4845
  export interface PlanAddonPagePaginatedResponse {
4846
4846
  data: PlanAddon[];
@@ -5694,6 +5694,8 @@ export interface CreditGrant {
5694
5694
  * fiat currency.
5695
5695
  */
5696
5696
  currency: BillingCurrencyCode;
5697
+ /** Managed currency reference. Present only for custom currencies. */
5698
+ customCurrency?: CurrencyCustomReference;
5697
5699
  /** Granted credit amount. */
5698
5700
  amount: string;
5699
5701
  /** Present when a funding workflow applies (funding_method is not `none`). */
@@ -9018,6 +9020,8 @@ export interface CreditGrantInput {
9018
9020
  * fiat currency.
9019
9021
  */
9020
9022
  currency: BillingCurrencyCode;
9023
+ /** Managed currency reference. Present only for custom currencies. */
9024
+ customCurrency?: CurrencyCustomReference;
9021
9025
  /** Granted credit amount. */
9022
9026
  amount: string;
9023
9027
  /** Present when a funding workflow applies (funding_method is not `none`). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmeter/client",
3
- "version": "1.0.0-beta-cba0a6656233",
3
+ "version": "1.0.0-beta-02013cc147e9",
4
4
  "description": "Official TypeScript SDK for the OpenMeter API — usage metering and billing",
5
5
  "keywords": [
6
6
  "openmeter",