@openmeter/client 1.0.0-beta.233 → 1.0.0-beta.235
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +125 -111
- package/dist/funcs/customers.d.ts +112 -1
- package/dist/funcs/customers.js +430 -0
- package/dist/funcs/entitlements.d.ts +38 -1
- package/dist/funcs/entitlements.js +169 -6
- package/dist/funcs/grants.d.ts +24 -0
- package/dist/funcs/grants.js +78 -0
- package/dist/funcs/index.d.ts +2 -0
- package/dist/funcs/index.js +2 -0
- package/dist/funcs/notifications.d.ts +43 -0
- package/dist/funcs/notifications.js +163 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +6 -0
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/customers.d.ts +109 -1
- package/dist/models/operations/entitlements.d.ts +59 -4
- package/dist/models/operations/grants.d.ts +43 -0
- package/dist/models/operations/grants.js +2 -0
- package/dist/models/operations/notifications.d.ts +46 -0
- package/dist/models/operations/notifications.js +2 -0
- package/dist/models/schemas.d.ts +6556 -2713
- package/dist/models/schemas.js +1802 -365
- package/dist/models/types.d.ts +1177 -228
- package/dist/sdk/apps.d.ts +70 -1
- package/dist/sdk/apps.js +86 -1
- package/dist/sdk/charges.d.ts +32 -0
- package/dist/sdk/charges.js +38 -0
- package/dist/sdk/currencies.d.ts +71 -0
- package/dist/sdk/currencies.js +87 -0
- package/dist/sdk/customers.d.ts +205 -2
- package/dist/sdk/customers.js +246 -1
- package/dist/sdk/entitlementAccess.d.ts +22 -0
- package/dist/sdk/entitlementAccess.js +26 -0
- package/dist/sdk/entitlements.d.ts +51 -1
- package/dist/sdk/entitlements.js +61 -1
- package/dist/sdk/grants.d.ts +43 -0
- package/dist/sdk/grants.js +51 -0
- package/dist/sdk/internal.d.ts +5 -458
- package/dist/sdk/internal.js +6 -569
- package/dist/sdk/notifications.d.ts +58 -0
- package/dist/sdk/notifications.js +72 -0
- package/dist/sdk/planAddons.d.ts +20 -1
- package/dist/sdk/planAddons.js +24 -1
- package/dist/sdk/sdk.d.ts +18 -0
- package/dist/sdk/sdk.js +30 -0
- package/dist/sdk/subscriptions.d.ts +39 -9
- package/dist/sdk/subscriptions.js +45 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,25 +24,24 @@ TypeSpec definitions and ships fully-typed request and response models.
|
|
|
24
24
|
- [Meters](#meters)
|
|
25
25
|
- [Customers](#customers)
|
|
26
26
|
- [Entitlements](#entitlements)
|
|
27
|
+
- [Grants](#grants)
|
|
27
28
|
- [Subscriptions](#subscriptions)
|
|
28
29
|
- [Apps](#apps)
|
|
29
30
|
- [Billing](#billing)
|
|
31
|
+
- [Invoices](#invoices)
|
|
32
|
+
- [Charges](#charges)
|
|
30
33
|
- [Tax](#tax)
|
|
34
|
+
- [Currencies](#currencies)
|
|
31
35
|
- [Features](#features)
|
|
32
36
|
- [LLMCost](#llmcost)
|
|
33
37
|
- [Plans](#plans)
|
|
34
38
|
- [Addons](#addons)
|
|
35
39
|
- [PlanAddons](#planaddons)
|
|
36
40
|
- [Defaults](#defaults)
|
|
41
|
+
- [EntitlementAccess](#entitlementaccess)
|
|
42
|
+
- [Notifications](#notifications)
|
|
37
43
|
- [Internal Operations](#internal-operations)
|
|
38
|
-
- [Internal Customers](#internal-customers)
|
|
39
44
|
- [Internal Subscriptions](#internal-subscriptions)
|
|
40
|
-
- [Internal Apps](#internal-apps)
|
|
41
|
-
- [Internal Invoices](#internal-invoices)
|
|
42
|
-
- [Internal Charges](#internal-charges)
|
|
43
|
-
- [Internal Currencies](#internal-currencies)
|
|
44
|
-
- [Internal PlanAddons](#internal-planaddons)
|
|
45
|
-
- [Internal EntitlementAccess](#internal-entitlementaccess)
|
|
46
45
|
- [Runtime Validation (validate option)](#runtime-validation-validate-option)
|
|
47
46
|
- [Zod Schemas (./zod export)](#zod-schemas-zod-export)
|
|
48
47
|
- [Error Handling](#error-handling)
|
|
@@ -283,53 +282,84 @@ The full call path, HTTP route, and a short description are listed below.
|
|
|
283
282
|
|
|
284
283
|
### Customers
|
|
285
284
|
|
|
286
|
-
| Method | HTTP | Description
|
|
287
|
-
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
288
|
-
| `client.customers.create` | `POST /openmeter/customers` | Create customer
|
|
289
|
-
| `client.customers.get` | `GET /openmeter/customers/{customerId}` | Get customer
|
|
290
|
-
| `client.customers.list` | `GET /openmeter/customers` | List customers
|
|
291
|
-
| `client.customers.upsert` | `PUT /openmeter/customers/{customerId}` | Upsert customer
|
|
292
|
-
| `client.customers.delete` | `DELETE /openmeter/customers/{customerId}` | Delete customer
|
|
293
|
-
| `client.customers.billing.get` | `GET /openmeter/customers/{customerId}/billing` | Get customer billing data
|
|
294
|
-
| `client.customers.billing.update` | `PUT /openmeter/customers/{customerId}/billing` | Update customer billing data
|
|
295
|
-
| `client.customers.billing.updateAppData` | `PUT /openmeter/customers/{customerId}/billing/app-data` | Update customer billing app data
|
|
296
|
-
| `client.customers.billing.createStripeCheckoutSession` | `POST /openmeter/customers/{customerId}/billing/stripe/checkout-sessions` | Create a [Stripe Checkout Session](https://docs.stripe.com/payments/checkout) for the customer. Creates a Checkout Session for collecting payment method information from customers. The session operates in "setup" mode, which collects payment details without charging the customer immediately. The collected payment method can be used for future subscription billing. For hosted checkout sessions, redirect customers to the returned URL. For embedded sessions, use the client_secret to initialize Stripe.js in your application.
|
|
297
|
-
| `client.customers.billing.createStripePortalSession` | `POST /openmeter/customers/{customerId}/billing/stripe/portal-sessions` | Create Stripe Customer Portal Session. Useful to redirect the customer to the Stripe Customer Portal to manage their payment methods, change their billing address and access their invoice history. Only returns URL if the customer billing profile is linked to a stripe app and customer.
|
|
298
|
-
| `client.customers.
|
|
299
|
-
| `client.customers.
|
|
300
|
-
| `client.customers.
|
|
301
|
-
| `client.customers.
|
|
302
|
-
| `client.customers.
|
|
303
|
-
| `client.customers.
|
|
304
|
-
| `client.customers.
|
|
285
|
+
| Method | HTTP | Description |
|
|
286
|
+
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
287
|
+
| `client.customers.create` | `POST /openmeter/customers` | Create customer |
|
|
288
|
+
| `client.customers.get` | `GET /openmeter/customers/{customerId}` | Get customer |
|
|
289
|
+
| `client.customers.list` | `GET /openmeter/customers` | List customers |
|
|
290
|
+
| `client.customers.upsert` | `PUT /openmeter/customers/{customerId}` | Upsert customer |
|
|
291
|
+
| `client.customers.delete` | `DELETE /openmeter/customers/{customerId}` | Delete customer |
|
|
292
|
+
| `client.customers.billing.get` | `GET /openmeter/customers/{customerId}/billing` | Get customer billing data |
|
|
293
|
+
| `client.customers.billing.update` | `PUT /openmeter/customers/{customerId}/billing` | Update customer billing data |
|
|
294
|
+
| `client.customers.billing.updateAppData` | `PUT /openmeter/customers/{customerId}/billing/app-data` | Update customer billing app data |
|
|
295
|
+
| `client.customers.billing.createStripeCheckoutSession` | `POST /openmeter/customers/{customerId}/billing/stripe/checkout-sessions` | Create a [Stripe Checkout Session](https://docs.stripe.com/payments/checkout) for the customer. Creates a Checkout Session for collecting payment method information from customers. The session operates in "setup" mode, which collects payment details without charging the customer immediately. The collected payment method can be used for future subscription billing. For hosted checkout sessions, redirect customers to the returned URL. For embedded sessions, use the client_secret to initialize Stripe.js in your application. |
|
|
296
|
+
| `client.customers.billing.createStripePortalSession` | `POST /openmeter/customers/{customerId}/billing/stripe/portal-sessions` | Create Stripe Customer Portal Session. Useful to redirect the customer to the Stripe Customer Portal to manage their payment methods, change their billing address and access their invoice history. Only returns URL if the customer billing profile is linked to a stripe app and customer. |
|
|
297
|
+
| `client.customers.entitlements.create` | `POST /openmeter/customers/{customerId}/entitlements` | Create an entitlement for the customer. A customer can have only one active entitlement per feature. The feature must be compatible with the entitlement type. Entitlements cannot be modified after creation, only deleted. |
|
|
298
|
+
| `client.customers.entitlements.override` | `PUT /openmeter/customers/{customerId}/entitlements/{entitlementId}/override` | Override an entitlement of the customer with a new one. The referenced entitlement ends and the new one starts at the same instant, so access continues without a gap. Both must belong to the same feature. Use this for upgrades and downgrades. Fails if the referenced entitlement does not exist, is deleted, or is no longer active. |
|
|
299
|
+
| `client.customers.entitlements.getHistory` | `GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history` | Get the balance and usage history of a metered entitlement. The queried range may span multiple usage periods. `windowed_history` groups usage into windows of the requested size and reports the balance at the start of each window. `burndown_history` lists the periods in which grants were consumed in a fixed order, together with the usage taken from each grant. |
|
|
300
|
+
| `client.customers.entitlements.get` | `GET /openmeter/customers/{customerId}/entitlements/{entitlementId}` | Get an entitlement of the customer by ID. For checking entitlement access, use the entitlement access endpoints instead. |
|
|
301
|
+
| `client.customers.entitlements.list` | `GET /openmeter/customers/{customerId}/entitlements` | List the entitlements of the customer that are active at the time of the request. For checking entitlement access, use the entitlement access endpoints instead. |
|
|
302
|
+
| `client.customers.entitlements.resetUsage` | `POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/reset` | Reset the usage of a metered entitlement. The reset starts a new usage period: usage is zeroed and grants roll over according to their rollover settings. Usage is reset automatically at the end of each usage period. Use this operation to reset it earlier, for example to align the entitlement with the customer's billing period. The usage period anchor can be moved at the same time. |
|
|
303
|
+
| `client.customers.entitlements.delete` | `DELETE /openmeter/customers/{customerId}/entitlements/{entitlementId}` | Deletes the entitlement and revokes access to its feature. A customer can hold only one active entitlement per feature, so migrating a feature requires deleting the previous entitlement first. Deletion sets the `deleted_at` timestamp instead of removing history. Access and status queries for earlier points in time still treat the entitlement as active, so access changes are never retroactive. |
|
|
304
|
+
| `client.customers.entitlements.grants.create` | `POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants` | Issue a grant for a metered entitlement of the customer. Boolean and static entitlements cannot have grants, so the request is rejected for them. Grants are immutable. The amount is added to the balance from `effective_at`, which cannot be earlier than the start of the current usage period. |
|
|
305
|
+
| `client.customers.entitlements.grants.list` | `GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants` | List the grants issued for an entitlement of the customer. Grants only exist for metered entitlements, so the list is empty for boolean and static entitlements. Deleted grants are excluded unless `include_deleted` is set. Voided and expired grants are always included, as they are part of the balance history. |
|
|
306
|
+
| `client.customers.credits.grants.create` | `POST /openmeter/customers/{customerId}/credits/grants` | Create a new credit grant. A credit grant represents an allocation of prepaid credits to a customer. |
|
|
307
|
+
| `client.customers.credits.grants.get` | `GET /openmeter/customers/{customerId}/credits/grants/{creditGrantId}` | Get a credit grant. |
|
|
308
|
+
| `client.customers.credits.grants.list` | `GET /openmeter/customers/{customerId}/credits/grants` | List credit grants. |
|
|
309
|
+
| `client.customers.credits.balance.get` | `GET /openmeter/customers/{customerId}/credits/balance` | Get a credit balance. |
|
|
310
|
+
| `client.customers.credits.adjustments.create` | `POST /openmeter/customers/{customerId}/credits/adjustments` | A credit adjustment can be used to make manual adjustments to a customer's credit balance. Supported use-cases: - Usage correction |
|
|
311
|
+
| `client.customers.credits.grants.void` | `POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void` | Void a credit grant, forfeiting the remaining unused balance. Voiding is a forward-looking, irreversible operation. Credits already consumed by usage remain unaffected — only the remaining balance is forfeited. The grant reads as `voided` status afterwards. Payment state is not adjusted when `payment_adjustment` is `none`, so invoice-backed or externally collected payments may still collect the original amount. Only `active` grants can be voided; voiding a pending, expired, or fully consumed grant returns a conflict. Retrying a successful void is an idempotent success. |
|
|
312
|
+
| `client.customers.credits.grants.updateExternalSettlement` | `POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/settlement/external` | Update the payment settlement status of an externally funded credit grant. Use this endpoint to synchronize the payment state of an external payment with the system so that revenue recognition and credit availability work as expected. |
|
|
313
|
+
| `client.customers.credits.transactions.list` | `GET /openmeter/customers/{customerId}/credits/transactions` | List credit transactions for a customer. Returns an immutable, chronological record of credit movements: funded credits and consumed credits. Transactions are returned in reverse chronological order by default. |
|
|
314
|
+
| `client.customers.charges.list` | `GET /openmeter/customers/{customerId}/charges` | List customer charges. Returns the customer's charges that are represented as either flat fee or usage-based charges. |
|
|
315
|
+
| `client.customers.charges.create` | `POST /openmeter/customers/{customerId}/charges` | Create customer charge. |
|
|
305
316
|
|
|
306
317
|
### Entitlements
|
|
307
318
|
|
|
308
|
-
| Method
|
|
309
|
-
|
|
|
310
|
-
| `client.entitlements.listCustomerAccess`
|
|
311
|
-
| `client.entitlements.getCustomerAccess`
|
|
319
|
+
| Method | HTTP | Description |
|
|
320
|
+
| -------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
321
|
+
| `client.entitlements.listCustomerAccess` | `GET /openmeter/customers/{customerId}/entitlement-access` | List customer entitlement access |
|
|
322
|
+
| `client.entitlements.getCustomerAccess` | `GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}` | Get the customer's access to a single feature. |
|
|
323
|
+
| `client.entitlements.getCustomerValueByFeatureKey` | `GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}/value` | Get the customer's entitlement value for a feature at a point in time. Without an active entitlement, the result denies access and omits the type. |
|
|
324
|
+
| `client.entitlements.list` | `GET /openmeter/entitlements` | List the active entitlements of all customers. Intended for administrative use. To list the entitlements of a single customer, use the customer entitlements endpoints; to check entitlement access, use the entitlement access endpoints. |
|
|
325
|
+
| `client.entitlements.get` | `GET /openmeter/entitlements/{entitlementId}` | Get an entitlement by ID. To check entitlement access, use the entitlement access endpoints instead. |
|
|
326
|
+
| `client.entitlements.getCustomerValue` | `GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/value` | Get the customer's access through a single entitlement, optionally evaluated at a point in time. |
|
|
327
|
+
|
|
328
|
+
### Grants
|
|
329
|
+
|
|
330
|
+
| Method | HTTP | Description |
|
|
331
|
+
| -------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
332
|
+
| `client.grants.list` | `GET /openmeter/grants` | List the grants of all customers and entitlements. To list the grants of a single entitlement, use the customer entitlement grants endpoint. Deleted grants are excluded unless `include_deleted` is set. Voided and expired grants are always included, as they are part of the balance history. |
|
|
333
|
+
| `client.grants.void` | `DELETE /openmeter/grants/{grantId}` | Void a grant so it no longer adds to the balance. Usage already deducted from the grant is kept. |
|
|
312
334
|
|
|
313
335
|
### Subscriptions
|
|
314
336
|
|
|
315
|
-
| Method | HTTP | Description
|
|
316
|
-
| -------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
317
|
-
| `client.subscriptions.create` | `POST /openmeter/subscriptions` | Create subscription
|
|
318
|
-
| `client.subscriptions.list` | `GET /openmeter/subscriptions` | List subscriptions
|
|
319
|
-
| `client.subscriptions.get` | `GET /openmeter/subscriptions/{subscriptionId}` | Get subscription
|
|
320
|
-
| `client.subscriptions.cancel` | `POST /openmeter/subscriptions/{subscriptionId}/cancel` | Cancels the subscription. Will result in a scheduling conflict if there are other subscriptions scheduled to start after the cancelation time.
|
|
321
|
-
| `client.subscriptions.unscheduleCancelation` | `POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation` | Unschedules the subscription cancelation.
|
|
322
|
-
| `client.subscriptions.
|
|
323
|
-
| `client.subscriptions.
|
|
324
|
-
| `client.subscriptions.
|
|
325
|
-
| `client.subscriptions.
|
|
326
|
-
| `client.subscriptions.
|
|
337
|
+
| Method | HTTP | Description |
|
|
338
|
+
| -------------------------------------------- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
339
|
+
| `client.subscriptions.create` | `POST /openmeter/subscriptions` | Create subscription |
|
|
340
|
+
| `client.subscriptions.list` | `GET /openmeter/subscriptions` | List subscriptions |
|
|
341
|
+
| `client.subscriptions.get` | `GET /openmeter/subscriptions/{subscriptionId}` | Get subscription |
|
|
342
|
+
| `client.subscriptions.cancel` | `POST /openmeter/subscriptions/{subscriptionId}/cancel` | Cancels the subscription. Will result in a scheduling conflict if there are other subscriptions scheduled to start after the cancelation time. |
|
|
343
|
+
| `client.subscriptions.unscheduleCancelation` | `POST /openmeter/subscriptions/{subscriptionId}/unschedule-cancelation` | Unschedules the subscription cancelation. |
|
|
344
|
+
| `client.subscriptions.unschedule` | `POST /openmeter/subscriptions/{subscriptionId}/unschedule` | Deletes a scheduled subscription that has not yet become active, removing it and resolving any scheduling conflict it was holding. This is distinct from canceling: cancel ends a running subscription, whereas unscheduling removes a not-yet-active one. Only scheduled subscriptions can be unscheduled; unscheduling an active or already-started subscription is rejected. |
|
|
345
|
+
| `client.subscriptions.restore` | `POST /openmeter/subscriptions/{subscriptionId}/restore` | Restores the subscription by deleting any later-scheduled successor subscriptions and continuing this one indefinitely. This is the inverse of a future-dated change, which schedules a successor. Restore is not available when multi-subscription is enabled. |
|
|
346
|
+
| `client.subscriptions.change` | `POST /openmeter/subscriptions/{subscriptionId}/change` | Closes a running subscription and starts a new one according to the specification. Can be used for upgrades, downgrades, and plan changes. |
|
|
347
|
+
| `client.subscriptions.migrate` | `POST /openmeter/subscriptions/{subscriptionId}/migrate` | Migrates to a later version of the current plan. With starting_phase omitted and billing_anchor omitted or unchanged, migration amends the subscription in place: unchanged items retain their service periods and both response entries have the same ID. Existing addons must remain compatible with the target plan. Incompatible phase timelines or billing settings return an error. Providing starting_phase or a different billing_anchor explicitly requests replacement, which resets the phase timeline, may produce billing adjustments, and does not transfer addons. Custom subscriptions cannot be migrated. |
|
|
348
|
+
| `client.subscriptions.edit` | `POST /openmeter/subscriptions/{subscriptionId}/edit` | Edits a running subscription by applying an ordered batch of customizations (adding or removing items, adding, removing, or stretching phases, or unscheduling a pending edit). The changes may take effect immediately or at the next billing cycle. Subscriptions that have add-ons cannot be edited. |
|
|
349
|
+
| `client.subscriptions.listAddons` | `GET /openmeter/subscriptions/{subscriptionId}/addons` | List the add-ons of a subscription. |
|
|
350
|
+
| `client.subscriptions.getAddon` | `GET /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}` | Get an add-on association for a subscription. |
|
|
327
351
|
|
|
328
352
|
### Apps
|
|
329
353
|
|
|
330
|
-
| Method
|
|
331
|
-
|
|
|
332
|
-
| `client.apps.
|
|
354
|
+
| Method | HTTP | Description |
|
|
355
|
+
| ---------------------------- | -------------------------------------- | -------------------------------- |
|
|
356
|
+
| `client.apps.list` | `GET /openmeter/apps` | List installed apps. |
|
|
357
|
+
| `client.apps.get` | `GET /openmeter/apps/{appId}` | Get an installed app. |
|
|
358
|
+
| `client.apps.uninstall` | `DELETE /openmeter/apps/{appId}` | Uninstall an app by ID. |
|
|
359
|
+
| `client.apps.update` | `PUT /openmeter/apps/{appId}` | Update an installed app. |
|
|
360
|
+
| `client.apps.listCatalog` | `GET /openmeter/app-catalog` | List available apps. |
|
|
361
|
+
| `client.apps.getCatalogItem` | `GET /openmeter/app-catalog/{appType}` | Get an app catalog item by type. |
|
|
362
|
+
| `client.apps.install` | `POST /openmeter/app-catalog/install` | Install an app from the catalog. |
|
|
333
363
|
|
|
334
364
|
### Billing
|
|
335
365
|
|
|
@@ -341,6 +371,25 @@ The full call path, HTTP route, and a short description are listed below.
|
|
|
341
371
|
| `client.billing.updateProfile` | `PUT /openmeter/profiles/{id}` | Update a billing profile. |
|
|
342
372
|
| `client.billing.deleteProfile` | `DELETE /openmeter/profiles/{id}` | Delete a billing profile. Only such billing profiles can be deleted that are: - not the default profile - not pinned to any customer using customer overrides - only have finalized invoices |
|
|
343
373
|
|
|
374
|
+
### Invoices
|
|
375
|
+
|
|
376
|
+
| Method | HTTP | Description |
|
|
377
|
+
| ------------------------------------ | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
378
|
+
| `client.invoices.list` | `GET /openmeter/billing/invoices` | List billing invoices. Returns a page of invoices. Gathering invoices are never included. Use `filter` to narrow by status, customer, dates, or service period start. Use `sort` to control ordering. |
|
|
379
|
+
| `client.invoices.get` | `GET /openmeter/billing/invoices/{invoiceId}` | Get a billing invoice by ID. Returns the full invoice resource including line items, status details, totals, and workflow configuration snapshot. |
|
|
380
|
+
| `client.invoices.update` | `PUT /openmeter/billing/invoices/{invoiceId}` | Update a billing invoice. Only the mutable fields of the invoice can be edited: description, labels, supplier, customer, workflow settings, and top-level lines. Top-level lines are matched by `id`; lines without an `id` are created, and existing lines omitted from `lines` are deleted. Detailed (child) lines are always computed and cannot be edited directly. Only invoices in draft status can be updated. |
|
|
381
|
+
| `client.invoices.delete` | `DELETE /openmeter/billing/invoices/{invoiceId}` | Delete a billing invoice. Only standard invoices in draft status can be deleted. Deleting an invoice will also delete all associated line items and workflow configuration. |
|
|
382
|
+
| `client.invoices.advance` | `POST /openmeter/billing/invoices/{invoiceId}/advance` | Advance a billing invoice. Advances the invoice to the next workflow state. The next state is determined by the invoice's current status and workflow configuration. Only invoices in draft or issued status can be advanced. |
|
|
383
|
+
| `client.invoices.approve` | `POST /openmeter/billing/invoices/{invoiceId}/approve` | Approve a billing invoice. This call instantly sends the invoice to the customer using the configured billing profile app. This call is valid in two invoice statuses: - draft: the invoice will be sent to the customer, the invoice state becomes issued - manual_approval_needed: the invoice will be sent to the customer, the invoice state becomes issued |
|
|
384
|
+
| `client.invoices.retry` | `POST /openmeter/billing/invoices/{invoiceId}/retry` | Retry sending a billing invoice. Retry advancing the invoice after a failed attempt. The action can be called when the invoice's statusDetails' actions field contain the "retry" action. |
|
|
385
|
+
| `client.invoices.snapshotQuantities` | `POST /openmeter/billing/invoices/{invoiceId}/snapshot-quantities` | Snapshot quantities for usage-based line items. This call will snapshot the quantities for all usage based line items in the invoice. This call is only valid in draft.waiting_for_collection status, where the collection period can be skipped using this action. |
|
|
386
|
+
|
|
387
|
+
### Charges
|
|
388
|
+
|
|
389
|
+
| Method | HTTP | Description |
|
|
390
|
+
| --------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------- |
|
|
391
|
+
| `client.charges.list` | `GET /openmeter/charges` | List charges. Returns the charges of every customer that are represented as either flat fee or usage-based charges. |
|
|
392
|
+
|
|
344
393
|
### Tax
|
|
345
394
|
|
|
346
395
|
| Method | HTTP | Description |
|
|
@@ -351,6 +400,16 @@ The full call path, HTTP route, and a short description are listed below.
|
|
|
351
400
|
| `client.tax.upsertCode` | `PUT /openmeter/tax-codes/{taxCodeId}` | Upsert tax code |
|
|
352
401
|
| `client.tax.deleteCode` | `DELETE /openmeter/tax-codes/{taxCodeId}` | Delete tax code |
|
|
353
402
|
|
|
403
|
+
### Currencies
|
|
404
|
+
|
|
405
|
+
| Method | HTTP | Description |
|
|
406
|
+
| ---------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
407
|
+
| `client.currencies.list` | `GET /openmeter/currencies` | List currencies supported by the billing system. |
|
|
408
|
+
| `client.currencies.createCustomCurrency` | `POST /openmeter/currencies/custom` | Create a custom currency. This operation allows defining your own custom currency for billing purposes. |
|
|
409
|
+
| `client.currencies.getCustomCurrency` | `GET /openmeter/currencies/custom/{currencyId}` | Get a custom currency. |
|
|
410
|
+
| `client.currencies.listCostBases` | `GET /openmeter/currencies/custom/{currencyId}/cost-bases` | List cost bases for a currency. For custom currencies, there can be multiple cost bases with different `effective_from` dates. |
|
|
411
|
+
| `client.currencies.createCostBasis` | `POST /openmeter/currencies/custom/{currencyId}/cost-bases` | Create a cost basis for a currency. |
|
|
412
|
+
|
|
354
413
|
### Features
|
|
355
414
|
|
|
356
415
|
| Method | HTTP | Description |
|
|
@@ -400,6 +459,7 @@ The full call path, HTTP route, and a short description are listed below.
|
|
|
400
459
|
|
|
401
460
|
| Method | HTTP | Description |
|
|
402
461
|
| -------------------------- | ------------------------------------------------------- | ---------------------------------------- |
|
|
462
|
+
| `client.planAddons.list` | `GET /openmeter/plans/{planId}/addons` | List add-ons associated with a plan. |
|
|
403
463
|
| `client.planAddons.create` | `POST /openmeter/plans/{planId}/addons` | Add an add-on to a plan. |
|
|
404
464
|
| `client.planAddons.get` | `GET /openmeter/plans/{planId}/addons/{planAddonId}` | Get an add-on association for a plan. |
|
|
405
465
|
| `client.planAddons.update` | `PUT /openmeter/plans/{planId}/addons/{planAddonId}` | Update an add-on association for a plan. |
|
|
@@ -412,6 +472,22 @@ The full call path, HTTP route, and a short description are listed below.
|
|
|
412
472
|
| `client.defaults.getOrganizationTaxCodes` | `GET /openmeter/defaults/tax-codes` | Get organization default tax codes |
|
|
413
473
|
| `client.defaults.updateOrganizationTaxCodes` | `PUT /openmeter/defaults/tax-codes` | Update organization default tax codes |
|
|
414
474
|
|
|
475
|
+
### EntitlementAccess
|
|
476
|
+
|
|
477
|
+
| Method | HTTP | Description |
|
|
478
|
+
| -------------------------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
479
|
+
| `client.entitlementAccess.query` | `POST /openmeter/entitlement-access/query` | Query feature access for a list of customers. The endpoint resolves each provided identifier to a customer and returns the access status for the requested features, plus optional credit balance availability. _Designed to be called on a fixed refresh interval and the query response is intended to be cached._ |
|
|
480
|
+
|
|
481
|
+
### Notifications
|
|
482
|
+
|
|
483
|
+
| Method | HTTP | Description |
|
|
484
|
+
| ------------------------------------ | ----------------------------------------------------------------- | ------------------------------------ |
|
|
485
|
+
| `client.notifications.listChannels` | `GET /openmeter/notification/channels` | List all notification channels. |
|
|
486
|
+
| `client.notifications.createChannel` | `POST /openmeter/notification/channels` | Create a notification channel. |
|
|
487
|
+
| `client.notifications.getChannel` | `GET /openmeter/notification/channels/{notificationChannelId}` | Get a notification channel by id. |
|
|
488
|
+
| `client.notifications.updateChannel` | `PUT /openmeter/notification/channels/{notificationChannelId}` | Update a notification channel by id. |
|
|
489
|
+
| `client.notifications.deleteChannel` | `DELETE /openmeter/notification/channels/{notificationChannelId}` | Delete a notification channel by id. |
|
|
490
|
+
|
|
415
491
|
## Internal Operations
|
|
416
492
|
|
|
417
493
|
Operations marked internal in the API definition are exposed under
|
|
@@ -419,74 +495,12 @@ Operations marked internal in the API definition are exposed under
|
|
|
419
495
|
intended for customer use: they may require additional permissions, and
|
|
420
496
|
they can change or be removed without notice or semver consideration.
|
|
421
497
|
|
|
422
|
-
### Internal Customers
|
|
423
|
-
|
|
424
|
-
| Method | HTTP | Description |
|
|
425
|
-
| ----------------------------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
426
|
-
| `client.internal.customers.credits.grants.void` | `POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void` | Void a credit grant, forfeiting the remaining unused balance. Voiding is a forward-looking, irreversible operation. Credits already consumed by usage remain unaffected — only the remaining balance is forfeited. The grant reads as `voided` status afterwards. Payment state is not adjusted when `payment_adjustment` is `none`, so invoice-backed or externally collected payments may still collect the original amount. Only `active` grants can be voided; voiding a pending, expired, or fully consumed grant returns a conflict. Retrying a successful void is an idempotent success. |
|
|
427
|
-
| `client.internal.customers.charges.list` | `GET /openmeter/customers/{customerId}/charges` | List customer charges. Returns the customer's charges that are represented as either flat fee or usage-based charges. |
|
|
428
|
-
| `client.internal.customers.charges.create` | `POST /openmeter/customers/{customerId}/charges` | Create customer charge. |
|
|
429
|
-
|
|
430
498
|
### Internal Subscriptions
|
|
431
499
|
|
|
432
|
-
| Method | HTTP | Description
|
|
433
|
-
| ------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
434
|
-
| `client.internal.subscriptions.
|
|
435
|
-
| `client.internal.subscriptions.
|
|
436
|
-
| `client.internal.subscriptions.migrate` | `POST /openmeter/subscriptions/{subscriptionId}/migrate` | Migrates to a later version of the current plan. With starting_phase omitted and billing_anchor omitted or unchanged, migration amends the subscription in place: unchanged items retain their service periods and both response entries have the same ID. Existing addons must remain compatible with the target plan. Incompatible phase timelines or billing settings return an error. Providing starting_phase or a different billing_anchor explicitly requests replacement, which resets the phase timeline, may produce billing adjustments, and does not transfer addons. Custom subscriptions cannot be migrated. |
|
|
437
|
-
| `client.internal.subscriptions.updateAddon` | `PATCH /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}` | Update a subscription add-on. Only the quantity is mutable; the timing controls when the new quantity takes effect. A new entry is appended to the add-on's timeline. |
|
|
438
|
-
|
|
439
|
-
### Internal Apps
|
|
440
|
-
|
|
441
|
-
| Method | HTTP | Description |
|
|
442
|
-
| ------------------------------------- | -------------------------------------- | -------------------------------- |
|
|
443
|
-
| `client.internal.apps.list` | `GET /openmeter/apps` | List installed apps. |
|
|
444
|
-
| `client.internal.apps.uninstall` | `DELETE /openmeter/apps/{appId}` | Uninstall an app by ID. |
|
|
445
|
-
| `client.internal.apps.update` | `PUT /openmeter/apps/{appId}` | Update an installed app. |
|
|
446
|
-
| `client.internal.apps.listCatalog` | `GET /openmeter/app-catalog` | List available apps. |
|
|
447
|
-
| `client.internal.apps.getCatalogItem` | `GET /openmeter/app-catalog/{appType}` | Get an app catalog item by type. |
|
|
448
|
-
| `client.internal.apps.install` | `POST /openmeter/app-catalog/install` | Install an app from the catalog. |
|
|
449
|
-
|
|
450
|
-
### Internal Invoices
|
|
451
|
-
|
|
452
|
-
| Method | HTTP | Description |
|
|
453
|
-
| --------------------------------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
454
|
-
| `client.internal.invoices.list` | `GET /openmeter/billing/invoices` | List billing invoices. Returns a page of invoices. Gathering invoices are never included. Use `filter` to narrow by status, customer, dates, or service period start. Use `sort` to control ordering. |
|
|
455
|
-
| `client.internal.invoices.get` | `GET /openmeter/billing/invoices/{invoiceId}` | Get a billing invoice by ID. Returns the full invoice resource including line items, status details, totals, and workflow configuration snapshot. |
|
|
456
|
-
| `client.internal.invoices.update` | `PUT /openmeter/billing/invoices/{invoiceId}` | Update a billing invoice. Only the mutable fields of the invoice can be edited: description, labels, supplier, customer, workflow settings, and top-level lines. Top-level lines are matched by `id`; lines without an `id` are created, and existing lines omitted from `lines` are deleted. Detailed (child) lines are always computed and cannot be edited directly. Only invoices in draft status can be updated. |
|
|
457
|
-
| `client.internal.invoices.delete` | `DELETE /openmeter/billing/invoices/{invoiceId}` | Delete a billing invoice. Only standard invoices in draft status can be deleted. Deleting an invoice will also delete all associated line items and workflow configuration. |
|
|
458
|
-
| `client.internal.invoices.advance` | `POST /openmeter/billing/invoices/{invoiceId}/advance` | Advance a billing invoice. Advances the invoice to the next workflow state. The next state is determined by the invoice's current status and workflow configuration. Only invoices in draft or issued status can be advanced. |
|
|
459
|
-
| `client.internal.invoices.approve` | `POST /openmeter/billing/invoices/{invoiceId}/approve` | Approve a billing invoice. This call instantly sends the invoice to the customer using the configured billing profile app. This call is valid in two invoice statuses: - draft: the invoice will be sent to the customer, the invoice state becomes issued - manual_approval_needed: the invoice will be sent to the customer, the invoice state becomes issued |
|
|
460
|
-
| `client.internal.invoices.retry` | `POST /openmeter/billing/invoices/{invoiceId}/retry` | Retry sending a billing invoice. Retry advancing the invoice after a failed attempt. The action can be called when the invoice's statusDetails' actions field contain the "retry" action. |
|
|
461
|
-
| `client.internal.invoices.snapshotQuantities` | `POST /openmeter/billing/invoices/{invoiceId}/snapshot-quantities` | Snapshot quantities for usage-based line items. This call will snapshot the quantities for all usage based line items in the invoice. This call is only valid in draft.waiting_for_collection status, where the collection period can be skipped using this action. |
|
|
462
|
-
|
|
463
|
-
### Internal Charges
|
|
464
|
-
|
|
465
|
-
| Method | HTTP | Description |
|
|
466
|
-
| ------------------------------ | ------------------------ | ------------------------------------------------------------------------------------------------------------------- |
|
|
467
|
-
| `client.internal.charges.list` | `GET /openmeter/charges` | List charges. Returns the charges of every customer that are represented as either flat fee or usage-based charges. |
|
|
468
|
-
|
|
469
|
-
### Internal Currencies
|
|
470
|
-
|
|
471
|
-
| Method | HTTP | Description |
|
|
472
|
-
| ------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
473
|
-
| `client.internal.currencies.list` | `GET /openmeter/currencies` | List currencies supported by the billing system. |
|
|
474
|
-
| `client.internal.currencies.createCustomCurrency` | `POST /openmeter/currencies/custom` | Create a custom currency. This operation allows defining your own custom currency for billing purposes. |
|
|
475
|
-
| `client.internal.currencies.getCustomCurrency` | `GET /openmeter/currencies/custom/{currencyId}` | Get a custom currency. |
|
|
476
|
-
| `client.internal.currencies.listCostBases` | `GET /openmeter/currencies/custom/{currencyId}/cost-bases` | List cost bases for a currency. For custom currencies, there can be multiple cost bases with different `effective_from` dates. |
|
|
477
|
-
| `client.internal.currencies.createCostBasis` | `POST /openmeter/currencies/custom/{currencyId}/cost-bases` | Create a cost basis for a currency. |
|
|
478
|
-
|
|
479
|
-
### Internal PlanAddons
|
|
480
|
-
|
|
481
|
-
| Method | HTTP | Description |
|
|
482
|
-
| --------------------------------- | -------------------------------------- | ------------------------------------ |
|
|
483
|
-
| `client.internal.planAddons.list` | `GET /openmeter/plans/{planId}/addons` | List add-ons associated with a plan. |
|
|
484
|
-
|
|
485
|
-
### Internal EntitlementAccess
|
|
486
|
-
|
|
487
|
-
| Method | HTTP | Description |
|
|
488
|
-
| ----------------------------------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
489
|
-
| `client.internal.entitlementAccess.query` | `POST /openmeter/entitlement-access/query` | Query feature access for a list of customers. The endpoint resolves each provided identifier to a customer and returns the access status for the requested features, plus optional credit balance availability. _Designed to be called on a fixed refresh interval and the query response is intended to be cached._ |
|
|
500
|
+
| Method | HTTP | Description |
|
|
501
|
+
| ------------------------------------------- | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
502
|
+
| `client.internal.subscriptions.createAddon` | `POST /openmeter/subscriptions/{subscriptionId}/addons` | Add add-on to a subscription. |
|
|
503
|
+
| `client.internal.subscriptions.updateAddon` | `PATCH /openmeter/subscriptions/{subscriptionId}/addons/{subscriptionAddonId}` | Update a subscription add-on. Only the quantity is mutable; the timing controls when the new quantity takes effect. A new entry is appended to the add-on's timeline. |
|
|
490
504
|
|
|
491
505
|
## Runtime Validation (validate option)
|
|
492
506
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type Result, 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, VoidCreditGrantRequest, VoidCreditGrantResponse, 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, CreateCustomerEntitlementRequest, CreateCustomerEntitlementResponse, OverrideCustomerEntitlementRequest, OverrideCustomerEntitlementResponse, GetCustomerEntitlementHistoryRequest, GetCustomerEntitlementHistoryResponse, GetCustomerEntitlementRequest, GetCustomerEntitlementResponse, ListCustomerEntitlementsRequest, ListCustomerEntitlementsResponse, ResetCustomerEntitlementUsageRequest, ResetCustomerEntitlementUsageResponse, DeleteCustomerEntitlementRequest, DeleteCustomerEntitlementResponse, CreateCustomerEntitlementGrantRequest, CreateCustomerEntitlementGrantResponse, ListCustomerEntitlementGrantsRequest, ListCustomerEntitlementGrantsResponse, 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
|
/**
|
|
5
5
|
* Create customer
|
|
6
6
|
*
|
|
@@ -80,6 +80,117 @@ export declare function createCustomerStripeCheckoutSession(client: Client, req:
|
|
|
80
80
|
* POST /openmeter/customers/{customerId}/billing/stripe/portal-sessions
|
|
81
81
|
*/
|
|
82
82
|
export declare function createCustomerStripePortalSession(client: Client, req: CreateCustomerStripePortalSessionRequest, options?: RequestOptions): Promise<Result<CreateCustomerStripePortalSessionResponse>>;
|
|
83
|
+
/**
|
|
84
|
+
* Create customer entitlement
|
|
85
|
+
*
|
|
86
|
+
* Create an entitlement for the customer.
|
|
87
|
+
*
|
|
88
|
+
* A customer can have only one active entitlement per feature. The feature must be
|
|
89
|
+
* compatible with the entitlement type. Entitlements cannot be modified after
|
|
90
|
+
* creation, only deleted.
|
|
91
|
+
*
|
|
92
|
+
* POST /openmeter/customers/{customerId}/entitlements
|
|
93
|
+
*/
|
|
94
|
+
export declare function createCustomerEntitlement(client: Client, req: CreateCustomerEntitlementRequest, options?: RequestOptions): Promise<Result<CreateCustomerEntitlementResponse>>;
|
|
95
|
+
/**
|
|
96
|
+
* Override customer entitlement
|
|
97
|
+
*
|
|
98
|
+
* Override an entitlement of the customer with a new one.
|
|
99
|
+
*
|
|
100
|
+
* The referenced entitlement ends and the new one starts at the same instant, so
|
|
101
|
+
* access continues without a gap. Both must belong to the same feature. Use this
|
|
102
|
+
* for upgrades and downgrades.
|
|
103
|
+
*
|
|
104
|
+
* Fails if the referenced entitlement does not exist, is deleted, or is no longer
|
|
105
|
+
* active.
|
|
106
|
+
*
|
|
107
|
+
* PUT /openmeter/customers/{customerId}/entitlements/{entitlementId}/override
|
|
108
|
+
*/
|
|
109
|
+
export declare function overrideCustomerEntitlement(client: Client, req: OverrideCustomerEntitlementRequest, options?: RequestOptions): Promise<Result<OverrideCustomerEntitlementResponse>>;
|
|
110
|
+
/**
|
|
111
|
+
* Get customer entitlement history
|
|
112
|
+
*
|
|
113
|
+
* Get the balance and usage history of a metered entitlement. The queried range
|
|
114
|
+
* may span multiple usage periods.
|
|
115
|
+
*
|
|
116
|
+
* `windowed_history` groups usage into windows of the requested size and reports
|
|
117
|
+
* the balance at the start of each window. `burndown_history` lists the periods in
|
|
118
|
+
* which grants were consumed in a fixed order, together with the usage taken from
|
|
119
|
+
* each grant.
|
|
120
|
+
*
|
|
121
|
+
* GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/history
|
|
122
|
+
*/
|
|
123
|
+
export declare function getCustomerEntitlementHistory(client: Client, req: GetCustomerEntitlementHistoryRequest, options?: RequestOptions): Promise<Result<GetCustomerEntitlementHistoryResponse>>;
|
|
124
|
+
/**
|
|
125
|
+
* Get customer entitlement
|
|
126
|
+
*
|
|
127
|
+
* Get an entitlement of the customer by ID. For checking entitlement access, use
|
|
128
|
+
* the entitlement access endpoints instead.
|
|
129
|
+
*
|
|
130
|
+
* GET /openmeter/customers/{customerId}/entitlements/{entitlementId}
|
|
131
|
+
*/
|
|
132
|
+
export declare function getCustomerEntitlement(client: Client, req: GetCustomerEntitlementRequest, options?: RequestOptions): Promise<Result<GetCustomerEntitlementResponse>>;
|
|
133
|
+
/**
|
|
134
|
+
* List customer entitlements
|
|
135
|
+
*
|
|
136
|
+
* List the entitlements of the customer that are active at the time of the
|
|
137
|
+
* request. For checking entitlement access, use the entitlement access endpoints
|
|
138
|
+
* instead.
|
|
139
|
+
*
|
|
140
|
+
* GET /openmeter/customers/{customerId}/entitlements
|
|
141
|
+
*/
|
|
142
|
+
export declare function listCustomerEntitlements(client: Client, req: ListCustomerEntitlementsRequest, options?: RequestOptions): Promise<Result<ListCustomerEntitlementsResponse>>;
|
|
143
|
+
/**
|
|
144
|
+
* Reset customer entitlement usage
|
|
145
|
+
*
|
|
146
|
+
* Reset the usage of a metered entitlement. The reset starts a new usage period:
|
|
147
|
+
* usage is zeroed and grants roll over according to their rollover settings.
|
|
148
|
+
*
|
|
149
|
+
* Usage is reset automatically at the end of each usage period. Use this operation
|
|
150
|
+
* to reset it earlier, for example to align the entitlement with the customer's
|
|
151
|
+
* billing period. The usage period anchor can be moved at the same time.
|
|
152
|
+
*
|
|
153
|
+
* POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/reset
|
|
154
|
+
*/
|
|
155
|
+
export declare function resetCustomerEntitlementUsage(client: Client, req: ResetCustomerEntitlementUsageRequest, options?: RequestOptions): Promise<Result<ResetCustomerEntitlementUsageResponse>>;
|
|
156
|
+
/**
|
|
157
|
+
* Delete customer entitlement
|
|
158
|
+
*
|
|
159
|
+
* Deletes the entitlement and revokes access to its feature. A customer can hold
|
|
160
|
+
* only one active entitlement per feature, so migrating a feature requires
|
|
161
|
+
* deleting the previous entitlement first.
|
|
162
|
+
*
|
|
163
|
+
* Deletion sets the `deleted_at` timestamp instead of removing history. Access and
|
|
164
|
+
* status queries for earlier points in time still treat the entitlement as active,
|
|
165
|
+
* so access changes are never retroactive.
|
|
166
|
+
*
|
|
167
|
+
* DELETE /openmeter/customers/{customerId}/entitlements/{entitlementId}
|
|
168
|
+
*/
|
|
169
|
+
export declare function deleteCustomerEntitlement(client: Client, req: DeleteCustomerEntitlementRequest, options?: RequestOptions): Promise<Result<DeleteCustomerEntitlementResponse>>;
|
|
170
|
+
/**
|
|
171
|
+
* Create customer entitlement grant
|
|
172
|
+
*
|
|
173
|
+
* Issue a grant for a metered entitlement of the customer. Boolean and static
|
|
174
|
+
* entitlements cannot have grants, so the request is rejected for them.
|
|
175
|
+
*
|
|
176
|
+
* Grants are immutable. The amount is added to the balance from `effective_at`,
|
|
177
|
+
* which cannot be earlier than the start of the current usage period.
|
|
178
|
+
*
|
|
179
|
+
* POST /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants
|
|
180
|
+
*/
|
|
181
|
+
export declare function createCustomerEntitlementGrant(client: Client, req: CreateCustomerEntitlementGrantRequest, options?: RequestOptions): Promise<Result<CreateCustomerEntitlementGrantResponse>>;
|
|
182
|
+
/**
|
|
183
|
+
* List customer entitlement grants
|
|
184
|
+
*
|
|
185
|
+
* List the grants issued for an entitlement of the customer. Grants only exist for
|
|
186
|
+
* metered entitlements, so the list is empty for boolean and static entitlements.
|
|
187
|
+
*
|
|
188
|
+
* Deleted grants are excluded unless `include_deleted` is set. Voided and expired
|
|
189
|
+
* grants are always included, as they are part of the balance history.
|
|
190
|
+
*
|
|
191
|
+
* GET /openmeter/customers/{customerId}/entitlements/{entitlementId}/grants
|
|
192
|
+
*/
|
|
193
|
+
export declare function listCustomerEntitlementGrants(client: Client, req: ListCustomerEntitlementGrantsRequest, options?: RequestOptions): Promise<Result<ListCustomerEntitlementGrantsResponse>>;
|
|
83
194
|
/**
|
|
84
195
|
* Create a new credit grant
|
|
85
196
|
*
|