@vansite/ts-sharetribe-flex-sdk
Version:
This is a TypeScript SDK for Sharetribe Flex API. It reduces the complexity of the API and provides a more user-friendly interface.
57 lines (56 loc) • 2.15 kB
TypeScript
/**
* @fileoverview Client for managing the current user's Stripe account in the Sharetribe Marketplace API.
*
* Use this to:
* - Fetch existing Stripe account status
* - Create a new Stripe Connect account
* - Update account details or capabilities
*
* Requires authentication.
*
* @see https://www.sharetribe.com/api-reference/marketplace.html#stripe-account
*/
import type { AxiosResponse } from "axios";
import MarketplaceApi from "./index";
import { ExtraParameter, StripeAccountCreateParameter, StripeAccountResponse, StripeAccountUpdateParameter } from "../../types";
/**
* Stripe Account API client (current user)
*/
declare class StripeAccount {
readonly authRequired = true;
private readonly axios;
private readonly endpoint;
private readonly headers;
constructor(api: MarketplaceApi);
/**
* Fetch current user's Stripe account
*
* @returns {Promise<AxiosResponse<StripeAccountResponse<"fetch">>>}
*
* @example
* const { data } = await sdk.stripeAccount.fetch();
* console.log(data.attributes.stripeAccountData.capabilities);
*/
fetch(): Promise<AxiosResponse<StripeAccountResponse<"fetch">>>;
/**
* Create a new Stripe Connect account
*
* @template P
* @template EP
* @param {P & StripeAccountCreateParameter} params
* @param {EP} [extraParams]
* @returns {Promise<AxiosResponse<StripeAccountResponse<"create", EP>>>}
*/
create<P extends StripeAccountCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeAccountResponse<"create", EP>>>;
/**
* Update existing Stripe Connect account
*
* @template P
* @template EP
* @param {P & StripeAccountUpdateParameter} params
* @param {EP} [extraParams]
* @returns {Promise<AxiosResponse<StripeAccountResponse<"update", EP>>>}
*/
update<P extends StripeAccountUpdateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeAccountResponse<"update", EP>>>;
}
export default StripeAccount;