1import type {
2 Account as StripeAccount,
3 CreateAccountError,
4 CreateAccountRequest,
5} from "@distilled.cloud/stripe/stripe";
6import type * as Effect from "effect/Effect";
7import * as Binding from "../Binding.ts";
8import type { RuntimeContext } from "../RuntimeContext.ts";
9
10/**
11 * Create a Stripe Connect Account over HTTP. Account-scoped — binds the
12 * API key onto the host, not a specific connected account.
13 *
14 * ### Creating an Account at runtime
15 * **Example:** Bind and create
16 * ```typescript
17 * const create = yield* Stripe.CreateAccount();
18 * const account = yield* create({
19 * type: "express",
20 * country: "US",
21 * email: "merchant@example.com",
22 * });
23 * ```
24 *
25 * @binding
26 * @product Account
27 */
28export interface CreateAccount extends Binding.Service<
29 CreateAccount,
30 "Stripe.CreateAccount",
31 () => Effect.Effect<
32 (
33 request: CreateAccountRequest,
34 ) => Effect.Effect<StripeAccount, CreateAccountError, RuntimeContext>
35 >
36> {}
37
38export const CreateAccount = Binding.Service<CreateAccount>(
39 "Stripe.CreateAccount",
40);