# Accounts ## Lookup an account `client.embed.accounts.get(stringaccountID, AccountGetParamsparams?, RequestOptionsoptions?): AccountV1` **get** `/v1/accounts/{account_id}` Retrieves the details of an account that has previously been created. Supply the unique account ID that was returned from your previous request, and Straddle will return the corresponding account information. ### Parameters - `accountID: string` The unique identifier of the account to retrieve. - `params: AccountGetParams` - `correlationID?: string` Optional client generated identifier to trace and debug a series of requests. - `requestID?: string` Optional client generated identifier to trace and debug a request. ### Returns - `AccountV1` - `data: Data` - `id: string` Unique identifier for the account. - `access_level: "standard" | "managed"` The access level granted to the account. This is determined by your platform configuration. Use `standard` unless instructed otherwise by Straddle. - `"standard"` - `"managed"` - `organization_id: string` The unique identifier of the organization this account belongs to. - `status: "created" | "onboarding" | "active" | 2 more` The current status of the account (e.g., 'active', 'inactive', 'pending'). - `"created"` - `"onboarding"` - `"active"` - `"rejected"` - `"inactive"` - `status_detail: StatusDetail` - `code: string` A machine-readable code for the specific status, useful for programmatic handling. - `message: string` A human-readable message describing the current status. - `reason: "unverified" | "in_review" | "pending" | 6 more` A machine-readable identifier for the specific status, useful for programmatic handling. - `"unverified"` - `"in_review"` - `"pending"` - `"stuck"` - `"verified"` - `"failed_verification"` - `"disabled"` - `"terminated"` - `"new"` - `source: "watchtower"` Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`). This helps in tracking the cause of status updates. - `"watchtower"` - `type: "business"` The type of account (e.g., 'individual', 'business'). - `"business"` - `business_profile?: BusinessProfileV1` - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. - `capabilities?: Capabilities` - `consent_types: ConsentTypes` - `internet: CapabilityV1` Whether the internet payment authorization capability is enabled for the account. - `capability_status: "active" | "inactive"` - `"active"` - `"inactive"` - `signed_agreement: CapabilityV1` Whether the signed agreement payment authorization capability is enabled for the account. - `customer_types: CustomerTypes` - `businesses: CapabilityV1` - `individuals: CapabilityV1` - `payment_types: PaymentTypes` - `charges: CapabilityV1` - `payouts: CapabilityV1` - `created_at?: string | null` Timestamp of when the account was created. - `external_id?: string | null` Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `settings?: Settings` - `charges: Charges` - `daily_amount: number` The maximum dollar amount of charges in a calendar day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a charge to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account associated with charges. This value is defined by Straddle. - `max_amount: number` The maximum amount of a single charge. - `monthly_amount: number` The maximum dollar amount of charges in a calendar month. - `monthly_count: number` The maximum number of charges in a calendar month. - `payouts: Payouts` - `daily_amount: number` The maximum dollar amount of payouts in a day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a payout to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account to use for payouts. - `max_amount: number` The maximum amount of a single payout. - `monthly_amount: number` The maximum dollar amount of payouts in a month. - `monthly_count: number` The maximum number of payouts in a month. - `terms_of_service?: TermsOfServiceV1` - `accepted_date: string` The datetime of when the terms of service were accepted, in ISO 8601 format. - `agreement_type: "embedded" | "direct"` The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements. - `"embedded"` - `"direct"` - `agreement_url: string | null` The URL where the full text of the accepted agreement can be found. - `accepted_ip?: string | null` The IP address from which the terms of service were accepted. - `accepted_user_agent?: string | null` The user agent string of the browser or application used to accept the terms. - `updated_at?: string | null` Timestamp of the most recent update to the account. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const accountV1 = await client.embed.accounts.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(accountV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "access_level": "standard", "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "status": "created", "status_detail": { "code": "code", "message": "message", "reason": "unverified", "source": "watchtower" }, "type": "business", "business_profile": { "name": "name", "website": "https://example.com", "address": { "city": "city", "line1": "line1", "postal_code": "21029-1360", "state": "SE", "country": "country", "line2": "line2" }, "description": "description", "industry": { "category": "category", "mcc": "mcc", "sector": "sector" }, "legal_name": "legal_name", "phone": "+46991022", "support_channels": { "email": "dev@stainless.com", "phone": "+46991022", "url": "https://example.com" }, "tax_id": "210297980", "use_case": "use_case" }, "capabilities": { "consent_types": { "internet": { "capability_status": "active" }, "signed_agreement": { "capability_status": "active" } }, "customer_types": { "businesses": { "capability_status": "active" }, "individuals": { "capability_status": "active" } }, "payment_types": { "charges": { "capability_status": "active" }, "payouts": { "capability_status": "active" } } }, "created_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id", "metadata": { "foo": "string" }, "settings": { "charges": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 }, "payouts": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 } }, "terms_of_service": { "accepted_date": "2019-12-27T18:11:19.117Z", "agreement_type": "embedded", "agreement_url": "agreement_url", "accepted_ip": "accepted_ip", "accepted_user_agent": "accepted_user_agent" }, "updated_at": "2019-12-27T18:11:19.117Z" }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Update an account `client.embed.accounts.update(stringaccountID, AccountUpdateParamsparams, RequestOptionsoptions?): AccountV1` **put** `/v1/accounts/{account_id}` Updates an existing account's information. This endpoint allows you to update various account details during onboarding or after the account has been created. ### Parameters - `accountID: string` - `params: AccountUpdateParams` - `business_profile: BusinessProfileV1` Body param - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. - `external_id?: string | null` Body param: Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Body param: Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. ### Returns - `AccountV1` - `data: Data` - `id: string` Unique identifier for the account. - `access_level: "standard" | "managed"` The access level granted to the account. This is determined by your platform configuration. Use `standard` unless instructed otherwise by Straddle. - `"standard"` - `"managed"` - `organization_id: string` The unique identifier of the organization this account belongs to. - `status: "created" | "onboarding" | "active" | 2 more` The current status of the account (e.g., 'active', 'inactive', 'pending'). - `"created"` - `"onboarding"` - `"active"` - `"rejected"` - `"inactive"` - `status_detail: StatusDetail` - `code: string` A machine-readable code for the specific status, useful for programmatic handling. - `message: string` A human-readable message describing the current status. - `reason: "unverified" | "in_review" | "pending" | 6 more` A machine-readable identifier for the specific status, useful for programmatic handling. - `"unverified"` - `"in_review"` - `"pending"` - `"stuck"` - `"verified"` - `"failed_verification"` - `"disabled"` - `"terminated"` - `"new"` - `source: "watchtower"` Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`). This helps in tracking the cause of status updates. - `"watchtower"` - `type: "business"` The type of account (e.g., 'individual', 'business'). - `"business"` - `business_profile?: BusinessProfileV1` - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. - `capabilities?: Capabilities` - `consent_types: ConsentTypes` - `internet: CapabilityV1` Whether the internet payment authorization capability is enabled for the account. - `capability_status: "active" | "inactive"` - `"active"` - `"inactive"` - `signed_agreement: CapabilityV1` Whether the signed agreement payment authorization capability is enabled for the account. - `customer_types: CustomerTypes` - `businesses: CapabilityV1` - `individuals: CapabilityV1` - `payment_types: PaymentTypes` - `charges: CapabilityV1` - `payouts: CapabilityV1` - `created_at?: string | null` Timestamp of when the account was created. - `external_id?: string | null` Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `settings?: Settings` - `charges: Charges` - `daily_amount: number` The maximum dollar amount of charges in a calendar day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a charge to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account associated with charges. This value is defined by Straddle. - `max_amount: number` The maximum amount of a single charge. - `monthly_amount: number` The maximum dollar amount of charges in a calendar month. - `monthly_count: number` The maximum number of charges in a calendar month. - `payouts: Payouts` - `daily_amount: number` The maximum dollar amount of payouts in a day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a payout to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account to use for payouts. - `max_amount: number` The maximum amount of a single payout. - `monthly_amount: number` The maximum dollar amount of payouts in a month. - `monthly_count: number` The maximum number of payouts in a month. - `terms_of_service?: TermsOfServiceV1` - `accepted_date: string` The datetime of when the terms of service were accepted, in ISO 8601 format. - `agreement_type: "embedded" | "direct"` The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements. - `"embedded"` - `"direct"` - `agreement_url: string | null` The URL where the full text of the accepted agreement can be found. - `accepted_ip?: string | null` The IP address from which the terms of service were accepted. - `accepted_user_agent?: string | null` The user agent string of the browser or application used to accept the terms. - `updated_at?: string | null` Timestamp of the most recent update to the account. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const accountV1 = await client.embed.accounts.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { business_profile: { name: 'name', website: 'https://example.com' }, }); console.log(accountV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "access_level": "standard", "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "status": "created", "status_detail": { "code": "code", "message": "message", "reason": "unverified", "source": "watchtower" }, "type": "business", "business_profile": { "name": "name", "website": "https://example.com", "address": { "city": "city", "line1": "line1", "postal_code": "21029-1360", "state": "SE", "country": "country", "line2": "line2" }, "description": "description", "industry": { "category": "category", "mcc": "mcc", "sector": "sector" }, "legal_name": "legal_name", "phone": "+46991022", "support_channels": { "email": "dev@stainless.com", "phone": "+46991022", "url": "https://example.com" }, "tax_id": "210297980", "use_case": "use_case" }, "capabilities": { "consent_types": { "internet": { "capability_status": "active" }, "signed_agreement": { "capability_status": "active" } }, "customer_types": { "businesses": { "capability_status": "active" }, "individuals": { "capability_status": "active" } }, "payment_types": { "charges": { "capability_status": "active" }, "payouts": { "capability_status": "active" } } }, "created_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id", "metadata": { "foo": "string" }, "settings": { "charges": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 }, "payouts": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 } }, "terms_of_service": { "accepted_date": "2019-12-27T18:11:19.117Z", "agreement_type": "embedded", "agreement_url": "agreement_url", "accepted_ip": "accepted_ip", "accepted_user_agent": "accepted_user_agent" }, "updated_at": "2019-12-27T18:11:19.117Z" }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Create an account `client.embed.accounts.create(AccountCreateParamsparams, RequestOptionsoptions?): AccountV1` **post** `/v1/accounts` Creates a new account associated with your Straddle platform integration. This endpoint allows you to set up an account with specified details, including business information and access levels. ### Parameters - `params: AccountCreateParams` - `access_level: "standard" | "managed"` Body param: The access level granted to the account. This is determined by your platform configuration. Use `standard` unless instructed otherwise by Straddle. - `"standard"` - `"managed"` - `account_type: "business"` Body param: The type of account to be created. Currently, only `business` is supported. - `"business"` - `business_profile: BusinessProfileV1` Body param - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. - `organization_id: string` Body param: The unique identifier of the organization related to this account. - `external_id?: string | null` Body param: Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Body param: Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. ### Returns - `AccountV1` - `data: Data` - `id: string` Unique identifier for the account. - `access_level: "standard" | "managed"` The access level granted to the account. This is determined by your platform configuration. Use `standard` unless instructed otherwise by Straddle. - `"standard"` - `"managed"` - `organization_id: string` The unique identifier of the organization this account belongs to. - `status: "created" | "onboarding" | "active" | 2 more` The current status of the account (e.g., 'active', 'inactive', 'pending'). - `"created"` - `"onboarding"` - `"active"` - `"rejected"` - `"inactive"` - `status_detail: StatusDetail` - `code: string` A machine-readable code for the specific status, useful for programmatic handling. - `message: string` A human-readable message describing the current status. - `reason: "unverified" | "in_review" | "pending" | 6 more` A machine-readable identifier for the specific status, useful for programmatic handling. - `"unverified"` - `"in_review"` - `"pending"` - `"stuck"` - `"verified"` - `"failed_verification"` - `"disabled"` - `"terminated"` - `"new"` - `source: "watchtower"` Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`). This helps in tracking the cause of status updates. - `"watchtower"` - `type: "business"` The type of account (e.g., 'individual', 'business'). - `"business"` - `business_profile?: BusinessProfileV1` - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. - `capabilities?: Capabilities` - `consent_types: ConsentTypes` - `internet: CapabilityV1` Whether the internet payment authorization capability is enabled for the account. - `capability_status: "active" | "inactive"` - `"active"` - `"inactive"` - `signed_agreement: CapabilityV1` Whether the signed agreement payment authorization capability is enabled for the account. - `customer_types: CustomerTypes` - `businesses: CapabilityV1` - `individuals: CapabilityV1` - `payment_types: PaymentTypes` - `charges: CapabilityV1` - `payouts: CapabilityV1` - `created_at?: string | null` Timestamp of when the account was created. - `external_id?: string | null` Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `settings?: Settings` - `charges: Charges` - `daily_amount: number` The maximum dollar amount of charges in a calendar day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a charge to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account associated with charges. This value is defined by Straddle. - `max_amount: number` The maximum amount of a single charge. - `monthly_amount: number` The maximum dollar amount of charges in a calendar month. - `monthly_count: number` The maximum number of charges in a calendar month. - `payouts: Payouts` - `daily_amount: number` The maximum dollar amount of payouts in a day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a payout to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account to use for payouts. - `max_amount: number` The maximum amount of a single payout. - `monthly_amount: number` The maximum dollar amount of payouts in a month. - `monthly_count: number` The maximum number of payouts in a month. - `terms_of_service?: TermsOfServiceV1` - `accepted_date: string` The datetime of when the terms of service were accepted, in ISO 8601 format. - `agreement_type: "embedded" | "direct"` The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements. - `"embedded"` - `"direct"` - `agreement_url: string | null` The URL where the full text of the accepted agreement can be found. - `accepted_ip?: string | null` The IP address from which the terms of service were accepted. - `accepted_user_agent?: string | null` The user agent string of the browser or application used to accept the terms. - `updated_at?: string | null` Timestamp of the most recent update to the account. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const accountV1 = await client.embed.accounts.create({ access_level: 'standard', account_type: 'business', business_profile: { name: 'name', website: 'https://example.com' }, organization_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(accountV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "access_level": "standard", "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "status": "created", "status_detail": { "code": "code", "message": "message", "reason": "unverified", "source": "watchtower" }, "type": "business", "business_profile": { "name": "name", "website": "https://example.com", "address": { "city": "city", "line1": "line1", "postal_code": "21029-1360", "state": "SE", "country": "country", "line2": "line2" }, "description": "description", "industry": { "category": "category", "mcc": "mcc", "sector": "sector" }, "legal_name": "legal_name", "phone": "+46991022", "support_channels": { "email": "dev@stainless.com", "phone": "+46991022", "url": "https://example.com" }, "tax_id": "210297980", "use_case": "use_case" }, "capabilities": { "consent_types": { "internet": { "capability_status": "active" }, "signed_agreement": { "capability_status": "active" } }, "customer_types": { "businesses": { "capability_status": "active" }, "individuals": { "capability_status": "active" } }, "payment_types": { "charges": { "capability_status": "active" }, "payouts": { "capability_status": "active" } } }, "created_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id", "metadata": { "foo": "string" }, "settings": { "charges": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 }, "payouts": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 } }, "terms_of_service": { "accepted_date": "2019-12-27T18:11:19.117Z", "agreement_type": "embedded", "agreement_url": "agreement_url", "accepted_ip": "accepted_ip", "accepted_user_agent": "accepted_user_agent" }, "updated_at": "2019-12-27T18:11:19.117Z" }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## List accounts `client.embed.accounts.list(AccountListParamsparams?, RequestOptionsoptions?): PageNumberSchema` **get** `/v1/accounts` Returns a list of accounts associated with your Straddle platform integration. The accounts are returned sorted by creation date, with the most recently created accounts appearing first. This endpoint supports advanced sorting and filtering options. ### Parameters - `params: AccountListParams` - `page_number?: number` Query param: Results page number. Starts at page 1. Default value: 1 - `page_size?: number` Query param: Page size. Default value: 100. Max value: 1000 - `search_text?: string` Query param - `sort_by?: string` Query param: Sort By. Default value: 'id'. - `sort_order?: "asc" | "desc"` Query param: Sort Order. Default value: 'asc'. - `"asc"` - `"desc"` - `status?: "created" | "onboarding" | "active" | 2 more` Query param - `"created"` - `"onboarding"` - `"active"` - `"rejected"` - `"inactive"` - `type?: "business"` Query param - `"business"` - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. ### Returns - `Data` - `id: string` Unique identifier for the account. - `access_level: "standard" | "managed"` The access level granted to the account. This is determined by your platform configuration. Use `standard` unless instructed otherwise by Straddle. - `"standard"` - `"managed"` - `organization_id: string` The unique identifier of the organization this account belongs to. - `status: "created" | "onboarding" | "active" | 2 more` The current status of the account (e.g., 'active', 'inactive', 'pending'). - `"created"` - `"onboarding"` - `"active"` - `"rejected"` - `"inactive"` - `status_detail: StatusDetail` - `code: string` A machine-readable code for the specific status, useful for programmatic handling. - `message: string` A human-readable message describing the current status. - `reason: "unverified" | "in_review" | "pending" | 6 more` A machine-readable identifier for the specific status, useful for programmatic handling. - `"unverified"` - `"in_review"` - `"pending"` - `"stuck"` - `"verified"` - `"failed_verification"` - `"disabled"` - `"terminated"` - `"new"` - `source: "watchtower"` Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`). This helps in tracking the cause of status updates. - `"watchtower"` - `type: "business"` The type of account (e.g., 'individual', 'business'). - `"business"` - `business_profile?: BusinessProfileV1` - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. - `capabilities?: Capabilities` - `consent_types: ConsentTypes` - `internet: CapabilityV1` Whether the internet payment authorization capability is enabled for the account. - `capability_status: "active" | "inactive"` - `"active"` - `"inactive"` - `signed_agreement: CapabilityV1` Whether the signed agreement payment authorization capability is enabled for the account. - `customer_types: CustomerTypes` - `businesses: CapabilityV1` - `individuals: CapabilityV1` - `payment_types: PaymentTypes` - `charges: CapabilityV1` - `payouts: CapabilityV1` - `created_at?: string | null` Timestamp of when the account was created. - `external_id?: string | null` Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `settings?: Settings` - `charges: Charges` - `daily_amount: number` The maximum dollar amount of charges in a calendar day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a charge to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account associated with charges. This value is defined by Straddle. - `max_amount: number` The maximum amount of a single charge. - `monthly_amount: number` The maximum dollar amount of charges in a calendar month. - `monthly_count: number` The maximum number of charges in a calendar month. - `payouts: Payouts` - `daily_amount: number` The maximum dollar amount of payouts in a day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a payout to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account to use for payouts. - `max_amount: number` The maximum amount of a single payout. - `monthly_amount: number` The maximum dollar amount of payouts in a month. - `monthly_count: number` The maximum number of payouts in a month. - `terms_of_service?: TermsOfServiceV1` - `accepted_date: string` The datetime of when the terms of service were accepted, in ISO 8601 format. - `agreement_type: "embedded" | "direct"` The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements. - `"embedded"` - `"direct"` - `agreement_url: string | null` The URL where the full text of the accepted agreement can be found. - `accepted_ip?: string | null` The IP address from which the terms of service were accepted. - `accepted_user_agent?: string | null` The user agent string of the browser or application used to accept the terms. - `updated_at?: string | null` Timestamp of the most recent update to the account. ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const account of client.embed.accounts.list()) { console.log(account.id); } ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "access_level": "standard", "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "status": "created", "status_detail": { "code": "code", "message": "message", "reason": "unverified", "source": "watchtower" }, "type": "business", "business_profile": { "name": "name", "website": "https://example.com", "address": { "city": "city", "line1": "line1", "postal_code": "21029-1360", "state": "SE", "country": "country", "line2": "line2" }, "description": "description", "industry": { "category": "category", "mcc": "mcc", "sector": "sector" }, "legal_name": "legal_name", "phone": "+46991022", "support_channels": { "email": "dev@stainless.com", "phone": "+46991022", "url": "https://example.com" }, "tax_id": "210297980", "use_case": "use_case" }, "capabilities": { "consent_types": { "internet": { "capability_status": "active" }, "signed_agreement": { "capability_status": "active" } }, "customer_types": { "businesses": { "capability_status": "active" }, "individuals": { "capability_status": "active" } }, "payment_types": { "charges": { "capability_status": "active" }, "payouts": { "capability_status": "active" } } }, "created_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id", "metadata": { "foo": "string" }, "settings": { "charges": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 }, "payouts": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 } }, "terms_of_service": { "accepted_date": "2019-12-27T18:11:19.117Z", "agreement_type": "embedded", "agreement_url": "agreement_url", "accepted_ip": "accepted_ip", "accepted_user_agent": "accepted_user_agent" }, "updated_at": "2019-12-27T18:11:19.117Z" } ], "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z", "max_page_size": 0, "page_number": 0, "page_size": 0, "sort_by": "sort_by", "sort_order": "asc", "total_items": 0, "total_pages": 0 }, "response_type": "object" } ``` ## Onboard an account `client.embed.accounts.onboard(stringaccountID, AccountOnboardParamsparams, RequestOptionsoptions?): AccountV1` **post** `/v1/accounts/{account_id}/onboard` Initiates the onboarding process for a new account. This endpoint can only be used for accounts where at least one representative and one bank account have already been created. ### Parameters - `accountID: string` - `params: AccountOnboardParams` - `terms_of_service: TermsOfServiceV1` Body param - `accepted_date: string` The datetime of when the terms of service were accepted, in ISO 8601 format. - `agreement_type: "embedded" | "direct"` The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements. - `"embedded"` - `"direct"` - `agreement_url: string | null` The URL where the full text of the accepted agreement can be found. - `accepted_ip?: string | null` The IP address from which the terms of service were accepted. - `accepted_user_agent?: string | null` The user agent string of the browser or application used to accept the terms. - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. ### Returns - `AccountV1` - `data: Data` - `id: string` Unique identifier for the account. - `access_level: "standard" | "managed"` The access level granted to the account. This is determined by your platform configuration. Use `standard` unless instructed otherwise by Straddle. - `"standard"` - `"managed"` - `organization_id: string` The unique identifier of the organization this account belongs to. - `status: "created" | "onboarding" | "active" | 2 more` The current status of the account (e.g., 'active', 'inactive', 'pending'). - `"created"` - `"onboarding"` - `"active"` - `"rejected"` - `"inactive"` - `status_detail: StatusDetail` - `code: string` A machine-readable code for the specific status, useful for programmatic handling. - `message: string` A human-readable message describing the current status. - `reason: "unverified" | "in_review" | "pending" | 6 more` A machine-readable identifier for the specific status, useful for programmatic handling. - `"unverified"` - `"in_review"` - `"pending"` - `"stuck"` - `"verified"` - `"failed_verification"` - `"disabled"` - `"terminated"` - `"new"` - `source: "watchtower"` Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`). This helps in tracking the cause of status updates. - `"watchtower"` - `type: "business"` The type of account (e.g., 'individual', 'business'). - `"business"` - `business_profile?: BusinessProfileV1` - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. - `capabilities?: Capabilities` - `consent_types: ConsentTypes` - `internet: CapabilityV1` Whether the internet payment authorization capability is enabled for the account. - `capability_status: "active" | "inactive"` - `"active"` - `"inactive"` - `signed_agreement: CapabilityV1` Whether the signed agreement payment authorization capability is enabled for the account. - `customer_types: CustomerTypes` - `businesses: CapabilityV1` - `individuals: CapabilityV1` - `payment_types: PaymentTypes` - `charges: CapabilityV1` - `payouts: CapabilityV1` - `created_at?: string | null` Timestamp of when the account was created. - `external_id?: string | null` Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `settings?: Settings` - `charges: Charges` - `daily_amount: number` The maximum dollar amount of charges in a calendar day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a charge to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account associated with charges. This value is defined by Straddle. - `max_amount: number` The maximum amount of a single charge. - `monthly_amount: number` The maximum dollar amount of charges in a calendar month. - `monthly_count: number` The maximum number of charges in a calendar month. - `payouts: Payouts` - `daily_amount: number` The maximum dollar amount of payouts in a day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a payout to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account to use for payouts. - `max_amount: number` The maximum amount of a single payout. - `monthly_amount: number` The maximum dollar amount of payouts in a month. - `monthly_count: number` The maximum number of payouts in a month. - `terms_of_service?: TermsOfServiceV1` - `accepted_date: string` The datetime of when the terms of service were accepted, in ISO 8601 format. - `agreement_type: "embedded" | "direct"` The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements. - `"embedded"` - `"direct"` - `agreement_url: string | null` The URL where the full text of the accepted agreement can be found. - `accepted_ip?: string | null` The IP address from which the terms of service were accepted. - `accepted_user_agent?: string | null` The user agent string of the browser or application used to accept the terms. - `updated_at?: string | null` Timestamp of the most recent update to the account. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const accountV1 = await client.embed.accounts.onboard('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { terms_of_service: { accepted_date: '2019-12-27T18:11:19.117Z', agreement_type: 'embedded', agreement_url: 'agreement_url', }, }); console.log(accountV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "access_level": "standard", "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "status": "created", "status_detail": { "code": "code", "message": "message", "reason": "unverified", "source": "watchtower" }, "type": "business", "business_profile": { "name": "name", "website": "https://example.com", "address": { "city": "city", "line1": "line1", "postal_code": "21029-1360", "state": "SE", "country": "country", "line2": "line2" }, "description": "description", "industry": { "category": "category", "mcc": "mcc", "sector": "sector" }, "legal_name": "legal_name", "phone": "+46991022", "support_channels": { "email": "dev@stainless.com", "phone": "+46991022", "url": "https://example.com" }, "tax_id": "210297980", "use_case": "use_case" }, "capabilities": { "consent_types": { "internet": { "capability_status": "active" }, "signed_agreement": { "capability_status": "active" } }, "customer_types": { "businesses": { "capability_status": "active" }, "individuals": { "capability_status": "active" } }, "payment_types": { "charges": { "capability_status": "active" }, "payouts": { "capability_status": "active" } } }, "created_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id", "metadata": { "foo": "string" }, "settings": { "charges": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 }, "payouts": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 } }, "terms_of_service": { "accepted_date": "2019-12-27T18:11:19.117Z", "agreement_type": "embedded", "agreement_url": "agreement_url", "accepted_ip": "accepted_ip", "accepted_user_agent": "accepted_user_agent" }, "updated_at": "2019-12-27T18:11:19.117Z" }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Simulate status transitions for a sandbox account `client.embed.accounts.simulate(stringaccountID, AccountSimulateParamsparams?, RequestOptionsoptions?): AccountV1` **post** `/v1/accounts/{account_id}/simulate` Simulate the status transitions for sandbox accounts. This endpoint can only be used for sandbox accounts. ### Parameters - `accountID: string` - `params: AccountSimulateParams` - `final_status?: "onboarding" | "active"` Query param - `"onboarding"` - `"active"` - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. ### Returns - `AccountV1` - `data: Data` - `id: string` Unique identifier for the account. - `access_level: "standard" | "managed"` The access level granted to the account. This is determined by your platform configuration. Use `standard` unless instructed otherwise by Straddle. - `"standard"` - `"managed"` - `organization_id: string` The unique identifier of the organization this account belongs to. - `status: "created" | "onboarding" | "active" | 2 more` The current status of the account (e.g., 'active', 'inactive', 'pending'). - `"created"` - `"onboarding"` - `"active"` - `"rejected"` - `"inactive"` - `status_detail: StatusDetail` - `code: string` A machine-readable code for the specific status, useful for programmatic handling. - `message: string` A human-readable message describing the current status. - `reason: "unverified" | "in_review" | "pending" | 6 more` A machine-readable identifier for the specific status, useful for programmatic handling. - `"unverified"` - `"in_review"` - `"pending"` - `"stuck"` - `"verified"` - `"failed_verification"` - `"disabled"` - `"terminated"` - `"new"` - `source: "watchtower"` Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`). This helps in tracking the cause of status updates. - `"watchtower"` - `type: "business"` The type of account (e.g., 'individual', 'business'). - `"business"` - `business_profile?: BusinessProfileV1` - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. - `capabilities?: Capabilities` - `consent_types: ConsentTypes` - `internet: CapabilityV1` Whether the internet payment authorization capability is enabled for the account. - `capability_status: "active" | "inactive"` - `"active"` - `"inactive"` - `signed_agreement: CapabilityV1` Whether the signed agreement payment authorization capability is enabled for the account. - `customer_types: CustomerTypes` - `businesses: CapabilityV1` - `individuals: CapabilityV1` - `payment_types: PaymentTypes` - `charges: CapabilityV1` - `payouts: CapabilityV1` - `created_at?: string | null` Timestamp of when the account was created. - `external_id?: string | null` Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `settings?: Settings` - `charges: Charges` - `daily_amount: number` The maximum dollar amount of charges in a calendar day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a charge to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account associated with charges. This value is defined by Straddle. - `max_amount: number` The maximum amount of a single charge. - `monthly_amount: number` The maximum dollar amount of charges in a calendar month. - `monthly_count: number` The maximum number of charges in a calendar month. - `payouts: Payouts` - `daily_amount: number` The maximum dollar amount of payouts in a day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a payout to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account to use for payouts. - `max_amount: number` The maximum amount of a single payout. - `monthly_amount: number` The maximum dollar amount of payouts in a month. - `monthly_count: number` The maximum number of payouts in a month. - `terms_of_service?: TermsOfServiceV1` - `accepted_date: string` The datetime of when the terms of service were accepted, in ISO 8601 format. - `agreement_type: "embedded" | "direct"` The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements. - `"embedded"` - `"direct"` - `agreement_url: string | null` The URL where the full text of the accepted agreement can be found. - `accepted_ip?: string | null` The IP address from which the terms of service were accepted. - `accepted_user_agent?: string | null` The user agent string of the browser or application used to accept the terms. - `updated_at?: string | null` Timestamp of the most recent update to the account. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const accountV1 = await client.embed.accounts.simulate('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(accountV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "access_level": "standard", "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "status": "created", "status_detail": { "code": "code", "message": "message", "reason": "unverified", "source": "watchtower" }, "type": "business", "business_profile": { "name": "name", "website": "https://example.com", "address": { "city": "city", "line1": "line1", "postal_code": "21029-1360", "state": "SE", "country": "country", "line2": "line2" }, "description": "description", "industry": { "category": "category", "mcc": "mcc", "sector": "sector" }, "legal_name": "legal_name", "phone": "+46991022", "support_channels": { "email": "dev@stainless.com", "phone": "+46991022", "url": "https://example.com" }, "tax_id": "210297980", "use_case": "use_case" }, "capabilities": { "consent_types": { "internet": { "capability_status": "active" }, "signed_agreement": { "capability_status": "active" } }, "customer_types": { "businesses": { "capability_status": "active" }, "individuals": { "capability_status": "active" } }, "payment_types": { "charges": { "capability_status": "active" }, "payouts": { "capability_status": "active" } } }, "created_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id", "metadata": { "foo": "string" }, "settings": { "charges": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 }, "payouts": { "daily_amount": 0, "funding_time": "immediate", "linked_bank_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "max_amount": 0, "monthly_amount": 0, "monthly_count": 0 } }, "terms_of_service": { "accepted_date": "2019-12-27T18:11:19.117Z", "agreement_type": "embedded", "agreement_url": "agreement_url", "accepted_ip": "accepted_ip", "accepted_user_agent": "accepted_user_agent" }, "updated_at": "2019-12-27T18:11:19.117Z" }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Domain Types ### Account Paged V1 - `AccountPagedV1` - `data: Array` - `id: string` Unique identifier for the account. - `access_level: "standard" | "managed"` The access level granted to the account. This is determined by your platform configuration. Use `standard` unless instructed otherwise by Straddle. - `"standard"` - `"managed"` - `organization_id: string` The unique identifier of the organization this account belongs to. - `status: "created" | "onboarding" | "active" | 2 more` The current status of the account (e.g., 'active', 'inactive', 'pending'). - `"created"` - `"onboarding"` - `"active"` - `"rejected"` - `"inactive"` - `status_detail: StatusDetail` - `code: string` A machine-readable code for the specific status, useful for programmatic handling. - `message: string` A human-readable message describing the current status. - `reason: "unverified" | "in_review" | "pending" | 6 more` A machine-readable identifier for the specific status, useful for programmatic handling. - `"unverified"` - `"in_review"` - `"pending"` - `"stuck"` - `"verified"` - `"failed_verification"` - `"disabled"` - `"terminated"` - `"new"` - `source: "watchtower"` Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`). This helps in tracking the cause of status updates. - `"watchtower"` - `type: "business"` The type of account (e.g., 'individual', 'business'). - `"business"` - `business_profile?: BusinessProfileV1` - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. - `capabilities?: Capabilities` - `consent_types: ConsentTypes` - `internet: CapabilityV1` Whether the internet payment authorization capability is enabled for the account. - `capability_status: "active" | "inactive"` - `"active"` - `"inactive"` - `signed_agreement: CapabilityV1` Whether the signed agreement payment authorization capability is enabled for the account. - `customer_types: CustomerTypes` - `businesses: CapabilityV1` - `individuals: CapabilityV1` - `payment_types: PaymentTypes` - `charges: CapabilityV1` - `payouts: CapabilityV1` - `created_at?: string | null` Timestamp of when the account was created. - `external_id?: string | null` Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `settings?: Settings` - `charges: Charges` - `daily_amount: number` The maximum dollar amount of charges in a calendar day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a charge to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account associated with charges. This value is defined by Straddle. - `max_amount: number` The maximum amount of a single charge. - `monthly_amount: number` The maximum dollar amount of charges in a calendar month. - `monthly_count: number` The maximum number of charges in a calendar month. - `payouts: Payouts` - `daily_amount: number` The maximum dollar amount of payouts in a day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a payout to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account to use for payouts. - `max_amount: number` The maximum amount of a single payout. - `monthly_amount: number` The maximum dollar amount of payouts in a month. - `monthly_count: number` The maximum number of payouts in a month. - `terms_of_service?: TermsOfServiceV1` - `accepted_date: string` The datetime of when the terms of service were accepted, in ISO 8601 format. - `agreement_type: "embedded" | "direct"` The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements. - `"embedded"` - `"direct"` - `agreement_url: string | null` The URL where the full text of the accepted agreement can be found. - `accepted_ip?: string | null` The IP address from which the terms of service were accepted. - `accepted_user_agent?: string | null` The user agent string of the browser or application used to accept the terms. - `updated_at?: string | null` Timestamp of the most recent update to the account. - `meta: PagedResponseMetadata` Metadata about the API request, including an identifier, timestamp, and pagination details. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `max_page_size: number` Maximum allowed page size for this endpoint. - `page_number: number` Page number for paginated results. - `page_size: number` Number of items per page in this response. - `sort_by: string` The field that the results were sorted by. - `sort_order: "asc" | "desc"` - `"asc"` - `"desc"` - `total_items: number` Total number of items returned in this response. - `total_pages: number` The number of pages available. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Account V1 - `AccountV1` - `data: Data` - `id: string` Unique identifier for the account. - `access_level: "standard" | "managed"` The access level granted to the account. This is determined by your platform configuration. Use `standard` unless instructed otherwise by Straddle. - `"standard"` - `"managed"` - `organization_id: string` The unique identifier of the organization this account belongs to. - `status: "created" | "onboarding" | "active" | 2 more` The current status of the account (e.g., 'active', 'inactive', 'pending'). - `"created"` - `"onboarding"` - `"active"` - `"rejected"` - `"inactive"` - `status_detail: StatusDetail` - `code: string` A machine-readable code for the specific status, useful for programmatic handling. - `message: string` A human-readable message describing the current status. - `reason: "unverified" | "in_review" | "pending" | 6 more` A machine-readable identifier for the specific status, useful for programmatic handling. - `"unverified"` - `"in_review"` - `"pending"` - `"stuck"` - `"verified"` - `"failed_verification"` - `"disabled"` - `"terminated"` - `"new"` - `source: "watchtower"` Identifies the origin of the status change (e.g., `bank_decline`, `watchtower`). This helps in tracking the cause of status updates. - `"watchtower"` - `type: "business"` The type of account (e.g., 'individual', 'business'). - `"business"` - `business_profile?: BusinessProfileV1` - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. - `capabilities?: Capabilities` - `consent_types: ConsentTypes` - `internet: CapabilityV1` Whether the internet payment authorization capability is enabled for the account. - `capability_status: "active" | "inactive"` - `"active"` - `"inactive"` - `signed_agreement: CapabilityV1` Whether the signed agreement payment authorization capability is enabled for the account. - `customer_types: CustomerTypes` - `businesses: CapabilityV1` - `individuals: CapabilityV1` - `payment_types: PaymentTypes` - `charges: CapabilityV1` - `payouts: CapabilityV1` - `created_at?: string | null` Timestamp of when the account was created. - `external_id?: string | null` Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `settings?: Settings` - `charges: Charges` - `daily_amount: number` The maximum dollar amount of charges in a calendar day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a charge to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account associated with charges. This value is defined by Straddle. - `max_amount: number` The maximum amount of a single charge. - `monthly_amount: number` The maximum dollar amount of charges in a calendar month. - `monthly_count: number` The maximum number of charges in a calendar month. - `payouts: Payouts` - `daily_amount: number` The maximum dollar amount of payouts in a day. - `funding_time: "immediate" | "next_day" | "one_day" | 4 more` The amount of time it takes for a payout to be funded. This value is defined by Straddle. - `"immediate"` - `"next_day"` - `"one_day"` - `"two_day"` - `"three_day"` - `"four_day"` - `"five_day"` - `linked_bank_account_id: string` The unique identifier of the linked bank account to use for payouts. - `max_amount: number` The maximum amount of a single payout. - `monthly_amount: number` The maximum dollar amount of payouts in a month. - `monthly_count: number` The maximum number of payouts in a month. - `terms_of_service?: TermsOfServiceV1` - `accepted_date: string` The datetime of when the terms of service were accepted, in ISO 8601 format. - `agreement_type: "embedded" | "direct"` The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements. - `"embedded"` - `"direct"` - `agreement_url: string | null` The URL where the full text of the accepted agreement can be found. - `accepted_ip?: string | null` The IP address from which the terms of service were accepted. - `accepted_user_agent?: string | null` The user agent string of the browser or application used to accept the terms. - `updated_at?: string | null` Timestamp of the most recent update to the account. - `meta: ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Address V1 - `AddressV1` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). ### Business Profile V1 - `BusinessProfileV1` - `name: string` The operating or trade name of the business. - `website: string` URL of the business's primary marketing website. - `address?: AddressV1 | null` The address object is optional. If provided, it must be a valid address. - `city: string | null` City, district, suburb, town, or village. - `line1: string | null` Primary address line (e.g., street, PO Box). - `postal_code: string | null` Postal or ZIP code. - `state: string | null` Two-letter state code. - `country?: string | null` The country of the address, in ISO 3166-1 alpha-2 format. - `line2?: string | null` Secondary address line (e.g., apartment, suite, unit, or building). - `description?: string | null` A brief description of the business and its products or services. - `industry?: IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. - `legal_name?: string | null` The official registered name of the business. - `phone?: string | null` The primary contact phone number for the business. - `support_channels?: SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. - `tax_id?: string | null` The business's tax identification number (e.g., EIN in the US). - `use_case?: string | null` A description of how the business intends to use Straddle's services. ### Capability V1 - `CapabilityV1` - `capability_status: "active" | "inactive"` - `"active"` - `"inactive"` ### Industry V1 - `IndustryV1` - `category?: string | null` The general category of the industry. Required if not providing MCC. - `mcc?: string | null` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector?: string | null` The specific sector within the industry category. Required if not providing MCC. ### Support Channels V1 - `SupportChannelsV1` - `email?: string | null` The email address for customer support inquiries. - `phone?: string | null` The phone number for customer support. - `url?: string | null` The URL of the business's customer support page or contact form. ### Terms Of Service V1 - `TermsOfServiceV1` - `accepted_date: string` The datetime of when the terms of service were accepted, in ISO 8601 format. - `agreement_type: "embedded" | "direct"` The type or version of the agreement accepted. Use `embedded` unless your platform was specifically enabled for `direct` agreements. - `"embedded"` - `"direct"` - `agreement_url: string | null` The URL where the full text of the accepted agreement can be found. - `accepted_ip?: string | null` The IP address from which the terms of service were accepted. - `accepted_user_agent?: string | null` The user agent string of the browser or application used to accept the terms. # Capability Requests ## Request a capability `client.embed.accounts.capabilityRequests.create(stringaccountID, CapabilityRequestCreateParamsparams?, RequestOptionsoptions?): CapabilityRequestPagedV1` **post** `/v1/accounts/{account_id}/capability_requests` Submits a request to enable a specific capability for an account. Use this endpoint to request additional features or services for an account. ### Parameters - `accountID: string` - `params: CapabilityRequestCreateParams` - `businesses?: Businesses` Body param: Allows the account to accept payments from businesses. - `enable: boolean` - `charges?: Charges` Body param: The charges capability settings for the account. - `daily_amount: number` The maximum dollar amount of charges in a calendar day. - `enable: boolean` Determines whether `charges` are enabled for the account. - `max_amount: number` The maximum amount of a single charge. - `monthly_amount: number` The maximum dollar amount of charges in a calendar month. - `monthly_count: number` The maximum number of charges in a calendar month. - `individuals?: Individuals` Body param: Allows the account to accept payments from individuals. - `enable: boolean` - `internet?: Internet` Body param: Allows the account to accept payments authorized via the internet or mobile applications. - `enable: boolean` - `payouts?: Payouts` Body param: The payouts capability settings for the account. - `daily_amount: number` The maximum dollar amount of payouts in a day. - `enable: boolean` Determines whether `payouts` are enabled for the account. - `max_amount: number` The maximum amount of a single payout. - `monthly_amount: number` The maximum dollar amount of payouts in a month. - `monthly_count: number` The maximum number of payouts in a month. - `signed_agreement?: SignedAgreement` Body param: Allows the account to accept payments authorized by signed agreements or contracts. - `enable: boolean` - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. ### Returns - `CapabilityRequestPagedV1` - `data: Array` - `id: string` Unique identifier for the capability request. - `account_id: string` The unique identifier of the account associated with this capability request. - `category: "payment_type" | "customer_type" | "consent_type"` The category of the requested capability. Use `payment_type` for charges and payouts, `customer_type` to define `individuals` or `businesses`, and `consent_type` for `signed_agreement` or `internet` payment authorization. - `"payment_type"` - `"customer_type"` - `"consent_type"` - `created_at: string` Timestamp of when the capability request was created. - `enable: boolean` Whether this capability request is to enable or disable the capability. - `status: "active" | "inactive" | "in_review" | 3 more` The current status of the capability request. - `"active"` - `"inactive"` - `"in_review"` - `"rejected"` - `"approved"` - `"reviewing"` - `type: "charges" | "payouts" | "individuals" | 3 more` The specific type of capability being requested within the category. - `"charges"` - `"payouts"` - `"individuals"` - `"businesses"` - `"signed_agreement"` - `"internet"` - `updated_at: string` Timestamp of the most recent update to the capability request. - `settings?: Record | null` Any specific settings or configurations related to the requested capability. - `meta: PagedResponseMetadata` Metadata about the API request, including an identifier, timestamp, and pagination details. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `max_page_size: number` Maximum allowed page size for this endpoint. - `page_number: number` Page number for paginated results. - `page_size: number` Number of items per page in this response. - `sort_by: string` The field that the results were sorted by. - `sort_order: "asc" | "desc"` - `"asc"` - `"desc"` - `total_items: number` Total number of items returned in this response. - `total_pages: number` The number of pages available. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"` ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const capabilityRequestPagedV1 = await client.embed.accounts.capabilityRequests.create( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ); console.log(capabilityRequestPagedV1.data); ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "category": "payment_type", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "status": "active", "type": "charges", "updated_at": "2019-12-27T18:11:19.117Z", "settings": { "foo": "bar" } } ], "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z", "max_page_size": 0, "page_number": 0, "page_size": 0, "sort_by": "sort_by", "sort_order": "asc", "total_items": 0, "total_pages": 0 }, "response_type": "object" } ``` ## List capability requests `client.embed.accounts.capabilityRequests.list(stringaccountID, CapabilityRequestListParamsparams?, RequestOptionsoptions?): PageNumberSchema` **get** `/v1/accounts/{account_id}/capability_requests` Retrieves a list of capability requests associated with an account. The requests are returned sorted by creation date, with the most recent requests appearing first. This endpoint supports advanced sorting and filtering options. ### Parameters - `accountID: string` - `params: CapabilityRequestListParams` - `category?: "payment_type" | "customer_type" | "consent_type"` Query param: Filter capability requests by category. - `"payment_type"` - `"customer_type"` - `"consent_type"` - `page_number?: number` Query param: Results page number. Starts at page 1. - `page_size?: number` Query param: Page size.Max value: 1000 - `sort_by?: string` Query param: Sort By. - `sort_order?: "asc" | "desc"` Query param: Sort Order. - `"asc"` - `"desc"` - `status?: "active" | "inactive" | "in_review" | "rejected"` Query param: Filter capability requests by their current status. - `"active"` - `"inactive"` - `"in_review"` - `"rejected"` - `type?: "charges" | "payouts" | "individuals" | 3 more` Query param: Filter capability requests by the specific type of capability. - `"charges"` - `"payouts"` - `"individuals"` - `"businesses"` - `"signed_agreement"` - `"internet"` - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. ### Returns - `Data` - `id: string` Unique identifier for the capability request. - `account_id: string` The unique identifier of the account associated with this capability request. - `category: "payment_type" | "customer_type" | "consent_type"` The category of the requested capability. Use `payment_type` for charges and payouts, `customer_type` to define `individuals` or `businesses`, and `consent_type` for `signed_agreement` or `internet` payment authorization. - `"payment_type"` - `"customer_type"` - `"consent_type"` - `created_at: string` Timestamp of when the capability request was created. - `enable: boolean` Whether this capability request is to enable or disable the capability. - `status: "active" | "inactive" | "in_review" | 3 more` The current status of the capability request. - `"active"` - `"inactive"` - `"in_review"` - `"rejected"` - `"approved"` - `"reviewing"` - `type: "charges" | "payouts" | "individuals" | 3 more` The specific type of capability being requested within the category. - `"charges"` - `"payouts"` - `"individuals"` - `"businesses"` - `"signed_agreement"` - `"internet"` - `updated_at: string` Timestamp of the most recent update to the capability request. - `settings?: Record | null` Any specific settings or configurations related to the requested capability. ### Example ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const capabilityRequest of client.embed.accounts.capabilityRequests.list( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', )) { console.log(capabilityRequest.id); } ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "category": "payment_type", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "status": "active", "type": "charges", "updated_at": "2019-12-27T18:11:19.117Z", "settings": { "foo": "bar" } } ], "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z", "max_page_size": 0, "page_number": 0, "page_size": 0, "sort_by": "sort_by", "sort_order": "asc", "total_items": 0, "total_pages": 0 }, "response_type": "object" } ``` ## Domain Types ### Capability Request Paged V1 - `CapabilityRequestPagedV1` - `data: Array` - `id: string` Unique identifier for the capability request. - `account_id: string` The unique identifier of the account associated with this capability request. - `category: "payment_type" | "customer_type" | "consent_type"` The category of the requested capability. Use `payment_type` for charges and payouts, `customer_type` to define `individuals` or `businesses`, and `consent_type` for `signed_agreement` or `internet` payment authorization. - `"payment_type"` - `"customer_type"` - `"consent_type"` - `created_at: string` Timestamp of when the capability request was created. - `enable: boolean` Whether this capability request is to enable or disable the capability. - `status: "active" | "inactive" | "in_review" | 3 more` The current status of the capability request. - `"active"` - `"inactive"` - `"in_review"` - `"rejected"` - `"approved"` - `"reviewing"` - `type: "charges" | "payouts" | "individuals" | 3 more` The specific type of capability being requested within the category. - `"charges"` - `"payouts"` - `"individuals"` - `"businesses"` - `"signed_agreement"` - `"internet"` - `updated_at: string` Timestamp of the most recent update to the capability request. - `settings?: Record | null` Any specific settings or configurations related to the requested capability. - `meta: PagedResponseMetadata` Metadata about the API request, including an identifier, timestamp, and pagination details. - `api_request_id: string` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: string` Timestamp for this API request, useful for troubleshooting. - `max_page_size: number` Maximum allowed page size for this endpoint. - `page_number: number` Page number for paginated results. - `page_size: number` Number of items per page in this response. - `sort_by: string` The field that the results were sorted by. - `sort_order: "asc" | "desc"` - `"asc"` - `"desc"` - `total_items: number` Total number of items returned in this response. - `total_pages: number` The number of pages available. - `response_type: "object" | "array" | "error" | "none"` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `"object"` - `"array"` - `"error"` - `"none"`