@openmeter/client 1.0.0-beta.229 → 1.0.0-beta.231
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/LICENSE +202 -0
- package/README.md +364 -66
- package/dist/core.d.ts +0 -1
- package/dist/core.js +8 -1
- package/dist/funcs/addons.d.ts +49 -1
- package/dist/funcs/addons.js +161 -29
- package/dist/funcs/apps.d.ts +14 -1
- package/dist/funcs/apps.js +52 -9
- package/dist/funcs/billing.d.ts +46 -1
- package/dist/funcs/billing.js +126 -17
- package/dist/funcs/currencies.d.ts +30 -1
- package/dist/funcs/currencies.js +113 -23
- package/dist/funcs/customers.d.ts +167 -2
- package/dist/funcs/customers.js +580 -90
- package/dist/funcs/defaults.d.ts +10 -1
- package/dist/funcs/defaults.js +35 -5
- package/dist/funcs/entitlements.d.ts +5 -1
- package/dist/funcs/entitlements.js +25 -6
- package/dist/funcs/events.d.ts +14 -1
- package/dist/funcs/events.js +41 -9
- package/dist/funcs/features.d.ts +42 -1
- package/dist/funcs/features.js +142 -28
- package/dist/funcs/governance.d.ts +14 -1
- package/dist/funcs/governance.js +42 -10
- package/dist/funcs/index.d.ts +1 -1
- package/dist/funcs/index.js +2 -1
- package/dist/funcs/invoices.d.ts +51 -0
- package/dist/funcs/invoices.js +125 -0
- package/dist/funcs/llmCost.d.ts +36 -1
- package/dist/funcs/llmCost.js +114 -24
- package/dist/funcs/meters.d.ts +55 -2
- package/dist/funcs/meters.js +172 -28
- package/dist/funcs/planAddons.d.ts +35 -1
- package/dist/funcs/planAddons.js +139 -29
- package/dist/funcs/plans.d.ts +49 -1
- package/dist/funcs/plans.js +163 -25
- package/dist/funcs/subscriptions.d.ts +61 -2
- package/dist/funcs/subscriptions.js +238 -40
- package/dist/funcs/tax.d.ts +25 -1
- package/dist/funcs/tax.js +104 -22
- package/dist/index.d.ts +6 -4
- package/dist/index.js +4 -3
- package/dist/lib/config.d.ts +9 -1
- package/dist/lib/config.js +1 -1
- package/dist/lib/encodings.d.ts +1 -2
- package/dist/lib/encodings.js +6 -5
- package/dist/lib/paginate.d.ts +56 -0
- package/dist/lib/paginate.js +60 -0
- package/dist/lib/request.d.ts +0 -1
- package/dist/lib/request.js +1 -1
- package/dist/lib/to-error.d.ts +0 -1
- package/dist/lib/to-error.js +1 -1
- package/dist/lib/types.d.ts +0 -1
- package/dist/lib/types.js +1 -1
- package/dist/lib/version.d.ts +1 -0
- package/dist/lib/version.js +5 -0
- package/dist/lib/wire.d.ts +20 -0
- package/dist/lib/wire.js +401 -0
- package/dist/models/errors.d.ts +13 -2
- package/dist/models/errors.js +31 -4
- package/dist/models/operations/addons.d.ts +17 -6
- package/dist/models/operations/addons.js +1 -1
- package/dist/models/operations/apps.d.ts +4 -6
- package/dist/models/operations/apps.js +1 -1
- package/dist/models/operations/billing.d.ts +5 -5
- package/dist/models/operations/billing.js +1 -1
- package/dist/models/operations/currencies.d.ts +27 -10
- package/dist/models/operations/currencies.js +1 -1
- package/dist/models/operations/customers.d.ts +87 -33
- package/dist/models/operations/customers.js +1 -1
- package/dist/models/operations/defaults.d.ts +2 -2
- package/dist/models/operations/defaults.js +1 -1
- package/dist/models/operations/entitlements.d.ts +0 -1
- package/dist/models/operations/entitlements.js +1 -1
- package/dist/models/operations/events.d.ts +20 -5
- package/dist/models/operations/events.js +1 -1
- package/dist/models/operations/features.d.ts +24 -9
- package/dist/models/operations/features.js +1 -1
- package/dist/models/operations/governance.d.ts +3 -3
- package/dist/models/operations/governance.js +1 -1
- package/dist/models/operations/invoices.d.ts +45 -0
- package/dist/models/operations/invoices.js +2 -0
- package/dist/models/operations/llmCost.d.ts +16 -5
- package/dist/models/operations/llmCost.js +1 -1
- package/dist/models/operations/meters.d.ts +29 -9
- package/dist/models/operations/meters.js +1 -1
- package/dist/models/operations/planAddons.d.ts +7 -7
- package/dist/models/operations/planAddons.js +1 -1
- package/dist/models/operations/plans.d.ts +14 -6
- package/dist/models/operations/plans.js +1 -1
- package/dist/models/operations/subscriptions.d.ts +36 -11
- package/dist/models/operations/subscriptions.js +1 -1
- package/dist/models/operations/tax.d.ts +6 -6
- package/dist/models/operations/tax.js +1 -1
- package/dist/models/schemas.d.ts +27484 -3125
- package/dist/models/schemas.js +6247 -495
- package/dist/models/types.d.ts +4548 -1398
- package/dist/models/types.js +1 -1
- package/dist/sdk/addons.d.ts +60 -1
- package/dist/sdk/addons.js +63 -1
- package/dist/sdk/apps.d.ts +25 -1
- package/dist/sdk/apps.js +28 -1
- package/dist/sdk/billing.d.ts +57 -1
- package/dist/sdk/billing.js +60 -1
- package/dist/sdk/customers.d.ts +213 -2
- package/dist/sdk/customers.js +228 -2
- package/dist/sdk/defaults.d.ts +10 -1
- package/dist/sdk/defaults.js +11 -1
- package/dist/sdk/entitlements.d.ts +5 -1
- package/dist/sdk/entitlements.js +6 -1
- package/dist/sdk/events.d.ts +25 -1
- package/dist/sdk/events.js +28 -1
- package/dist/sdk/features.d.ts +53 -1
- package/dist/sdk/features.js +56 -1
- package/dist/sdk/internal.d.ts +180 -0
- package/dist/sdk/internal.js +224 -0
- package/dist/sdk/llmCost.d.ts +57 -1
- package/dist/sdk/llmCost.js +62 -1
- package/dist/sdk/meters.d.ts +66 -2
- package/dist/sdk/meters.js +71 -2
- package/dist/sdk/planAddons.d.ts +46 -1
- package/dist/sdk/planAddons.js +49 -1
- package/dist/sdk/plans.d.ts +60 -1
- package/dist/sdk/plans.js +63 -1
- package/dist/sdk/sdk.d.ts +9 -7
- package/dist/sdk/sdk.js +11 -10
- package/dist/sdk/subscriptions.d.ts +71 -1
- package/dist/sdk/subscriptions.js +76 -1
- package/dist/sdk/tax.d.ts +34 -1
- package/dist/sdk/tax.js +37 -1
- package/package.json +31 -6
- package/dist/sdk/currencies.d.ts +0 -12
- package/dist/sdk/currencies.js +0 -21
- package/dist/sdk/governance.d.ts +0 -9
- package/dist/sdk/governance.js +0 -12
package/dist/funcs/currencies.js
CHANGED
|
@@ -1,35 +1,125 @@
|
|
|
1
|
+
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
1
2
|
import { http } from '../core.js';
|
|
2
3
|
import { request } from '../lib/request.js';
|
|
3
|
-
import {
|
|
4
|
+
import { toURLSearchParams, encodeSort } from '../lib/encodings.js';
|
|
5
|
+
import { toWire, fromWire, assertValid, toSnakeCase } from '../lib/wire.js';
|
|
6
|
+
import * as schemas from '../models/schemas.js';
|
|
7
|
+
/**
|
|
8
|
+
* List currencies
|
|
9
|
+
*
|
|
10
|
+
* List currencies supported by the billing system.
|
|
11
|
+
*
|
|
12
|
+
* GET /openmeter/currencies
|
|
13
|
+
*/
|
|
4
14
|
export function listCurrencies(client, req = {}, options) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
return request(() => {
|
|
16
|
+
const query = toWire({
|
|
17
|
+
page: req.page,
|
|
18
|
+
sort: encodeSort(req.sort, toSnakeCase),
|
|
19
|
+
filter: req.filter,
|
|
20
|
+
}, schemas.listCurrenciesQueryParams);
|
|
21
|
+
if (client._options.validate) {
|
|
22
|
+
assertValid(schemas.listCurrenciesQueryParamsWire, query);
|
|
23
|
+
}
|
|
24
|
+
const searchParams = toURLSearchParams(query);
|
|
25
|
+
return http(client)
|
|
26
|
+
.get('openmeter/currencies', { ...options, searchParams })
|
|
27
|
+
.json()
|
|
28
|
+
.then((data) => {
|
|
29
|
+
if (client._options.validate) {
|
|
30
|
+
assertValid(schemas.listCurrenciesResponseWire, data);
|
|
31
|
+
}
|
|
32
|
+
return fromWire(data, schemas.listCurrenciesResponse);
|
|
33
|
+
});
|
|
9
34
|
});
|
|
10
|
-
return request(() => http(client)
|
|
11
|
-
.get('openmeter/currencies', { ...options, searchParams })
|
|
12
|
-
.json());
|
|
13
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Create custom currency
|
|
38
|
+
*
|
|
39
|
+
* Create a custom currency. This operation allows defining your own custom
|
|
40
|
+
* currency for billing purposes.
|
|
41
|
+
*
|
|
42
|
+
* POST /openmeter/currencies/custom
|
|
43
|
+
*/
|
|
14
44
|
export function createCustomCurrency(client, req, options) {
|
|
15
|
-
return request(() =>
|
|
16
|
-
|
|
17
|
-
.
|
|
45
|
+
return request(() => {
|
|
46
|
+
const body = toWire(req, schemas.createCustomCurrencyBody);
|
|
47
|
+
if (client._options.validate) {
|
|
48
|
+
assertValid(schemas.createCustomCurrencyBodyWire, body);
|
|
49
|
+
}
|
|
50
|
+
return http(client)
|
|
51
|
+
.post('openmeter/currencies/custom', { ...options, json: body })
|
|
52
|
+
.json()
|
|
53
|
+
.then((data) => {
|
|
54
|
+
if (client._options.validate) {
|
|
55
|
+
assertValid(schemas.createCustomCurrencyResponseWire, data);
|
|
56
|
+
}
|
|
57
|
+
return fromWire(data, schemas.createCustomCurrencyResponse);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
18
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* List cost bases
|
|
63
|
+
*
|
|
64
|
+
* List cost bases for a currency. For custom currencies, there can be multiple
|
|
65
|
+
* cost bases with different `effective_from` dates.
|
|
66
|
+
*
|
|
67
|
+
* GET /openmeter/currencies/custom/{currencyId}/cost-bases
|
|
68
|
+
*/
|
|
19
69
|
export function listCostBases(client, req, options) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
70
|
+
return request(() => {
|
|
71
|
+
const path = `openmeter/currencies/custom/${(() => {
|
|
72
|
+
if (req.currencyId === undefined) {
|
|
73
|
+
throw new Error('missing path parameter: currencyId');
|
|
74
|
+
}
|
|
75
|
+
return encodeURIComponent(String(req.currencyId));
|
|
76
|
+
})()}/cost-bases`;
|
|
77
|
+
const query = toWire({
|
|
78
|
+
filter: req.filter,
|
|
79
|
+
page: req.page,
|
|
80
|
+
}, schemas.listCostBasesQueryParams);
|
|
81
|
+
if (client._options.validate) {
|
|
82
|
+
assertValid(schemas.listCostBasesQueryParamsWire, query);
|
|
83
|
+
}
|
|
84
|
+
const searchParams = toURLSearchParams(query);
|
|
85
|
+
return http(client)
|
|
86
|
+
.get(path, { ...options, searchParams })
|
|
87
|
+
.json()
|
|
88
|
+
.then((data) => {
|
|
89
|
+
if (client._options.validate) {
|
|
90
|
+
assertValid(schemas.listCostBasesResponseWire, data);
|
|
91
|
+
}
|
|
92
|
+
return fromWire(data, schemas.listCostBasesResponse);
|
|
93
|
+
});
|
|
23
94
|
});
|
|
24
|
-
const path = encodePath('openmeter/currencies/custom/{currencyId}/cost-bases', { currencyId: req.currencyId });
|
|
25
|
-
return request(() => http(client)
|
|
26
|
-
.get(path, { ...options, searchParams })
|
|
27
|
-
.json());
|
|
28
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Create cost basis
|
|
98
|
+
*
|
|
99
|
+
* Create a cost basis for a currency.
|
|
100
|
+
*
|
|
101
|
+
* POST /openmeter/currencies/custom/{currencyId}/cost-bases
|
|
102
|
+
*/
|
|
29
103
|
export function createCostBasis(client, req, options) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
104
|
+
return request(() => {
|
|
105
|
+
const path = `openmeter/currencies/custom/${(() => {
|
|
106
|
+
if (req.currencyId === undefined) {
|
|
107
|
+
throw new Error('missing path parameter: currencyId');
|
|
108
|
+
}
|
|
109
|
+
return encodeURIComponent(String(req.currencyId));
|
|
110
|
+
})()}/cost-bases`;
|
|
111
|
+
const body = toWire(req.body, schemas.createCostBasisBody);
|
|
112
|
+
if (client._options.validate) {
|
|
113
|
+
assertValid(schemas.createCostBasisBodyWire, body);
|
|
114
|
+
}
|
|
115
|
+
return http(client)
|
|
116
|
+
.post(path, { ...options, json: body })
|
|
117
|
+
.json()
|
|
118
|
+
.then((data) => {
|
|
119
|
+
if (client._options.validate) {
|
|
120
|
+
assertValid(schemas.createCostBasisResponseWire, data);
|
|
121
|
+
}
|
|
122
|
+
return fromWire(data, schemas.createCostBasisResponse);
|
|
123
|
+
});
|
|
124
|
+
});
|
|
34
125
|
}
|
|
35
|
-
//# sourceMappingURL=currencies.js.map
|
|
@@ -1,21 +1,186 @@
|
|
|
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, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse } 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
|
+
/**
|
|
5
|
+
* Create customer
|
|
6
|
+
*
|
|
7
|
+
* POST /openmeter/customers
|
|
8
|
+
*/
|
|
4
9
|
export declare function createCustomer(client: Client, req: CreateCustomerRequest, options?: RequestOptions): Promise<Result<CreateCustomerResponse>>;
|
|
10
|
+
/**
|
|
11
|
+
* Get customer
|
|
12
|
+
*
|
|
13
|
+
* GET /openmeter/customers/{customerId}
|
|
14
|
+
*/
|
|
5
15
|
export declare function getCustomer(client: Client, req: GetCustomerRequest, options?: RequestOptions): Promise<Result<GetCustomerResponse>>;
|
|
16
|
+
/**
|
|
17
|
+
* List customers
|
|
18
|
+
*
|
|
19
|
+
* GET /openmeter/customers
|
|
20
|
+
*/
|
|
6
21
|
export declare function listCustomers(client: Client, req?: ListCustomersRequest, options?: RequestOptions): Promise<Result<ListCustomersResponse>>;
|
|
22
|
+
/**
|
|
23
|
+
* Upsert customer
|
|
24
|
+
*
|
|
25
|
+
* PUT /openmeter/customers/{customerId}
|
|
26
|
+
*/
|
|
7
27
|
export declare function upsertCustomer(client: Client, req: UpsertCustomerRequest, options?: RequestOptions): Promise<Result<UpsertCustomerResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Delete customer
|
|
30
|
+
*
|
|
31
|
+
* DELETE /openmeter/customers/{customerId}
|
|
32
|
+
*/
|
|
8
33
|
export declare function deleteCustomer(client: Client, req: DeleteCustomerRequest, options?: RequestOptions): Promise<Result<DeleteCustomerResponse>>;
|
|
34
|
+
/**
|
|
35
|
+
* Get customer billing data
|
|
36
|
+
*
|
|
37
|
+
* GET /openmeter/customers/{customerId}/billing
|
|
38
|
+
*/
|
|
9
39
|
export declare function getCustomerBilling(client: Client, req: GetCustomerBillingRequest, options?: RequestOptions): Promise<Result<GetCustomerBillingResponse>>;
|
|
40
|
+
/**
|
|
41
|
+
* Update customer billing data
|
|
42
|
+
*
|
|
43
|
+
* PUT /openmeter/customers/{customerId}/billing
|
|
44
|
+
*/
|
|
10
45
|
export declare function updateCustomerBilling(client: Client, req: UpdateCustomerBillingRequest, options?: RequestOptions): Promise<Result<UpdateCustomerBillingResponse>>;
|
|
46
|
+
/**
|
|
47
|
+
* Update customer billing app data
|
|
48
|
+
*
|
|
49
|
+
* PUT /openmeter/customers/{customerId}/billing/app-data
|
|
50
|
+
*/
|
|
11
51
|
export declare function updateCustomerBillingAppData(client: Client, req: UpdateCustomerBillingAppDataRequest, options?: RequestOptions): Promise<Result<UpdateCustomerBillingAppDataResponse>>;
|
|
52
|
+
/**
|
|
53
|
+
* Create Stripe Checkout Session
|
|
54
|
+
*
|
|
55
|
+
* Create a [Stripe Checkout Session](https://docs.stripe.com/payments/checkout)
|
|
56
|
+
* for the customer.
|
|
57
|
+
*
|
|
58
|
+
* Creates a Checkout Session for collecting payment method information from
|
|
59
|
+
* customers. The session operates in "setup" mode, which collects payment details
|
|
60
|
+
* without charging the customer immediately. The collected payment method can be
|
|
61
|
+
* used for future subscription billing.
|
|
62
|
+
*
|
|
63
|
+
* For hosted checkout sessions, redirect customers to the returned URL. For
|
|
64
|
+
* embedded sessions, use the client_secret to initialize Stripe.js in your
|
|
65
|
+
* application.
|
|
66
|
+
*
|
|
67
|
+
* POST /openmeter/customers/{customerId}/billing/stripe/checkout-sessions
|
|
68
|
+
*/
|
|
12
69
|
export declare function createCustomerStripeCheckoutSession(client: Client, req: CreateCustomerStripeCheckoutSessionRequest, options?: RequestOptions): Promise<Result<CreateCustomerStripeCheckoutSessionResponse>>;
|
|
70
|
+
/**
|
|
71
|
+
* Create Stripe customer portal session
|
|
72
|
+
*
|
|
73
|
+
* Create Stripe Customer Portal Session.
|
|
74
|
+
*
|
|
75
|
+
* Useful to redirect the customer to the Stripe Customer Portal to manage their
|
|
76
|
+
* payment methods, change their billing address and access their invoice history.
|
|
77
|
+
* Only returns URL if the customer billing profile is linked to a stripe app and
|
|
78
|
+
* customer.
|
|
79
|
+
*
|
|
80
|
+
* POST /openmeter/customers/{customerId}/billing/stripe/portal-sessions
|
|
81
|
+
*/
|
|
13
82
|
export declare function createCustomerStripePortalSession(client: Client, req: CreateCustomerStripePortalSessionRequest, options?: RequestOptions): Promise<Result<CreateCustomerStripePortalSessionResponse>>;
|
|
83
|
+
/**
|
|
84
|
+
* Create a new credit grant
|
|
85
|
+
*
|
|
86
|
+
* Create a new credit grant. A credit grant represents an allocation of prepaid
|
|
87
|
+
* credits to a customer.
|
|
88
|
+
*
|
|
89
|
+
* POST /openmeter/customers/{customerId}/credits/grants
|
|
90
|
+
*/
|
|
14
91
|
export declare function createCreditGrant(client: Client, req: CreateCreditGrantRequest, options?: RequestOptions): Promise<Result<CreateCreditGrantResponse>>;
|
|
92
|
+
/**
|
|
93
|
+
* Get a credit grant
|
|
94
|
+
*
|
|
95
|
+
* Get a credit grant.
|
|
96
|
+
*
|
|
97
|
+
* GET /openmeter/customers/{customerId}/credits/grants/{creditGrantId}
|
|
98
|
+
*/
|
|
15
99
|
export declare function getCreditGrant(client: Client, req: GetCreditGrantRequest, options?: RequestOptions): Promise<Result<GetCreditGrantResponse>>;
|
|
100
|
+
/**
|
|
101
|
+
* List credit grants
|
|
102
|
+
*
|
|
103
|
+
* List credit grants.
|
|
104
|
+
*
|
|
105
|
+
* GET /openmeter/customers/{customerId}/credits/grants
|
|
106
|
+
*/
|
|
16
107
|
export declare function listCreditGrants(client: Client, req: ListCreditGrantsRequest, options?: RequestOptions): Promise<Result<ListCreditGrantsResponse>>;
|
|
108
|
+
/**
|
|
109
|
+
* Get a customer's credit balance
|
|
110
|
+
*
|
|
111
|
+
* Get a credit balance.
|
|
112
|
+
*
|
|
113
|
+
* GET /openmeter/customers/{customerId}/credits/balance
|
|
114
|
+
*/
|
|
17
115
|
export declare function getCustomerCreditBalance(client: Client, req: GetCustomerCreditBalanceRequest, options?: RequestOptions): Promise<Result<GetCustomerCreditBalanceResponse>>;
|
|
116
|
+
/**
|
|
117
|
+
* Create a credit adjustment
|
|
118
|
+
*
|
|
119
|
+
* A credit adjustment can be used to make manual adjustments to a customer's
|
|
120
|
+
* credit balance.
|
|
121
|
+
*
|
|
122
|
+
* Supported use-cases:
|
|
123
|
+
*
|
|
124
|
+
* - Usage correction
|
|
125
|
+
*
|
|
126
|
+
* POST /openmeter/customers/{customerId}/credits/adjustments
|
|
127
|
+
*/
|
|
18
128
|
export declare function createCreditAdjustment(client: Client, req: CreateCreditAdjustmentRequest, options?: RequestOptions): Promise<Result<CreateCreditAdjustmentResponse>>;
|
|
129
|
+
/**
|
|
130
|
+
* Void credit grant
|
|
131
|
+
*
|
|
132
|
+
* Void a credit grant, forfeiting the remaining unused balance.
|
|
133
|
+
*
|
|
134
|
+
* Voiding is a forward-looking, irreversible operation. Credits already consumed
|
|
135
|
+
* by usage remain unaffected — only the remaining balance is forfeited. The grant
|
|
136
|
+
* reads as `voided` status afterwards. Payment state is not adjusted when
|
|
137
|
+
* `payment_adjustment` is `none`, so invoice-backed or externally collected
|
|
138
|
+
* payments may still collect the original amount. Only `active` grants can be
|
|
139
|
+
* voided; voiding a pending, expired, or fully consumed grant returns a conflict.
|
|
140
|
+
* Retrying a successful void is an idempotent success.
|
|
141
|
+
*
|
|
142
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
|
|
143
|
+
*/
|
|
144
|
+
export declare function voidCreditGrant(client: Client, req: VoidCreditGrantRequest, options?: RequestOptions): Promise<Result<VoidCreditGrantResponse>>;
|
|
145
|
+
/**
|
|
146
|
+
* Update credit grant external settlement status
|
|
147
|
+
*
|
|
148
|
+
* Update the payment settlement status of an externally funded credit grant.
|
|
149
|
+
*
|
|
150
|
+
* Use this endpoint to synchronize the payment state of an external payment with
|
|
151
|
+
* the system so that revenue recognition and credit availability work as expected.
|
|
152
|
+
*
|
|
153
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/settlement/external
|
|
154
|
+
*/
|
|
155
|
+
export declare function updateCreditGrantExternalSettlement(client: Client, req: UpdateCreditGrantExternalSettlementRequest, options?: RequestOptions): Promise<Result<UpdateCreditGrantExternalSettlementResponse>>;
|
|
156
|
+
/**
|
|
157
|
+
* List credit transactions
|
|
158
|
+
*
|
|
159
|
+
* List credit transactions for a customer.
|
|
160
|
+
*
|
|
161
|
+
* Returns an immutable, chronological record of credit movements: funded credits
|
|
162
|
+
* and consumed credits. Transactions are returned in reverse chronological order
|
|
163
|
+
* by default.
|
|
164
|
+
*
|
|
165
|
+
* GET /openmeter/customers/{customerId}/credits/transactions
|
|
166
|
+
*/
|
|
19
167
|
export declare function listCreditTransactions(client: Client, req: ListCreditTransactionsRequest, options?: RequestOptions): Promise<Result<ListCreditTransactionsResponse>>;
|
|
168
|
+
/**
|
|
169
|
+
* List customer charges
|
|
170
|
+
*
|
|
171
|
+
* List customer charges.
|
|
172
|
+
*
|
|
173
|
+
* Returns the customer's charges that are represented as either flat fee or
|
|
174
|
+
* usage-based charges.
|
|
175
|
+
*
|
|
176
|
+
* GET /openmeter/customers/{customerId}/charges
|
|
177
|
+
*/
|
|
20
178
|
export declare function listCustomerCharges(client: Client, req: ListCustomerChargesRequest, options?: RequestOptions): Promise<Result<ListCustomerChargesResponse>>;
|
|
21
|
-
|
|
179
|
+
/**
|
|
180
|
+
* Create customer charge
|
|
181
|
+
*
|
|
182
|
+
* Create customer charge.
|
|
183
|
+
*
|
|
184
|
+
* POST /openmeter/customers/{customerId}/charges
|
|
185
|
+
*/
|
|
186
|
+
export declare function createCustomerCharges(client: Client, req: CreateCustomerChargesRequest, options?: RequestOptions): Promise<Result<CreateCustomerChargesResponse>>;
|