@boelabs/billete-sdk 8.0.0 → 9.1.0

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 CHANGED
@@ -49,11 +49,11 @@ SDK en `@boelabs/billete-sdk@beta`.
49
49
 
50
50
  El paquete tiene tres puntos de entrada:
51
51
 
52
- | Import | Dónde se usa | Para qué |
53
- | --- | --- | --- |
54
- | `@boelabs/billete-sdk` | Servidor | Toda la API, con tu clave secreta |
55
- | `@boelabs/billete-sdk/client` | Navegador | Checkout y estado de un cliente, sin clave secreta |
56
- | `@boelabs/billete-sdk/webhooks` | Servidor | Verificar la firma de los webhooks |
52
+ | Import | Dónde se usa | Para qué |
53
+ | ------------------------------- | ------------ | -------------------------------------------------- |
54
+ | `@boelabs/billete-sdk` | Servidor | Toda la API, con tu clave secreta |
55
+ | `@boelabs/billete-sdk/client` | Navegador | Checkout y estado de un cliente, sin clave secreta |
56
+ | `@boelabs/billete-sdk/webhooks` | Servidor | Verificar la firma de los webhooks |
57
57
 
58
58
  ## Inicio rápido
59
59
 
@@ -63,7 +63,7 @@ Crea una clave secreta en el dashboard (**Desarrolladores → Claves API**) y gu
63
63
  ```ts
64
64
  import { createBillete } from "@boelabs/billete-sdk";
65
65
 
66
- const billete = createBillete({ apiVersion: "2026-10-21", environment: "test" });
66
+ const billete = createBillete({ apiVersion: "2026-10-24", environment: "test" });
67
67
 
68
68
  const checkout = await billete.checkouts.create({
69
69
  plan: "plan_…",
@@ -91,7 +91,7 @@ solicite expresamente. En carritos, solo ofrece los demás métodos que todos lo
91
91
 
92
92
  ```ts
93
93
  const billete = createBillete({
94
- apiVersion: "2026-10-21",
94
+ apiVersion: "2026-10-24",
95
95
  environment: "production",
96
96
  apiKey: process.env.BILLETE_API_KEY,
97
97
  timeoutMs: 30_000,
@@ -99,14 +99,14 @@ const billete = createBillete({
99
99
  });
100
100
  ```
101
101
 
102
- | Opción | Por defecto | Descripción |
103
- | --- | --- | --- |
104
- | `environment` | — (obligatoria) | `"test"` o `"production"`. Debe coincidir con la clave. |
105
- | `apiKey` | `BILLETE_API_KEY` | Clave secreta: `sk_test_…` o `sk_prod_…`. |
106
- | `baseUrl` | `BILLETE_BASE_URL`, o `https://api.billete.run` | URL de la API. |
107
- | `timeoutMs` | `30000` | Tiempo máximo por intento. |
108
- | `maxRetries` | `2` | Reintentos ante errores de red, `429` y `5xx`. |
109
- | `fetch` | `globalThis.fetch` | Implementación de `fetch` propia (proxies, tests). |
102
+ | Opción | Por defecto | Descripción |
103
+ | ------------- | ----------------------------------------------- | ------------------------------------------------------- |
104
+ | `environment` | — (obligatoria) | `"test"` o `"production"`. Debe coincidir con la clave. |
105
+ | `apiKey` | `BILLETE_API_KEY` | Clave secreta: `sk_test_…` o `sk_prod_…`. |
106
+ | `baseUrl` | `BILLETE_BASE_URL`, o `https://api.billete.run` | URL de la API. |
107
+ | `timeoutMs` | `30000` | Tiempo máximo por intento. |
108
+ | `maxRetries` | `2` | Reintentos ante errores de red, `429` y `5xx`. |
109
+ | `fetch` | `globalThis.fetch` | Implementación de `fetch` propia (proxies, tests). |
110
110
 
111
111
  Si `environment` no coincide con el prefijo de la clave, `createBillete` lanza un error: una
112
112
  clave de prueba nunca opera en producción ni al revés. Por la misma razón, el cliente de servidor
@@ -121,27 +121,27 @@ se niega a crearse en un navegador.
121
121
  Todos los métodos devuelven promesas con el recurso tipado. Los recursos con listado tienen
122
122
  `create`, `retrieve`, `update`, `list` e `iterate`, además de sus acciones propias:
123
123
 
124
- | Recurso | Acciones propias |
125
- | --- | --- |
126
- | `customers` | — |
127
- | `customerSessions` | `create` |
128
- | `portalSessions` | `create` (enlace al portal del cliente, válido 60 minutos) |
129
- | `products` | `delete`, `deleteVariant` |
130
- | `plans` | `delete` |
131
- | `features` | `delete`, `check`, `isEnabled`, `listForCustomer`, `consume`, `release`, `set` |
132
- | `coupons` | `delete` |
133
- | `checkouts` | `expire` |
134
- | `paymentLinks` | `delete` |
135
- | `invoices` | `void` (cobros: renovaciones y cobros sueltos, con página de pago en `url`) |
136
- | `subscriptions` | `cancel`, `resume` |
137
- | `payments` | `refund`, `listRefunds` |
138
- | `fulfillments` | `deliver`, `submitTracking` (entregas de productos físicos; también `retrieve`, `list` e `iterate`) |
139
- | `payouts` | — |
140
- | `balance` | `retrieve` |
141
- | `webhookEndpoints` | `delete` |
142
- | `events` | `retrieve`, `list`, `iterate` |
143
- | `exchangeRates` | `list` |
144
- | `currencies` | `list` |
124
+ | Recurso | Acciones propias |
125
+ | ------------------ | --------------------------------------------------------------------------------------------------- |
126
+ | `customers` | — |
127
+ | `customerSessions` | `create` |
128
+ | `portalSessions` | `create` (enlace al portal del cliente, válido 60 minutos) |
129
+ | `products` | `delete`, `deleteVariant` |
130
+ | `plans` | `delete` |
131
+ | `features` | `delete`, `check`, `isEnabled`, `listForCustomer`, `consume`, `release`, `set` |
132
+ | `coupons` | `delete` |
133
+ | `checkouts` | `expire` |
134
+ | `paymentLinks` | `delete` |
135
+ | `invoices` | `void` (cobros: renovaciones y cobros sueltos, con página de pago en `url`) |
136
+ | `subscriptions` | `cancel`, `resume` |
137
+ | `payments` | `refund`, `listRefunds` |
138
+ | `fulfillments` | `deliver`, `submitTracking` (entregas de productos físicos; también `retrieve`, `list` e `iterate`) |
139
+ | `payouts` | — |
140
+ | `balance` | `retrieve` |
141
+ | `webhookEndpoints` | `delete` |
142
+ | `events` | `retrieve`, `list`, `iterate` |
143
+ | `exchangeRates` | `list` |
144
+ | `currencies` | `list` |
145
145
 
146
146
  ### Ejemplo: plan con cuotas
147
147
 
@@ -220,14 +220,14 @@ try {
220
220
  }
221
221
  ```
222
222
 
223
- | Propiedad | Descripción |
224
- | --- | --- |
225
- | `type` | Categoría: `invalid_request`, `authentication`, `permission`, `not_found`, `conflict`, `validation`, `rate_limit`, `provider`, `internal` o `network`. |
226
- | `code` | Código estable, apto para decidir en tu código: uno del [catálogo](https://billete.run/docs/api/errors#catálogo-de-códigos) (`BilleteErrorCode`), o `network_error` / `invalid_response` del SDK. |
227
- | `message` | Descripción legible del error. |
228
- | `status` | Código HTTP (`0` si no hubo respuesta). |
229
- | `param` | Campo que causó el error, cuando aplica. |
230
- | `requestId` | Identificador de la petición; inclúyelo al pedir soporte. |
223
+ | Propiedad | Descripción |
224
+ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
225
+ | `type` | Categoría: `invalid_request`, `authentication`, `permission`, `not_found`, `conflict`, `validation`, `rate_limit`, `provider`, `internal` o `network`. |
226
+ | `code` | Código estable, apto para decidir en tu código: uno del [catálogo](https://billete.run/docs/api/errors#catálogo-de-códigos) (`BilleteErrorCode`), o `network_error` / `invalid_response` del SDK. |
227
+ | `message` | Descripción legible del error. |
228
+ | `status` | Código HTTP (`0` si no hubo respuesta). |
229
+ | `param` | Campo que causó el error, cuando aplica. |
230
+ | `requestId` | Identificador de la petición; inclúyelo al pedir soporte. |
231
231
 
232
232
  ## Idempotencia y reintentos
233
233
 
@@ -257,7 +257,7 @@ return { token: session.token };
257
257
  // Navegador
258
258
  import { createClient } from "@boelabs/billete-sdk/client";
259
259
 
260
- const billete = createClient({ apiVersion: "2026-10-21", customerSession: token });
260
+ const billete = createClient({ apiVersion: "2026-10-24", customerSession: token });
261
261
 
262
262
  const { data: subscriptions } = await billete.customer.subscriptions();
263
263
  const tokens = await billete.customer.feature("tokens");
package/dist/client.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { $ as ProductCheckoutCreate, A as CustomerUpdate, At as PublicPortal, B as InvoiceCreate, Bt as apiVersionStage, C as CouponUpdate, Ct as PublicCheckoutItem, D as CustomerMemberCreate, Dt as PublicInvoice, E as CustomerInput, Et as PublicFulfillment, F as FeatureUpdate, Ft as ApiVersionLifecycle, G as PlanCheckoutCreate, H as KEY_PATTERN, Ht as isApiVersion, I as FulfillmentDeliverInput, It as ApiVersionStage, J as PlanFeaturesInput, K as PlanCouponCreate, L as FulfillmentHandoverInput, Lt as LATEST_API_VERSION, M as FeatureCreate, Mt as API_VERSION_HEADER, N as FeatureOperationCommit, Nt as API_VERSION_PATTERN, O as CustomerMemberUpdate, Ot as PublicPaymentLink, P as FeatureOperationCreate, Pt as ApiVersion, Q as PortalSessionCreate, R as FulfillmentInput, Rt as LatestApiVersion, S as CouponCreate, St as PublicCheckout, T as CustomerCreate, Tt as PublicClaimSummary, U as PaymentLinkCreate, Ut as isApiVersionRetired, V as InvoiceLineInput, Vt as currentApiVersion, W as PaymentLinkUpdate, Wt as supportedApiVersions, X as PlanPriceInput, Y as PlanLinkCreate, Z as PlanUpdate, _ as ClientPaymentCode, _t as PaymentMethodField, a as AfterCompletionInput, at as SubscriptionCancel, b as ClientSubscriptionUpdate, bt as PaymentTestScenario, c as ClaimResolve, ct as SubscriptionCreate, d as ClientCheckoutUpdate, dt as WebhookEndpointCreate, et as ProductCouponCreate, f as ClientClaimCreate, ft as WebhookEndpointUpdate, g as ClientLinkCheckout, gt as PaymentInstructions, h as ClientInvoicePay, ht as FulfillmentOption, i as TransportOptions, it as RefundCreate, j as EventSelector, jt as API_VERSIONS, k as CustomerSessionCreate, kt as PublicPaymentState, l as ClaimRespond, lt as SubscriptionUpdate, m as ClientFulfillmentProblem, mt as CustomerSubscriptionChangeResult, n as BilleteErrorCode, nt as ProductLinkCreate, o as CheckoutCreate, ot as SubscriptionChangeCreate, p as ClientCustomerClaimCreate, pt as CustomerSubscription, q as PlanCreate, r as RequestOptions, rt as ProductUpdate, s as CheckoutItemInput, st as SubscriptionChangePreviewInput, t as BilleteError, tt as ProductCreate, u as ClientCheckoutPay, ut as VariantInput, v as ClientSubscriptionCancel, vt as PaymentMethodOption, w as CustomFieldInput, wt as PublicClaim, x as CollectInput, xt as PortalFeatures, y as ClientSubscriptionSeats, yt as PaymentNextAction, z as FulfillmentTrackingInput, zt as apiVersionLifecycle } from "./errors-DERevGF5.js";
2
- import { $ as FulfillmentHandover, $t as PaymentFailureCode, A as Coupon, An as Environment, At as Refund, B as Event, Bt as SubscriptionRenewal, C as CheckoutPurpose, Cn as Timestamp, Ct as PlanSeats, D as ClaimReason, Dn as isMobilePhone, Dt as ProductVariant, E as ClaimOutcome, En as isLandlinePhone, Et as ProductCategory, F as CustomerFeature, Ft as SubmitLabel, G as Feature, Gt as Weekday, H as FEATURE_TYPES, Ht as SubscriptionTerms, I as CustomerMember, It as Subscription, J as FeatureReset, Jt as API_ERROR_TYPES, K as FeatureOperation, Kt as ReceiptReference, L as CustomerMemberList, Lt as SubscriptionChange, M as CustomField, Mn as tokenEnvironment, Mt as RiskLevel, N as Customer, Nn as tokenPrefix, Nt as SUBMIT_LABELS, O as ClaimStatus, On as nationalPhone, Ot as RESET_FREQUENCIES, P as CustomerDetails, Pt as SUBSCRIPTION_STATUSES, Q as FulfillmentChoice, Qt as PAYMENT_FAILURE_CODES, R as CustomerSession, Rt as SubscriptionChangePreview, S as CheckoutItem, Sn as TaxBehavior, St as PlanPrice, T as ClaimMessage, Tn as findBank, Tt as Product, U as FULFILLMENT_METHODS, Ut as USAGE_FEATURE_TYPES, V as ExchangeRate, Vt as SubscriptionStatus, W as FULFILLMENT_STATUSES, Wt as WebhookEndpoint, X as FeatureUsageResult, Xt as ApiErrorEnvelope, Y as FeatureType, Yt as ApiErrorBody, Z as Fulfillment, Zt as ApiErrorType, _ as CLAIM_STATUSES, _n as Metadata, _t as PaymentSettlement, a as WEBHOOK_TEST_EVENT, an as BILLING_MONTHS, at as Invoice, b as CarrierOffice, bn as SuspensionDays, bt as Plan, c as AfterCompletion, cn as CURRENCIES, ct as LineItem, d as CANCELLATION_FEEDBACK, dn as GracePeriodDays, dt as PRODUCT_CATEGORIES, en as API_ERROR_CODES, et as FulfillmentMethod, f as CARRIERS, fn as List, ft as Payment, g as CLAIM_REASONS, gn as MOBILE_PREFIXES, gt as PaymentLink, h as CLAIM_OUTCOMES, hn as MAX_QUANTITY, ht as PaymentFeeDetails, i as SubscribableEventType, in as AddressInput, it as INVOICE_STATUSES, j as CurrencyAvailability, jn as TokenKind, jt as ResetFrequency, k as CollectSettings, kn as ENVIRONMENTS, kt as RISK_LEVELS, l as Balance, ln as Currency, lt as MAX_SEATS, m as CHECKOUT_PURPOSES, mn as ListSort, mt as PaymentFailure, n as EventDataMap, nn as ACCOUNT_NUMBER_LENGTH, nt as FulfillmentTracking, o as WebhookEvent, on as BankCode, ot as InvoiceReason, p as CARRIER_TEST_SCENARIOS, pn as ListQuery, pt as PaymentAttempt, q as FeatureOperationResult, qt as ReceiptSend, r as EventType, rn as Address, rt as INVOICE_REASONS, s as Actor, sn as BillingMonths, st as InvoiceStatus, t as EVENT_TYPES, tn as ApiErrorCode, tt as FulfillmentStatus, u as BalanceAmount, un as GRACE_PERIOD_DAYS, ut as PAYMENT_STATUSES, v as CancellationFeedback, vn as MobilePrefix, vt as PaymentStatus, w as Claim, wn as VENEZUELAN_BANKS, wt as PortalSession, x as Checkout, xn as TAX_BEHAVIORS, xt as PlanFeatureValues, y as Carrier, yn as SUSPENSION_DAYS, yt as Payout, z as Deletion, zt as SubscriptionChangeResult } from "./events-b2qMWZF8.js";
3
- //#region src/create-client.d.ts
1
+ import { $ as PortalSessionCreate, A as CustomerSessionCreate, At as PublicPaymentLink, B as FulfillmentTrackingInput, Bt as LatestApiVersion, C as CouponCreate, Ct as PublicCheckout, D as CustomerInput, Dt as PublicFulfillment, E as CustomerCreate, Et as PublicClaimSummary, F as FeatureOperationCreate, Ft as API_VERSION_PATTERN, G as PaymentLinkUpdate, Gt as isApiVersionRetired, H as InvoiceLineInput, Ht as apiVersionStage, I as FeatureUpdate, It as ApiVersion, J as PlanCreate, K as PlanCheckoutCreate, Kt as supportedApiVersions, L as FulfillmentDeliverInput, Lt as ApiVersionLifecycle, M as EventSelector, Mt as PublicPortal, N as FeatureCreate, Nt as API_VERSIONS, O as CustomerMemberCreate, Ot as PublicFulfillmentRefund, P as FeatureOperationCommit, Pt as API_VERSION_HEADER, Q as PlanUpdate, R as FulfillmentHandoverInput, Rt as ApiVersionStage, S as CollectInput, St as PortalFeatures, T as CustomFieldInput, Tt as PublicClaim, U as KEY_PATTERN, Ut as currentApiVersion, V as InvoiceCreate, Vt as apiVersionLifecycle, W as PaymentLinkCreate, Wt as isApiVersion, X as PlanLinkCreate, Y as PlanFeaturesInput, Z as PlanPriceInput, _ as ClientPaymentCode, _t as PaymentInstructions, a as AfterCompletionInput, at as RefundCreate, b as ClientSubscriptionSeats, bt as PaymentNextAction, c as ClaimResolve, ct as SubscriptionChangePreviewInput, d as ClientCheckoutUpdate, dt as VariantInput, et as ProductCheckoutCreate, f as ClientClaimCreate, ft as WebhookEndpointCreate, g as ClientLinkCheckout, gt as FulfillmentOption, h as ClientInvoicePay, ht as CustomerSubscriptionChangeResult, i as TransportOptions, it as ProductUpdate, j as CustomerUpdate, jt as PublicPaymentState, k as CustomerMemberUpdate, kt as PublicInvoice, l as ClaimRespond, lt as SubscriptionCreate, m as ClientFulfillmentProblem, mt as CustomerSubscription, n as BilleteErrorCode, nt as ProductCreate, o as CheckoutCreate, ot as SubscriptionCancel, p as ClientCustomerClaimCreate, pt as WebhookEndpointUpdate, q as PlanCouponCreate, r as RequestOptions, rt as ProductLinkCreate, s as CheckoutItemInput, st as SubscriptionChangeCreate, t as BilleteError, tt as ProductCouponCreate, u as ClientCheckoutPay, ut as SubscriptionUpdate, v as ClientRefundDestination, vt as PaymentMethodField, w as CouponUpdate, wt as PublicCheckoutItem, x as ClientSubscriptionUpdate, xt as PaymentTestScenario, y as ClientSubscriptionCancel, yt as PaymentMethodOption, z as FulfillmentInput, zt as LATEST_API_VERSION } from "./errors-B7u708iH.js";
2
+ import { $ as FulfillmentHandover, $t as PAYMENT_FAILURE_CODES, A as Coupon, An as ENVIRONMENTS, At as RISK_LEVELS, B as Event, Bt as SubscriptionChangeResult, C as CheckoutPurpose, Cn as TaxBehavior, Ct as PlanSeats, D as ClaimReason, Dn as isLandlinePhone, Dt as ProductVariant, E as ClaimOutcome, En as findBank, Et as ProductCategory, F as CustomerFeature, Ft as SUBSCRIPTION_STATUSES, G as Feature, Gt as WebhookEndpoint, H as FEATURE_TYPES, Ht as SubscriptionStatus, I as CustomerMember, It as SubmitLabel, J as FeatureReset, Jt as ReceiptSend, K as FeatureOperation, Kt as Weekday, L as CustomerMemberList, Lt as Subscription, M as CustomField, Mn as TokenKind, Mt as ResetFrequency, N as Customer, Nn as tokenEnvironment, Nt as RiskLevel, O as ClaimStatus, On as isMobilePhone, Ot as REFUND_MODES, P as CustomerDetails, Pn as tokenPrefix, Pt as SUBMIT_LABELS, Q as FulfillmentChoice, Qt as ApiErrorType, R as CustomerSession, Rt as SubscriptionChange, S as CheckoutItem, Sn as TAX_BEHAVIORS, St as PlanPrice, T as ClaimMessage, Tn as VENEZUELAN_BANKS, Tt as Product, U as FULFILLMENT_METHODS, Ut as SubscriptionTerms, V as ExchangeRate, Vt as SubscriptionRenewal, W as FULFILLMENT_STATUSES, Wt as USAGE_FEATURE_TYPES, X as FeatureUsageResult, Xt as ApiErrorBody, Y as FeatureType, Yt as API_ERROR_TYPES, Z as Fulfillment, Zt as ApiErrorEnvelope, _ as CLAIM_STATUSES, _n as MOBILE_PREFIXES, _t as PaymentSettlement, a as WEBHOOK_TEST_EVENT, an as AddressInput, at as Invoice, b as CarrierOffice, bn as SUSPENSION_DAYS, bt as Plan, c as AfterCompletion, cn as BillingMonths, ct as LineItem, d as CANCELLATION_FEEDBACK, dn as GRACE_PERIOD_DAYS, dt as PRODUCT_CATEGORIES, en as PaymentFailureCode, et as FulfillmentMethod, f as CARRIERS, fn as GracePeriodDays, ft as Payment, g as CLAIM_REASONS, gn as MAX_QUANTITY, gt as PaymentLink, h as CLAIM_OUTCOMES, hn as ListSort, ht as PaymentFeeDetails, i as SubscribableEventType, in as Address, it as INVOICE_STATUSES, j as CurrencyAvailability, jn as Environment, jt as Refund, k as CollectSettings, kn as nationalPhone, kt as RESET_FREQUENCIES, l as Balance, ln as CURRENCIES, lt as MAX_SEATS, m as CHECKOUT_PURPOSES, mn as ListQuery, mt as PaymentFailure, n as EventDataMap, nn as ApiErrorCode, nt as FulfillmentTracking, o as WebhookEvent, on as BILLING_MONTHS, ot as InvoiceReason, p as CARRIER_TEST_SCENARIOS, pn as List, pt as PaymentAttempt, q as FeatureOperationResult, qt as ReceiptReference, r as EventType, rn as ACCOUNT_NUMBER_LENGTH, rt as INVOICE_REASONS, s as Actor, sn as BankCode, st as InvoiceStatus, t as EVENT_TYPES, tn as API_ERROR_CODES, tt as FulfillmentStatus, u as BalanceAmount, un as Currency, ut as PAYMENT_STATUSES, v as CancellationFeedback, vn as Metadata, vt as PaymentStatus, w as Claim, wn as Timestamp, wt as PortalSession, x as Checkout, xn as SuspensionDays, xt as PlanFeatureValues, y as Carrier, yn as MobilePrefix, yt as Payout, z as Deletion, zt as SubscriptionChangePreview } from "./events-TqSJMxqF.js";
4
3
  interface ClientOptions extends TransportOptions {
5
4
  /**
6
5
  * Token from `billete.customerSessions.create()` on your server. Needed only for the
@@ -14,7 +13,7 @@ interface ClientOptions extends TransportOptions {
14
13
  * and customer data requires a short-lived customer session minted by your server.
15
14
  *
16
15
  * ```ts
17
- * const billete = createClient({ apiVersion: "2026-10-21", customerSession: token });
16
+ * const billete = createClient({ apiVersion: "2026-10-24", customerSession: token });
18
17
  * const [subscription] = (await billete.customer.subscriptions()).data;
19
18
  * if (subscription?.renewal?.status === "overdue") showBanner(subscription.renewal);
20
19
  * ```
@@ -84,6 +83,11 @@ export declare function createClient(options: ClientOptions): {
84
83
  openClaim: (token: string, input: ClientClaimCreate, options?: RequestOptions) => Promise<PublicFulfillment>;
85
84
  /** Something went wrong: the funds stay held while Billete reviews it. */
86
85
  reportProblem: (token: string, input: ClientFulfillmentProblem, options?: RequestOptions) => Promise<PublicFulfillment>;
86
+ /**
87
+ * Where Billete sends the customer's refund by Pago Móvil, while it waits for one
88
+ * (`refund.status: "needs_destination"`).
89
+ */
90
+ setRefundDestination: (token: string, input: ClientRefundDestination, options?: RequestOptions) => Promise<PublicFulfillment>;
87
91
  };
88
92
  /**
89
93
  * A claim about a payment, as its customer follows it. The `token` comes in its page's link
@@ -133,5 +137,4 @@ export declare function createClient(options: ClientOptions): {
133
137
  };
134
138
  };
135
139
  type BilleteClient = ReturnType<typeof createClient>;
136
- //#endregion
137
- export { type ACCOUNT_NUMBER_LENGTH, type API_ERROR_CODES, type API_ERROR_TYPES, type API_VERSIONS, type API_VERSION_HEADER, type API_VERSION_PATTERN, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorCode, type ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type BilleteClient, BilleteError, type BilleteErrorCode, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CLAIM_OUTCOMES, type CLAIM_REASONS, type CLAIM_STATUSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type Claim, type ClaimMessage, type ClaimOutcome, type ClaimReason, type ClaimResolve, type ClaimRespond, type ClaimStatus, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientClaimCreate, type ClientCustomerClaimCreate, type ClientFulfillmentProblem, type ClientInvoicePay, type ClientLinkCheckout, type ClientOptions, type ClientPaymentCode, type ClientSubscriptionCancel, type ClientSubscriptionSeats, type ClientSubscriptionUpdate, type CollectInput, type CollectSettings, type Coupon, type CouponCreate, type CouponUpdate, type Currency, type CurrencyAvailability, type CustomField, type CustomFieldInput, type Customer, type CustomerCreate, type CustomerDetails, type CustomerFeature, type CustomerInput, type CustomerMember, type CustomerMemberCreate, type CustomerMemberList, type CustomerMemberUpdate, type CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerSubscriptionChangeResult, type CustomerUpdate, type Deletion, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type FULFILLMENT_METHODS, type FULFILLMENT_STATUSES, type Feature, type FeatureCreate, type FeatureOperation, type FeatureOperationCommit, type FeatureOperationCreate, type FeatureOperationResult, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, type Fulfillment, type FulfillmentChoice, type FulfillmentDeliverInput, type FulfillmentHandover, type FulfillmentHandoverInput, type FulfillmentInput, type FulfillmentMethod, type FulfillmentOption, type FulfillmentStatus, type FulfillmentTracking, type FulfillmentTrackingInput, type GRACE_PERIOD_DAYS, type GracePeriodDays, type INVOICE_REASONS, type INVOICE_STATUSES, type Invoice, type InvoiceCreate, type InvoiceLineInput, type InvoiceReason, type InvoiceStatus, type KEY_PATTERN, type LATEST_API_VERSION, type LatestApiVersion, type LineItem, type List, type ListQuery, type ListSort, type MAX_QUANTITY, type MAX_SEATS, type MOBILE_PREFIXES, type Metadata, type MobilePrefix, type PAYMENT_FAILURE_CODES, type PAYMENT_STATUSES, type PRODUCT_CATEGORIES, type Payment, type PaymentAttempt, type PaymentFailure, type PaymentFailureCode, type PaymentFeeDetails, type PaymentInstructions, type PaymentLink, type PaymentLinkCreate, type PaymentLinkUpdate, type PaymentMethodField, type PaymentMethodOption, type PaymentNextAction, type PaymentSettlement, type PaymentStatus, type PaymentTestScenario, type Payout, type Plan, type PlanCheckoutCreate, type PlanCouponCreate, type PlanCreate, type PlanFeatureValues, type PlanFeaturesInput, type PlanLinkCreate, type PlanPrice, type PlanPriceInput, type PlanSeats, type PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCouponCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicCheckoutItem, type PublicClaim, type PublicClaimSummary, type PublicFulfillment, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type RESET_FREQUENCIES, type RISK_LEVELS, type ReceiptReference, type ReceiptSend, type Refund, type RefundCreate, type RequestOptions, type ResetFrequency, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SUSPENSION_DAYS, type SubmitLabel, type SubscribableEventType, type Subscription, type SubscriptionCancel, type SubscriptionChange, type SubscriptionChangeCreate, type SubscriptionChangePreview, type SubscriptionChangePreviewInput, type SubscriptionChangeResult, type SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, type SubscriptionTerms, type SubscriptionUpdate, type SuspensionDays, type TAX_BEHAVIORS, type TaxBehavior, type Timestamp, type TokenKind, type USAGE_FEATURE_TYPES, type VENEZUELAN_BANKS, type VariantInput, type WEBHOOK_TEST_EVENT, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointUpdate, type WebhookEvent, type Weekday, type apiVersionLifecycle, type apiVersionStage, type currentApiVersion, type findBank, type isApiVersion, type isApiVersionRetired, type isLandlinePhone, type isMobilePhone, type nationalPhone, type supportedApiVersions, type tokenEnvironment, type tokenPrefix };
140
+ export { type ACCOUNT_NUMBER_LENGTH, type API_ERROR_CODES, type API_ERROR_TYPES, type API_VERSIONS, type API_VERSION_HEADER, type API_VERSION_PATTERN, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorCode, type ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type BilleteClient, BilleteError, type BilleteErrorCode, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CLAIM_OUTCOMES, type CLAIM_REASONS, type CLAIM_STATUSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type Claim, type ClaimMessage, type ClaimOutcome, type ClaimReason, type ClaimResolve, type ClaimRespond, type ClaimStatus, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientClaimCreate, type ClientCustomerClaimCreate, type ClientFulfillmentProblem, type ClientInvoicePay, type ClientLinkCheckout, type ClientOptions, type ClientPaymentCode, type ClientRefundDestination, type ClientSubscriptionCancel, type ClientSubscriptionSeats, type ClientSubscriptionUpdate, type CollectInput, type CollectSettings, type Coupon, type CouponCreate, type CouponUpdate, type Currency, type CurrencyAvailability, type CustomField, type CustomFieldInput, type Customer, type CustomerCreate, type CustomerDetails, type CustomerFeature, type CustomerInput, type CustomerMember, type CustomerMemberCreate, type CustomerMemberList, type CustomerMemberUpdate, type CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerSubscriptionChangeResult, type CustomerUpdate, type Deletion, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type FULFILLMENT_METHODS, type FULFILLMENT_STATUSES, type Feature, type FeatureCreate, type FeatureOperation, type FeatureOperationCommit, type FeatureOperationCreate, type FeatureOperationResult, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, type Fulfillment, type FulfillmentChoice, type FulfillmentDeliverInput, type FulfillmentHandover, type FulfillmentHandoverInput, type FulfillmentInput, type FulfillmentMethod, type FulfillmentOption, type FulfillmentStatus, type FulfillmentTracking, type FulfillmentTrackingInput, type GRACE_PERIOD_DAYS, type GracePeriodDays, type INVOICE_REASONS, type INVOICE_STATUSES, type Invoice, type InvoiceCreate, type InvoiceLineInput, type InvoiceReason, type InvoiceStatus, type KEY_PATTERN, type LATEST_API_VERSION, type LatestApiVersion, type LineItem, type List, type ListQuery, type ListSort, type MAX_QUANTITY, type MAX_SEATS, type MOBILE_PREFIXES, type Metadata, type MobilePrefix, type PAYMENT_FAILURE_CODES, type PAYMENT_STATUSES, type PRODUCT_CATEGORIES, type Payment, type PaymentAttempt, type PaymentFailure, type PaymentFailureCode, type PaymentFeeDetails, type PaymentInstructions, type PaymentLink, type PaymentLinkCreate, type PaymentLinkUpdate, type PaymentMethodField, type PaymentMethodOption, type PaymentNextAction, type PaymentSettlement, type PaymentStatus, type PaymentTestScenario, type Payout, type Plan, type PlanCheckoutCreate, type PlanCouponCreate, type PlanCreate, type PlanFeatureValues, type PlanFeaturesInput, type PlanLinkCreate, type PlanPrice, type PlanPriceInput, type PlanSeats, type PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCouponCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicCheckoutItem, type PublicClaim, type PublicClaimSummary, type PublicFulfillment, type PublicFulfillmentRefund, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type REFUND_MODES, type RESET_FREQUENCIES, type RISK_LEVELS, type ReceiptReference, type ReceiptSend, type Refund, type RefundCreate, type RequestOptions, type ResetFrequency, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SUSPENSION_DAYS, type SubmitLabel, type SubscribableEventType, type Subscription, type SubscriptionCancel, type SubscriptionChange, type SubscriptionChangeCreate, type SubscriptionChangePreview, type SubscriptionChangePreviewInput, type SubscriptionChangeResult, type SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, type SubscriptionTerms, type SubscriptionUpdate, type SuspensionDays, type TAX_BEHAVIORS, type TaxBehavior, type Timestamp, type TokenKind, type USAGE_FEATURE_TYPES, type VENEZUELAN_BANKS, type VariantInput, type WEBHOOK_TEST_EVENT, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointUpdate, type WebhookEvent, type Weekday, type apiVersionLifecycle, type apiVersionStage, type currentApiVersion, type findBank, type isApiVersion, type isApiVersionRetired, type isLandlinePhone, type isMobilePhone, type nationalPhone, type supportedApiVersions, type tokenEnvironment, type tokenPrefix };
package/dist/client.js CHANGED
@@ -1,12 +1,12 @@
1
- import { n as segment, r as BilleteError, t as createTransport } from "./http-CNxkDxq4.js";
2
- //#region src/create-client.ts
1
+ import { n as segment, r as BilleteError, t as createTransport } from "./http-B4z0Sbfu.js";
2
+ // src/create-client.ts
3
3
  /**
4
4
  * Browser client. It never holds a secret key: checkouts and Cobros are addressed by their
5
5
  * unguessable ID
6
6
  * and customer data requires a short-lived customer session minted by your server.
7
7
  *
8
8
  * ```ts
9
- * const billete = createClient({ apiVersion: "2026-10-21", customerSession: token });
9
+ * const billete = createClient({ apiVersion: "2026-10-24", customerSession: token });
10
10
  * const [subscription] = (await billete.customer.subscriptions()).data;
11
11
  * if (subscription?.renewal?.status === "overdue") showBanner(subscription.renewal);
12
12
  * ```
@@ -169,6 +169,16 @@ function createClient(options) {
169
169
  path: `${fulfillmentPath(token)}/problem`,
170
170
  body: input,
171
171
  options
172
+ }),
173
+ /**
174
+ * Where Billete sends the customer's refund by Pago Móvil, while it waits for one
175
+ * (`refund.status: "needs_destination"`).
176
+ */
177
+ setRefundDestination: (token, input, options) => http.request({
178
+ method: "PUT",
179
+ path: `${fulfillmentPath(token)}/refund-destination`,
180
+ body: input,
181
+ options
172
182
  })
173
183
  },
174
184
  /**
@@ -294,5 +304,4 @@ list: (options) => http.request({
294
304
  }
295
305
  };
296
306
  }
297
- //#endregion
298
307
  export { BilleteError, createClient };
@@ -1,5 +1,4 @@
1
- import { $t as PaymentFailureCode, An as Environment, At as Refund, C as CheckoutPurpose, Cn as Timestamp, Ct as PlanSeats, D as ClaimReason, E as ClaimOutcome, Et as ProductCategory, Ft as SubmitLabel, It as Subscription, J as FeatureReset, Kt as ReceiptReference, M as CustomField, O as ClaimStatus, P as CustomerDetails, S as CheckoutItem, Sn as TaxBehavior, St as PlanPrice, T as ClaimMessage, Yt as ApiErrorBody, Z as Fulfillment, Zt as ApiErrorType, _n as Metadata, b as CarrierOffice, bn as SuspensionDays, c as AfterCompletion, ct as LineItem, dn as GracePeriodDays, et as FulfillmentMethod, i as SubscribableEventType, in as AddressInput, k as CollectSettings, ln as Currency, mt as PaymentFailure, nt as FulfillmentTracking, ot as InvoiceReason, rn as Address, sn as BillingMonths, st as InvoiceStatus, tn as ApiErrorCode, tt as FulfillmentStatus, v as CancellationFeedback, vt as PaymentStatus, y as Carrier } from "./events-b2qMWZF8.js";
2
- //#region ../contracts/src/api-versions.d.ts
1
+ import { C as CheckoutPurpose, Cn as TaxBehavior, Ct as PlanSeats, D as ClaimReason, E as ClaimOutcome, Et as ProductCategory, It as SubmitLabel, J as FeatureReset, Lt as Subscription, M as CustomField, O as ClaimStatus, P as CustomerDetails, Qt as ApiErrorType, S as CheckoutItem, St as PlanPrice, T as ClaimMessage, Xt as ApiErrorBody, Z as Fulfillment, an as AddressInput, b as CarrierOffice, c as AfterCompletion, cn as BillingMonths, ct as LineItem, en as PaymentFailureCode, et as FulfillmentMethod, fn as GracePeriodDays, i as SubscribableEventType, in as Address, jn as Environment, jt as Refund, k as CollectSettings, mt as PaymentFailure, nn as ApiErrorCode, nt as FulfillmentTracking, ot as InvoiceReason, qt as ReceiptReference, st as InvoiceStatus, tt as FulfillmentStatus, un as Currency, v as CancellationFeedback, vn as Metadata, vt as PaymentStatus, wn as Timestamp, xn as SuspensionDays, y as Carrier } from "./events-TqSJMxqF.js";
3
2
  /**
4
3
  * Billete API versions. Kept free of runtime dependencies: the dashboard, the API, the worker and
5
4
  * the docs read it, and the public SDK pins its newest entry as a type.
@@ -9,8 +8,11 @@ import { $t as PaymentFailureCode, An as Environment, At as Refund, C as Checkou
9
8
  * ships as a new version. Additive changes (new endpoints, optional fields) reach every version
10
9
  * that is still supported.
11
10
  */
12
- /** Every version ever published, oldest first. Append only: retired versions stay listed. */
13
- declare const API_VERSIONS: readonly ["2026-10-07.beta", "2026-10-08", "2026-10-09", "2026-10-10", "2026-10-16", "2026-10-19", "2026-10-20", "2026-10-21"];
11
+ /**
12
+ * Every version published, oldest first. The history starts at `2026-10-24`, the first version
13
+ * open to businesses. Append only: retired versions stay listed.
14
+ */
15
+ declare const API_VERSIONS: readonly ["2026-10-24"];
14
16
  type ApiVersion = (typeof API_VERSIONS)[number];
15
17
  type LatestApiVersion = typeof API_VERSIONS extends readonly [...unknown[], infer Last] ? Last : never;
16
18
  /** The version the code speaks: responses are built in its shape. Always the last entry. */
@@ -42,8 +44,6 @@ declare function supportedApiVersions(now: Date): ApiVersion[];
42
44
  declare function supportedApiVersions<T extends string>(now: Date, registry: readonly T[]): T[];
43
45
  /** What new integrations should use: the newest stable version, or the newest beta before any. */
44
46
  declare function currentApiVersion(): ApiVersion;
45
- //#endregion
46
- //#region ../contracts/src/client.d.ts
47
47
  /**
48
48
  * A subscription as its customer sees it, in the browser: without the business's `metadata`, with
49
49
  * its plan's name and the cycles the customer may switch to.
@@ -287,6 +287,8 @@ interface PublicFulfillment {
287
287
  * and never for a shipment, which the carrier hands over.
288
288
  */
289
289
  handoverUrl: string | null;
290
+ /** When a shipment reached the carrier's office, waiting for the customer to pick it up. */
291
+ readyAt: Timestamp | null;
290
292
  deliveredAt: Timestamp | null;
291
293
  handover: Fulfillment["handover"];
292
294
  confirmBy: Timestamp | null;
@@ -299,6 +301,24 @@ interface PublicFulfillment {
299
301
  cancellationReason: Fulfillment["cancellationReason"];
300
302
  /** The latest claim about it, followed on its page (`url`); `null` without one. */
301
303
  claim: PublicClaimSummary | null;
304
+ /** Billete returning the purchase's money (`mode: "billete"`); `null` without one. */
305
+ refund: PublicFulfillmentRefund | null;
306
+ }
307
+ /**
308
+ * Billete returning a purchase's money by Pago Móvil. `needs_destination`: it waits for the
309
+ * customer to say where (`setRefundDestination`), also after a transfer to the previous one failed
310
+ * (`problem`). `processing`: Billete is sending it. `paid`: sent, with the bank's reference.
311
+ */
312
+ interface PublicFulfillmentRefund {
313
+ amount: number;
314
+ currency: Currency;
315
+ status: "needs_destination" | "processing" | "paid";
316
+ /** The destination given, masked: `Banesco · 0414 •••• 567`. */
317
+ destination: string | null;
318
+ /** Why the transfer to the previous destination did not go through. */
319
+ problem: string | null;
320
+ reference: string | null;
321
+ paidAt: Timestamp | null;
302
322
  }
303
323
  /**
304
324
  * The step a provider asks of the payer after starting a charge: leave for its page and come back
@@ -518,6 +538,7 @@ interface PublicClaim extends PublicClaimSummary {
518
538
  } | null;
519
539
  resolution: {
520
540
  outcome: ClaimOutcome;
541
+ by: "business" | "billete";
521
542
  note: string;
522
543
  refund: Pick<Refund, "amount" | "currency" | "status"> | null;
523
544
  resolvedAt: Timestamp;
@@ -525,8 +546,6 @@ interface PublicClaim extends PublicClaimSummary {
525
546
  withdrawnAt: Timestamp | null;
526
547
  updatedAt: Timestamp;
527
548
  }
528
- //#endregion
529
- //#region ../contracts/src/inputs.d.ts
530
549
  /** Identifiers merchants choose and use in code: `ai_tokens`, `export-pdf`. */
531
550
  declare const KEY_PATTERN: RegExp;
532
551
  interface CustomerCreate {
@@ -1056,6 +1075,15 @@ interface FulfillmentDeliverInput {
1056
1075
  interface ClientFulfillmentProblem {
1057
1076
  comment: string;
1058
1077
  }
1078
+ /** Where Billete sends the customer's refund by Pago Móvil. */
1079
+ interface ClientRefundDestination {
1080
+ /** The bank's code, `0102`. */
1081
+ bank: string;
1082
+ /** A Venezuelan mobile phone, `0414 1234567`. */
1083
+ phone: string;
1084
+ /** The cédula or RIF of whoever holds it, `V-12345678`. */
1085
+ holderId: string;
1086
+ }
1059
1087
  /** Opens a claim about a payment, from the customer's page of it. */
1060
1088
  interface ClientClaimCreate {
1061
1089
  reason: ClaimReason;
@@ -1085,8 +1113,6 @@ type ClaimResolve = {
1085
1113
  outcome: "business";
1086
1114
  note: string;
1087
1115
  };
1088
- //#endregion
1089
- //#region src/http.d.ts
1090
1116
  interface TransportOptions {
1091
1117
  /**
1092
1118
  * The Billete API version your integration is written against. Required: Billete never changes
@@ -1113,8 +1139,6 @@ interface RequestOptions {
1113
1139
  idempotencyKey?: string;
1114
1140
  signal?: AbortSignal;
1115
1141
  }
1116
- //#endregion
1117
- //#region src/errors.d.ts
1118
1142
  /**
1119
1143
  * What a failed request says: a code of the API (`API_ERROR_CODES` lists what each means), or the
1120
1144
  * SDK's own when Billete could not be reached (`network_error`) or answered something unexpected
@@ -1133,5 +1157,4 @@ declare class BilleteError extends Error {
1133
1157
  code: BilleteErrorCode;
1134
1158
  }, status: number, options?: ErrorOptions);
1135
1159
  }
1136
- //#endregion
1137
- export { ProductCheckoutCreate as $, CustomerUpdate as A, PublicPortal as At, InvoiceCreate as B, apiVersionStage as Bt, CouponUpdate as C, PublicCheckoutItem as Ct, CustomerMemberCreate as D, PublicInvoice as Dt, CustomerInput as E, PublicFulfillment as Et, FeatureUpdate as F, ApiVersionLifecycle as Ft, PlanCheckoutCreate as G, KEY_PATTERN as H, isApiVersion as Ht, FulfillmentDeliverInput as I, ApiVersionStage as It, PlanFeaturesInput as J, PlanCouponCreate as K, FulfillmentHandoverInput as L, LATEST_API_VERSION as Lt, FeatureCreate as M, API_VERSION_HEADER as Mt, FeatureOperationCommit as N, API_VERSION_PATTERN as Nt, CustomerMemberUpdate as O, PublicPaymentLink as Ot, FeatureOperationCreate as P, ApiVersion as Pt, PortalSessionCreate as Q, FulfillmentInput as R, LatestApiVersion as Rt, CouponCreate as S, PublicCheckout as St, CustomerCreate as T, PublicClaimSummary as Tt, PaymentLinkCreate as U, isApiVersionRetired as Ut, InvoiceLineInput as V, currentApiVersion as Vt, PaymentLinkUpdate as W, supportedApiVersions as Wt, PlanPriceInput as X, PlanLinkCreate as Y, PlanUpdate as Z, ClientPaymentCode as _, PaymentMethodField as _t, AfterCompletionInput as a, SubscriptionCancel as at, ClientSubscriptionUpdate as b, PaymentTestScenario as bt, ClaimResolve as c, SubscriptionCreate as ct, ClientCheckoutUpdate as d, WebhookEndpointCreate as dt, ProductCouponCreate as et, ClientClaimCreate as f, WebhookEndpointUpdate as ft, ClientLinkCheckout as g, PaymentInstructions as gt, ClientInvoicePay as h, FulfillmentOption as ht, TransportOptions as i, RefundCreate as it, EventSelector as j, API_VERSIONS as jt, CustomerSessionCreate as k, PublicPaymentState as kt, ClaimRespond as l, SubscriptionUpdate as lt, ClientFulfillmentProblem as m, CustomerSubscriptionChangeResult as mt, BilleteErrorCode as n, ProductLinkCreate as nt, CheckoutCreate as o, SubscriptionChangeCreate as ot, ClientCustomerClaimCreate as p, CustomerSubscription as pt, PlanCreate as q, RequestOptions as r, ProductUpdate as rt, CheckoutItemInput as s, SubscriptionChangePreviewInput as st, BilleteError as t, ProductCreate as tt, ClientCheckoutPay as u, VariantInput as ut, ClientSubscriptionCancel as v, PaymentMethodOption as vt, CustomFieldInput as w, PublicClaim as wt, CollectInput as x, PortalFeatures as xt, ClientSubscriptionSeats as y, PaymentNextAction as yt, FulfillmentTrackingInput as z, apiVersionLifecycle as zt };
1160
+ export { PortalSessionCreate as $, CustomerSessionCreate as A, PublicPaymentLink as At, FulfillmentTrackingInput as B, LatestApiVersion as Bt, CouponCreate as C, PublicCheckout as Ct, CustomerInput as D, PublicFulfillment as Dt, CustomerCreate as E, PublicClaimSummary as Et, FeatureOperationCreate as F, API_VERSION_PATTERN as Ft, PaymentLinkUpdate as G, isApiVersionRetired as Gt, InvoiceLineInput as H, apiVersionStage as Ht, FeatureUpdate as I, ApiVersion as It, PlanCreate as J, PlanCheckoutCreate as K, supportedApiVersions as Kt, FulfillmentDeliverInput as L, ApiVersionLifecycle as Lt, EventSelector as M, PublicPortal as Mt, FeatureCreate as N, API_VERSIONS as Nt, CustomerMemberCreate as O, PublicFulfillmentRefund as Ot, FeatureOperationCommit as P, API_VERSION_HEADER as Pt, PlanUpdate as Q, FulfillmentHandoverInput as R, ApiVersionStage as Rt, CollectInput as S, PortalFeatures as St, CustomFieldInput as T, PublicClaim as Tt, KEY_PATTERN as U, currentApiVersion as Ut, InvoiceCreate as V, apiVersionLifecycle as Vt, PaymentLinkCreate as W, isApiVersion as Wt, PlanLinkCreate as X, PlanFeaturesInput as Y, PlanPriceInput as Z, ClientPaymentCode as _, PaymentInstructions as _t, AfterCompletionInput as a, RefundCreate as at, ClientSubscriptionSeats as b, PaymentNextAction as bt, ClaimResolve as c, SubscriptionChangePreviewInput as ct, ClientCheckoutUpdate as d, VariantInput as dt, ProductCheckoutCreate as et, ClientClaimCreate as f, WebhookEndpointCreate as ft, ClientLinkCheckout as g, FulfillmentOption as gt, ClientInvoicePay as h, CustomerSubscriptionChangeResult as ht, TransportOptions as i, ProductUpdate as it, CustomerUpdate as j, PublicPaymentState as jt, CustomerMemberUpdate as k, PublicInvoice as kt, ClaimRespond as l, SubscriptionCreate as lt, ClientFulfillmentProblem as m, CustomerSubscription as mt, BilleteErrorCode as n, ProductCreate as nt, CheckoutCreate as o, SubscriptionCancel as ot, ClientCustomerClaimCreate as p, WebhookEndpointUpdate as pt, PlanCouponCreate as q, RequestOptions as r, ProductLinkCreate as rt, CheckoutItemInput as s, SubscriptionChangeCreate as st, BilleteError as t, ProductCouponCreate as tt, ClientCheckoutPay as u, SubscriptionUpdate as ut, ClientRefundDestination as v, PaymentMethodField as vt, CouponUpdate as w, PublicCheckoutItem as wt, ClientSubscriptionUpdate as x, PaymentTestScenario as xt, ClientSubscriptionCancel as y, PaymentMethodOption as yt, FulfillmentInput as z, LATEST_API_VERSION as zt };
@@ -1,4 +1,3 @@
1
- //#region ../contracts/src/environment.d.ts
2
1
  /**
3
2
  * Environments and the credentials that name them. Kept free of runtime dependencies: the public
4
3
  * SDK bundles this module to check API keys.
@@ -17,8 +16,6 @@ declare function tokenPrefix(kind: TokenKind, environment: Environment): string;
17
16
  * The environment a token belongs to by its prefix, or `null` when it is not that kind of token.
18
17
  */
19
18
  declare function tokenEnvironment(kind: TokenKind, token: string): Environment | null;
20
- //#endregion
21
- //#region ../contracts/src/common.d.ts
22
19
  /** Currencies Billete can price in. Availability depends on the registered payment providers. */
23
20
  declare const CURRENCIES: readonly ["VES", "USD", "EUR", "USDT"];
24
21
  type Currency = (typeof CURRENCIES)[number];
@@ -255,8 +252,6 @@ interface List<T> {
255
252
  }
256
253
  /** ISO 8601 timestamp in UTC. */
257
254
  type Timestamp = string;
258
- //#endregion
259
- //#region ../contracts/src/error-codes.d.ts
260
255
  /**
261
256
  * Every `code` the API may answer with in `/v1` and `/v1/client`, with what it means. Stable: an
262
257
  * integration may decide on them. A new code is an incompatible change and ships in a new API
@@ -294,7 +289,6 @@ declare const API_ERROR_CODES: {
294
289
  readonly claim_messages_limit: "Este reclamo ya tiene demasiados mensajes: es momento de resolverlo.";
295
290
  readonly claim_not_found: "No existe el reclamo.";
296
291
  readonly coupon_already_used: "Ya usaste este cupón.";
297
- readonly coupon_applies_to_required: "Indica si el cupón es para productos o para planes (appliesTo).";
298
292
  readonly coupon_currency_mismatch: "El cupón solo aplica a precios en otra moneda.";
299
293
  readonly coupon_deleted: "Este cupón fue eliminado y no puede modificarse.";
300
294
  readonly coupon_exhausted: "El cupón alcanzó su límite de usos.";
@@ -430,6 +424,7 @@ declare const API_ERROR_CODES: {
430
424
  readonly receipt_resend_limit: "Puedes enviar el recibo hasta cinco veces por hora. Inténtalo más tarde.";
431
425
  readonly refund_amount_mismatch: "Registra el importe completo de la devolución pendiente.";
432
426
  readonly refund_approval_pending: "Este pago ya tiene un reembolso esperando aprobación.";
427
+ readonly refund_destination_not_needed: "Esta compra no tiene una devolución esperando tus datos.";
433
428
  readonly refund_exceeds_payment: "El reembolso supera lo que queda por reembolsar del pago.";
434
429
  readonly refund_threshold_change_pending: "Ya hay un cambio de la aprobación de reembolsos pendiente: cancélalo antes de pedir otro.";
435
430
  readonly renewal_invoice: "El cobro es la renovación de una suscripción y no se puede cerrar a mano.";
@@ -481,8 +476,6 @@ declare const API_ERROR_CODES: {
481
476
  readonly webhook_url_unresolvable: "No pudimos resolver el dominio del webhook.";
482
477
  };
483
478
  type ApiErrorCode = keyof typeof API_ERROR_CODES;
484
- //#endregion
485
- //#region ../contracts/src/errors.d.ts
486
479
  declare const API_ERROR_TYPES: readonly ["invalid_request", "authentication", "permission", "not_found", "conflict", "validation", "rate_limit", "provider", "internal"];
487
480
  type ApiErrorType = (typeof API_ERROR_TYPES)[number];
488
481
  interface ApiErrorBody {
@@ -506,8 +499,6 @@ declare const PAYMENT_FAILURE_CODES: readonly ["insufficient_funds", "payment_no
506
499
  /** The payer left the page while it waited for their code, and did not come back in time. */
507
500
  "abandoned"];
508
501
  type PaymentFailureCode = (typeof PAYMENT_FAILURE_CODES)[number];
509
- //#endregion
510
- //#region ../contracts/src/receipts.d.ts
511
502
  interface ReceiptReference {
512
503
  id: string;
513
504
  number: string;
@@ -515,8 +506,6 @@ interface ReceiptReference {
515
506
  interface ReceiptSend {
516
507
  email?: string;
517
508
  }
518
- //#endregion
519
- //#region ../contracts/src/resources.d.ts
520
509
  interface Resource<TObject extends string> {
521
510
  id: string;
522
511
  object: TObject;
@@ -1124,6 +1113,8 @@ interface Fulfillment extends Resource<"fulfillment"> {
1124
1113
  number: string;
1125
1114
  reason: string;
1126
1115
  } | null;
1116
+ /** When the carrier reported a shipment at the office, waiting for its customer. */
1117
+ readyAt: Timestamp | null;
1127
1118
  deliveredAt: Timestamp | null;
1128
1119
  /** How it was handed over, once the business did; `null` before, and for a shipment. */
1129
1120
  handover: FulfillmentHandover | null;
@@ -1132,9 +1123,10 @@ interface Fulfillment extends Resource<"fulfillment"> {
1132
1123
  receivedAt: Timestamp | null;
1133
1124
  /**
1134
1125
  * `customer`: they confirmed it. `timeout`: they said nothing before `confirmBy`. `carrier`: the
1135
- * carrier delivered it.
1126
+ * carrier delivered it. `billete`: Billete reviewed the problem reported and decided it in the
1127
+ * business's favor.
1136
1128
  */
1137
- receivedBy: "customer" | "timeout" | "carrier" | null;
1129
+ receivedBy: "customer" | "timeout" | "carrier" | "billete" | null;
1138
1130
  problem: {
1139
1131
  comment: string;
1140
1132
  reportedAt: Timestamp;
@@ -1142,7 +1134,7 @@ interface Fulfillment extends Resource<"fulfillment"> {
1142
1134
  canceledAt: Timestamp | null;
1143
1135
  /**
1144
1136
  * `refunded`: its payment was fully refunded. `not_shipped`: it had no valid tracking number by
1145
- * `trackingDueAt`; its funds stay held until the customer is refunded.
1137
+ * `trackingDueAt`; Billete refunds its customer (`mode: "billete"`).
1146
1138
  */
1147
1139
  cancellationReason: "refunded" | "not_shipped" | null;
1148
1140
  updatedAt: Timestamp;
@@ -1268,13 +1260,19 @@ interface Payment extends Resource<"payment"> {
1268
1260
  succeededAt: Timestamp | null;
1269
1261
  updatedAt: Timestamp;
1270
1262
  }
1263
+ declare const REFUND_MODES: readonly ["provider", "manual", "billete"];
1271
1264
  interface Refund extends Resource<"refund"> {
1272
1265
  paymentId: string;
1273
1266
  amount: number;
1274
1267
  currency: Currency;
1275
1268
  reason: string | null;
1276
- /** `manual`: the method cannot refund automatically; the merchant returned the funds. */
1277
- mode: "provider" | "manual";
1269
+ /**
1270
+ * `provider`: the method's provider returns the funds. `manual`: the method cannot refund
1271
+ * automatically; the merchant returned the funds. `billete`: Billete returns them by Pago Móvil
1272
+ * to where the customer says, on the delivery's page (a shipment not sent in time, or a problem
1273
+ * Billete decided in the customer's favor); `pending` until it does.
1274
+ */
1275
+ mode: (typeof REFUND_MODES)[number];
1278
1276
  status: "pending" | "succeeded" | "failed";
1279
1277
  }
1280
1278
  /**
@@ -1295,10 +1293,13 @@ type ClaimStatus = (typeof CLAIM_STATUSES)[number];
1295
1293
  /** In whose favor a claim was resolved. */
1296
1294
  declare const CLAIM_OUTCOMES: readonly ["customer", "business"];
1297
1295
  type ClaimOutcome = (typeof CLAIM_OUTCOMES)[number];
1298
- /** One message of a claim's conversation between the customer and the business. */
1296
+ /**
1297
+ * One message of a claim's conversation between the customer and the business. `billete`: Billete's
1298
+ * team, reviewing a problem with a delivery whose funds it holds.
1299
+ */
1299
1300
  interface ClaimMessage {
1300
1301
  id: string;
1301
- author: "customer" | "business";
1302
+ author: "customer" | "business" | "billete";
1302
1303
  body: string;
1303
1304
  createdAt: Timestamp;
1304
1305
  }
@@ -1320,7 +1321,9 @@ interface Claim extends Resource<"claim"> {
1320
1321
  messages: ClaimMessage[];
1321
1322
  resolution: {
1322
1323
  outcome: ClaimOutcome;
1323
- /** What the business told the customer. */
1324
+ /** Who decided it: the business, or Billete reviewing a problem with a delivery. */
1325
+ by: "business" | "billete";
1326
+ /** What the customer was told. */
1324
1327
  note: string;
1325
1328
  /** The refund issued when resolving it in the customer's favor. */
1326
1329
  refundId: string | null;
@@ -1399,8 +1402,6 @@ interface PortalSession {
1399
1402
  returnUrl: string | null;
1400
1403
  expiresAt: Timestamp;
1401
1404
  }
1402
- //#endregion
1403
- //#region ../contracts/src/events.d.ts
1404
1405
  interface EventDataMap {
1405
1406
  "product.updated": Product;
1406
1407
  "product.deleted": Product;
@@ -1443,6 +1444,10 @@ interface EventDataMap {
1443
1444
  "refund.created": Refund;
1444
1445
  /** The provider could not return the funds; the amount is back in the balance. */
1445
1446
  "refund.failed": Refund;
1447
+ "payout.created": Payout;
1448
+ "payout.paid": Payout;
1449
+ "payout.failed": Payout;
1450
+ "payout.canceled": Payout;
1446
1451
  "invoice.created": Invoice;
1447
1452
  "invoice.paid": Invoice;
1448
1453
  "invoice.voided": Invoice;
@@ -1473,7 +1478,7 @@ type EventType = keyof EventDataMap;
1473
1478
  declare const WEBHOOK_TEST_EVENT: "webhook_endpoint.test";
1474
1479
  /** What a webhook endpoint can subscribe to: everything that happens in a business. */
1475
1480
  type SubscribableEventType = Exclude<EventType, typeof WEBHOOK_TEST_EVENT>;
1476
- declare const EVENT_TYPES: readonly ["product.updated", "product.deleted", "payment_link.deleted", "customer.created", "customer.updated", "customer.member_added", "customer.member_removed", "subscription.change_failed", "checkout.completed", "checkout.expired", "payment.succeeded", "payment.failed", "payment.refunded", "fulfillment.created", "fulfillment.shipped", "fulfillment.ready_for_pickup", "fulfillment.delivered", "fulfillment.received", "fulfillment.problem_reported", "fulfillment.canceled", "claim.created", "claim.updated", "claim.resolved", "claim.withdrawn", "refund.created", "refund.failed", "invoice.created", "invoice.paid", "invoice.voided", "invoice.uncollectible", "subscription.created", "subscription.updated", "subscription.renewal_due", "subscription.renewed", "subscription.past_due", "subscription.suspended", "subscription.reactivated", "subscription.canceled", "subscription.expired"];
1481
+ declare const EVENT_TYPES: readonly ["product.updated", "product.deleted", "payment_link.deleted", "customer.created", "customer.updated", "customer.member_added", "customer.member_removed", "subscription.change_failed", "checkout.completed", "checkout.expired", "payment.succeeded", "payment.failed", "payment.refunded", "fulfillment.created", "fulfillment.shipped", "fulfillment.ready_for_pickup", "fulfillment.delivered", "fulfillment.received", "fulfillment.problem_reported", "fulfillment.canceled", "claim.created", "claim.updated", "claim.resolved", "claim.withdrawn", "refund.created", "refund.failed", "payout.created", "payout.paid", "payout.failed", "payout.canceled", "invoice.created", "invoice.paid", "invoice.voided", "invoice.uncollectible", "subscription.created", "subscription.updated", "subscription.renewal_due", "subscription.renewed", "subscription.past_due", "subscription.suspended", "subscription.reactivated", "subscription.canceled", "subscription.expired"];
1477
1482
  /** A delivered webhook, discriminated by `type` so `data` narrows automatically. */
1478
1483
  type WebhookEvent = { [TType in EventType]: {
1479
1484
  id: string;
@@ -1485,5 +1490,4 @@ type WebhookEvent = { [TType in EventType]: {
1485
1490
  createdAt: string;
1486
1491
  data: EventDataMap[TType];
1487
1492
  }; }[EventType];
1488
- //#endregion
1489
- export { FulfillmentHandover as $, PaymentFailureCode as $t, Coupon as A, Environment as An, Refund as At, Event as B, SubscriptionRenewal as Bt, CheckoutPurpose as C, Timestamp as Cn, PlanSeats as Ct, ClaimReason as D, isMobilePhone as Dn, ProductVariant as Dt, ClaimOutcome as E, isLandlinePhone as En, ProductCategory as Et, CustomerFeature as F, SubmitLabel as Ft, Feature as G, Weekday as Gt, FEATURE_TYPES as H, SubscriptionTerms as Ht, CustomerMember as I, Subscription as It, FeatureReset as J, API_ERROR_TYPES as Jt, FeatureOperation as K, ReceiptReference as Kt, CustomerMemberList as L, SubscriptionChange as Lt, CustomField as M, tokenEnvironment as Mn, RiskLevel as Mt, Customer as N, tokenPrefix as Nn, SUBMIT_LABELS as Nt, ClaimStatus as O, nationalPhone as On, RESET_FREQUENCIES as Ot, CustomerDetails as P, SUBSCRIPTION_STATUSES as Pt, FulfillmentChoice as Q, PAYMENT_FAILURE_CODES as Qt, CustomerSession as R, SubscriptionChangePreview as Rt, CheckoutItem as S, TaxBehavior as Sn, PlanPrice as St, ClaimMessage as T, findBank as Tn, Product as Tt, FULFILLMENT_METHODS as U, USAGE_FEATURE_TYPES as Ut, ExchangeRate as V, SubscriptionStatus as Vt, FULFILLMENT_STATUSES as W, WebhookEndpoint as Wt, FeatureUsageResult as X, ApiErrorEnvelope as Xt, FeatureType as Y, ApiErrorBody as Yt, Fulfillment as Z, ApiErrorType as Zt, CLAIM_STATUSES as _, Metadata as _n, PaymentSettlement as _t, WEBHOOK_TEST_EVENT as a, BILLING_MONTHS as an, Invoice as at, CarrierOffice as b, SuspensionDays as bn, Plan as bt, AfterCompletion as c, CURRENCIES as cn, LineItem as ct, CANCELLATION_FEEDBACK as d, GracePeriodDays as dn, PRODUCT_CATEGORIES as dt, API_ERROR_CODES as en, FulfillmentMethod as et, CARRIERS as f, List as fn, Payment as ft, CLAIM_REASONS as g, MOBILE_PREFIXES as gn, PaymentLink as gt, CLAIM_OUTCOMES as h, MAX_QUANTITY as hn, PaymentFeeDetails as ht, SubscribableEventType as i, AddressInput as in, INVOICE_STATUSES as it, CurrencyAvailability as j, TokenKind as jn, ResetFrequency as jt, CollectSettings as k, ENVIRONMENTS as kn, RISK_LEVELS as kt, Balance as l, Currency as ln, MAX_SEATS as lt, CHECKOUT_PURPOSES as m, ListSort as mn, PaymentFailure as mt, EventDataMap as n, ACCOUNT_NUMBER_LENGTH as nn, FulfillmentTracking as nt, WebhookEvent as o, BankCode as on, InvoiceReason as ot, CARRIER_TEST_SCENARIOS as p, ListQuery as pn, PaymentAttempt as pt, FeatureOperationResult as q, ReceiptSend as qt, EventType as r, Address as rn, INVOICE_REASONS as rt, Actor as s, BillingMonths as sn, InvoiceStatus as st, EVENT_TYPES as t, ApiErrorCode as tn, FulfillmentStatus as tt, BalanceAmount as u, GRACE_PERIOD_DAYS as un, PAYMENT_STATUSES as ut, CancellationFeedback as v, MobilePrefix as vn, PaymentStatus as vt, Claim as w, VENEZUELAN_BANKS as wn, PortalSession as wt, Checkout as x, TAX_BEHAVIORS as xn, PlanFeatureValues as xt, Carrier as y, SUSPENSION_DAYS as yn, Payout as yt, Deletion as z, SubscriptionChangeResult as zt };
1493
+ export { FulfillmentHandover as $, PAYMENT_FAILURE_CODES as $t, Coupon as A, ENVIRONMENTS as An, RISK_LEVELS as At, Event as B, SubscriptionChangeResult as Bt, CheckoutPurpose as C, TaxBehavior as Cn, PlanSeats as Ct, ClaimReason as D, isLandlinePhone as Dn, ProductVariant as Dt, ClaimOutcome as E, findBank as En, ProductCategory as Et, CustomerFeature as F, SUBSCRIPTION_STATUSES as Ft, Feature as G, WebhookEndpoint as Gt, FEATURE_TYPES as H, SubscriptionStatus as Ht, CustomerMember as I, SubmitLabel as It, FeatureReset as J, ReceiptSend as Jt, FeatureOperation as K, Weekday as Kt, CustomerMemberList as L, Subscription as Lt, CustomField as M, TokenKind as Mn, ResetFrequency as Mt, Customer as N, tokenEnvironment as Nn, RiskLevel as Nt, ClaimStatus as O, isMobilePhone as On, REFUND_MODES as Ot, CustomerDetails as P, tokenPrefix as Pn, SUBMIT_LABELS as Pt, FulfillmentChoice as Q, ApiErrorType as Qt, CustomerSession as R, SubscriptionChange as Rt, CheckoutItem as S, TAX_BEHAVIORS as Sn, PlanPrice as St, ClaimMessage as T, VENEZUELAN_BANKS as Tn, Product as Tt, FULFILLMENT_METHODS as U, SubscriptionTerms as Ut, ExchangeRate as V, SubscriptionRenewal as Vt, FULFILLMENT_STATUSES as W, USAGE_FEATURE_TYPES as Wt, FeatureUsageResult as X, ApiErrorBody as Xt, FeatureType as Y, API_ERROR_TYPES as Yt, Fulfillment as Z, ApiErrorEnvelope as Zt, CLAIM_STATUSES as _, MOBILE_PREFIXES as _n, PaymentSettlement as _t, WEBHOOK_TEST_EVENT as a, AddressInput as an, Invoice as at, CarrierOffice as b, SUSPENSION_DAYS as bn, Plan as bt, AfterCompletion as c, BillingMonths as cn, LineItem as ct, CANCELLATION_FEEDBACK as d, GRACE_PERIOD_DAYS as dn, PRODUCT_CATEGORIES as dt, PaymentFailureCode as en, FulfillmentMethod as et, CARRIERS as f, GracePeriodDays as fn, Payment as ft, CLAIM_REASONS as g, MAX_QUANTITY as gn, PaymentLink as gt, CLAIM_OUTCOMES as h, ListSort as hn, PaymentFeeDetails as ht, SubscribableEventType as i, Address as in, INVOICE_STATUSES as it, CurrencyAvailability as j, Environment as jn, Refund as jt, CollectSettings as k, nationalPhone as kn, RESET_FREQUENCIES as kt, Balance as l, CURRENCIES as ln, MAX_SEATS as lt, CHECKOUT_PURPOSES as m, ListQuery as mn, PaymentFailure as mt, EventDataMap as n, ApiErrorCode as nn, FulfillmentTracking as nt, WebhookEvent as o, BILLING_MONTHS as on, InvoiceReason as ot, CARRIER_TEST_SCENARIOS as p, List as pn, PaymentAttempt as pt, FeatureOperationResult as q, ReceiptReference as qt, EventType as r, ACCOUNT_NUMBER_LENGTH as rn, INVOICE_REASONS as rt, Actor as s, BankCode as sn, InvoiceStatus as st, EVENT_TYPES as t, API_ERROR_CODES as tn, FulfillmentStatus as tt, BalanceAmount as u, Currency as un, PAYMENT_STATUSES as ut, CancellationFeedback as v, Metadata as vn, PaymentStatus as vt, Claim as w, Timestamp as wn, PortalSession as wt, Checkout as x, SuspensionDays as xn, PlanFeatureValues as xt, Carrier as y, MobilePrefix as yn, Payout as yt, Deletion as z, SubscriptionChangePreview as zt };
@@ -1,4 +1,4 @@
1
- //#region src/errors.ts
1
+ // src/errors.ts
2
2
  /** Any failed Billete request. `type`/`code` are stable and safe to branch on. */
3
3
  var BilleteError = class extends Error {
4
4
  type;
@@ -16,9 +16,8 @@ var BilleteError = class extends Error {
16
16
  this.requestId = body.requestId;
17
17
  }
18
18
  };
19
- //#endregion
20
- //#region src/http.ts
21
- const SDK_VERSION = "8.0.0";
19
+ // src/http.ts
20
+ const SDK_VERSION = "9.1.0";
22
21
  const DEFAULT_BASE_URL = "https://api.billete.run";
23
22
  const RETRYABLE_STATUS = /* @__PURE__ */ new Set([
24
23
  429,
@@ -147,5 +146,4 @@ function createTransport(options) {
147
146
  function segment(value) {
148
147
  return encodeURIComponent(value);
149
148
  }
150
- //#endregion
151
149
  export { segment as n, BilleteError as r, createTransport as t };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { $ as ProductCheckoutCreate, A as CustomerUpdate, At as PublicPortal, B as InvoiceCreate, Bt as apiVersionStage, C as CouponUpdate, Ct as PublicCheckoutItem, D as CustomerMemberCreate, Dt as PublicInvoice, E as CustomerInput, Et as PublicFulfillment, F as FeatureUpdate, Ft as ApiVersionLifecycle, G as PlanCheckoutCreate, H as KEY_PATTERN, Ht as isApiVersion, I as FulfillmentDeliverInput, It as ApiVersionStage, J as PlanFeaturesInput, K as PlanCouponCreate, L as FulfillmentHandoverInput, Lt as LATEST_API_VERSION, M as FeatureCreate, Mt as API_VERSION_HEADER, N as FeatureOperationCommit, Nt as API_VERSION_PATTERN, O as CustomerMemberUpdate, Ot as PublicPaymentLink, P as FeatureOperationCreate, Pt as ApiVersion, Q as PortalSessionCreate, R as FulfillmentInput, Rt as LatestApiVersion, S as CouponCreate, St as PublicCheckout, T as CustomerCreate, Tt as PublicClaimSummary, U as PaymentLinkCreate, Ut as isApiVersionRetired, V as InvoiceLineInput, Vt as currentApiVersion, W as PaymentLinkUpdate, Wt as supportedApiVersions, X as PlanPriceInput, Y as PlanLinkCreate, Z as PlanUpdate, _ as ClientPaymentCode, _t as PaymentMethodField, a as AfterCompletionInput, at as SubscriptionCancel, b as ClientSubscriptionUpdate, bt as PaymentTestScenario, c as ClaimResolve, ct as SubscriptionCreate, d as ClientCheckoutUpdate, dt as WebhookEndpointCreate, et as ProductCouponCreate, f as ClientClaimCreate, ft as WebhookEndpointUpdate, g as ClientLinkCheckout, gt as PaymentInstructions, h as ClientInvoicePay, ht as FulfillmentOption, i as TransportOptions, it as RefundCreate, j as EventSelector, jt as API_VERSIONS, k as CustomerSessionCreate, kt as PublicPaymentState, l as ClaimRespond, lt as SubscriptionUpdate, m as ClientFulfillmentProblem, mt as CustomerSubscriptionChangeResult, n as BilleteErrorCode, nt as ProductLinkCreate, o as CheckoutCreate, ot as SubscriptionChangeCreate, p as ClientCustomerClaimCreate, pt as CustomerSubscription, q as PlanCreate, r as RequestOptions, rt as ProductUpdate, s as CheckoutItemInput, st as SubscriptionChangePreviewInput, t as BilleteError, tt as ProductCreate, u as ClientCheckoutPay, ut as VariantInput, v as ClientSubscriptionCancel, vt as PaymentMethodOption, w as CustomFieldInput, wt as PublicClaim, x as CollectInput, xt as PortalFeatures, y as ClientSubscriptionSeats, yt as PaymentNextAction, z as FulfillmentTrackingInput, zt as apiVersionLifecycle } from "./errors-DERevGF5.js";
2
- import { $ as FulfillmentHandover, $t as PaymentFailureCode, A as Coupon, An as Environment, At as Refund, B as Event, Bt as SubscriptionRenewal, C as CheckoutPurpose, Cn as Timestamp, Ct as PlanSeats, D as ClaimReason, Dn as isMobilePhone, Dt as ProductVariant, E as ClaimOutcome, En as isLandlinePhone, Et as ProductCategory, F as CustomerFeature, Ft as SubmitLabel, G as Feature, Gt as Weekday, H as FEATURE_TYPES, Ht as SubscriptionTerms, I as CustomerMember, It as Subscription, J as FeatureReset, Jt as API_ERROR_TYPES, K as FeatureOperation, Kt as ReceiptReference, L as CustomerMemberList, Lt as SubscriptionChange, M as CustomField, Mn as tokenEnvironment, Mt as RiskLevel, N as Customer, Nn as tokenPrefix, Nt as SUBMIT_LABELS, O as ClaimStatus, On as nationalPhone, Ot as RESET_FREQUENCIES, P as CustomerDetails, Pt as SUBSCRIPTION_STATUSES, Q as FulfillmentChoice, Qt as PAYMENT_FAILURE_CODES, R as CustomerSession, Rt as SubscriptionChangePreview, S as CheckoutItem, Sn as TaxBehavior, St as PlanPrice, T as ClaimMessage, Tn as findBank, Tt as Product, U as FULFILLMENT_METHODS, Ut as USAGE_FEATURE_TYPES, V as ExchangeRate, Vt as SubscriptionStatus, W as FULFILLMENT_STATUSES, Wt as WebhookEndpoint, X as FeatureUsageResult, Xt as ApiErrorEnvelope, Y as FeatureType, Yt as ApiErrorBody, Z as Fulfillment, Zt as ApiErrorType, _ as CLAIM_STATUSES, _n as Metadata, _t as PaymentSettlement, a as WEBHOOK_TEST_EVENT, an as BILLING_MONTHS, at as Invoice, b as CarrierOffice, bn as SuspensionDays, bt as Plan, c as AfterCompletion, cn as CURRENCIES, ct as LineItem, d as CANCELLATION_FEEDBACK, dn as GracePeriodDays, dt as PRODUCT_CATEGORIES, en as API_ERROR_CODES, et as FulfillmentMethod, f as CARRIERS, fn as List, ft as Payment, g as CLAIM_REASONS, gn as MOBILE_PREFIXES, gt as PaymentLink, h as CLAIM_OUTCOMES, hn as MAX_QUANTITY, ht as PaymentFeeDetails, i as SubscribableEventType, in as AddressInput, it as INVOICE_STATUSES, j as CurrencyAvailability, jn as TokenKind, jt as ResetFrequency, k as CollectSettings, kn as ENVIRONMENTS, kt as RISK_LEVELS, l as Balance, ln as Currency, lt as MAX_SEATS, m as CHECKOUT_PURPOSES, mn as ListSort, mt as PaymentFailure, n as EventDataMap, nn as ACCOUNT_NUMBER_LENGTH, nt as FulfillmentTracking, o as WebhookEvent, on as BankCode, ot as InvoiceReason, p as CARRIER_TEST_SCENARIOS, pn as ListQuery, pt as PaymentAttempt, q as FeatureOperationResult, qt as ReceiptSend, r as EventType, rn as Address, rt as INVOICE_REASONS, s as Actor, sn as BillingMonths, st as InvoiceStatus, t as EVENT_TYPES, tn as ApiErrorCode, tt as FulfillmentStatus, u as BalanceAmount, un as GRACE_PERIOD_DAYS, ut as PAYMENT_STATUSES, v as CancellationFeedback, vn as MobilePrefix, vt as PaymentStatus, w as Claim, wn as VENEZUELAN_BANKS, wt as PortalSession, x as Checkout, xn as TAX_BEHAVIORS, xt as PlanFeatureValues, y as Carrier, yn as SUSPENSION_DAYS, yt as Payout, z as Deletion, zt as SubscriptionChangeResult } from "./events-b2qMWZF8.js";
1
+ import { $ as FulfillmentHandover, $t as PAYMENT_FAILURE_CODES, A as Coupon, An as ENVIRONMENTS, At as RISK_LEVELS, B as Event, Bt as SubscriptionChangeResult, C as CheckoutPurpose, Cn as TaxBehavior, Ct as PlanSeats, D as ClaimReason, Dn as isLandlinePhone, Dt as ProductVariant, E as ClaimOutcome, En as findBank, Et as ProductCategory, F as CustomerFeature, Ft as SUBSCRIPTION_STATUSES, G as Feature, Gt as WebhookEndpoint, H as FEATURE_TYPES, Ht as SubscriptionStatus, I as CustomerMember, It as SubmitLabel, J as FeatureReset, Jt as ReceiptSend, K as FeatureOperation, Kt as Weekday, L as CustomerMemberList, Lt as Subscription, M as CustomField, Mn as TokenKind, Mt as ResetFrequency, N as Customer, Nn as tokenEnvironment, Nt as RiskLevel, O as ClaimStatus, On as isMobilePhone, Ot as REFUND_MODES, P as CustomerDetails, Pn as tokenPrefix, Pt as SUBMIT_LABELS, Q as FulfillmentChoice, Qt as ApiErrorType, R as CustomerSession, Rt as SubscriptionChange, S as CheckoutItem, Sn as TAX_BEHAVIORS, St as PlanPrice, T as ClaimMessage, Tn as VENEZUELAN_BANKS, Tt as Product, U as FULFILLMENT_METHODS, Ut as SubscriptionTerms, V as ExchangeRate, Vt as SubscriptionRenewal, W as FULFILLMENT_STATUSES, Wt as USAGE_FEATURE_TYPES, X as FeatureUsageResult, Xt as ApiErrorBody, Y as FeatureType, Yt as API_ERROR_TYPES, Z as Fulfillment, Zt as ApiErrorEnvelope, _ as CLAIM_STATUSES, _n as MOBILE_PREFIXES, _t as PaymentSettlement, a as WEBHOOK_TEST_EVENT, an as AddressInput, at as Invoice, b as CarrierOffice, bn as SUSPENSION_DAYS, bt as Plan, c as AfterCompletion, cn as BillingMonths, ct as LineItem, d as CANCELLATION_FEEDBACK, dn as GRACE_PERIOD_DAYS, dt as PRODUCT_CATEGORIES, en as PaymentFailureCode, et as FulfillmentMethod, f as CARRIERS, fn as GracePeriodDays, ft as Payment, g as CLAIM_REASONS, gn as MAX_QUANTITY, gt as PaymentLink, h as CLAIM_OUTCOMES, hn as ListSort, ht as PaymentFeeDetails, i as SubscribableEventType, in as Address, it as INVOICE_STATUSES, j as CurrencyAvailability, jn as Environment, jt as Refund, k as CollectSettings, kn as nationalPhone, kt as RESET_FREQUENCIES, l as Balance, ln as CURRENCIES, lt as MAX_SEATS, m as CHECKOUT_PURPOSES, mn as ListQuery, mt as PaymentFailure, n as EventDataMap, nn as ApiErrorCode, nt as FulfillmentTracking, o as WebhookEvent, on as BILLING_MONTHS, ot as InvoiceReason, p as CARRIER_TEST_SCENARIOS, pn as List, pt as PaymentAttempt, q as FeatureOperationResult, qt as ReceiptReference, r as EventType, rn as ACCOUNT_NUMBER_LENGTH, rt as INVOICE_REASONS, s as Actor, sn as BankCode, st as InvoiceStatus, t as EVENT_TYPES, tn as API_ERROR_CODES, tt as FulfillmentStatus, u as BalanceAmount, un as Currency, ut as PAYMENT_STATUSES, v as CancellationFeedback, vn as Metadata, vt as PaymentStatus, w as Claim, wn as Timestamp, wt as PortalSession, x as Checkout, xn as SuspensionDays, xt as PlanFeatureValues, y as Carrier, yn as MobilePrefix, yt as Payout, z as Deletion, zt as SubscriptionChangePreview } from "./events-TqSJMxqF.js";
2
+ import { $ as PortalSessionCreate, A as CustomerSessionCreate, At as PublicPaymentLink, B as FulfillmentTrackingInput, Bt as LatestApiVersion, C as CouponCreate, Ct as PublicCheckout, D as CustomerInput, Dt as PublicFulfillment, E as CustomerCreate, Et as PublicClaimSummary, F as FeatureOperationCreate, Ft as API_VERSION_PATTERN, G as PaymentLinkUpdate, Gt as isApiVersionRetired, H as InvoiceLineInput, Ht as apiVersionStage, I as FeatureUpdate, It as ApiVersion, J as PlanCreate, K as PlanCheckoutCreate, Kt as supportedApiVersions, L as FulfillmentDeliverInput, Lt as ApiVersionLifecycle, M as EventSelector, Mt as PublicPortal, N as FeatureCreate, Nt as API_VERSIONS, O as CustomerMemberCreate, Ot as PublicFulfillmentRefund, P as FeatureOperationCommit, Pt as API_VERSION_HEADER, Q as PlanUpdate, R as FulfillmentHandoverInput, Rt as ApiVersionStage, S as CollectInput, St as PortalFeatures, T as CustomFieldInput, Tt as PublicClaim, U as KEY_PATTERN, Ut as currentApiVersion, V as InvoiceCreate, Vt as apiVersionLifecycle, W as PaymentLinkCreate, Wt as isApiVersion, X as PlanLinkCreate, Y as PlanFeaturesInput, Z as PlanPriceInput, _ as ClientPaymentCode, _t as PaymentInstructions, a as AfterCompletionInput, at as RefundCreate, b as ClientSubscriptionSeats, bt as PaymentNextAction, c as ClaimResolve, ct as SubscriptionChangePreviewInput, d as ClientCheckoutUpdate, dt as VariantInput, et as ProductCheckoutCreate, f as ClientClaimCreate, ft as WebhookEndpointCreate, g as ClientLinkCheckout, gt as FulfillmentOption, h as ClientInvoicePay, ht as CustomerSubscriptionChangeResult, i as TransportOptions, it as ProductUpdate, j as CustomerUpdate, jt as PublicPaymentState, k as CustomerMemberUpdate, kt as PublicInvoice, l as ClaimRespond, lt as SubscriptionCreate, m as ClientFulfillmentProblem, mt as CustomerSubscription, n as BilleteErrorCode, nt as ProductCreate, o as CheckoutCreate, ot as SubscriptionCancel, p as ClientCustomerClaimCreate, pt as WebhookEndpointUpdate, q as PlanCouponCreate, r as RequestOptions, rt as ProductLinkCreate, s as CheckoutItemInput, st as SubscriptionChangeCreate, t as BilleteError, tt as ProductCouponCreate, u as ClientCheckoutPay, ut as SubscriptionUpdate, v as ClientRefundDestination, vt as PaymentMethodField, w as CouponUpdate, wt as PublicCheckoutItem, x as ClientSubscriptionUpdate, xt as PaymentTestScenario, y as ClientSubscriptionCancel, yt as PaymentMethodOption, z as FulfillmentInput, zt as LATEST_API_VERSION } from "./errors-B7u708iH.js";
3
3
  import { WebhookVerificationError, verifyWebhook } from "./webhooks.js";
4
- //#region src/server.d.ts
5
4
  type Filters<T> = ListQuery & T;
6
5
  type MemberOptions = RequestOptions & {
7
6
  member?: string;
@@ -25,7 +24,7 @@ interface BilleteOptions extends TransportOptions {
25
24
  *
26
25
  * ```ts
27
26
  * // Reads BILLETE_API_KEY.
28
- * const billete = createBillete({ apiVersion: "2026-10-21", environment: "test" });
27
+ * const billete = createBillete({ apiVersion: "2026-10-24", environment: "test" });
29
28
  * const { allowed } = await billete.features.consume("user_123", "tokens", 850);
30
29
  * ```
31
30
  */
@@ -388,5 +387,4 @@ export declare function createBillete(options: BilleteOptions): {
388
387
  };
389
388
  /** The server client: what `createBillete` returns. */
390
389
  type Billete = ReturnType<typeof createBillete>;
391
- //#endregion
392
- export { type ACCOUNT_NUMBER_LENGTH, type API_ERROR_CODES, type API_ERROR_TYPES, type API_VERSIONS, type API_VERSION_HEADER, type API_VERSION_PATTERN, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorCode, type ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type Billete, BilleteError, type BilleteErrorCode, type BilleteOptions, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CLAIM_OUTCOMES, type CLAIM_REASONS, type CLAIM_STATUSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type Claim, type ClaimMessage, type ClaimOutcome, type ClaimReason, type ClaimResolve, type ClaimRespond, type ClaimStatus, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientClaimCreate, type ClientCustomerClaimCreate, type ClientFulfillmentProblem, type ClientInvoicePay, type ClientLinkCheckout, type ClientPaymentCode, type ClientSubscriptionCancel, type ClientSubscriptionSeats, type ClientSubscriptionUpdate, type CollectInput, type CollectSettings, type Coupon, type CouponCreate, type CouponUpdate, type Currency, type CurrencyAvailability, type CustomField, type CustomFieldInput, type Customer, type CustomerCreate, type CustomerDetails, type CustomerFeature, type CustomerInput, type CustomerMember, type CustomerMemberCreate, type CustomerMemberList, type CustomerMemberUpdate, type CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerSubscriptionChangeResult, type CustomerUpdate, type Deletion, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type FULFILLMENT_METHODS, type FULFILLMENT_STATUSES, type Feature, type FeatureCreate, type FeatureOperation, type FeatureOperationCommit, type FeatureOperationCreate, type FeatureOperationResult, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, type Fulfillment, type FulfillmentChoice, type FulfillmentDeliverInput, type FulfillmentHandover, type FulfillmentHandoverInput, type FulfillmentInput, type FulfillmentMethod, type FulfillmentOption, type FulfillmentStatus, type FulfillmentTracking, type FulfillmentTrackingInput, type GRACE_PERIOD_DAYS, type GracePeriodDays, type INVOICE_REASONS, type INVOICE_STATUSES, type Invoice, type InvoiceCreate, type InvoiceLineInput, type InvoiceReason, type InvoiceStatus, type KEY_PATTERN, type LATEST_API_VERSION, type LatestApiVersion, type LineItem, type List, type ListQuery, type ListSort, type MAX_QUANTITY, type MAX_SEATS, type MOBILE_PREFIXES, type Metadata, type MobilePrefix, type PAYMENT_FAILURE_CODES, type PAYMENT_STATUSES, type PRODUCT_CATEGORIES, type Payment, type PaymentAttempt, type PaymentFailure, type PaymentFailureCode, type PaymentFeeDetails, type PaymentInstructions, type PaymentLink, type PaymentLinkCreate, type PaymentLinkUpdate, type PaymentMethodField, type PaymentMethodOption, type PaymentNextAction, type PaymentSettlement, type PaymentStatus, type PaymentTestScenario, type Payout, type Plan, type PlanCheckoutCreate, type PlanCouponCreate, type PlanCreate, type PlanFeatureValues, type PlanFeaturesInput, type PlanLinkCreate, type PlanPrice, type PlanPriceInput, type PlanSeats, type PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCouponCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicCheckoutItem, type PublicClaim, type PublicClaimSummary, type PublicFulfillment, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type RESET_FREQUENCIES, type RISK_LEVELS, type ReceiptReference, type ReceiptSend, type Refund, type RefundCreate, type RequestOptions, type ResetFrequency, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SUSPENSION_DAYS, type SubmitLabel, type SubscribableEventType, type Subscription, type SubscriptionCancel, type SubscriptionChange, type SubscriptionChangeCreate, type SubscriptionChangePreview, type SubscriptionChangePreviewInput, type SubscriptionChangeResult, type SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, type SubscriptionTerms, type SubscriptionUpdate, type SuspensionDays, type TAX_BEHAVIORS, type TaxBehavior, type Timestamp, type TokenKind, type TransportOptions, type USAGE_FEATURE_TYPES, type VENEZUELAN_BANKS, type VariantInput, type WEBHOOK_TEST_EVENT, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointUpdate, type WebhookEvent, WebhookVerificationError, type Weekday, type apiVersionLifecycle, type apiVersionStage, type currentApiVersion, type findBank, type isApiVersion, type isApiVersionRetired, type isLandlinePhone, type isMobilePhone, type nationalPhone, type supportedApiVersions, type tokenEnvironment, type tokenPrefix, verifyWebhook };
390
+ export { type ACCOUNT_NUMBER_LENGTH, type API_ERROR_CODES, type API_ERROR_TYPES, type API_VERSIONS, type API_VERSION_HEADER, type API_VERSION_PATTERN, type Actor, type Address, type AddressInput, type AfterCompletion, type AfterCompletionInput, type ApiErrorBody, type ApiErrorCode, type ApiErrorEnvelope, type ApiErrorType, type ApiVersion, type ApiVersionLifecycle, type ApiVersionStage, type BILLING_MONTHS, type Balance, type BalanceAmount, type BankCode, type Billete, BilleteError, type BilleteErrorCode, type BilleteOptions, type BillingMonths, type CANCELLATION_FEEDBACK, type CARRIERS, type CARRIER_TEST_SCENARIOS, type CHECKOUT_PURPOSES, type CLAIM_OUTCOMES, type CLAIM_REASONS, type CLAIM_STATUSES, type CURRENCIES, type CancellationFeedback, type Carrier, type CarrierOffice, type Checkout, type CheckoutCreate, type CheckoutItem, type CheckoutItemInput, type CheckoutPurpose, type Claim, type ClaimMessage, type ClaimOutcome, type ClaimReason, type ClaimResolve, type ClaimRespond, type ClaimStatus, type ClientCheckoutPay, type ClientCheckoutUpdate, type ClientClaimCreate, type ClientCustomerClaimCreate, type ClientFulfillmentProblem, type ClientInvoicePay, type ClientLinkCheckout, type ClientPaymentCode, type ClientRefundDestination, type ClientSubscriptionCancel, type ClientSubscriptionSeats, type ClientSubscriptionUpdate, type CollectInput, type CollectSettings, type Coupon, type CouponCreate, type CouponUpdate, type Currency, type CurrencyAvailability, type CustomField, type CustomFieldInput, type Customer, type CustomerCreate, type CustomerDetails, type CustomerFeature, type CustomerInput, type CustomerMember, type CustomerMemberCreate, type CustomerMemberList, type CustomerMemberUpdate, type CustomerSession, type CustomerSessionCreate, type CustomerSubscription, type CustomerSubscriptionChangeResult, type CustomerUpdate, type Deletion, type ENVIRONMENTS, type EVENT_TYPES, type Environment, type Event, type EventDataMap, type EventSelector, type EventType, type ExchangeRate, type FEATURE_TYPES, type FULFILLMENT_METHODS, type FULFILLMENT_STATUSES, type Feature, type FeatureCreate, type FeatureOperation, type FeatureOperationCommit, type FeatureOperationCreate, type FeatureOperationResult, type FeatureReset, type FeatureType, type FeatureUpdate, type FeatureUsageResult, type Fulfillment, type FulfillmentChoice, type FulfillmentDeliverInput, type FulfillmentHandover, type FulfillmentHandoverInput, type FulfillmentInput, type FulfillmentMethod, type FulfillmentOption, type FulfillmentStatus, type FulfillmentTracking, type FulfillmentTrackingInput, type GRACE_PERIOD_DAYS, type GracePeriodDays, type INVOICE_REASONS, type INVOICE_STATUSES, type Invoice, type InvoiceCreate, type InvoiceLineInput, type InvoiceReason, type InvoiceStatus, type KEY_PATTERN, type LATEST_API_VERSION, type LatestApiVersion, type LineItem, type List, type ListQuery, type ListSort, type MAX_QUANTITY, type MAX_SEATS, type MOBILE_PREFIXES, type Metadata, type MobilePrefix, type PAYMENT_FAILURE_CODES, type PAYMENT_STATUSES, type PRODUCT_CATEGORIES, type Payment, type PaymentAttempt, type PaymentFailure, type PaymentFailureCode, type PaymentFeeDetails, type PaymentInstructions, type PaymentLink, type PaymentLinkCreate, type PaymentLinkUpdate, type PaymentMethodField, type PaymentMethodOption, type PaymentNextAction, type PaymentSettlement, type PaymentStatus, type PaymentTestScenario, type Payout, type Plan, type PlanCheckoutCreate, type PlanCouponCreate, type PlanCreate, type PlanFeatureValues, type PlanFeaturesInput, type PlanLinkCreate, type PlanPrice, type PlanPriceInput, type PlanSeats, type PlanUpdate, type PortalFeatures, type PortalSession, type PortalSessionCreate, type Product, type ProductCategory, type ProductCheckoutCreate, type ProductCouponCreate, type ProductCreate, type ProductLinkCreate, type ProductUpdate, type ProductVariant, type PublicCheckout, type PublicCheckoutItem, type PublicClaim, type PublicClaimSummary, type PublicFulfillment, type PublicFulfillmentRefund, type PublicInvoice, type PublicPaymentLink, type PublicPaymentState, type PublicPortal, type REFUND_MODES, type RESET_FREQUENCIES, type RISK_LEVELS, type ReceiptReference, type ReceiptSend, type Refund, type RefundCreate, type RequestOptions, type ResetFrequency, type RiskLevel, type SUBMIT_LABELS, type SUBSCRIPTION_STATUSES, type SUSPENSION_DAYS, type SubmitLabel, type SubscribableEventType, type Subscription, type SubscriptionCancel, type SubscriptionChange, type SubscriptionChangeCreate, type SubscriptionChangePreview, type SubscriptionChangePreviewInput, type SubscriptionChangeResult, type SubscriptionCreate, type SubscriptionRenewal, type SubscriptionStatus, type SubscriptionTerms, type SubscriptionUpdate, type SuspensionDays, type TAX_BEHAVIORS, type TaxBehavior, type Timestamp, type TokenKind, type TransportOptions, type USAGE_FEATURE_TYPES, type VENEZUELAN_BANKS, type VariantInput, type WEBHOOK_TEST_EVENT, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointUpdate, type WebhookEvent, WebhookVerificationError, type Weekday, type apiVersionLifecycle, type apiVersionStage, type currentApiVersion, type findBank, type isApiVersion, type isApiVersionRetired, type isLandlinePhone, type isMobilePhone, type nationalPhone, type supportedApiVersions, type tokenEnvironment, type tokenPrefix, verifyWebhook };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { n as segment, r as BilleteError, t as createTransport } from "./http-CNxkDxq4.js";
1
+ import { n as segment, r as BilleteError, t as createTransport } from "./http-B4z0Sbfu.js";
2
2
  import { WebhookVerificationError, verifyWebhook } from "./webhooks.js";
3
- //#region ../contracts/src/environment.ts
3
+ // ../contracts/src/environment.ts
4
4
  /**
5
5
  * Environments and the credentials that name them. Kept free of runtime dependencies: the public
6
6
  * SDK bundles this module to check API keys.
@@ -25,8 +25,7 @@ function tokenPrefix(kind, environment) {
25
25
  function tokenEnvironment(kind, token) {
26
26
  return ENVIRONMENTS.find((environment) => token.startsWith(tokenPrefix(kind, environment))) ?? null;
27
27
  }
28
- //#endregion
29
- //#region src/server.ts
28
+ // src/server.ts
30
29
  function collection(http, path) {
31
30
  return {
32
31
  create: (input, options) => http.request({
@@ -75,7 +74,7 @@ function fromEnv(name) {
75
74
  *
76
75
  * ```ts
77
76
  * // Reads BILLETE_API_KEY.
78
- * const billete = createBillete({ apiVersion: "2026-10-21", environment: "test" });
77
+ * const billete = createBillete({ apiVersion: "2026-10-24", environment: "test" });
79
78
  * const { allowed } = await billete.features.consume("user_123", "tokens", 850);
80
79
  * ```
81
80
  */
@@ -488,5 +487,4 @@ verify: (payload, headers, secret) => verifyWebhook({
488
487
  }) }
489
488
  };
490
489
  }
491
- //#endregion
492
490
  export { BilleteError, WebhookVerificationError, createBillete, verifyWebhook };
@@ -1,5 +1,4 @@
1
- import { o as WebhookEvent } from "./events-b2qMWZF8.js";
2
- //#region src/webhooks.d.ts
1
+ import { o as WebhookEvent } from "./events-TqSJMxqF.js";
3
2
  export declare class WebhookVerificationError extends Error {
4
3
  constructor(message: string);
5
4
  }
@@ -15,4 +14,4 @@ export declare function verifyWebhook(input: {
15
14
  toleranceSeconds?: number;
16
15
  now?: Date;
17
16
  }): Promise<WebhookEvent>;
18
- //#endregion
17
+ export {};
package/dist/webhooks.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/webhooks.ts
1
+ // src/webhooks.ts
2
2
  var WebhookVerificationError = class extends Error {
3
3
  constructor(message) {
4
4
  super(message);
@@ -40,5 +40,4 @@ async function verifyWebhook(input) {
40
40
  if (!signatures.split(" ").some((candidate) => candidate.startsWith("v1,") && constantTimeEqual(candidate.slice(3), expected))) throw new WebhookVerificationError("Invalid webhook signature");
41
41
  return JSON.parse(input.payload);
42
42
  }
43
- //#endregion
44
43
  export { WebhookVerificationError, verifyWebhook };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boelabs/billete-sdk",
3
- "version": "8.0.0",
3
+ "version": "9.1.0",
4
4
  "description": "Billete SDK: server client, browser client and webhook verification",
5
5
  "keywords": [
6
6
  "billete",
@@ -39,10 +39,10 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@boelabs/billete-contracts": "0.1.0",
42
- "tsdown": "0.23.0",
42
+ "tsdown": "0.23.4",
43
43
  "typescript": "7.0.2",
44
- "vite": "8.3.1",
45
- "vitest": "5.0.2"
44
+ "vite": "8.3.5",
45
+ "vitest": "5.0.5"
46
46
  },
47
47
  "sideEffects": false,
48
48
  "scripts": {