@onflay/node 0.3.0 → 1.0.0-staging-20261206080029
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/CHANGELOG.md +74 -0
- package/README.md +211 -48
- package/dist/chunk-4RUPPDC2.mjs +121 -0
- package/dist/chunk-4RUPPDC2.mjs.map +1 -0
- package/dist/chunk-63KSRMJG.mjs +47 -0
- package/dist/chunk-63KSRMJG.mjs.map +1 -0
- package/dist/chunk-7LYAEZCT.mjs +197 -0
- package/dist/chunk-7LYAEZCT.mjs.map +1 -0
- package/dist/chunk-A3TRCKHK.mjs +60 -0
- package/dist/chunk-A3TRCKHK.mjs.map +1 -0
- package/dist/chunk-AFAU2FH2.js +47 -0
- package/dist/chunk-AFAU2FH2.js.map +1 -0
- package/dist/chunk-DBE2YZWE.mjs +38 -0
- package/dist/chunk-DBE2YZWE.mjs.map +1 -0
- package/dist/chunk-EOHFYWFQ.mjs +154 -0
- package/dist/chunk-EOHFYWFQ.mjs.map +1 -0
- package/dist/chunk-I2IVHBFA.js +197 -0
- package/dist/chunk-I2IVHBFA.js.map +1 -0
- package/dist/chunk-J4MYKTPN.mjs +37 -0
- package/dist/chunk-J4MYKTPN.mjs.map +1 -0
- package/dist/chunk-JQPANXLV.mjs +37 -0
- package/dist/chunk-JQPANXLV.mjs.map +1 -0
- package/dist/chunk-JXP6V2P2.mjs +1057 -0
- package/dist/chunk-JXP6V2P2.mjs.map +1 -0
- package/dist/chunk-M52GW7GQ.js +1057 -0
- package/dist/chunk-M52GW7GQ.js.map +1 -0
- package/dist/chunk-MMMUKAI6.js +37 -0
- package/dist/chunk-MMMUKAI6.js.map +1 -0
- package/dist/chunk-NSR4UQLV.js +87 -0
- package/dist/chunk-NSR4UQLV.js.map +1 -0
- package/dist/chunk-SUONZUVK.js +154 -0
- package/dist/chunk-SUONZUVK.js.map +1 -0
- package/dist/chunk-T26CPULH.js +121 -0
- package/dist/chunk-T26CPULH.js.map +1 -0
- package/dist/chunk-V2XJ4GZU.js +38 -0
- package/dist/chunk-V2XJ4GZU.js.map +1 -0
- package/dist/chunk-W6AEPYUG.js +37 -0
- package/dist/chunk-W6AEPYUG.js.map +1 -0
- package/dist/chunk-YHQ7XIC6.js +60 -0
- package/dist/chunk-YHQ7XIC6.js.map +1 -0
- package/dist/chunk-YSXUZYUY.mjs +87 -0
- package/dist/chunk-YSXUZYUY.mjs.map +1 -0
- package/dist/index-C1KFW_9r.d.mts +3989 -0
- package/dist/index-C1KFW_9r.d.ts +3989 -0
- package/dist/index.d.mts +918 -0
- package/dist/index.d.ts +918 -29
- package/dist/index.js +2990 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2991 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/config.d.mts +59 -0
- package/dist/lib/config.d.ts +59 -0
- package/dist/lib/config.js +15 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/config.mjs +15 -0
- package/dist/lib/config.mjs.map +1 -0
- package/dist/lib/http.d.mts +51 -0
- package/dist/lib/http.d.ts +51 -0
- package/dist/lib/http.js +13 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/http.mjs +13 -0
- package/dist/lib/http.mjs.map +1 -0
- package/dist/lib/retries.d.mts +41 -0
- package/dist/lib/retries.d.ts +41 -0
- package/dist/lib/retries.js +16 -0
- package/dist/lib/retries.js.map +1 -0
- package/dist/lib/retries.mjs +16 -0
- package/dist/lib/retries.mjs.map +1 -0
- package/dist/lib/sdks.d.mts +61 -0
- package/dist/lib/sdks.d.ts +61 -0
- package/dist/lib/sdks.js +12 -0
- package/dist/lib/sdks.js.map +1 -0
- package/dist/lib/sdks.mjs +12 -0
- package/dist/lib/sdks.mjs.map +1 -0
- package/dist/models/components/index.d.mts +1 -0
- package/dist/models/components/index.d.ts +1 -0
- package/dist/models/components/index.js +1 -0
- package/dist/models/components/index.js.map +1 -0
- package/dist/models/components/index.mjs +1 -0
- package/dist/models/components/index.mjs.map +1 -0
- package/dist/models/errors/index.d.mts +161 -0
- package/dist/models/errors/index.d.ts +161 -0
- package/dist/models/errors/index.js +29 -0
- package/dist/models/errors/index.js.map +1 -0
- package/dist/models/errors/index.mjs +29 -0
- package/dist/models/errors/index.mjs.map +1 -0
- package/dist/models/operations/index.d.mts +769 -0
- package/dist/models/operations/index.d.ts +769 -0
- package/dist/models/operations/index.js +1 -0
- package/dist/models/operations/index.js.map +1 -0
- package/dist/models/operations/index.mjs +1 -0
- package/dist/models/operations/index.mjs.map +1 -0
- package/dist/types/index.d.mts +26 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/verify-tF2BsJK6.d.mts +325 -0
- package/dist/verify-tF2BsJK6.d.ts +325 -0
- package/dist/webhooks/express.d.mts +39 -0
- package/dist/webhooks/express.d.ts +39 -0
- package/dist/webhooks/express.js +10 -0
- package/dist/webhooks/express.js.map +1 -0
- package/dist/webhooks/express.mjs +10 -0
- package/dist/webhooks/express.mjs.map +1 -0
- package/dist/webhooks/hono.d.mts +33 -0
- package/dist/webhooks/hono.d.ts +33 -0
- package/dist/webhooks/hono.js +10 -0
- package/dist/webhooks/hono.js.map +1 -0
- package/dist/webhooks/hono.mjs +10 -0
- package/dist/webhooks/hono.mjs.map +1 -0
- package/dist/webhooks/index.d.mts +34 -0
- package/dist/webhooks/index.d.ts +34 -0
- package/dist/webhooks/index.js +75 -0
- package/dist/webhooks/index.js.map +1 -0
- package/dist/webhooks/index.mjs +75 -0
- package/dist/webhooks/index.mjs.map +1 -0
- package/dist/webhooks/next.d.mts +38 -0
- package/dist/webhooks/next.d.ts +38 -0
- package/dist/webhooks/next.js +10 -0
- package/dist/webhooks/next.js.map +1 -0
- package/dist/webhooks/next.mjs +10 -0
- package/dist/webhooks/next.mjs.map +1 -0
- package/package.json +273 -14
- package/dist/client.d.ts +0 -65
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -216
- package/dist/client.js.map +0 -1
- package/dist/errors.d.ts +0 -61
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -134
- package/dist/errors.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/onflay.d.ts +0 -44
- package/dist/onflay.d.ts.map +0 -1
- package/dist/onflay.js +0 -63
- package/dist/onflay.js.map +0 -1
- package/dist/pagination.d.ts +0 -19
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js +0 -61
- package/dist/pagination.js.map +0 -1
- package/dist/resources/checkout-sessions.d.ts +0 -11
- package/dist/resources/checkout-sessions.d.ts.map +0 -1
- package/dist/resources/checkout-sessions.js +0 -20
- package/dist/resources/checkout-sessions.js.map +0 -1
- package/dist/resources/customers.d.ts +0 -17
- package/dist/resources/customers.d.ts.map +0 -1
- package/dist/resources/customers.js +0 -39
- package/dist/resources/customers.js.map +0 -1
- package/dist/resources/invoices.d.ts +0 -60
- package/dist/resources/invoices.d.ts.map +0 -1
- package/dist/resources/invoices.js +0 -69
- package/dist/resources/invoices.js.map +0 -1
- package/dist/resources/payments.d.ts +0 -11
- package/dist/resources/payments.d.ts.map +0 -1
- package/dist/resources/payments.js +0 -27
- package/dist/resources/payments.js.map +0 -1
- package/dist/resources/prices.d.ts +0 -24
- package/dist/resources/prices.d.ts.map +0 -1
- package/dist/resources/prices.js +0 -46
- package/dist/resources/prices.js.map +0 -1
- package/dist/resources/products.d.ts +0 -18
- package/dist/resources/products.d.ts.map +0 -1
- package/dist/resources/products.js +0 -40
- package/dist/resources/products.js.map +0 -1
- package/dist/resources/subscriptions.d.ts +0 -39
- package/dist/resources/subscriptions.d.ts.map +0 -1
- package/dist/resources/subscriptions.js +0 -62
- package/dist/resources/subscriptions.js.map +0 -1
- package/dist/resources/usage.d.ts +0 -26
- package/dist/resources/usage.d.ts.map +0 -1
- package/dist/resources/usage.js +0 -43
- package/dist/resources/usage.js.map +0 -1
- package/dist/resources/webhook-endpoints.d.ts +0 -20
- package/dist/resources/webhook-endpoints.d.ts.map +0 -1
- package/dist/resources/webhook-endpoints.js +0 -47
- package/dist/resources/webhook-endpoints.js.map +0 -1
- package/dist/types/checkout-sessions.d.ts +0 -67
- package/dist/types/checkout-sessions.d.ts.map +0 -1
- package/dist/types/checkout-sessions.js +0 -3
- package/dist/types/checkout-sessions.js.map +0 -1
- package/dist/types/customers.d.ts +0 -28
- package/dist/types/customers.d.ts.map +0 -1
- package/dist/types/customers.js +0 -3
- package/dist/types/customers.js.map +0 -1
- package/dist/types/events.d.ts +0 -118
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/events.js +0 -28
- package/dist/types/events.js.map +0 -1
- package/dist/types/invoices.d.ts +0 -65
- package/dist/types/invoices.d.ts.map +0 -1
- package/dist/types/invoices.js +0 -3
- package/dist/types/invoices.js.map +0 -1
- package/dist/types/payments.d.ts +0 -25
- package/dist/types/payments.d.ts.map +0 -1
- package/dist/types/payments.js +0 -3
- package/dist/types/payments.js.map +0 -1
- package/dist/types/prices.d.ts +0 -57
- package/dist/types/prices.d.ts.map +0 -1
- package/dist/types/prices.js +0 -3
- package/dist/types/prices.js.map +0 -1
- package/dist/types/products.d.ts +0 -29
- package/dist/types/products.d.ts.map +0 -1
- package/dist/types/products.js +0 -3
- package/dist/types/products.js.map +0 -1
- package/dist/types/shared.d.ts +0 -34
- package/dist/types/shared.d.ts.map +0 -1
- package/dist/types/shared.js +0 -4
- package/dist/types/shared.js.map +0 -1
- package/dist/types/subscriptions.d.ts +0 -85
- package/dist/types/subscriptions.d.ts.map +0 -1
- package/dist/types/subscriptions.js +0 -3
- package/dist/types/subscriptions.js.map +0 -1
- package/dist/types/usage.d.ts +0 -35
- package/dist/types/usage.d.ts.map +0 -1
- package/dist/types/usage.js +0 -3
- package/dist/types/usage.js.map +0 -1
- package/dist/types/webhook-endpoints.d.ts +0 -48
- package/dist/types/webhook-endpoints.d.ts.map +0 -1
- package/dist/types/webhook-endpoints.js +0 -3
- package/dist/types/webhook-endpoints.js.map +0 -1
- package/dist/version.d.ts +0 -4
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -7
- package/dist/version.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,918 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
export { SDKOptions, SDK_METADATA, ServerList, ServerProduction, ServerSandbox, serverURLFromOptions } from './lib/config.js';
|
|
2
|
+
export { Fetcher, HTTPClient, HTTPClientOptions } from './lib/http.js';
|
|
3
|
+
import { ClientSDK, RequestOptions } from './lib/sdks.js';
|
|
4
|
+
import { PageIterator } from './types/index.js';
|
|
5
|
+
import { I as IntegrationGuide, L as ListingRecipe, C as CatalogProduct, a as CheckoutSessionCreateResponse, b as CheckoutSession, c as CheckoutReceipt, d as CreditOperation, e as CreditBalances, f as CustomerAccess$1, g as CustomerPortalSession, h as Customer, i as CustomersListPaymentMethodsResponse, S as SetupIntent, D as Discount, R as RecordIntegrationVerification, j as IntegrationVerification, k as Invoice, J as Jwks$1, A as ActivateLicenseKey, l as LicenseKeyStatus, m as DeactivateLicenseKey, V as ValidateLicenseKey, n as LicenseKey, M as MetersListResponse, o as Meter, P as PaymentConfirmation, p as Refund, q as Payment, r as Price, s as Product, t as SandboxPayoutMethodResult, u as SetupSession, v as SubscriptionCancellation, w as Subscription, x as SubscriptionsUpdateResponse, y as SubscriptionUpdatePreview, U as UsageBillingPlan, z as ReportUsage, B as UsageRecord, W as WebhookDelivery, E as WebhookEndpointList, F as WebhookEndpointWithSecret, G as WebhookEndpoint } from './index-C1KFW_9r.js';
|
|
6
|
+
import { CatalogListingsRetrieveIntegrationGuideRequest, CatalogListingsRetrieveRecipeRequest, CatalogProductsRetrieveRequest, CatalogProductsUpsertRequest, CatalogPlansUpsertRequest, CatalogListRequest, CatalogListResponse, CheckoutSessionsCreateRequest, CheckoutSessionsRetrieveRequest, CheckoutSessionsRetrieveReceiptRequest, CreditsAdjustRequest, CreditsConsumeRequest, CreditsRetrieveRequest, CreditsListLedgerRequest, CreditsListLedgerResponse, CustomerAccessRetrieveRequest, CustomerPortalSessionsCreateRequest, CustomersListRequest, CustomersListResponse, CustomersCreateRequest, CustomersRetrieveRequest, CustomersUpdateRequest, CustomersListPaymentMethodsRequest, CustomersCreateSetupIntentRequest, DiscountsListRequest, DiscountsListResponse, DiscountsCreateRequest, DiscountsRetrieveRequest, DiscountsUpdateRequest, DiscountsDeactivateRequest, IntegrationVerificationsListForListingRequest, IntegrationVerificationsListForListingResponse, InvoicesListRequest, InvoicesListResponse, InvoicesCreateRequest, InvoicesRetrieveRequest, LicenseKeysListRequest, LicenseKeysListResponse, LicenseKeysRetrieveRequest, LicenseKeysRevokeRequest, MetersCreateRequest, PaymentConfirmationsRetrieveRequest, PaymentsRefundsListRequest, PaymentsRefundsListResponse, PaymentsRefundsCreateRequest, PaymentsRefundsRetrieveRequest, PaymentsListRequest, PaymentsListResponse, PaymentsCreateRequest, PaymentsRetrieveRequest, PricesListRequest, PricesListResponse, PricesCreateRequest, PricesRetrieveRequest, PricesUpdateRequest, ProductsListRequest, ProductsListResponse, ProductsCreateRequest, ProductsRetrieveRequest, ProductsUpdateRequest, SetupSessionsRetrieveRequest, SubscriptionsListRequest, SubscriptionsListResponse, SubscriptionsCancelByExternalCustomerRequest, SubscriptionsUncancelByExternalCustomerRequest, SubscriptionsRetrieveRequest, SubscriptionsUpdateRequest, SubscriptionsCancelRequest, SubscriptionsPreviewUpdateRequest, UsageBillingPlansCreateRequest, UsageBillingPlansRetrieveRequest, WebhookDeliveriesListRequest, WebhookDeliveriesListResponse, WebhookDeliveriesRetrieveRequest, WebhookDeliveriesResendRequest, WebhookEndpointsCreateRequest, WebhookEndpointsRetrieveRequest, WebhookEndpointsDeleteRequest, WebhookEndpointsUpdateRequest } from './models/operations/index.js';
|
|
7
|
+
import './lib/retries.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* `onflay.jwks`
|
|
11
|
+
*/
|
|
12
|
+
declare class Jwks extends ClientSDK {
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve the JWKS
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* The public keys (JWKS) that verify customer-access JWTs. No API key needed. Use the key whose `kid` matches the token header.
|
|
18
|
+
*
|
|
19
|
+
* `GET /v1/.well-known/jwks.json`
|
|
20
|
+
*/
|
|
21
|
+
retrieve(options?: RequestOptions): Promise<Jwks$1>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* `onflay.catalog.listings`
|
|
25
|
+
*/
|
|
26
|
+
declare class CatalogListings extends ClientSDK {
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve an integration guide
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* A generated integration prompt and checklist for an app builder.
|
|
32
|
+
*
|
|
33
|
+
* `GET /v1/catalog/listings/{catalogKey}/integration-guide`
|
|
34
|
+
*/
|
|
35
|
+
retrieveIntegrationGuide(request: CatalogListingsRetrieveIntegrationGuideRequest, options?: RequestOptions): Promise<IntegrationGuide>;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve a listing recipe
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* The agent-readable recipe (plans, prices, entitlements, endpoints) of a listing. Supports conditional requests: send the `ETag` back in `If-None-Match` to get `304 Not Modified` while the recipe is unchanged.
|
|
41
|
+
*
|
|
42
|
+
* `GET /v1/catalog/listings/{catalogKey}/recipe`
|
|
43
|
+
*/
|
|
44
|
+
retrieveRecipe(request: CatalogListingsRetrieveRecipeRequest, options?: RequestOptions): Promise<ListingRecipe | undefined>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* `onflay.catalog.products`
|
|
48
|
+
*/
|
|
49
|
+
declare class CatalogProducts extends ClientSDK {
|
|
50
|
+
/**
|
|
51
|
+
* Retrieve a catalog product
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* A product with its plans, prices and entitlements. Each price includes the `checkout` selection to send to `POST /v1/checkout-sessions`. Supports conditional requests: send the `ETag` back in `If-None-Match` to get `304 Not Modified` while the product is unchanged.
|
|
55
|
+
*
|
|
56
|
+
* `GET /v1/catalog/products/{key}`
|
|
57
|
+
*/
|
|
58
|
+
retrieve(request: CatalogProductsRetrieveRequest, options?: RequestOptions): Promise<CatalogProduct | undefined>;
|
|
59
|
+
/**
|
|
60
|
+
* Upsert a product
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* Creates the product when no product has this key, otherwise updates it. `type` is required when creating and cannot change. With `active` (default `true` on create) the product goes on sale as soon as it has a plan.
|
|
64
|
+
*
|
|
65
|
+
* `PUT /v1/catalog/products/{key}`
|
|
66
|
+
*/
|
|
67
|
+
upsert(request: CatalogProductsUpsertRequest, options?: RequestOptions): Promise<CatalogProduct>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* `onflay.catalog.plans`
|
|
71
|
+
*/
|
|
72
|
+
declare class CatalogPlans extends ClientSDK {
|
|
73
|
+
/**
|
|
74
|
+
* Upsert a plan
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* Creates or updates a plan of a product by key, with its prices. `prices` is the complete set for the plan: prices you leave out stop being sold. Subscription products take a monthly price and optionally a yearly one; other products take exactly one `one_time` price. Returns the whole product.
|
|
78
|
+
*
|
|
79
|
+
* `PUT /v1/catalog/products/{key}/plans/{planKey}`
|
|
80
|
+
*/
|
|
81
|
+
upsert(request: CatalogPlansUpsertRequest, options?: RequestOptions): Promise<CatalogProduct>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* `onflay.catalog`
|
|
85
|
+
*/
|
|
86
|
+
declare class Catalog extends ClientSDK {
|
|
87
|
+
private _listings?;
|
|
88
|
+
get listings(): CatalogListings;
|
|
89
|
+
private _products?;
|
|
90
|
+
get products(): CatalogProducts;
|
|
91
|
+
private _plans?;
|
|
92
|
+
get plans(): CatalogPlans;
|
|
93
|
+
/**
|
|
94
|
+
* List catalog products
|
|
95
|
+
*
|
|
96
|
+
* @remarks
|
|
97
|
+
* Lists the products of your catalog with their plan keys. Only products with a key are listed. Oldest first; follow `nextCursor` for more.
|
|
98
|
+
*
|
|
99
|
+
* `GET /v1/catalog`
|
|
100
|
+
*/
|
|
101
|
+
list(request?: CatalogListRequest, options?: RequestOptions): Promise<PageIterator<CatalogListResponse, {
|
|
102
|
+
cursor: string;
|
|
103
|
+
}>>;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* `onflay.checkoutSessions`
|
|
107
|
+
*/
|
|
108
|
+
declare class CheckoutSessions extends ClientSDK {
|
|
109
|
+
/**
|
|
110
|
+
* Create a checkout session
|
|
111
|
+
*
|
|
112
|
+
* @remarks
|
|
113
|
+
* Creates a hosted (or embedded) checkout session for one of your products. Send either `listingId` (optionally with `variantId`) or `catalog` together with `externalCustomerId`, not both. Requires the `checkout_sessions:write` scope.
|
|
114
|
+
*
|
|
115
|
+
* `POST /v1/checkout-sessions`
|
|
116
|
+
*/
|
|
117
|
+
create(request: CheckoutSessionsCreateRequest, options?: RequestOptions): Promise<CheckoutSessionCreateResponse>;
|
|
118
|
+
/**
|
|
119
|
+
* Retrieve a checkout session
|
|
120
|
+
*
|
|
121
|
+
* @remarks
|
|
122
|
+
* Returns one of your checkout sessions that is still pending payment, with what a custom embedded flow needs (`checkoutUrl`, `clientSecret`, `stripePublishableKey`). Sessions of other accounts return 404, and sessions in any other state return 400; use the receipt route to confirm payment. Requires the `checkout_sessions:read` scope.
|
|
123
|
+
*
|
|
124
|
+
* `GET /v1/checkout-sessions/{id}`
|
|
125
|
+
*/
|
|
126
|
+
retrieve(request: CheckoutSessionsRetrieveRequest, options?: RequestOptions): Promise<CheckoutSession>;
|
|
127
|
+
/**
|
|
128
|
+
* Retrieve a checkout receipt
|
|
129
|
+
*
|
|
130
|
+
* @remarks
|
|
131
|
+
* Confirms payment without webhooks. Send the `X-Onflay-Return-Token` from the success redirect, or pass `headless=true` to poll with the secret key alone. While `status` is `processing`, retry after `retryAfterMs`. Requires the `checkout_sessions:read` scope.
|
|
132
|
+
*
|
|
133
|
+
* `GET /v1/checkout-sessions/{id}/receipt`
|
|
134
|
+
*/
|
|
135
|
+
retrieveReceipt(request: CheckoutSessionsRetrieveReceiptRequest, options?: RequestOptions): Promise<CheckoutReceipt>;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* `onflay.credits`
|
|
139
|
+
*/
|
|
140
|
+
declare class Credits extends ClientSDK {
|
|
141
|
+
/**
|
|
142
|
+
* Adjust credits
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* Manual grant (positive `amount`) or correction (negative `amount`), recorded with reason `adjustment`. A removal larger than the balance answers 402 `insufficient_credits`: balances never go negative. Same idempotency rules as consume. Bumps the customer-access `version` and, for a grant, sends `credits.granted`. A positive adjustment can expire: `expiresInDays` (1 to 3650) makes the added credits expire that many days from now; it is rejected (400 `expires_in_days_not_allowed`) with a negative `amount`.
|
|
146
|
+
*
|
|
147
|
+
* `POST /v1/credits/adjust`
|
|
148
|
+
*/
|
|
149
|
+
adjust(request: CreditsAdjustRequest, options?: RequestOptions): Promise<CreditOperation>;
|
|
150
|
+
/**
|
|
151
|
+
* Consume credits
|
|
152
|
+
*
|
|
153
|
+
* @remarks
|
|
154
|
+
* Spends `amount` credits atomically: concurrent consumes never spend more than the balance. Not enough credits answers 402 `insufficient_credits` and consumes nothing. Reusing an `idempotencyKey` returns the first result (`replayed: true`) without consuming twice; reusing it for a different customer, key or amount answers 409 `idempotency_key_reused`. A consume bumps the customer-access `version` (and sends `customer.access_changed` with `credits`) only when it empties the balance; other consumes do not.
|
|
155
|
+
*
|
|
156
|
+
* `POST /v1/credits/consume`
|
|
157
|
+
*/
|
|
158
|
+
consume(request: CreditsConsumeRequest, options?: RequestOptions): Promise<CreditOperation>;
|
|
159
|
+
/**
|
|
160
|
+
* Retrieve credit balances
|
|
161
|
+
*
|
|
162
|
+
* @remarks
|
|
163
|
+
* A customer's credit balances. One balance per credit key. The same balances appear in customer access as `credits`.
|
|
164
|
+
*
|
|
165
|
+
* `GET /v1/credits/{externalCustomerId}`
|
|
166
|
+
*/
|
|
167
|
+
retrieve(request: CreditsRetrieveRequest, options?: RequestOptions): Promise<CreditBalances>;
|
|
168
|
+
/**
|
|
169
|
+
* List a customer's credit ledger
|
|
170
|
+
*
|
|
171
|
+
* @remarks
|
|
172
|
+
* Every credit movement of the customer, newest first, cursor-paginated. Filter by credit `key`.
|
|
173
|
+
*
|
|
174
|
+
* `GET /v1/credits/{externalCustomerId}/ledger`
|
|
175
|
+
*/
|
|
176
|
+
listLedger(request: CreditsListLedgerRequest, options?: RequestOptions): Promise<PageIterator<CreditsListLedgerResponse, {
|
|
177
|
+
cursor: string;
|
|
178
|
+
}>>;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* `onflay.customerAccess`
|
|
182
|
+
*/
|
|
183
|
+
declare class CustomerAccess extends ClientSDK {
|
|
184
|
+
/**
|
|
185
|
+
* Retrieve customer access
|
|
186
|
+
*
|
|
187
|
+
* @remarks
|
|
188
|
+
* What a customer has right now: plans, purchases, tickets, bookings, credits, license keys and entitlements. Supports conditional requests: the response carries an `ETag`; send it back in `If-None-Match` to get `304 Not Modified` with no body while access is unchanged. Pass `includeToken=true` to also receive a short-lived signed JWT of the same claims.
|
|
189
|
+
*
|
|
190
|
+
* `GET /v1/customer-access/{externalCustomerId}`
|
|
191
|
+
*/
|
|
192
|
+
retrieve(request: CustomerAccessRetrieveRequest, options?: RequestOptions): Promise<CustomerAccess$1 | undefined>;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* `onflay.customerPortal.sessions`
|
|
196
|
+
*/
|
|
197
|
+
declare class CustomerPortalSessions extends ClientSDK {
|
|
198
|
+
/**
|
|
199
|
+
* Create a customer portal session
|
|
200
|
+
*
|
|
201
|
+
* @remarks
|
|
202
|
+
* Returns a 1-hour link to the Onflay-hosted portal where the customer sees their subscriptions, cancels or resumes them, updates the card their renewals use, and sees their billing history. Create one each time the customer clicks "Manage billing" and redirect to `url`. Requires the `customers:write` scope.
|
|
203
|
+
*
|
|
204
|
+
* `POST /v1/customer-portal/sessions`
|
|
205
|
+
*/
|
|
206
|
+
create(request: CustomerPortalSessionsCreateRequest, options?: RequestOptions): Promise<CustomerPortalSession>;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* `onflay.customerPortal`
|
|
210
|
+
*/
|
|
211
|
+
declare class CustomerPortal extends ClientSDK {
|
|
212
|
+
private _sessions?;
|
|
213
|
+
get sessions(): CustomerPortalSessions;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* `onflay.customers`
|
|
217
|
+
*/
|
|
218
|
+
declare class Customers extends ClientSDK {
|
|
219
|
+
/**
|
|
220
|
+
* List customers
|
|
221
|
+
*
|
|
222
|
+
* @remarks
|
|
223
|
+
* Lists the customers linked to your account (created through the API or checkout) or with a payment on it, newest first. Cursor-paginated. Requires the `customers:read` scope.
|
|
224
|
+
*
|
|
225
|
+
* `GET /v1/customers`
|
|
226
|
+
*/
|
|
227
|
+
list(request?: CustomersListRequest, options?: RequestOptions): Promise<PageIterator<CustomersListResponse, {
|
|
228
|
+
cursor: string;
|
|
229
|
+
}>>;
|
|
230
|
+
/**
|
|
231
|
+
* Create a customer
|
|
232
|
+
*
|
|
233
|
+
* @remarks
|
|
234
|
+
* Creates a customer and links it to your account. Emails are unique across Onflay: if a customer with this email already exists it is linked to your account and returned unchanged (`name` and `phone` are ignored). Requires the `customers:write` scope.
|
|
235
|
+
*
|
|
236
|
+
* `POST /v1/customers`
|
|
237
|
+
*/
|
|
238
|
+
create(request: CustomersCreateRequest, options?: RequestOptions): Promise<Customer>;
|
|
239
|
+
/**
|
|
240
|
+
* Retrieve a customer
|
|
241
|
+
*
|
|
242
|
+
* @remarks
|
|
243
|
+
* Requires the `customers:read` scope.
|
|
244
|
+
*
|
|
245
|
+
* `GET /v1/customers/{id}`
|
|
246
|
+
*/
|
|
247
|
+
retrieve(request: CustomersRetrieveRequest, options?: RequestOptions): Promise<Customer>;
|
|
248
|
+
/**
|
|
249
|
+
* Update a customer
|
|
250
|
+
*
|
|
251
|
+
* @remarks
|
|
252
|
+
* Updates `name` and/or `phone`. Requires the `customers:write` scope.
|
|
253
|
+
*
|
|
254
|
+
* `PATCH /v1/customers/{id}`
|
|
255
|
+
*/
|
|
256
|
+
update(request: CustomersUpdateRequest, options?: RequestOptions): Promise<Customer>;
|
|
257
|
+
/**
|
|
258
|
+
* List a customer's payment methods
|
|
259
|
+
*
|
|
260
|
+
* @remarks
|
|
261
|
+
* Cards the customer saved with your account (through a setup intent), default first, then newest first. Cards they saved with another seller on Onflay are never listed. Not paginated. Requires the `customers:read` scope.
|
|
262
|
+
*
|
|
263
|
+
* `GET /v1/customers/{id}/payment-methods`
|
|
264
|
+
*/
|
|
265
|
+
listPaymentMethods(request: CustomersListPaymentMethodsRequest, options?: RequestOptions): Promise<CustomersListPaymentMethodsResponse>;
|
|
266
|
+
/**
|
|
267
|
+
* Create a setup intent
|
|
268
|
+
*
|
|
269
|
+
* @remarks
|
|
270
|
+
* Creates a Stripe SetupIntent so the customer can save a card for off-session charges by your account. Returns a hosted page URL and a 1-hour session token. The saved card becomes the one your invoices charge for this customer; it is never visible to or chargeable by other sellers. Requires the `customers:write` scope.
|
|
271
|
+
*
|
|
272
|
+
* `POST /v1/customers/{id}/setup-intent`
|
|
273
|
+
*/
|
|
274
|
+
createSetupIntent(request: CustomersCreateSetupIntentRequest, options?: RequestOptions): Promise<SetupIntent>;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* `onflay.discounts`
|
|
278
|
+
*/
|
|
279
|
+
declare class Discounts extends ClientSDK {
|
|
280
|
+
/**
|
|
281
|
+
* List discounts
|
|
282
|
+
*
|
|
283
|
+
* @remarks
|
|
284
|
+
* Lists your discounts, newest first. Cursor-paginated. Filter by `active`, `type` or `code`. Requires the `discounts:read` scope.
|
|
285
|
+
*
|
|
286
|
+
* `GET /v1/discounts`
|
|
287
|
+
*/
|
|
288
|
+
list(request?: DiscountsListRequest, options?: RequestOptions): Promise<PageIterator<DiscountsListResponse, {
|
|
289
|
+
cursor: string;
|
|
290
|
+
}>>;
|
|
291
|
+
/**
|
|
292
|
+
* Create a discount
|
|
293
|
+
*
|
|
294
|
+
* @remarks
|
|
295
|
+
* Creates a discount code (`type: discount_code`, buyers enter `code`) or a time-limited offer (`type: time_limited_offer`, applies on its own in its window). Target products and plans by key. Requires the `discounts:write` scope.
|
|
296
|
+
*
|
|
297
|
+
* `POST /v1/discounts`
|
|
298
|
+
*/
|
|
299
|
+
create(request: DiscountsCreateRequest, options?: RequestOptions): Promise<Discount>;
|
|
300
|
+
/**
|
|
301
|
+
* Retrieve a discount
|
|
302
|
+
*
|
|
303
|
+
* @remarks
|
|
304
|
+
* Returns one discount. Requires the `discounts:read` scope.
|
|
305
|
+
*
|
|
306
|
+
* `GET /v1/discounts/{id}`
|
|
307
|
+
*/
|
|
308
|
+
retrieve(request: DiscountsRetrieveRequest, options?: RequestOptions): Promise<Discount>;
|
|
309
|
+
/**
|
|
310
|
+
* Update a discount
|
|
311
|
+
*
|
|
312
|
+
* @remarks
|
|
313
|
+
* Changes the fields you send; the others keep their value. `type` cannot change. `productKeys` replaces the products (and clears `planKeys` unless you send it too). Send `{ "active": true }` to turn a deactivated discount back on. Requires the `discounts:write` scope.
|
|
314
|
+
*
|
|
315
|
+
* `PATCH /v1/discounts/{id}`
|
|
316
|
+
*/
|
|
317
|
+
update(request: DiscountsUpdateRequest, options?: RequestOptions): Promise<Discount>;
|
|
318
|
+
/**
|
|
319
|
+
* Deactivate a discount
|
|
320
|
+
*
|
|
321
|
+
* @remarks
|
|
322
|
+
* Turns the discount off (`active: false`): buyers can no longer use it, and its code stays reserved. Orders that already used it are not affected. Deactivating twice is fine. Requires the `discounts:write` scope.
|
|
323
|
+
*
|
|
324
|
+
* `POST /v1/discounts/{id}/deactivate`
|
|
325
|
+
*/
|
|
326
|
+
deactivate(request: DiscountsDeactivateRequest, options?: RequestOptions): Promise<Discount>;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* `onflay.integrationVerifications`
|
|
330
|
+
*/
|
|
331
|
+
declare class IntegrationVerifications extends ClientSDK {
|
|
332
|
+
/**
|
|
333
|
+
* Record an integration check
|
|
334
|
+
*
|
|
335
|
+
* @remarks
|
|
336
|
+
* Records a self-reported integration check for a listing. Deprecated: nothing is checked. On the sandbox, `npx onflay verify` (`POST /v1/sandbox/verifications`) checks the integration on Onflay’s side. Still accepted. The listing (and `checkoutSessionId`, when given) must belong to your account; otherwise 404.
|
|
337
|
+
* @deprecated
|
|
338
|
+
*
|
|
339
|
+
* `POST /v1/integration-verifications`
|
|
340
|
+
*/
|
|
341
|
+
create(request: RecordIntegrationVerification, options?: RequestOptions): Promise<IntegrationVerification>;
|
|
342
|
+
/**
|
|
343
|
+
* List integration checks
|
|
344
|
+
*
|
|
345
|
+
* @remarks
|
|
346
|
+
* The integration checks recorded for a listing, newest first. Cursor-paginated; `data` is empty when the listing has none (or is not yours).
|
|
347
|
+
*
|
|
348
|
+
* `GET /v1/integration-verifications/listings/{listingId}`
|
|
349
|
+
*/
|
|
350
|
+
listForListing(request: IntegrationVerificationsListForListingRequest, options?: RequestOptions): Promise<PageIterator<IntegrationVerificationsListForListingResponse, {
|
|
351
|
+
cursor: string;
|
|
352
|
+
}>>;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* `onflay.invoices`
|
|
356
|
+
*/
|
|
357
|
+
declare class Invoices extends ClientSDK {
|
|
358
|
+
/**
|
|
359
|
+
* List invoices
|
|
360
|
+
*
|
|
361
|
+
* @remarks
|
|
362
|
+
* Cursor-paginated list of invoices, newest first. Filter by `customerId`.
|
|
363
|
+
*
|
|
364
|
+
* `GET /v1/invoices`
|
|
365
|
+
*/
|
|
366
|
+
list(request?: InvoicesListRequest, options?: RequestOptions): Promise<PageIterator<InvoicesListResponse, {
|
|
367
|
+
cursor: string;
|
|
368
|
+
}>>;
|
|
369
|
+
/**
|
|
370
|
+
* Create and charge an invoice
|
|
371
|
+
*
|
|
372
|
+
* @remarks
|
|
373
|
+
* Creates an invoice from pre-computed line items and charges the default card the customer saved with your account (never a card saved with another seller). Returns `payment_method_required` (402) when there is none. With an `Idempotency-Key`, a repeated request returns the invoice already created for that key, or finishes the same charge if the first attempt timed out.
|
|
374
|
+
*
|
|
375
|
+
* `POST /v1/invoices`
|
|
376
|
+
*/
|
|
377
|
+
create(request: InvoicesCreateRequest, options?: RequestOptions): Promise<Invoice>;
|
|
378
|
+
/**
|
|
379
|
+
* Retrieve an invoice
|
|
380
|
+
*
|
|
381
|
+
* `GET /v1/invoices/{id}`
|
|
382
|
+
*/
|
|
383
|
+
retrieve(request: InvoicesRetrieveRequest, options?: RequestOptions): Promise<Invoice>;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* `onflay.licenseKeys`
|
|
387
|
+
*/
|
|
388
|
+
declare class LicenseKeys extends ClientSDK {
|
|
389
|
+
/**
|
|
390
|
+
* List license keys
|
|
391
|
+
*
|
|
392
|
+
* @remarks
|
|
393
|
+
* Cursor-paginated, newest first. Filter by `externalCustomerId`. Each item includes the key itself.
|
|
394
|
+
*
|
|
395
|
+
* `GET /v1/license-keys`
|
|
396
|
+
*/
|
|
397
|
+
list(request?: LicenseKeysListRequest, options?: RequestOptions): Promise<PageIterator<LicenseKeysListResponse, {
|
|
398
|
+
cursor: string;
|
|
399
|
+
}>>;
|
|
400
|
+
/**
|
|
401
|
+
* Activate a license key
|
|
402
|
+
*
|
|
403
|
+
* @remarks
|
|
404
|
+
* Activates a license key on an instance. No API key. Registers `instanceId` (machine or install) against the key; activating an instance that is already active changes nothing. A revoked key answers 403 `license_key_revoked`, an expired one 403 `license_key_expired`, a key at its `activationLimit` 409 `activation_limit_reached`. Unknown or malformed keys answer 404 `license_key_not_found`. Limited to about 3 requests a second per IP (429 `rate_limited`).
|
|
405
|
+
*
|
|
406
|
+
* `POST /v1/license-keys/activate`
|
|
407
|
+
*/
|
|
408
|
+
activate(request: ActivateLicenseKey, options?: RequestOptions): Promise<LicenseKeyStatus>;
|
|
409
|
+
/**
|
|
410
|
+
* Deactivate a license key
|
|
411
|
+
*
|
|
412
|
+
* @remarks
|
|
413
|
+
* Deactivates a license key on an instance. No API key. Frees the seat `instanceId` used, so the key can be activated elsewhere. Idempotent; also works on revoked and expired keys. Unknown or malformed keys answer 404 `license_key_not_found`. Limited to about 3 requests a second per IP (429 `rate_limited`).
|
|
414
|
+
*
|
|
415
|
+
* `POST /v1/license-keys/deactivate`
|
|
416
|
+
*/
|
|
417
|
+
deactivate(request: DeactivateLicenseKey, options?: RequestOptions): Promise<LicenseKeyStatus>;
|
|
418
|
+
/**
|
|
419
|
+
* Validate a license key
|
|
420
|
+
*
|
|
421
|
+
* @remarks
|
|
422
|
+
* No API key: call it from your app. Answers 200 for any existing key with `valid`, `status` (`active`, `revoked` or `expired`), the product and plan keys, `expiresAt` and the activation count. With `instanceId`, `valid` also requires that instance to be activated. Unknown or malformed keys answer 404 `license_key_not_found`. Limited to about 3 requests a second per IP (429 `rate_limited`).
|
|
423
|
+
*
|
|
424
|
+
* `POST /v1/license-keys/validate`
|
|
425
|
+
*/
|
|
426
|
+
validate(request: ValidateLicenseKey, options?: RequestOptions): Promise<LicenseKeyStatus>;
|
|
427
|
+
/**
|
|
428
|
+
* Retrieve a license key
|
|
429
|
+
*
|
|
430
|
+
* `GET /v1/license-keys/{id}`
|
|
431
|
+
*/
|
|
432
|
+
retrieve(request: LicenseKeysRetrieveRequest, options?: RequestOptions): Promise<LicenseKey>;
|
|
433
|
+
/**
|
|
434
|
+
* Revoke a license key
|
|
435
|
+
*
|
|
436
|
+
* @remarks
|
|
437
|
+
* The key stops validating and activating at once (`status: revoked`). Idempotent. Sends `license_key.revoked` and bumps the customer-access `version`.
|
|
438
|
+
*
|
|
439
|
+
* `POST /v1/license-keys/{id}/revoke`
|
|
440
|
+
*/
|
|
441
|
+
revoke(request: LicenseKeysRevokeRequest, options?: RequestOptions): Promise<LicenseKey>;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* `onflay.meters`
|
|
445
|
+
*/
|
|
446
|
+
declare class Meters extends ClientSDK {
|
|
447
|
+
/**
|
|
448
|
+
* List meters
|
|
449
|
+
*
|
|
450
|
+
* @remarks
|
|
451
|
+
* All meters of the account, newest first.
|
|
452
|
+
*
|
|
453
|
+
* `GET /v1/meters`
|
|
454
|
+
*/
|
|
455
|
+
list(options?: RequestOptions): Promise<MetersListResponse>;
|
|
456
|
+
/**
|
|
457
|
+
* Create a meter
|
|
458
|
+
*
|
|
459
|
+
* `POST /v1/meters`
|
|
460
|
+
*/
|
|
461
|
+
create(request: MetersCreateRequest, options?: RequestOptions): Promise<Meter>;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* `onflay.paymentConfirmations`
|
|
465
|
+
*/
|
|
466
|
+
declare class PaymentConfirmations extends ClientSDK {
|
|
467
|
+
/**
|
|
468
|
+
* Retrieve a payment confirmation
|
|
469
|
+
*
|
|
470
|
+
* @remarks
|
|
471
|
+
* Resolves the token of a `confirmUrl` (a payment with `status: "requires_action"`). No API key: the token itself is the credential. Used by the Onflay-hosted confirmation page; you do not need to call it.
|
|
472
|
+
*
|
|
473
|
+
* `GET /v1/payment-confirmations/{token}`
|
|
474
|
+
*/
|
|
475
|
+
retrieve(request: PaymentConfirmationsRetrieveRequest, options?: RequestOptions): Promise<PaymentConfirmation>;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* `onflay.payments.refunds`
|
|
479
|
+
*/
|
|
480
|
+
declare class PaymentsRefunds extends ClientSDK {
|
|
481
|
+
/**
|
|
482
|
+
* List refunds of a payment
|
|
483
|
+
*
|
|
484
|
+
* @remarks
|
|
485
|
+
* Lists the refunds of one payment, newest first, including `pending` and `failed` ones. Cursor-paginated. Requires the `refunds:read` scope.
|
|
486
|
+
*
|
|
487
|
+
* `GET /v1/payments/{id}/refunds`
|
|
488
|
+
*/
|
|
489
|
+
list(request: PaymentsRefundsListRequest, options?: RequestOptions): Promise<PageIterator<PaymentsRefundsListResponse, {
|
|
490
|
+
cursor: string;
|
|
491
|
+
}>>;
|
|
492
|
+
/**
|
|
493
|
+
* Refund a payment
|
|
494
|
+
*
|
|
495
|
+
* @remarks
|
|
496
|
+
* Refunds all or part of a payment to the buyer’s original payment method. Omit `amountInCents` to refund everything that is left. Requires the `refunds:write` scope and an `Idempotency-Key` header: a retry with the same key and body returns the first refund instead of refunding again. A full refund revokes what the payment granted; a refund never cancels a subscription.
|
|
497
|
+
*
|
|
498
|
+
* `POST /v1/payments/{id}/refunds`
|
|
499
|
+
*/
|
|
500
|
+
create(request: PaymentsRefundsCreateRequest, options?: RequestOptions): Promise<Refund>;
|
|
501
|
+
/**
|
|
502
|
+
* Retrieve a refund
|
|
503
|
+
*
|
|
504
|
+
* @remarks
|
|
505
|
+
* Returns one refund of a payment. Requires the `refunds:read` scope.
|
|
506
|
+
*
|
|
507
|
+
* `GET /v1/payments/{id}/refunds/{refundId}`
|
|
508
|
+
*/
|
|
509
|
+
retrieve(request: PaymentsRefundsRetrieveRequest, options?: RequestOptions): Promise<Refund>;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* `onflay.payments`
|
|
513
|
+
*/
|
|
514
|
+
declare class Payments extends ClientSDK {
|
|
515
|
+
private _refunds?;
|
|
516
|
+
get refunds(): PaymentsRefunds;
|
|
517
|
+
/**
|
|
518
|
+
* List payments
|
|
519
|
+
*
|
|
520
|
+
* @remarks
|
|
521
|
+
* Lists payments on your account, newest first. Cursor-paginated. Requires the `payments:read` scope.
|
|
522
|
+
*
|
|
523
|
+
* `GET /v1/payments`
|
|
524
|
+
*/
|
|
525
|
+
list(request?: PaymentsListRequest, options?: RequestOptions): Promise<PageIterator<PaymentsListResponse, {
|
|
526
|
+
cursor: string;
|
|
527
|
+
}>>;
|
|
528
|
+
/**
|
|
529
|
+
* Charge a saved card
|
|
530
|
+
*
|
|
531
|
+
* @remarks
|
|
532
|
+
* Charges a card the customer saved with your account (at checkout with `savePaymentMethod`, or through a setup intent), off-session, now. Send `amountInCents` + `currency`, or `catalog` to charge a one-time plan at its price (its grants apply). Returns the payment: `completed` when charged, `failed` with `failureCode` when declined, or `requires_action` with `confirmUrl` when the bank needs the customer to confirm (Onflay emails them the link). Cards saved with other sellers are never charged (`payment_method_required`). Requires the `payments:write` scope and an `Idempotency-Key` header: a retry with the same key returns the same payment and never charges twice.
|
|
533
|
+
*
|
|
534
|
+
* `POST /v1/payments`
|
|
535
|
+
*/
|
|
536
|
+
create(request: PaymentsCreateRequest, options?: RequestOptions): Promise<Payment>;
|
|
537
|
+
/**
|
|
538
|
+
* Retrieve a payment
|
|
539
|
+
*
|
|
540
|
+
* @remarks
|
|
541
|
+
* Returns one payment on your account. Requires the `payments:read` scope.
|
|
542
|
+
*
|
|
543
|
+
* `GET /v1/payments/{id}`
|
|
544
|
+
*/
|
|
545
|
+
retrieve(request: PaymentsRetrieveRequest, options?: RequestOptions): Promise<Payment>;
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* `onflay.prices`
|
|
549
|
+
*/
|
|
550
|
+
declare class Prices extends ClientSDK {
|
|
551
|
+
/**
|
|
552
|
+
* List prices
|
|
553
|
+
*
|
|
554
|
+
* @remarks
|
|
555
|
+
* Cursor-paginated list of the account prices, newest first. `limit` counts prices. Filter by `productId` or `active`. Requires the `prices:read` scope.
|
|
556
|
+
*
|
|
557
|
+
* `GET /v1/prices`
|
|
558
|
+
*/
|
|
559
|
+
list(request?: PricesListRequest, options?: RequestOptions): Promise<PageIterator<PricesListResponse, {
|
|
560
|
+
cursor: string;
|
|
561
|
+
}>>;
|
|
562
|
+
/**
|
|
563
|
+
* Create a price
|
|
564
|
+
*
|
|
565
|
+
* @remarks
|
|
566
|
+
* Creates (or updates the matching) USD price on a product. Only `billingScheme: "flat"` is supported. Requires the `prices:write` scope.
|
|
567
|
+
*
|
|
568
|
+
* `POST /v1/prices`
|
|
569
|
+
*/
|
|
570
|
+
create(request: PricesCreateRequest, options?: RequestOptions): Promise<Price>;
|
|
571
|
+
/**
|
|
572
|
+
* Retrieve a price
|
|
573
|
+
*
|
|
574
|
+
* @remarks
|
|
575
|
+
* Requires the `prices:read` scope.
|
|
576
|
+
*
|
|
577
|
+
* `GET /v1/prices/{id}`
|
|
578
|
+
*/
|
|
579
|
+
retrieve(request: PricesRetrieveRequest, options?: RequestOptions): Promise<Price>;
|
|
580
|
+
/**
|
|
581
|
+
* Update a price
|
|
582
|
+
*
|
|
583
|
+
* @remarks
|
|
584
|
+
* Activates or deactivates a price and merges `metadata`. Requires the `prices:write` scope.
|
|
585
|
+
*
|
|
586
|
+
* `PATCH /v1/prices/{id}`
|
|
587
|
+
*/
|
|
588
|
+
update(request: PricesUpdateRequest, options?: RequestOptions): Promise<Price>;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* `onflay.products`
|
|
592
|
+
*/
|
|
593
|
+
declare class Products extends ClientSDK {
|
|
594
|
+
/**
|
|
595
|
+
* List products
|
|
596
|
+
*
|
|
597
|
+
* @remarks
|
|
598
|
+
* Cursor-paginated list of the account products, newest first. Filter by `active`. Requires the `products:read` scope.
|
|
599
|
+
*
|
|
600
|
+
* `GET /v1/products`
|
|
601
|
+
*/
|
|
602
|
+
list(request?: ProductsListRequest, options?: RequestOptions): Promise<PageIterator<ProductsListResponse, {
|
|
603
|
+
cursor: string;
|
|
604
|
+
}>>;
|
|
605
|
+
/**
|
|
606
|
+
* Create a product
|
|
607
|
+
*
|
|
608
|
+
* @remarks
|
|
609
|
+
* Creates a digital product. It is published for sale unless `active` is false. Requires the `products:write` scope.
|
|
610
|
+
*
|
|
611
|
+
* `POST /v1/products`
|
|
612
|
+
*/
|
|
613
|
+
create(request: ProductsCreateRequest, options?: RequestOptions): Promise<Product>;
|
|
614
|
+
/**
|
|
615
|
+
* Retrieve a product
|
|
616
|
+
*
|
|
617
|
+
* @remarks
|
|
618
|
+
* Requires the `products:read` scope.
|
|
619
|
+
*
|
|
620
|
+
* `GET /v1/products/{id}`
|
|
621
|
+
*/
|
|
622
|
+
retrieve(request: ProductsRetrieveRequest, options?: RequestOptions): Promise<Product>;
|
|
623
|
+
/**
|
|
624
|
+
* Update a product
|
|
625
|
+
*
|
|
626
|
+
* @remarks
|
|
627
|
+
* Updates the provided fields. `metadata` is merged into the existing metadata. Requires the `products:write` scope.
|
|
628
|
+
*
|
|
629
|
+
* `PATCH /v1/products/{id}`
|
|
630
|
+
*/
|
|
631
|
+
update(request: ProductsUpdateRequest, options?: RequestOptions): Promise<Product>;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* `onflay.sandbox.payoutMethods`
|
|
635
|
+
*/
|
|
636
|
+
declare class SandboxPayoutMethods extends ClientSDK {
|
|
637
|
+
/**
|
|
638
|
+
* Create a test payout method
|
|
639
|
+
*
|
|
640
|
+
* @remarks
|
|
641
|
+
* Provisions a test payout method for this sandbox account. Sandbox only (`sk_test_*` keys); returns 403 on the production plane. Safe to call repeatedly.
|
|
642
|
+
*
|
|
643
|
+
* `POST /v1/sandbox/payout-methods/test`
|
|
644
|
+
*/
|
|
645
|
+
createTest(options?: RequestOptions): Promise<SandboxPayoutMethodResult>;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* `onflay.sandbox`
|
|
649
|
+
*/
|
|
650
|
+
declare class Sandbox extends ClientSDK {
|
|
651
|
+
private _payoutMethods?;
|
|
652
|
+
get payoutMethods(): SandboxPayoutMethods;
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* `onflay.setupSessions`
|
|
656
|
+
*/
|
|
657
|
+
declare class SetupSessions extends ClientSDK {
|
|
658
|
+
/**
|
|
659
|
+
* Retrieve a setup session
|
|
660
|
+
*
|
|
661
|
+
* @remarks
|
|
662
|
+
* Resolves a setup session token from `POST /v1/customers/{id}/setup-intent`. No API key: the token itself is the credential. Tokens expire after 1 hour.
|
|
663
|
+
*
|
|
664
|
+
* `GET /v1/setup-sessions/{token}`
|
|
665
|
+
*/
|
|
666
|
+
retrieve(request: SetupSessionsRetrieveRequest, options?: RequestOptions): Promise<SetupSession>;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* `onflay.subscriptions`
|
|
670
|
+
*/
|
|
671
|
+
declare class Subscriptions extends ClientSDK {
|
|
672
|
+
/**
|
|
673
|
+
* List subscriptions
|
|
674
|
+
*
|
|
675
|
+
* @remarks
|
|
676
|
+
* Cursor-paginated list of the account subscriptions, newest first. Filter by `status` or `externalCustomerId`.
|
|
677
|
+
*
|
|
678
|
+
* `GET /v1/subscriptions`
|
|
679
|
+
*/
|
|
680
|
+
list(request?: SubscriptionsListRequest, options?: RequestOptions): Promise<PageIterator<SubscriptionsListResponse, {
|
|
681
|
+
cursor: string;
|
|
682
|
+
}>>;
|
|
683
|
+
/**
|
|
684
|
+
* Cancel by externalCustomerId
|
|
685
|
+
*
|
|
686
|
+
* @remarks
|
|
687
|
+
* Resolves the customer's single cancelable subscription (optionally scoped by catalogKey) and cancels it. Defaults to cancel at period end.
|
|
688
|
+
*
|
|
689
|
+
* `POST /v1/subscriptions/cancel`
|
|
690
|
+
*/
|
|
691
|
+
cancelByExternalCustomer(request: SubscriptionsCancelByExternalCustomerRequest, options?: RequestOptions): Promise<SubscriptionCancellation>;
|
|
692
|
+
/**
|
|
693
|
+
* Uncancel by externalCustomerId
|
|
694
|
+
*
|
|
695
|
+
* @remarks
|
|
696
|
+
* Clears the customer's single scheduled period-end cancellation (optionally scoped by catalogKey).
|
|
697
|
+
*
|
|
698
|
+
* `POST /v1/subscriptions/uncancel`
|
|
699
|
+
*/
|
|
700
|
+
uncancelByExternalCustomer(request: SubscriptionsUncancelByExternalCustomerRequest, options?: RequestOptions): Promise<Subscription>;
|
|
701
|
+
/**
|
|
702
|
+
* Retrieve a subscription
|
|
703
|
+
*
|
|
704
|
+
* `GET /v1/subscriptions/{id}`
|
|
705
|
+
*/
|
|
706
|
+
retrieve(request: SubscriptionsRetrieveRequest, options?: RequestOptions): Promise<Subscription>;
|
|
707
|
+
/**
|
|
708
|
+
* Update a subscription
|
|
709
|
+
*
|
|
710
|
+
* @remarks
|
|
711
|
+
* Cancels, resumes or switches the plan of a subscription. Provide exactly one intent. `{ cancelAtPeriodEnd }` returns a `SubscriptionCancellation`; `{ uncancel: true }`, `{ catalog }` and `{ cancelPendingChange: true }` return the updated `Subscription`. A plan switch applies now (`effective: "now"`, default, prorated with `prorationBehavior`) or at the end of the paid period (`effective: "period_end"`: the subscription shows `pendingChange` and `subscription.updated` fires when the new plan starts). Price either with `POST /v1/subscriptions/{id}/preview` first.
|
|
712
|
+
*
|
|
713
|
+
* `PATCH /v1/subscriptions/{id}`
|
|
714
|
+
*/
|
|
715
|
+
update(request: SubscriptionsUpdateRequest, options?: RequestOptions): Promise<SubscriptionsUpdateResponse>;
|
|
716
|
+
/**
|
|
717
|
+
* Cancel a subscription
|
|
718
|
+
*
|
|
719
|
+
* @remarks
|
|
720
|
+
* Defaults to cancel at period end (status stays `active` with cancelAtPeriodEnd=true). Pass cancelAtPeriodEnd=false to cancel immediately.
|
|
721
|
+
*
|
|
722
|
+
* `POST /v1/subscriptions/{id}/cancel`
|
|
723
|
+
*/
|
|
724
|
+
cancel(request: SubscriptionsCancelRequest, options?: RequestOptions): Promise<SubscriptionCancellation>;
|
|
725
|
+
/**
|
|
726
|
+
* Preview a plan switch
|
|
727
|
+
*
|
|
728
|
+
* @remarks
|
|
729
|
+
* Returns what a plan switch would cost without changing anything: `amountDueNow` (charged when you switch), the next invoice and its lines. Takes the plan-switch fields of `PATCH /v1/subscriptions/{id}` (`catalog`, `prorationBehavior`, `effective`) and runs the same checks, so it fails with the same errors (`plan_unchanged`, `cross_listing_switch_forbidden`, `cancellation_scheduled`, ...). Amounts exclude tax Onflay adds to invoices of tax-collected subscriptions.
|
|
730
|
+
*
|
|
731
|
+
* `POST /v1/subscriptions/{id}/preview`
|
|
732
|
+
*/
|
|
733
|
+
previewUpdate(request: SubscriptionsPreviewUpdateRequest, options?: RequestOptions): Promise<SubscriptionUpdatePreview>;
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* `onflay.usage.billingPlans`
|
|
737
|
+
*/
|
|
738
|
+
declare class UsageBillingPlans extends ClientSDK {
|
|
739
|
+
/**
|
|
740
|
+
* Create a usage billing plan
|
|
741
|
+
*
|
|
742
|
+
* @remarks
|
|
743
|
+
* Attaches metered billing (meter + price) to a subscription. One plan per subscription.
|
|
744
|
+
*
|
|
745
|
+
* `POST /v1/usage/billing-plans`
|
|
746
|
+
*/
|
|
747
|
+
create(request: UsageBillingPlansCreateRequest, options?: RequestOptions): Promise<UsageBillingPlan>;
|
|
748
|
+
/**
|
|
749
|
+
* Retrieve a usage billing plan
|
|
750
|
+
*
|
|
751
|
+
* @remarks
|
|
752
|
+
* The usage billing plan of a subscription.
|
|
753
|
+
*
|
|
754
|
+
* `GET /v1/usage/billing-plans/{subscriptionId}`
|
|
755
|
+
*/
|
|
756
|
+
retrieve(request: UsageBillingPlansRetrieveRequest, options?: RequestOptions): Promise<UsageBillingPlan>;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* `onflay.usage.records`
|
|
760
|
+
*/
|
|
761
|
+
declare class UsageRecords extends ClientSDK {
|
|
762
|
+
/**
|
|
763
|
+
* Report usage
|
|
764
|
+
*
|
|
765
|
+
* @remarks
|
|
766
|
+
* Buffers a usage event for a subscription and meter; it is persisted asynchronously. Deduplicated by the body `idempotencyKey`.
|
|
767
|
+
*
|
|
768
|
+
* `POST /v1/usage/records`
|
|
769
|
+
*/
|
|
770
|
+
create(request: ReportUsage, options?: RequestOptions): Promise<UsageRecord>;
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* `onflay.usage`
|
|
774
|
+
*/
|
|
775
|
+
declare class Usage extends ClientSDK {
|
|
776
|
+
private _billingPlans?;
|
|
777
|
+
get billingPlans(): UsageBillingPlans;
|
|
778
|
+
private _records?;
|
|
779
|
+
get records(): UsageRecords;
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* `onflay.webhookDeliveries`
|
|
783
|
+
*/
|
|
784
|
+
declare class WebhookDeliveries extends ClientSDK {
|
|
785
|
+
/**
|
|
786
|
+
* List webhook deliveries
|
|
787
|
+
*
|
|
788
|
+
* @remarks
|
|
789
|
+
* Newest first. Cursor-paginated. List items omit `payload`; retrieve a delivery to see it.
|
|
790
|
+
*
|
|
791
|
+
* `GET /v1/webhook-deliveries`
|
|
792
|
+
*/
|
|
793
|
+
list(request?: WebhookDeliveriesListRequest, options?: RequestOptions): Promise<PageIterator<WebhookDeliveriesListResponse, {
|
|
794
|
+
cursor: string;
|
|
795
|
+
}>>;
|
|
796
|
+
/**
|
|
797
|
+
* Retrieve a webhook delivery
|
|
798
|
+
*
|
|
799
|
+
* @remarks
|
|
800
|
+
* Includes the payload that was sent.
|
|
801
|
+
*
|
|
802
|
+
* `GET /v1/webhook-deliveries/{id}`
|
|
803
|
+
*/
|
|
804
|
+
retrieve(request: WebhookDeliveriesRetrieveRequest, options?: RequestOptions): Promise<WebhookDelivery>;
|
|
805
|
+
/**
|
|
806
|
+
* Resend a webhook delivery
|
|
807
|
+
*
|
|
808
|
+
* @remarks
|
|
809
|
+
* Queues the delivery for another attempt now. Sets the status back to `PENDING` and enqueues a new attempt. The response omits `payload`.
|
|
810
|
+
*
|
|
811
|
+
* `POST /v1/webhook-deliveries/{id}/resend`
|
|
812
|
+
*/
|
|
813
|
+
resend(request: WebhookDeliveriesResendRequest, options?: RequestOptions): Promise<WebhookDelivery>;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* `onflay.webhookEndpoints`
|
|
817
|
+
*/
|
|
818
|
+
declare class WebhookEndpoints extends ClientSDK {
|
|
819
|
+
/**
|
|
820
|
+
* List webhook endpoints
|
|
821
|
+
*
|
|
822
|
+
* @remarks
|
|
823
|
+
* Newest first. Returns every endpoint in one page; `nextCursor` is always null.
|
|
824
|
+
*
|
|
825
|
+
* `GET /v1/webhook-endpoints`
|
|
826
|
+
*/
|
|
827
|
+
list(options?: RequestOptions): Promise<WebhookEndpointList>;
|
|
828
|
+
/**
|
|
829
|
+
* Create a webhook endpoint
|
|
830
|
+
*
|
|
831
|
+
* @remarks
|
|
832
|
+
* The signing secret is returned once, in `secret`.
|
|
833
|
+
*
|
|
834
|
+
* `POST /v1/webhook-endpoints`
|
|
835
|
+
*/
|
|
836
|
+
create(request: WebhookEndpointsCreateRequest, options?: RequestOptions): Promise<WebhookEndpointWithSecret>;
|
|
837
|
+
/**
|
|
838
|
+
* Retrieve a webhook endpoint
|
|
839
|
+
*
|
|
840
|
+
* `GET /v1/webhook-endpoints/{id}`
|
|
841
|
+
*/
|
|
842
|
+
retrieve(request: WebhookEndpointsRetrieveRequest, options?: RequestOptions): Promise<WebhookEndpoint>;
|
|
843
|
+
/**
|
|
844
|
+
* Delete a webhook endpoint
|
|
845
|
+
*
|
|
846
|
+
* @remarks
|
|
847
|
+
* Deletes the endpoint and its delivery log.
|
|
848
|
+
*
|
|
849
|
+
* `DELETE /v1/webhook-endpoints/{id}`
|
|
850
|
+
*/
|
|
851
|
+
delete(request: WebhookEndpointsDeleteRequest, options?: RequestOptions): Promise<void>;
|
|
852
|
+
/**
|
|
853
|
+
* Update a webhook endpoint
|
|
854
|
+
*
|
|
855
|
+
* @remarks
|
|
856
|
+
* Updates the URL, events, description or `isActive`.
|
|
857
|
+
*
|
|
858
|
+
* `PATCH /v1/webhook-endpoints/{id}`
|
|
859
|
+
*/
|
|
860
|
+
update(request: WebhookEndpointsUpdateRequest, options?: RequestOptions): Promise<WebhookEndpoint>;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Onflay API client.
|
|
864
|
+
*
|
|
865
|
+
* ```ts
|
|
866
|
+
* import { Onflay } from '@onflay/node';
|
|
867
|
+
*
|
|
868
|
+
* const onflay = new Onflay({ bearer: process.env['ONFLAY_SECRET_KEY'] ?? '' });
|
|
869
|
+
* ```
|
|
870
|
+
*/
|
|
871
|
+
declare class Onflay extends ClientSDK {
|
|
872
|
+
private _jwks?;
|
|
873
|
+
get jwks(): Jwks;
|
|
874
|
+
private _catalog?;
|
|
875
|
+
get catalog(): Catalog;
|
|
876
|
+
private _checkoutSessions?;
|
|
877
|
+
get checkoutSessions(): CheckoutSessions;
|
|
878
|
+
private _credits?;
|
|
879
|
+
get credits(): Credits;
|
|
880
|
+
private _customerAccess?;
|
|
881
|
+
get customerAccess(): CustomerAccess;
|
|
882
|
+
private _customerPortal?;
|
|
883
|
+
get customerPortal(): CustomerPortal;
|
|
884
|
+
private _customers?;
|
|
885
|
+
get customers(): Customers;
|
|
886
|
+
private _discounts?;
|
|
887
|
+
get discounts(): Discounts;
|
|
888
|
+
private _integrationVerifications?;
|
|
889
|
+
get integrationVerifications(): IntegrationVerifications;
|
|
890
|
+
private _invoices?;
|
|
891
|
+
get invoices(): Invoices;
|
|
892
|
+
private _licenseKeys?;
|
|
893
|
+
get licenseKeys(): LicenseKeys;
|
|
894
|
+
private _meters?;
|
|
895
|
+
get meters(): Meters;
|
|
896
|
+
private _paymentConfirmations?;
|
|
897
|
+
get paymentConfirmations(): PaymentConfirmations;
|
|
898
|
+
private _payments?;
|
|
899
|
+
get payments(): Payments;
|
|
900
|
+
private _prices?;
|
|
901
|
+
get prices(): Prices;
|
|
902
|
+
private _products?;
|
|
903
|
+
get products(): Products;
|
|
904
|
+
private _sandbox?;
|
|
905
|
+
get sandbox(): Sandbox;
|
|
906
|
+
private _setupSessions?;
|
|
907
|
+
get setupSessions(): SetupSessions;
|
|
908
|
+
private _subscriptions?;
|
|
909
|
+
get subscriptions(): Subscriptions;
|
|
910
|
+
private _usage?;
|
|
911
|
+
get usage(): Usage;
|
|
912
|
+
private _webhookDeliveries?;
|
|
913
|
+
get webhookDeliveries(): WebhookDeliveries;
|
|
914
|
+
private _webhookEndpoints?;
|
|
915
|
+
get webhookEndpoints(): WebhookEndpoints;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
export { Catalog, CatalogListings, CatalogPlans, CatalogProducts, CheckoutSessions, Credits, CustomerAccess, CustomerPortal, CustomerPortalSessions, Customers, Discounts, IntegrationVerifications, Invoices, Jwks, LicenseKeys, Meters, Onflay, PaymentConfirmations, Payments, PaymentsRefunds, Prices, Products, Sandbox, SandboxPayoutMethods, SetupSessions, Subscriptions, Usage, UsageBillingPlans, UsageRecords, WebhookDeliveries, WebhookEndpoints };
|