@openmeter/client 1.0.0-beta-ef2981c866ad → 1.0.0-beta-1d51ec73a3d5
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 +22 -21
- package/dist/funcs/customers.d.ts +17 -1
- package/dist/funcs/customers.js +43 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/customers.d.ts +7 -1
- package/dist/models/schemas.d.ts +162 -0
- package/dist/models/schemas.js +36 -4
- package/dist/models/types.d.ts +24 -2
- package/dist/sdk/customers.d.ts +17 -1
- package/dist/sdk/customers.js +19 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -277,27 +277,28 @@ The full call path, HTTP route, and a short description are listed below.
|
|
|
277
277
|
|
|
278
278
|
### Customers
|
|
279
279
|
|
|
280
|
-
| Method | HTTP | Description
|
|
281
|
-
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
282
|
-
| `client.customers.create` | `POST /openmeter/customers` | Create customer
|
|
283
|
-
| `client.customers.get` | `GET /openmeter/customers/{customerId}` | Get customer
|
|
284
|
-
| `client.customers.list` | `GET /openmeter/customers` | List customers
|
|
285
|
-
| `client.customers.upsert` | `PUT /openmeter/customers/{customerId}` | Upsert customer
|
|
286
|
-
| `client.customers.delete` | `DELETE /openmeter/customers/{customerId}` | Delete customer
|
|
287
|
-
| `client.customers.billing.get` | `GET /openmeter/customers/{customerId}/billing` | Get customer billing data
|
|
288
|
-
| `client.customers.billing.update` | `PUT /openmeter/customers/{customerId}/billing` | Update customer billing data
|
|
289
|
-
| `client.customers.billing.updateAppData` | `PUT /openmeter/customers/{customerId}/billing/app-data` | Update customer billing app data
|
|
290
|
-
| `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.
|
|
291
|
-
| `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.
|
|
292
|
-
| `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.
|
|
293
|
-
| `client.customers.credits.grants.get` | `GET /openmeter/customers/{customerId}/credits/grants/{creditGrantId}` | Get a credit grant.
|
|
294
|
-
| `client.customers.credits.grants.list` | `GET /openmeter/customers/{customerId}/credits/grants` | List credit grants.
|
|
295
|
-
| `client.customers.credits.balance.get` | `GET /openmeter/customers/{customerId}/credits/balance` | Get a credit balance.
|
|
296
|
-
| `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
|
|
297
|
-
| `client.customers.credits.grants.
|
|
298
|
-
| `client.customers.credits.
|
|
299
|
-
| `client.customers.
|
|
300
|
-
| `client.customers.charges.
|
|
280
|
+
| Method | HTTP | Description |
|
|
281
|
+
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
282
|
+
| `client.customers.create` | `POST /openmeter/customers` | Create customer |
|
|
283
|
+
| `client.customers.get` | `GET /openmeter/customers/{customerId}` | Get customer |
|
|
284
|
+
| `client.customers.list` | `GET /openmeter/customers` | List customers |
|
|
285
|
+
| `client.customers.upsert` | `PUT /openmeter/customers/{customerId}` | Upsert customer |
|
|
286
|
+
| `client.customers.delete` | `DELETE /openmeter/customers/{customerId}` | Delete customer |
|
|
287
|
+
| `client.customers.billing.get` | `GET /openmeter/customers/{customerId}/billing` | Get customer billing data |
|
|
288
|
+
| `client.customers.billing.update` | `PUT /openmeter/customers/{customerId}/billing` | Update customer billing data |
|
|
289
|
+
| `client.customers.billing.updateAppData` | `PUT /openmeter/customers/{customerId}/billing/app-data` | Update customer billing app data |
|
|
290
|
+
| `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. |
|
|
291
|
+
| `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. |
|
|
292
|
+
| `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. |
|
|
293
|
+
| `client.customers.credits.grants.get` | `GET /openmeter/customers/{customerId}/credits/grants/{creditGrantId}` | Get a credit grant. |
|
|
294
|
+
| `client.customers.credits.grants.list` | `GET /openmeter/customers/{customerId}/credits/grants` | List credit grants. |
|
|
295
|
+
| `client.customers.credits.balance.get` | `GET /openmeter/customers/{customerId}/credits/balance` | Get a credit balance. |
|
|
296
|
+
| `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 |
|
|
297
|
+
| `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. |
|
|
298
|
+
| `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. |
|
|
299
|
+
| `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. |
|
|
300
|
+
| `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. |
|
|
301
|
+
| `client.customers.charges.create` | `POST /openmeter/customers/{customerId}/charges` | Create customer charge. |
|
|
301
302
|
|
|
302
303
|
### Entitlements
|
|
303
304
|
|
|
@@ -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, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
3
|
+
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
4
4
|
/**
|
|
5
5
|
* Create customer
|
|
6
6
|
*
|
|
@@ -126,6 +126,22 @@ export declare function getCustomerCreditBalance(client: Client, req: GetCustome
|
|
|
126
126
|
* POST /openmeter/customers/{customerId}/credits/adjustments
|
|
127
127
|
*/
|
|
128
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>>;
|
|
129
145
|
/**
|
|
130
146
|
* Update credit grant external settlement status
|
|
131
147
|
*
|
package/dist/funcs/customers.js
CHANGED
|
@@ -441,6 +441,49 @@ export function createCreditAdjustment(client, req, options) {
|
|
|
441
441
|
});
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
|
+
/**
|
|
445
|
+
* Void credit grant
|
|
446
|
+
*
|
|
447
|
+
* Void a credit grant, forfeiting the remaining unused balance.
|
|
448
|
+
*
|
|
449
|
+
* Voiding is a forward-looking, irreversible operation. Credits already consumed
|
|
450
|
+
* by usage remain unaffected — only the remaining balance is forfeited. The grant
|
|
451
|
+
* reads as `voided` status afterwards. Payment state is not adjusted when
|
|
452
|
+
* `payment_adjustment` is `none`, so invoice-backed or externally collected
|
|
453
|
+
* payments may still collect the original amount. Only `active` grants can be
|
|
454
|
+
* voided; voiding a pending, expired, or fully consumed grant returns a conflict.
|
|
455
|
+
* Retrying a successful void is an idempotent success.
|
|
456
|
+
*
|
|
457
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
|
|
458
|
+
*/
|
|
459
|
+
export function voidCreditGrant(client, req, options) {
|
|
460
|
+
return request(() => {
|
|
461
|
+
const path = `openmeter/customers/${(() => {
|
|
462
|
+
if (req.customerId === undefined) {
|
|
463
|
+
throw new Error('missing path parameter: customerId');
|
|
464
|
+
}
|
|
465
|
+
return encodeURIComponent(String(req.customerId));
|
|
466
|
+
})()}/credits/grants/${(() => {
|
|
467
|
+
if (req.creditGrantId === undefined) {
|
|
468
|
+
throw new Error('missing path parameter: creditGrantId');
|
|
469
|
+
}
|
|
470
|
+
return encodeURIComponent(String(req.creditGrantId));
|
|
471
|
+
})()}/void`;
|
|
472
|
+
const body = toWire(req.body, schemas.voidCreditGrantBody);
|
|
473
|
+
if (client._options.validate) {
|
|
474
|
+
assertValid(schemas.voidCreditGrantBodyWire, body);
|
|
475
|
+
}
|
|
476
|
+
return http(client)
|
|
477
|
+
.post(path, { ...options, json: body })
|
|
478
|
+
.json()
|
|
479
|
+
.then((data) => {
|
|
480
|
+
if (client._options.validate) {
|
|
481
|
+
assertValid(schemas.voidCreditGrantResponseWire, data);
|
|
482
|
+
}
|
|
483
|
+
return fromWire(data, schemas.voidCreditGrantResponse);
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
}
|
|
444
487
|
/**
|
|
445
488
|
* Update credit grant external settlement status
|
|
446
489
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -39,4 +39,4 @@ export type * from './models/operations/plans.js';
|
|
|
39
39
|
export type * from './models/operations/addons.js';
|
|
40
40
|
export type * from './models/operations/planAddons.js';
|
|
41
41
|
export type * from './models/operations/defaults.js';
|
|
42
|
-
export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels, TaxConfigStripe, TaxConfigExternalInvoicing, ChargeFlatFeeDiscounts, PriceFree, RateCardStaticEntitlement, RateCardBooleanEntitlement, WorkflowCollectionAlignmentSubscription, WorkflowPaymentChargeAutomaticallySettings, WorkflowPaymentSendInvoiceSettings, InvoiceExternalReferences, InvoiceAvailableActionDetails, InvoiceWorkflowInvoicingSettings, InvoiceLineExternalReferences, UpdateLabels, UpdateBillingInvoiceWorkflowInvoicingSettings, UpdateBillingWorkflowPaymentChargeAutomaticallySettings, UpdateBillingWorkflowPaymentSendInvoiceSettings, UpdatePriceFree, LlmCostProvider, LlmCostModel, ProductCatalogValidationError, GovernanceQueryRequestCustomers, GovernanceQueryRequestFeatures, QueryFilterInteger, QueryFilterFloat, QueryFilterBoolean, PagePaginationQuery, PublicLabels, SystemAccountAccessToken, PersonalAccessToken, KonnectAccessToken, AppCustomerDataStripe, AppCustomerDataExternalInvoicing, CurrencyFiat, ListCostBasesParamsFilter, CurrencyAmount, PriceFlat, PriceUnit, RateCardDiscounts, Totals, SpendCommitments, InvoiceLineCreditsApplied, UpdatePriceFlat, UpdatePriceUnit, UpdateDiscounts, FeatureManualUnitCost, FeatureLlmUnitCostPricing, LlmCostModelPricing, QueryFilterNumeric, CursorPaginationQuery, ListMetersParamsFilter, ListLlmCostPricesParamsFilter, LabelsFieldFilter, CustomerReference, ProfileReference, CreateResourceReference, TaxCodeReference, CreditGrantInvoiceReference, BillingCustomerReference, SubscriptionReference, AddonReference, FeatureReference, AppReference, ChargeReference, UpdateResourceReference, Event, MeterQueryRow, AppStripeCreateCustomerPortalSessionResult, ClosedPeriod, SubscriptionAddonTimelineSegment, UpdateClosedPeriod, CostBasis, FeatureCostQueryRow, Resource, ResourceImmutable, QueryFilterDateTime, CursorMeta, InvalidParameterStandard, InvalidParameterMinimumLength, InvalidParameterMaximumLength, InvalidParameterChoiceItem, InvalidParameterDependentItem, Unauthorized, Forbidden, NotFound, Gone, Conflict, PayloadTooLarge, UnsupportedMediaType, UnprocessableContent, TooManyRequests, Internal, NotImplemented, NotAvailable, CreateCreditGrantFilters, CreditGrantFilters, UpsertPlanAddonRequest, ResourceWithKey, Meter, PaginatedMeta, QueryFilterStringMapItem, CustomerKeyReference, CustomerUsageAttribution, UpdateCustomerUsageAttribution, Address, UpdateAddress, AppStripeCreateCheckoutSessionCustomerUpdate, AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement, AppStripeCreateCheckoutSessionTaxIdCollection, AppStripeCreateCheckoutSessionResult, CustomerStripeCreateCustomerPortalSessionRequest, EntitlementAccessResult, CreateCreditGrantPurchase, RateCardMeteredEntitlement, RecurringPeriod, CreditGrantPurchase, ListCreditGrantsParamsFilter, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListPlansParamsFilter, SubscriptionCreate, RateCardProrationConfiguration, Subscription, UnitConfig, AppCatalogItem, TaxCodeAppMapping, PartyTaxIdentity, UpdateBillingPartyTaxIdentity, WorkflowInvoicingSettings, InvoiceValidationIssue, InvoiceAvailableActions, InvoiceLineAmountDiscount, InvoiceLineUsageDiscount, InvoiceLineBaseDiscount, ListCurrenciesParamsFilter, CurrencyCustom, CreateCurrencyCustomRequest, GovernanceQueryRequest, GovernanceFeatureAccessReason, GovernanceQueryError, AppCustomerData, UpsertAppCustomerDataRequest, CreditAdjustment, CreditBalance, ListCreditTransactionsParamsFilter, CreditTransaction, PriceTier, ChargeTotals, UpdatePriceTier, FeatureLlmUnitCost, LlmCostPrice, LlmCostOverrideCreate, ListCustomersParamsFilter, ListSubscriptionsParamsFilter, ListFeatureParamsFilter, ListAddonsParamsFilter, CreateCreditGrantTaxConfig, CreditGrantTaxConfig, TaxConfig, RateCardTaxConfig, OrganizationDefaultTaxCodes, PlanAddon, ProfileAppReferences, InvoiceWorkflowAppsReferences, UpdateRateCardTaxConfig, ListEventsParamsFilter, ListInvoicesParamsFilter, ResourceFilters, FieldFilters, IngestedEvent, MeterQueryResult, FeatureCostQueryResult, MeterPagePaginatedResponse, CostBasisPagePaginatedResponse, MeterQueryFilters, FeatureMeterReference, Customer, PartyAddresses, InvoiceCustomer, UpdateBillingPartyAddresses, UpdateInvoiceCustomer, AppStripeCreateCheckoutSessionConsentCollection, ListCustomerEntitlementAccessResponseData, WorkflowCollectionAlignmentAnchored, ChargeFlatFeeSystemIntent, SubscriptionPagePaginatedResponse, SubscriptionChangeResponse, SubscriptionCancel, SubscriptionChange, InvoiceUsageQuantityDetail, AppStripe, AppSandbox, AppExternalInvoicing, TaxCode, InvoiceWorkflow, InvoiceStatusDetails, InvoiceLineDiscounts, UpdateBillingInvoiceWorkflow, GovernanceFeatureAccess, CustomerData, UpsertCustomerBillingDataRequest, CreditBalances, CreditTransactionPaginatedResponse, PriceGraduated, PriceVolume, UpdatePriceGraduated, UpdatePriceVolume, PricePagePaginatedResponse, CreditGrant, CreateChargeFlatFeeRequest, WorkflowTaxSettings, PlanAddonPagePaginatedResponse, IngestedEventPaginatedResponse, InvalidParameters, MeterQueryRequest, CustomerPagePaginatedResponse, Party, Supplier, UpdateSupplier, AppStripeCreateCheckoutSessionRequestOptions, TaxCodePagePaginatedResponse, InvoiceWorkflowSettings, InvoiceDetailedLine, UpdateInvoiceWorkflowSettings, CurrencyPagePaginatedResponse, GovernanceQueryResult, Feature, CreditGrantPagePaginatedResponse, BadRequest, InvoiceBase, CustomerStripeCreateCheckoutSessionRequest, WorkflowCollectionSettings, AppPagePaginatedResponse, ProfileApps, GovernanceQueryResponse, ChargeFlatFee, ChargeUsageBasedSystemIntent, CreateChargeUsageBasedRequest, RateCard, InvoiceLineRateCard, UpdateInvoiceLineRateCard, FeaturePagePaginatedResponse, Workflow, ChargeUsageBased, SubscriptionAddonRateCard, PlanPhase, Addon, UpsertAddonRequest, InvoiceStandardLine, UpdateInvoiceStandardLine, Profile, UpsertBillingProfileRequest, SubscriptionAddon, Plan, UpsertPlanRequest, AddonPagePaginatedResponse, ProfilePagePaginatedResponse, ChargePagePaginatedResponse, SubscriptionAddonPagePaginatedResponse, PlanPagePaginatedResponse, InvoiceStandard, UpdateInvoiceStandardRequest, InvoicePagePaginatedResponse, StringFieldFilter, MeterAggregation, MeterQueryGranularity, StringFieldFilterExact, PricePaymentTerm, BillingCurrencyCode, CreateCurrencyCode, UlidFieldFilter, DateTimeFieldFilter, SubscriptionEditTiming, WorkflowPaymentSettings, InvalidParameter, RateCardEntitlement, Currency, FeatureUnitCost, WorkflowCollectionAlignment, App, Price, CreateChargeRequest, Charge, SortQueryInput, BaseErrorInput, WorkflowPaymentSendInvoiceSettingsInput, InvoiceWorkflowInvoicingSettingsInput, UpdateBillingInvoiceWorkflowInvoicingSettingsInput, UpdateBillingWorkflowPaymentSendInvoiceSettingsInput, EventInput, UnauthorizedInput, ForbiddenInput, NotFoundInput, GoneInput, ConflictInput, PayloadTooLargeInput, UnsupportedMediaTypeInput, UnprocessableContentInput, TooManyRequestsInput, InternalInput, NotImplementedInput, NotAvailableInput, AppStripeCreateCheckoutSessionCustomerUpdateInput, AppStripeCreateCheckoutSessionTaxIdCollectionInput, CreateCreditGrantPurchaseInput, RateCardMeteredEntitlementInput, CreditGrantPurchaseInput, UnitConfigInput, WorkflowInvoicingSettingsInput, GovernanceQueryRequestInput, IngestedEventInput, SubscriptionCancelInput, InvoiceUsageQuantityDetailInput, InvoiceWorkflowInput, UpdateBillingInvoiceWorkflowInput, CreateCreditGrantRequestInput, CreditGrantInput, WorkflowTaxSettingsInput, IngestedEventPaginatedResponseInput, MeterQueryRequestInput, AppStripeCreateCheckoutSessionRequestOptionsInput, InvoiceWorkflowSettingsInput, InvoiceDetailedLineInput, UpdateInvoiceWorkflowSettingsInput, CreditGrantPagePaginatedResponseInput, BadRequestInput, CustomerStripeCreateCheckoutSessionRequestInput, WorkflowCollectionSettingsInput, RateCardInput, WorkflowInput, SubscriptionAddonRateCardInput, PlanPhaseInput, AddonInput, CreateAddonRequestInput, UpsertAddonRequestInput, InvoiceStandardLineInput, ProfileInput, CreateBillingProfileRequestInput, UpsertBillingProfileRequestInput, SubscriptionAddonInput, PlanInput, CreatePlanRequestInput, UpsertPlanRequestInput, AddonPagePaginatedResponseInput, ProfilePagePaginatedResponseInput, SubscriptionAddonPagePaginatedResponseInput, PlanPagePaginatedResponseInput, InvoiceStandardInput, UpdateInvoiceStandardRequestInput, InvoicePagePaginatedResponseInput, WorkflowPaymentSettingsInput, RateCardEntitlementInput, } from './models/types.js';
|
|
42
|
+
export type { Labels, CursorPaginationQueryPage, SortQuery, IngestedEventValidationError, CursorMetaPage, BaseError, PageMeta, QueryFilterString, AppStripeCheckoutSessionCustomTextParams, AppStripeCreateCustomerPortalSessionOptions, CreateLabels, TaxConfigStripe, TaxConfigExternalInvoicing, ChargeFlatFeeDiscounts, PriceFree, RateCardStaticEntitlement, RateCardBooleanEntitlement, WorkflowCollectionAlignmentSubscription, WorkflowPaymentChargeAutomaticallySettings, WorkflowPaymentSendInvoiceSettings, InvoiceExternalReferences, InvoiceAvailableActionDetails, InvoiceWorkflowInvoicingSettings, InvoiceLineExternalReferences, UpdateLabels, UpdateBillingInvoiceWorkflowInvoicingSettings, UpdateBillingWorkflowPaymentChargeAutomaticallySettings, UpdateBillingWorkflowPaymentSendInvoiceSettings, UpdatePriceFree, LlmCostProvider, LlmCostModel, ProductCatalogValidationError, GovernanceQueryRequestCustomers, GovernanceQueryRequestFeatures, QueryFilterInteger, QueryFilterFloat, QueryFilterBoolean, PagePaginationQuery, PublicLabels, SystemAccountAccessToken, PersonalAccessToken, KonnectAccessToken, AppCustomerDataStripe, AppCustomerDataExternalInvoicing, CurrencyFiat, ListCostBasesParamsFilter, CurrencyAmount, PriceFlat, PriceUnit, RateCardDiscounts, Totals, SpendCommitments, InvoiceLineCreditsApplied, UpdatePriceFlat, UpdatePriceUnit, UpdateDiscounts, FeatureManualUnitCost, FeatureLlmUnitCostPricing, LlmCostModelPricing, QueryFilterNumeric, CursorPaginationQuery, ListMetersParamsFilter, ListLlmCostPricesParamsFilter, LabelsFieldFilter, CustomerReference, ProfileReference, CreateResourceReference, TaxCodeReference, CreditGrantInvoiceReference, BillingCustomerReference, SubscriptionReference, AddonReference, FeatureReference, AppReference, ChargeReference, UpdateResourceReference, Event, MeterQueryRow, AppStripeCreateCustomerPortalSessionResult, ClosedPeriod, SubscriptionAddonTimelineSegment, UpdateClosedPeriod, CostBasis, FeatureCostQueryRow, Resource, ResourceImmutable, QueryFilterDateTime, CursorMeta, InvalidParameterStandard, InvalidParameterMinimumLength, InvalidParameterMaximumLength, InvalidParameterChoiceItem, InvalidParameterDependentItem, Unauthorized, Forbidden, NotFound, Gone, Conflict, PayloadTooLarge, UnsupportedMediaType, UnprocessableContent, TooManyRequests, Internal, NotImplemented, NotAvailable, CreateCreditGrantFilters, CreditGrantFilters, UpsertPlanAddonRequest, ResourceWithKey, Meter, PaginatedMeta, QueryFilterStringMapItem, CustomerKeyReference, CustomerUsageAttribution, UpdateCustomerUsageAttribution, Address, UpdateAddress, AppStripeCreateCheckoutSessionCustomerUpdate, AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement, AppStripeCreateCheckoutSessionTaxIdCollection, AppStripeCreateCheckoutSessionResult, CustomerStripeCreateCustomerPortalSessionRequest, EntitlementAccessResult, CreateCreditGrantPurchase, RateCardMeteredEntitlement, RecurringPeriod, CreditGrantPurchase, ListCreditGrantsParamsFilter, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListPlansParamsFilter, SubscriptionCreate, RateCardProrationConfiguration, Subscription, UnitConfig, AppCatalogItem, TaxCodeAppMapping, PartyTaxIdentity, UpdateBillingPartyTaxIdentity, WorkflowInvoicingSettings, InvoiceValidationIssue, InvoiceAvailableActions, InvoiceLineAmountDiscount, InvoiceLineUsageDiscount, InvoiceLineBaseDiscount, ListCurrenciesParamsFilter, CurrencyCustom, CreateCurrencyCustomRequest, GovernanceQueryRequest, GovernanceFeatureAccessReason, GovernanceQueryError, AppCustomerData, UpsertAppCustomerDataRequest, CreditAdjustment, CreditBalance, ListCreditTransactionsParamsFilter, CreditTransaction, PriceTier, ChargeTotals, UpdatePriceTier, FeatureLlmUnitCost, LlmCostPrice, LlmCostOverrideCreate, ListCustomersParamsFilter, ListSubscriptionsParamsFilter, ListFeatureParamsFilter, ListAddonsParamsFilter, CreateCreditGrantTaxConfig, CreditGrantTaxConfig, TaxConfig, RateCardTaxConfig, OrganizationDefaultTaxCodes, PlanAddon, ProfileAppReferences, InvoiceWorkflowAppsReferences, UpdateRateCardTaxConfig, ListEventsParamsFilter, ListInvoicesParamsFilter, ResourceFilters, FieldFilters, IngestedEvent, MeterQueryResult, FeatureCostQueryResult, MeterPagePaginatedResponse, CostBasisPagePaginatedResponse, MeterQueryFilters, FeatureMeterReference, Customer, PartyAddresses, InvoiceCustomer, UpdateBillingPartyAddresses, UpdateInvoiceCustomer, AppStripeCreateCheckoutSessionConsentCollection, ListCustomerEntitlementAccessResponseData, WorkflowCollectionAlignmentAnchored, ChargeFlatFeeSystemIntent, SubscriptionPagePaginatedResponse, SubscriptionChangeResponse, SubscriptionCancel, SubscriptionChange, InvoiceUsageQuantityDetail, AppStripe, AppSandbox, AppExternalInvoicing, TaxCode, InvoiceWorkflow, InvoiceStatusDetails, InvoiceLineDiscounts, UpdateBillingInvoiceWorkflow, GovernanceFeatureAccess, CustomerData, UpsertCustomerBillingDataRequest, CreditBalances, CreditTransactionPaginatedResponse, PriceGraduated, PriceVolume, UpdatePriceGraduated, UpdatePriceVolume, PricePagePaginatedResponse, CreditGrant, CreateChargeFlatFeeRequest, WorkflowTaxSettings, PlanAddonPagePaginatedResponse, IngestedEventPaginatedResponse, InvalidParameters, MeterQueryRequest, CustomerPagePaginatedResponse, Party, Supplier, UpdateSupplier, AppStripeCreateCheckoutSessionRequestOptions, TaxCodePagePaginatedResponse, InvoiceWorkflowSettings, InvoiceDetailedLine, UpdateInvoiceWorkflowSettings, CurrencyPagePaginatedResponse, GovernanceQueryResult, Feature, CreditGrantPagePaginatedResponse, BadRequest, InvoiceBase, CustomerStripeCreateCheckoutSessionRequest, WorkflowCollectionSettings, AppPagePaginatedResponse, ProfileApps, GovernanceQueryResponse, ChargeFlatFee, ChargeUsageBasedSystemIntent, CreateChargeUsageBasedRequest, RateCard, InvoiceLineRateCard, UpdateInvoiceLineRateCard, FeaturePagePaginatedResponse, Workflow, ChargeUsageBased, SubscriptionAddonRateCard, PlanPhase, Addon, UpsertAddonRequest, InvoiceStandardLine, UpdateInvoiceStandardLine, Profile, UpsertBillingProfileRequest, SubscriptionAddon, Plan, UpsertPlanRequest, AddonPagePaginatedResponse, ProfilePagePaginatedResponse, ChargePagePaginatedResponse, SubscriptionAddonPagePaginatedResponse, PlanPagePaginatedResponse, InvoiceStandard, UpdateInvoiceStandardRequest, InvoicePagePaginatedResponse, StringFieldFilter, MeterAggregation, MeterQueryGranularity, StringFieldFilterExact, PricePaymentTerm, BillingCurrencyCode, CreateCurrencyCode, UlidFieldFilter, DateTimeFieldFilter, SubscriptionEditTiming, WorkflowPaymentSettings, InvalidParameter, RateCardEntitlement, Currency, FeatureUnitCost, WorkflowCollectionAlignment, App, Price, CreateChargeRequest, Charge, SortQueryInput, BaseErrorInput, WorkflowPaymentSendInvoiceSettingsInput, InvoiceWorkflowInvoicingSettingsInput, UpdateBillingInvoiceWorkflowInvoicingSettingsInput, UpdateBillingWorkflowPaymentSendInvoiceSettingsInput, EventInput, UnauthorizedInput, ForbiddenInput, NotFoundInput, GoneInput, ConflictInput, PayloadTooLargeInput, UnsupportedMediaTypeInput, UnprocessableContentInput, TooManyRequestsInput, InternalInput, NotImplementedInput, NotAvailableInput, AppStripeCreateCheckoutSessionCustomerUpdateInput, AppStripeCreateCheckoutSessionTaxIdCollectionInput, CreateCreditGrantPurchaseInput, RateCardMeteredEntitlementInput, CreditGrantPurchaseInput, VoidCreditGrantRequestInput, UnitConfigInput, WorkflowInvoicingSettingsInput, GovernanceQueryRequestInput, IngestedEventInput, SubscriptionCancelInput, InvoiceUsageQuantityDetailInput, InvoiceWorkflowInput, UpdateBillingInvoiceWorkflowInput, CreateCreditGrantRequestInput, CreditGrantInput, WorkflowTaxSettingsInput, IngestedEventPaginatedResponseInput, MeterQueryRequestInput, AppStripeCreateCheckoutSessionRequestOptionsInput, InvoiceWorkflowSettingsInput, InvoiceDetailedLineInput, UpdateInvoiceWorkflowSettingsInput, CreditGrantPagePaginatedResponseInput, BadRequestInput, CustomerStripeCreateCheckoutSessionRequestInput, WorkflowCollectionSettingsInput, RateCardInput, WorkflowInput, SubscriptionAddonRateCardInput, PlanPhaseInput, AddonInput, CreateAddonRequestInput, UpsertAddonRequestInput, InvoiceStandardLineInput, ProfileInput, CreateBillingProfileRequestInput, UpsertBillingProfileRequestInput, SubscriptionAddonInput, PlanInput, CreatePlanRequestInput, UpsertPlanRequestInput, AddonPagePaginatedResponseInput, ProfilePagePaginatedResponseInput, SubscriptionAddonPagePaginatedResponseInput, PlanPagePaginatedResponseInput, InvoiceStandardInput, UpdateInvoiceStandardRequestInput, InvoicePagePaginatedResponseInput, WorkflowPaymentSettingsInput, RateCardEntitlementInput, } from './models/types.js';
|
package/dist/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.0-beta-
|
|
1
|
+
export declare const SDK_VERSION = "1.0.0-beta-1d51ec73a3d5";
|
package/dist/lib/version.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// The committed value is a dev placeholder. The publish flow
|
|
3
3
|
// (`make -C api/spec publish-aip-sdk`) stamps the real release version here
|
|
4
4
|
// before `pnpm publish`, after `pnpm version` updates package.json.
|
|
5
|
-
export const SDK_VERSION = '1.0.0-beta-
|
|
5
|
+
export const SDK_VERSION = '1.0.0-beta-1d51ec73a3d5';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AcceptDateStrings } from '../../lib/wire.js';
|
|
2
|
-
import type { AppCustomerData, AppStripeCreateCheckoutSessionResult, AppStripeCreateCustomerPortalSessionResult, Charge, ChargePagePaginatedResponse, CreateChargeRequest, CreateCreditAdjustmentRequest as CreateCreditAdjustmentRequestBody, CreateCreditGrantRequestInput, CreateCustomerRequest as CreateCustomerRequestBody, CreditAdjustment, CreditBalances, CreditGrant, CreditGrantPagePaginatedResponse, CreditTransactionPaginatedResponse, CursorPaginationQueryPage, Customer, CustomerData, CustomerPagePaginatedResponse, CustomerStripeCreateCheckoutSessionRequestInput, CustomerStripeCreateCustomerPortalSessionRequest, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListCreditGrantsParamsFilter, ListCreditTransactionsParamsFilter, ListCustomersParamsFilter, SortQueryInput, UpdateCreditGrantExternalSettlementRequest as UpdateCreditGrantExternalSettlementRequestBody, UpsertAppCustomerDataRequest, UpsertCustomerBillingDataRequest, UpsertCustomerRequest as UpsertCustomerRequestBody } from '../types.js';
|
|
2
|
+
import type { AppCustomerData, AppStripeCreateCheckoutSessionResult, AppStripeCreateCustomerPortalSessionResult, Charge, ChargePagePaginatedResponse, CreateChargeRequest, CreateCreditAdjustmentRequest as CreateCreditAdjustmentRequestBody, CreateCreditGrantRequestInput, CreateCustomerRequest as CreateCustomerRequestBody, CreditAdjustment, CreditBalances, CreditGrant, CreditGrantPagePaginatedResponse, CreditTransactionPaginatedResponse, CursorPaginationQueryPage, Customer, CustomerData, CustomerPagePaginatedResponse, CustomerStripeCreateCheckoutSessionRequestInput, CustomerStripeCreateCustomerPortalSessionRequest, GetCreditBalanceParamsFilter, ListChargesParamsFilter, ListCreditGrantsParamsFilter, ListCreditTransactionsParamsFilter, ListCustomersParamsFilter, SortQueryInput, UpdateCreditGrantExternalSettlementRequest as UpdateCreditGrantExternalSettlementRequestBody, UpsertAppCustomerDataRequest, UpsertCustomerBillingDataRequest, UpsertCustomerRequest as UpsertCustomerRequestBody, VoidCreditGrantRequestInput } from '../types.js';
|
|
3
3
|
export type CreateCustomerRequest = AcceptDateStrings<CreateCustomerRequestBody>;
|
|
4
4
|
export type CreateCustomerResponse = Customer;
|
|
5
5
|
export type GetCustomerRequest = {
|
|
@@ -106,6 +106,12 @@ export type CreateCreditAdjustmentRequest = AcceptDateStrings<{
|
|
|
106
106
|
body: CreateCreditAdjustmentRequestBody;
|
|
107
107
|
}>;
|
|
108
108
|
export type CreateCreditAdjustmentResponse = CreditAdjustment;
|
|
109
|
+
export type VoidCreditGrantRequest = AcceptDateStrings<{
|
|
110
|
+
customerId: string;
|
|
111
|
+
creditGrantId: string;
|
|
112
|
+
body: VoidCreditGrantRequestInput;
|
|
113
|
+
}>;
|
|
114
|
+
export type VoidCreditGrantResponse = CreditGrant;
|
|
109
115
|
export type UpdateCreditGrantExternalSettlementRequest = AcceptDateStrings<{
|
|
110
116
|
customerId: string;
|
|
111
117
|
creditGrantId: string;
|
package/dist/models/schemas.d.ts
CHANGED
|
@@ -199,8 +199,12 @@ export declare const stringFieldFilterExact: z.ZodUnion<readonly [z.ZodString, z
|
|
|
199
199
|
oeq: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
200
200
|
neq: z.ZodOptional<z.ZodString>;
|
|
201
201
|
}, z.core.$strip>]>;
|
|
202
|
+
export declare const creditGrantVoidPaymentAdjustment: z.ZodEnum<{
|
|
203
|
+
none: "none";
|
|
204
|
+
}>;
|
|
202
205
|
export declare const creditTransactionType: z.ZodEnum<{
|
|
203
206
|
expired: "expired";
|
|
207
|
+
voided: "voided";
|
|
204
208
|
funded: "funded";
|
|
205
209
|
consumed: "consumed";
|
|
206
210
|
}>;
|
|
@@ -1303,6 +1307,11 @@ export declare const listPlansParamsFilter: z.ZodObject<{
|
|
|
1303
1307
|
neq: z.ZodOptional<z.ZodString>;
|
|
1304
1308
|
}, z.core.$strip>]>>;
|
|
1305
1309
|
}, z.core.$strip>;
|
|
1310
|
+
export declare const voidCreditGrantRequest: z.ZodObject<{
|
|
1311
|
+
paymentAdjustment: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1312
|
+
none: "none";
|
|
1313
|
+
}>>>;
|
|
1314
|
+
}, z.core.$strip>;
|
|
1306
1315
|
export declare const subscriptionCreate: z.ZodObject<{
|
|
1307
1316
|
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1308
1317
|
settlementMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1575,6 +1584,7 @@ export declare const createCreditAdjustmentRequest: z.ZodObject<{
|
|
|
1575
1584
|
export declare const listCreditTransactionsParamsFilter: z.ZodObject<{
|
|
1576
1585
|
type: z.ZodOptional<z.ZodEnum<{
|
|
1577
1586
|
expired: "expired";
|
|
1587
|
+
voided: "voided";
|
|
1578
1588
|
funded: "funded";
|
|
1579
1589
|
consumed: "consumed";
|
|
1580
1590
|
}>>;
|
|
@@ -1601,6 +1611,7 @@ export declare const creditTransaction: z.ZodObject<{
|
|
|
1601
1611
|
bookedAt: z.ZodDate;
|
|
1602
1612
|
type: z.ZodEnum<{
|
|
1603
1613
|
expired: "expired";
|
|
1614
|
+
voided: "voided";
|
|
1604
1615
|
funded: "funded";
|
|
1605
1616
|
consumed: "consumed";
|
|
1606
1617
|
}>;
|
|
@@ -3049,6 +3060,7 @@ export declare const creditTransactionPaginatedResponse: z.ZodObject<{
|
|
|
3049
3060
|
bookedAt: z.ZodDate;
|
|
3050
3061
|
type: z.ZodEnum<{
|
|
3051
3062
|
expired: "expired";
|
|
3063
|
+
voided: "voided";
|
|
3052
3064
|
funded: "funded";
|
|
3053
3065
|
consumed: "consumed";
|
|
3054
3066
|
}>;
|
|
@@ -11048,6 +11060,73 @@ export declare const createCreditAdjustmentResponse: z.ZodObject<{
|
|
|
11048
11060
|
description: z.ZodOptional<z.ZodString>;
|
|
11049
11061
|
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
11050
11062
|
}, z.core.$strip>;
|
|
11063
|
+
export declare const voidCreditGrantPathParams: z.ZodObject<{
|
|
11064
|
+
customerId: z.ZodString;
|
|
11065
|
+
creditGrantId: z.ZodString;
|
|
11066
|
+
}, z.core.$strip>;
|
|
11067
|
+
export declare const voidCreditGrantBody: z.ZodObject<{
|
|
11068
|
+
paymentAdjustment: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
11069
|
+
none: "none";
|
|
11070
|
+
}>>>;
|
|
11071
|
+
}, z.core.$strip>;
|
|
11072
|
+
export declare const voidCreditGrantResponse: z.ZodObject<{
|
|
11073
|
+
id: z.ZodString;
|
|
11074
|
+
name: z.ZodString;
|
|
11075
|
+
description: z.ZodOptional<z.ZodString>;
|
|
11076
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
11077
|
+
createdAt: z.ZodDate;
|
|
11078
|
+
updatedAt: z.ZodDate;
|
|
11079
|
+
deletedAt: z.ZodOptional<z.ZodDate>;
|
|
11080
|
+
fundingMethod: z.ZodEnum<{
|
|
11081
|
+
none: "none";
|
|
11082
|
+
external: "external";
|
|
11083
|
+
invoice: "invoice";
|
|
11084
|
+
}>;
|
|
11085
|
+
currency: z.ZodUnion<readonly [z.ZodString]>;
|
|
11086
|
+
amount: z.ZodString;
|
|
11087
|
+
purchase: z.ZodOptional<z.ZodObject<{
|
|
11088
|
+
currency: z.ZodString;
|
|
11089
|
+
perUnitCostBasis: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
11090
|
+
amount: z.ZodString;
|
|
11091
|
+
availabilityPolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
11092
|
+
on_creation: "on_creation";
|
|
11093
|
+
}>>>;
|
|
11094
|
+
settlementStatus: z.ZodOptional<z.ZodEnum<{
|
|
11095
|
+
pending: "pending";
|
|
11096
|
+
authorized: "authorized";
|
|
11097
|
+
settled: "settled";
|
|
11098
|
+
}>>;
|
|
11099
|
+
}, z.core.$strip>>;
|
|
11100
|
+
taxConfig: z.ZodOptional<z.ZodObject<{
|
|
11101
|
+
behavior: z.ZodOptional<z.ZodEnum<{
|
|
11102
|
+
exclusive: "exclusive";
|
|
11103
|
+
inclusive: "inclusive";
|
|
11104
|
+
}>>;
|
|
11105
|
+
taxCode: z.ZodOptional<z.ZodObject<{
|
|
11106
|
+
id: z.ZodString;
|
|
11107
|
+
}, z.core.$strip>>;
|
|
11108
|
+
}, z.core.$strip>>;
|
|
11109
|
+
invoice: z.ZodOptional<z.ZodObject<{
|
|
11110
|
+
id: z.ZodOptional<z.ZodString>;
|
|
11111
|
+
line: z.ZodOptional<z.ZodObject<{
|
|
11112
|
+
id: z.ZodString;
|
|
11113
|
+
}, z.core.$strip>>;
|
|
11114
|
+
}, z.core.$strip>>;
|
|
11115
|
+
filters: z.ZodOptional<z.ZodObject<{
|
|
11116
|
+
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11117
|
+
}, z.core.$strip>>;
|
|
11118
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
11119
|
+
effectiveAt: z.ZodOptional<z.ZodDate>;
|
|
11120
|
+
key: z.ZodOptional<z.ZodString>;
|
|
11121
|
+
expiresAt: z.ZodOptional<z.ZodDate>;
|
|
11122
|
+
voidedAt: z.ZodOptional<z.ZodDate>;
|
|
11123
|
+
status: z.ZodEnum<{
|
|
11124
|
+
active: "active";
|
|
11125
|
+
pending: "pending";
|
|
11126
|
+
expired: "expired";
|
|
11127
|
+
voided: "voided";
|
|
11128
|
+
}>;
|
|
11129
|
+
}, z.core.$strip>;
|
|
11051
11130
|
export declare const updateCreditGrantExternalSettlementPathParams: z.ZodObject<{
|
|
11052
11131
|
customerId: z.ZodString;
|
|
11053
11132
|
creditGrantId: z.ZodString;
|
|
@@ -11129,6 +11208,7 @@ export declare const listCreditTransactionsQueryParams: z.ZodObject<{
|
|
|
11129
11208
|
filter: z.ZodOptional<z.ZodObject<{
|
|
11130
11209
|
type: z.ZodOptional<z.ZodEnum<{
|
|
11131
11210
|
expired: "expired";
|
|
11211
|
+
voided: "voided";
|
|
11132
11212
|
funded: "funded";
|
|
11133
11213
|
consumed: "consumed";
|
|
11134
11214
|
}>>;
|
|
@@ -11157,6 +11237,7 @@ export declare const listCreditTransactionsResponse: z.ZodObject<{
|
|
|
11157
11237
|
bookedAt: z.ZodDate;
|
|
11158
11238
|
type: z.ZodEnum<{
|
|
11159
11239
|
expired: "expired";
|
|
11240
|
+
voided: "voided";
|
|
11160
11241
|
funded: "funded";
|
|
11161
11242
|
consumed: "consumed";
|
|
11162
11243
|
}>;
|
|
@@ -16735,8 +16816,12 @@ export declare const stringFieldFilterExactWire: z.ZodUnion<readonly [z.ZodStrin
|
|
|
16735
16816
|
oeq: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16736
16817
|
neq: z.ZodOptional<z.ZodString>;
|
|
16737
16818
|
}, z.core.$strict>]>;
|
|
16819
|
+
export declare const creditGrantVoidPaymentAdjustmentWire: z.ZodEnum<{
|
|
16820
|
+
none: "none";
|
|
16821
|
+
}>;
|
|
16738
16822
|
export declare const creditTransactionTypeWire: z.ZodEnum<{
|
|
16739
16823
|
expired: "expired";
|
|
16824
|
+
voided: "voided";
|
|
16740
16825
|
funded: "funded";
|
|
16741
16826
|
consumed: "consumed";
|
|
16742
16827
|
}>;
|
|
@@ -17839,6 +17924,11 @@ export declare const listPlansParamsFilterWire: z.ZodObject<{
|
|
|
17839
17924
|
neq: z.ZodOptional<z.ZodString>;
|
|
17840
17925
|
}, z.core.$strict>]>>;
|
|
17841
17926
|
}, z.core.$strict>;
|
|
17927
|
+
export declare const voidCreditGrantRequestWire: z.ZodObject<{
|
|
17928
|
+
payment_adjustment: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
17929
|
+
none: "none";
|
|
17930
|
+
}>>>;
|
|
17931
|
+
}, z.core.$strict>;
|
|
17842
17932
|
export declare const subscriptionCreateWire: z.ZodObject<{
|
|
17843
17933
|
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
17844
17934
|
settlement_mode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -18111,6 +18201,7 @@ export declare const createCreditAdjustmentRequestWire: z.ZodObject<{
|
|
|
18111
18201
|
export declare const listCreditTransactionsParamsFilterWire: z.ZodObject<{
|
|
18112
18202
|
type: z.ZodOptional<z.ZodEnum<{
|
|
18113
18203
|
expired: "expired";
|
|
18204
|
+
voided: "voided";
|
|
18114
18205
|
funded: "funded";
|
|
18115
18206
|
consumed: "consumed";
|
|
18116
18207
|
}>>;
|
|
@@ -18137,6 +18228,7 @@ export declare const creditTransactionWire: z.ZodObject<{
|
|
|
18137
18228
|
booked_at: z.ZodString;
|
|
18138
18229
|
type: z.ZodEnum<{
|
|
18139
18230
|
expired: "expired";
|
|
18231
|
+
voided: "voided";
|
|
18140
18232
|
funded: "funded";
|
|
18141
18233
|
consumed: "consumed";
|
|
18142
18234
|
}>;
|
|
@@ -19585,6 +19677,7 @@ export declare const creditTransactionPaginatedResponseWire: z.ZodObject<{
|
|
|
19585
19677
|
booked_at: z.ZodString;
|
|
19586
19678
|
type: z.ZodEnum<{
|
|
19587
19679
|
expired: "expired";
|
|
19680
|
+
voided: "voided";
|
|
19588
19681
|
funded: "funded";
|
|
19589
19682
|
consumed: "consumed";
|
|
19590
19683
|
}>;
|
|
@@ -27584,6 +27677,73 @@ export declare const createCreditAdjustmentResponseWire: z.ZodObject<{
|
|
|
27584
27677
|
description: z.ZodOptional<z.ZodString>;
|
|
27585
27678
|
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
27586
27679
|
}, z.core.$strict>;
|
|
27680
|
+
export declare const voidCreditGrantPathParamsWire: z.ZodObject<{
|
|
27681
|
+
customerId: z.ZodString;
|
|
27682
|
+
creditGrantId: z.ZodString;
|
|
27683
|
+
}, z.core.$strip>;
|
|
27684
|
+
export declare const voidCreditGrantBodyWire: z.ZodObject<{
|
|
27685
|
+
payment_adjustment: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
27686
|
+
none: "none";
|
|
27687
|
+
}>>>;
|
|
27688
|
+
}, z.core.$strict>;
|
|
27689
|
+
export declare const voidCreditGrantResponseWire: z.ZodObject<{
|
|
27690
|
+
id: z.ZodString;
|
|
27691
|
+
name: z.ZodString;
|
|
27692
|
+
description: z.ZodOptional<z.ZodString>;
|
|
27693
|
+
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
27694
|
+
created_at: z.ZodString;
|
|
27695
|
+
updated_at: z.ZodString;
|
|
27696
|
+
deleted_at: z.ZodOptional<z.ZodString>;
|
|
27697
|
+
funding_method: z.ZodEnum<{
|
|
27698
|
+
none: "none";
|
|
27699
|
+
external: "external";
|
|
27700
|
+
invoice: "invoice";
|
|
27701
|
+
}>;
|
|
27702
|
+
currency: z.ZodUnion<readonly [z.ZodString]>;
|
|
27703
|
+
amount: z.ZodString;
|
|
27704
|
+
purchase: z.ZodOptional<z.ZodObject<{
|
|
27705
|
+
currency: z.ZodString;
|
|
27706
|
+
per_unit_cost_basis: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
27707
|
+
amount: z.ZodString;
|
|
27708
|
+
availability_policy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
27709
|
+
on_creation: "on_creation";
|
|
27710
|
+
}>>>;
|
|
27711
|
+
settlement_status: z.ZodOptional<z.ZodEnum<{
|
|
27712
|
+
pending: "pending";
|
|
27713
|
+
authorized: "authorized";
|
|
27714
|
+
settled: "settled";
|
|
27715
|
+
}>>;
|
|
27716
|
+
}, z.core.$strict>>;
|
|
27717
|
+
tax_config: z.ZodOptional<z.ZodObject<{
|
|
27718
|
+
behavior: z.ZodOptional<z.ZodEnum<{
|
|
27719
|
+
exclusive: "exclusive";
|
|
27720
|
+
inclusive: "inclusive";
|
|
27721
|
+
}>>;
|
|
27722
|
+
tax_code: z.ZodOptional<z.ZodObject<{
|
|
27723
|
+
id: z.ZodString;
|
|
27724
|
+
}, z.core.$strict>>;
|
|
27725
|
+
}, z.core.$strict>>;
|
|
27726
|
+
invoice: z.ZodOptional<z.ZodObject<{
|
|
27727
|
+
id: z.ZodOptional<z.ZodString>;
|
|
27728
|
+
line: z.ZodOptional<z.ZodObject<{
|
|
27729
|
+
id: z.ZodString;
|
|
27730
|
+
}, z.core.$strict>>;
|
|
27731
|
+
}, z.core.$strict>>;
|
|
27732
|
+
filters: z.ZodOptional<z.ZodObject<{
|
|
27733
|
+
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27734
|
+
}, z.core.$strict>>;
|
|
27735
|
+
priority: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
27736
|
+
effective_at: z.ZodOptional<z.ZodString>;
|
|
27737
|
+
key: z.ZodOptional<z.ZodString>;
|
|
27738
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
27739
|
+
voided_at: z.ZodOptional<z.ZodString>;
|
|
27740
|
+
status: z.ZodEnum<{
|
|
27741
|
+
active: "active";
|
|
27742
|
+
pending: "pending";
|
|
27743
|
+
expired: "expired";
|
|
27744
|
+
voided: "voided";
|
|
27745
|
+
}>;
|
|
27746
|
+
}, z.core.$strict>;
|
|
27587
27747
|
export declare const updateCreditGrantExternalSettlementPathParamsWire: z.ZodObject<{
|
|
27588
27748
|
customerId: z.ZodString;
|
|
27589
27749
|
creditGrantId: z.ZodString;
|
|
@@ -27665,6 +27825,7 @@ export declare const listCreditTransactionsQueryParamsWire: z.ZodObject<{
|
|
|
27665
27825
|
filter: z.ZodOptional<z.ZodObject<{
|
|
27666
27826
|
type: z.ZodOptional<z.ZodEnum<{
|
|
27667
27827
|
expired: "expired";
|
|
27828
|
+
voided: "voided";
|
|
27668
27829
|
funded: "funded";
|
|
27669
27830
|
consumed: "consumed";
|
|
27670
27831
|
}>>;
|
|
@@ -27693,6 +27854,7 @@ export declare const listCreditTransactionsResponseWire: z.ZodObject<{
|
|
|
27693
27854
|
booked_at: z.ZodString;
|
|
27694
27855
|
type: z.ZodEnum<{
|
|
27695
27856
|
expired: "expired";
|
|
27857
|
+
voided: "voided";
|
|
27696
27858
|
funded: "funded";
|
|
27697
27859
|
consumed: "consumed";
|
|
27698
27860
|
}>;
|
package/dist/models/schemas.js
CHANGED
|
@@ -411,9 +411,12 @@ export const stringFieldFilterExact = z
|
|
|
411
411
|
}),
|
|
412
412
|
])
|
|
413
413
|
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
414
|
+
export const creditGrantVoidPaymentAdjustment = z
|
|
415
|
+
.enum(['none'])
|
|
416
|
+
.describe('Describes how voiding a credit grant adjusts related payment state. - `none`: Voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state.');
|
|
414
417
|
export const creditTransactionType = z
|
|
415
|
-
.enum(['funded', 'consumed', 'expired'])
|
|
416
|
-
.describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used.');
|
|
418
|
+
.enum(['funded', 'consumed', 'expired', 'voided'])
|
|
419
|
+
.describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used. - `voided`: Credit removed because the grant was voided before being used.');
|
|
417
420
|
export const chargesExpand = z
|
|
418
421
|
.enum(['real_time_usage'])
|
|
419
422
|
.describe("Expands for customer charges. Values: - `real_time_usage`: The charge's real-time usage.");
|
|
@@ -1931,6 +1934,13 @@ export const listPlansParamsFilter = z
|
|
|
1931
1934
|
currency: stringFieldFilterExact.optional(),
|
|
1932
1935
|
})
|
|
1933
1936
|
.describe('Filter options for listing plans.');
|
|
1937
|
+
export const voidCreditGrantRequest = z
|
|
1938
|
+
.object({
|
|
1939
|
+
paymentAdjustment: creditGrantVoidPaymentAdjustment
|
|
1940
|
+
.optional()
|
|
1941
|
+
.default('none'),
|
|
1942
|
+
})
|
|
1943
|
+
.describe('Request body for voiding a credit grant.');
|
|
1934
1944
|
export const subscriptionCreate = z
|
|
1935
1945
|
.object({
|
|
1936
1946
|
labels: labels.optional(),
|
|
@@ -4364,6 +4374,12 @@ export const createCreditAdjustmentPathParams = z.object({
|
|
|
4364
4374
|
});
|
|
4365
4375
|
export const createCreditAdjustmentBody = createCreditAdjustmentRequest;
|
|
4366
4376
|
export const createCreditAdjustmentResponse = creditAdjustment;
|
|
4377
|
+
export const voidCreditGrantPathParams = z.object({
|
|
4378
|
+
customerId: ulid,
|
|
4379
|
+
creditGrantId: ulid,
|
|
4380
|
+
});
|
|
4381
|
+
export const voidCreditGrantBody = voidCreditGrantRequest;
|
|
4382
|
+
export const voidCreditGrantResponse = creditGrant;
|
|
4367
4383
|
export const updateCreditGrantExternalSettlementPathParams = z.object({
|
|
4368
4384
|
customerId: ulid,
|
|
4369
4385
|
creditGrantId: ulid,
|
|
@@ -5237,9 +5253,12 @@ export const stringFieldFilterExactWire = z
|
|
|
5237
5253
|
}),
|
|
5238
5254
|
])
|
|
5239
5255
|
.describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
|
|
5256
|
+
export const creditGrantVoidPaymentAdjustmentWire = z
|
|
5257
|
+
.enum(['none'])
|
|
5258
|
+
.describe('Describes how voiding a credit grant adjusts related payment state. - `none`: Voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state.');
|
|
5240
5259
|
export const creditTransactionTypeWire = z
|
|
5241
|
-
.enum(['funded', 'consumed', 'expired'])
|
|
5242
|
-
.describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used.');
|
|
5260
|
+
.enum(['funded', 'consumed', 'expired', 'voided'])
|
|
5261
|
+
.describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used. - `voided`: Credit removed because the grant was voided before being used.');
|
|
5243
5262
|
export const chargesExpandWire = z
|
|
5244
5263
|
.enum(['real_time_usage'])
|
|
5245
5264
|
.describe("Expands for customer charges. Values: - `real_time_usage`: The charge's real-time usage.");
|
|
@@ -6757,6 +6776,13 @@ export const listPlansParamsFilterWire = z
|
|
|
6757
6776
|
currency: stringFieldFilterExactWire.optional(),
|
|
6758
6777
|
})
|
|
6759
6778
|
.describe('Filter options for listing plans.');
|
|
6779
|
+
export const voidCreditGrantRequestWire = z
|
|
6780
|
+
.strictObject({
|
|
6781
|
+
payment_adjustment: creditGrantVoidPaymentAdjustmentWire
|
|
6782
|
+
.optional()
|
|
6783
|
+
.default('none'),
|
|
6784
|
+
})
|
|
6785
|
+
.describe('Request body for voiding a credit grant.');
|
|
6760
6786
|
export const subscriptionCreateWire = z
|
|
6761
6787
|
.strictObject({
|
|
6762
6788
|
labels: labelsWire.optional(),
|
|
@@ -9208,6 +9234,12 @@ export const createCreditAdjustmentPathParamsWire = z.object({
|
|
|
9208
9234
|
});
|
|
9209
9235
|
export const createCreditAdjustmentBodyWire = createCreditAdjustmentRequestWire;
|
|
9210
9236
|
export const createCreditAdjustmentResponseWire = creditAdjustmentWire;
|
|
9237
|
+
export const voidCreditGrantPathParamsWire = z.object({
|
|
9238
|
+
customerId: ulidWire,
|
|
9239
|
+
creditGrantId: ulidWire,
|
|
9240
|
+
});
|
|
9241
|
+
export const voidCreditGrantBodyWire = voidCreditGrantRequestWire;
|
|
9242
|
+
export const voidCreditGrantResponseWire = creditGrantWire;
|
|
9211
9243
|
export const updateCreditGrantExternalSettlementPathParamsWire = z.object({
|
|
9212
9244
|
customerId: ulidWire,
|
|
9213
9245
|
creditGrantId: ulidWire,
|
package/dist/models/types.d.ts
CHANGED
|
@@ -1632,6 +1632,17 @@ export interface ListPlansParamsFilter {
|
|
|
1632
1632
|
status?: StringFieldFilterExact;
|
|
1633
1633
|
currency?: StringFieldFilterExact;
|
|
1634
1634
|
}
|
|
1635
|
+
/** Request body for voiding a credit grant. */
|
|
1636
|
+
export interface VoidCreditGrantRequest {
|
|
1637
|
+
/**
|
|
1638
|
+
* How voiding adjusts payment state related to the grant.
|
|
1639
|
+
*
|
|
1640
|
+
* Currently only `none` is supported: voiding does not adjust invoices, payment
|
|
1641
|
+
* authorization, settlement, payment intents, or external collection state. If
|
|
1642
|
+
* payment later completes, the original invoiced amount may still be collected.
|
|
1643
|
+
*/
|
|
1644
|
+
paymentAdjustment: 'none';
|
|
1645
|
+
}
|
|
1635
1646
|
/** Subscription create request. */
|
|
1636
1647
|
export interface SubscriptionCreate {
|
|
1637
1648
|
labels?: Labels;
|
|
@@ -2039,7 +2050,7 @@ export interface CreateCreditAdjustmentRequest {
|
|
|
2039
2050
|
/** Filter options for listing credit transactions. */
|
|
2040
2051
|
export interface ListCreditTransactionsParamsFilter {
|
|
2041
2052
|
/** Filter credit transactions by type. */
|
|
2042
|
-
type?: 'funded' | 'consumed' | 'expired';
|
|
2053
|
+
type?: 'funded' | 'consumed' | 'expired' | 'voided';
|
|
2043
2054
|
/** Filter credit transactions by currency. */
|
|
2044
2055
|
currency?: BillingCurrencyCode;
|
|
2045
2056
|
/**
|
|
@@ -2075,7 +2086,7 @@ export interface CreditTransaction {
|
|
|
2075
2086
|
/** The date and time the transaction was booked. */
|
|
2076
2087
|
bookedAt: Date;
|
|
2077
2088
|
/** The type of credit transaction. */
|
|
2078
|
-
type: 'funded' | 'consumed' | 'expired';
|
|
2089
|
+
type: 'funded' | 'consumed' | 'expired' | 'voided';
|
|
2079
2090
|
/** Currency of the balance affected by the transaction. */
|
|
2080
2091
|
currency: BillingCurrencyCode;
|
|
2081
2092
|
/**
|
|
@@ -5237,6 +5248,17 @@ export interface CreditGrantPurchaseInput {
|
|
|
5237
5248
|
/** Current payment settlement status. */
|
|
5238
5249
|
settlementStatus?: 'pending' | 'authorized' | 'settled';
|
|
5239
5250
|
}
|
|
5251
|
+
/** Request body for voiding a credit grant. */
|
|
5252
|
+
export interface VoidCreditGrantRequestInput {
|
|
5253
|
+
/**
|
|
5254
|
+
* How voiding adjusts payment state related to the grant.
|
|
5255
|
+
*
|
|
5256
|
+
* Currently only `none` is supported: voiding does not adjust invoices, payment
|
|
5257
|
+
* authorization, settlement, payment intents, or external collection state. If
|
|
5258
|
+
* payment later completes, the original invoiced amount may still be collected.
|
|
5259
|
+
*/
|
|
5260
|
+
paymentAdjustment?: 'none';
|
|
5261
|
+
}
|
|
5240
5262
|
/**
|
|
5241
5263
|
* Unit conversion configuration.
|
|
5242
5264
|
*
|
package/dist/sdk/customers.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
3
|
+
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, VoidCreditGrantRequest, VoidCreditGrantResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
4
4
|
import type { Charge, CreditGrant, CreditTransaction, Customer } from '../models/types.js';
|
|
5
5
|
export declare class Customers {
|
|
6
6
|
private readonly _client;
|
|
@@ -153,6 +153,22 @@ export declare class CustomersCreditsGrants {
|
|
|
153
153
|
* GET /openmeter/customers/{customerId}/credits/grants
|
|
154
154
|
*/
|
|
155
155
|
listAll(request: ListCreditGrantsRequest, options?: RequestOptions): AsyncIterable<CreditGrant>;
|
|
156
|
+
/**
|
|
157
|
+
* Void credit grant
|
|
158
|
+
*
|
|
159
|
+
* Void a credit grant, forfeiting the remaining unused balance.
|
|
160
|
+
*
|
|
161
|
+
* Voiding is a forward-looking, irreversible operation. Credits already consumed
|
|
162
|
+
* by usage remain unaffected — only the remaining balance is forfeited. The grant
|
|
163
|
+
* reads as `voided` status afterwards. Payment state is not adjusted when
|
|
164
|
+
* `payment_adjustment` is `none`, so invoice-backed or externally collected
|
|
165
|
+
* payments may still collect the original amount. Only `active` grants can be
|
|
166
|
+
* voided; voiding a pending, expired, or fully consumed grant returns a conflict.
|
|
167
|
+
* Retrying a successful void is an idempotent success.
|
|
168
|
+
*
|
|
169
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
|
|
170
|
+
*/
|
|
171
|
+
void(request: VoidCreditGrantRequest, options?: RequestOptions): Promise<VoidCreditGrantResponse>;
|
|
156
172
|
/**
|
|
157
173
|
* Update credit grant external settlement status
|
|
158
174
|
*
|
package/dist/sdk/customers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
|
|
2
2
|
import { unwrap } from '../lib/types.js';
|
|
3
3
|
import { paginateCursor, paginatePages } from '../lib/paginate.js';
|
|
4
|
-
import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, updateCreditGrantExternalSettlement, listCreditTransactions, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
4
|
+
import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, voidCreditGrant, updateCreditGrantExternalSettlement, listCreditTransactions, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
5
5
|
export class Customers {
|
|
6
6
|
_client;
|
|
7
7
|
constructor(_client) {
|
|
@@ -205,6 +205,24 @@ export class CustomersCreditsGrants {
|
|
|
205
205
|
listAll(request, options) {
|
|
206
206
|
return paginatePages((req, opts) => listCreditGrants(this._client, req, opts), request, options);
|
|
207
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Void credit grant
|
|
210
|
+
*
|
|
211
|
+
* Void a credit grant, forfeiting the remaining unused balance.
|
|
212
|
+
*
|
|
213
|
+
* Voiding is a forward-looking, irreversible operation. Credits already consumed
|
|
214
|
+
* by usage remain unaffected — only the remaining balance is forfeited. The grant
|
|
215
|
+
* reads as `voided` status afterwards. Payment state is not adjusted when
|
|
216
|
+
* `payment_adjustment` is `none`, so invoice-backed or externally collected
|
|
217
|
+
* payments may still collect the original amount. Only `active` grants can be
|
|
218
|
+
* voided; voiding a pending, expired, or fully consumed grant returns a conflict.
|
|
219
|
+
* Retrying a successful void is an idempotent success.
|
|
220
|
+
*
|
|
221
|
+
* POST /openmeter/customers/{customerId}/credits/grants/{creditGrantId}/void
|
|
222
|
+
*/
|
|
223
|
+
async void(request, options) {
|
|
224
|
+
return unwrap(await voidCreditGrant(this._client, request, options));
|
|
225
|
+
}
|
|
208
226
|
/**
|
|
209
227
|
* Update credit grant external settlement status
|
|
210
228
|
*
|