> ## Documentation Index
> Fetch the complete documentation index at: https://developer.tryfinch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a new sandbox account

> Create a new account for an existing connection (company/provider pair)



## OpenAPI

````yaml post /sandbox/connections/accounts
openapi: 3.1.0
info:
  title: API Reference
  version: '2020-09-17'
  contact: {}
  description: >-
    The Finch HRIS API provides a unified way to connect to a multitide of HRIS
    systems. The API requires an access token issued by Finch.


    By default, Organization and Payroll requests use Finch's [Data
    Syncs](/developer-resources/Data-Syncs). If a request is made before the
    initial sync has completed, Finch will request data live from the provider.
    The latency on live requests may range from seconds to minutes depending on
    the provider and batch size.

    For automated integrations, Deductions requests (both read and write) are
    always made live to the provider. Latencies may range from seconds to
    minutes depending on the provider and batch size.



    Employer products are specified by the product parameter, a space-separated
    list of products that your application requests from an employer
    authenticating through Finch Connect. Valid product names are—

    - `company`: Read basic company data


    - `directory`: Read company directory and organization structure


    - `individual`: Read individual data, excluding income and employment data


    - `employment`: Read individual employment and income data


    - `payment`: Read payroll and contractor related payments by the company


    - `pay_statement`: Read detailed pay statements for each individual


    - `benefits`: Create and manage deductions and contributions and enrollment
    for an employer


    [![Open in
    Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4?action=collection%2Ffork&collection-url=entityId%3D21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4%26entityType%3Dcollection%26workspaceId%3D1edf19bc-e0a8-41e9-ac55-481a4b50790b)
servers:
  - url: https://api.tryfinch.com
    description: ''
security: []
tags:
  - name: Organization
  - name: Payroll
  - name: Deductions
  - name: Management
  - name: Sandbox
paths:
  /sandbox/connections/accounts:
    parameters: []
    post:
      tags:
        - Sandbox
      summary: Create a new sandbox account
      description: Create a new account for an existing connection (company/provider pair)
      operationId: post-sandbox-connections-accounts
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                company_id:
                  type: string
                  format: uuid
                provider_id:
                  type: string
                  description: The provider associated with the `access_token`
                authentication_type:
                  $ref: '#/components/schemas/AuthenticationType'
                products:
                  type: array
                  description: >-
                    Optional, defaults to Organization products (`company`,
                    `directory`, `employment`, `individual`)
                  items:
                    type: string
              required:
                - company_id
                - provider_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  connection_id:
                    type: string
                    format: uuid
                    description: The ID of the new connection
                  entity_id:
                    type: string
                    format: uuid
                    description: The ID of the entity for this connection
                  company_id:
                    type: string
                    format: uuid
                    deprecated: true
                    description: >-
                      [DEPRECATED] Use `connection_id` to associate a connection
                      with an access token
                  provider_id:
                    type: string
                    description: The ID of the provider associated with the `access_token`
                  account_id:
                    type: string
                    format: uuid
                    deprecated: true
                    description: >-
                      [DEPRECATED] Use `connection_id` to associate a connection
                      with an access token
                  authentication_type:
                    $ref: '#/components/schemas/AuthenticationType'
                  products:
                    type: array
                    items:
                      type: string
                  access_token:
                    type: string
                    format: uuid
                required:
                  - connection_id
                  - entity_id
                  - company_id
                  - provider_id
                  - account_id
                  - authentication_type
                  - products
                  - access_token
              examples:
                Example 1:
                  value:
                    connection_id: a237a1c3-1a5e-44ae-a8fd-81f76fd715c2
                    entity_id: 449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65
                    company_id: b2e6a1c3-1a5e-44ae-a8fd-81f76fd715cf
                    account_id: 449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65
                    provider_id: gusto
                    authentication_type: credential
                    products:
                      - company
                    access_token: 7eb55bcf-6593-4040-afac-252ee1f78e20
      security:
        - basicAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Finch from '@tryfinch/finch-api';

            const client = new Finch({
              clientID: process.env['FINCH_CLIENT_ID'], // This is the default and can be omitted
              clientSecret: process.env['FINCH_CLIENT_SECRET'], // This is the default and can be omitted
            });

            const account = await client.sandbox.connections.accounts.create({
              company_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              provider_id: 'provider_id',
            });

            console.log(account.account_id);
        - lang: Python
          source: |-
            import os
            from finch import Finch

            client = Finch(
                client_id=os.environ.get("FINCH_CLIENT_ID"),  # This is the default and can be omitted
                client_secret=os.environ.get("FINCH_CLIENT_SECRET"),  # This is the default and can be omitted
            )
            account = client.sandbox.connections.accounts.create(
                company_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                provider_id="provider_id",
            )
            print(account.account_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/Finch-API/finch-api-go\"\n\t\"github.com/Finch-API/finch-api-go/option\"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithClientID(\"4ab15e51-11ad-49f4-acae-f343b7794375\"),\n\t\toption.WithClientSecret(\"My Client Secret\"),\n\t)\n\taccount, err := client.Sandbox.Connections.Accounts.New(context.TODO(), finchgo.SandboxConnectionAccountNewParams{\n\t\tCompanyID:  finchgo.F(\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\"),\n\t\tProviderID: finchgo.F(\"provider_id\"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", account.AccountID)\n}\n"
        - lang: Java
          source: |-
            package com.tryfinch.api.example;

            import com.tryfinch.api.client.FinchClient;
            import com.tryfinch.api.client.okhttp.FinchOkHttpClient;
            import com.tryfinch.api.models.AccountCreateResponse;
            import com.tryfinch.api.models.SandboxConnectionAccountCreateParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    FinchClient client = FinchOkHttpClient.fromEnv();

                    SandboxConnectionAccountCreateParams params = SandboxConnectionAccountCreateParams.builder()
                        .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                        .providerId("provider_id")
                        .build();
                    AccountCreateResponse account = client.sandbox().connections().accounts().create(params);
                }
            }
        - lang: Kotlin
          source: |-
            package com.tryfinch.api.example

            import com.tryfinch.api.client.FinchClient
            import com.tryfinch.api.client.okhttp.FinchOkHttpClient
            import com.tryfinch.api.models.AccountCreateResponse
            import com.tryfinch.api.models.SandboxConnectionAccountCreateParams

            fun main() {
                val client: FinchClient = FinchOkHttpClient.fromEnv()

                val params: SandboxConnectionAccountCreateParams = SandboxConnectionAccountCreateParams.builder()
                    .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                    .providerId("provider_id")
                    .build()
                val account: AccountCreateResponse = client.sandbox().connections().accounts().create(params)
            }
        - lang: Ruby
          source: >-
            require "finch_api"


            finch = FinchAPI::Client.new(client_id:
            "4ab15e51-11ad-49f4-acae-f343b7794375", client_secret: "My Client
            Secret")


            account = finch.sandbox.connections.accounts.create(
              company_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              provider_id: "provider_id"
            )


            puts(account)
components:
  schemas:
    AuthenticationType:
      title: AuthenticationType
      enum:
        - credential
        - api_token
        - oauth
        - assisted
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Please use base64 encoded client_id:client_secret

````