## Onboard an account `embed.accounts.onboard(account_id, **kwargs) -> 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 - `account_id: String` - `terms_of_service: TermsOfServiceV1` - `accepted_date: Time` 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` The URL where the full text of the accepted agreement can be found. - `accepted_ip: String` The IP address from which the terms of service were accepted. - `accepted_user_agent: String` The user agent string of the browser or application used to accept the terms. - `correlation_id: String` - `idempotency_key: String` - `request_id: String` ### Returns - `class AccountV1` - `data: { id, access_level, organization_id, 11 more}` - `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: { code, message, reason, source}` - `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` The address object is optional. If provided, it must be a valid address. - `city: String` City, district, suburb, town, or village. - `line1: String` Primary address line (e.g., street, PO Box). - `postal_code: String` Postal or ZIP code. - `state: String` Two-letter state code. - `country: String` The country of the address, in ISO 3166-1 alpha-2 format. - `line2: String` Secondary address line (e.g., apartment, suite, unit, or building). - `description: String` A brief description of the business and its products or services. - `industry: IndustryV1` - `category: String` The general category of the industry. Required if not providing MCC. - `mcc: String` The Merchant Category Code (MCC) that best describes the business. Optional. - `sector: String` The specific sector within the industry category. Required if not providing MCC. - `legal_name: String` The official registered name of the business. - `phone: String` The primary contact phone number for the business. - `support_channels: SupportChannelsV1` - `email: String` The email address for customer support inquiries. - `phone: String` The phone number for customer support. - `url: String` The URL of the business's customer support page or contact form. - `tax_id: String` The business's tax identification number (e.g., EIN in the US). - `use_case: String` A description of how the business intends to use Straddle's services. - `capabilities: { consent_types, customer_types, payment_types}` - `consent_types: { internet, signed_agreement}` - `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: { businesses, individuals}` - `businesses: CapabilityV1` - `individuals: CapabilityV1` - `payment_types: { charges, payouts}` - `charges: CapabilityV1` - `payouts: CapabilityV1` - `created_at: Time` Timestamp of when the account was created. - `external_id: String` Unique identifier for the account in your database, used for cross-referencing between Straddle and your systems. - `metadata: Hash[Symbol, String]` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the account in a structured format. - `settings: { charges, payouts}` - `charges: { daily_amount, funding_time, linked_bank_account_id, 3 more}` - `daily_amount: Integer` 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: Integer` The maximum amount of a single charge. - `monthly_amount: Integer` The maximum dollar amount of charges in a calendar month. - `monthly_count: Integer` The maximum number of charges in a calendar month. - `payouts: { daily_amount, funding_time, linked_bank_account_id, 3 more}` - `daily_amount: Integer` 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: Integer` The maximum amount of a single payout. - `monthly_amount: Integer` The maximum dollar amount of payouts in a month. - `monthly_count: Integer` The maximum number of payouts in a month. - `terms_of_service: TermsOfServiceV1` - `accepted_date: Time` 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` The URL where the full text of the accepted agreement can be found. - `accepted_ip: String` The IP address from which the terms of service were accepted. - `accepted_user_agent: String` The user agent string of the browser or application used to accept the terms. - `updated_at: Time` 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: Time` 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 ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) account_v1 = straddle.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"} ) puts(account_v1) ``` #### 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" } ```