> ## 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.

# Add a new sandbox payment

All fields are optional. If you don't provide a start and end date, the default `start_date` is one business day after the `end_date` of the most recently created payment, and the default `end_date` is `start_date` + 14 business days. The default `pay_date` is the `end_date` and the default `debit_date` is one business day after the `pay_date`.

You may override any fields in the pay statements you would like. By default, no taxes, earnings or deductions are created (unless an individual is enrolled in deductions via the `/benefits` endpoints).


## OpenAPI

````yaml post /sandbox/payment
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/payment:
    post:
      tags:
        - Sandbox
      summary: Add a new sandbox payment
      operationId: post-sandbox-payment
      requestBody:
        description: >-
          Fields to configure the payment. Takes all fields from the `/payment`
          endpoint. All fields are optional.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSandboxPaymentRequest'
            examples:
              Example 1:
                value:
                  pay_statements:
                    - individual_id: b2338cfb-472f-4f72-9faa-e028c083144a
                      employee_deductions:
                        - name: 401k test
                          type: 401k
                          amount: 2000
                          currency: usd
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIdentifiers'
              examples:
                Success:
                  value:
                    payment_id: some-payment-id
                    pay_date: '2024-01-01'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Finch from '@tryfinch/finch-api';

            const client = new Finch({
              accessToken: 'My Access Token',
            });

            const payment = await client.sandbox.payment.create();

            console.log(payment.payment_id);
        - lang: Python
          source: |-
            from finch import Finch

            client = Finch(
                access_token="My Access Token",
            )
            payment = client.sandbox.payment.create()
            print(payment.payment_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.WithAccessToken(\"My Access Token\"),\n\t)\n\tpayment, err := client.Sandbox.Payment.New(context.TODO(), finchgo.SandboxPaymentNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", payment.PaymentID)\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.PaymentCreateResponse;
            import com.tryfinch.api.models.SandboxPaymentCreateParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    FinchClient client = FinchOkHttpClient.builder()
                        .fromEnv()
                        .accessToken("My Access Token")
                        .build();

                    PaymentCreateResponse payment = client.sandbox().payment().create();
                }
            }
        - 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.PaymentCreateResponse
            import com.tryfinch.api.models.SandboxPaymentCreateParams

            fun main() {
                val client: FinchClient = FinchOkHttpClient.builder()
                    .fromEnv()
                    .accessToken("My Access Token")
                    .build()

                val payment: PaymentCreateResponse = client.sandbox().payment().create()
            }
        - lang: Ruby
          source: |-
            require "finch_api"

            finch = FinchAPI::Client.new(access_token: "My Access Token")

            payment = finch.sandbox.payment.create

            puts(payment)
components:
  schemas:
    CreateSandboxPaymentRequest:
      type: object
      properties:
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
        pay_statements:
          type: array
          items:
            type: object
            properties:
              individual_id:
                type: string
                format: uuid
              type:
                type: string
                nullable: true
                enum:
                  - off_cycle_payroll
                  - one_time_payment
                  - regular_payroll
                  - null
                default: regular_payroll
              payment_method:
                type: string
                nullable: true
                enum:
                  - check
                  - direct_deposit
                  - other
                  - null
                default: direct_deposit
              total_hours:
                type: number
                minimum: 0
                exclusiveMinimum: true
                default: 40
              gross_pay:
                type: integer
                minimum: 0
                exclusiveMinimum: true
                maximum: 9007199254740991
              net_pay:
                type: integer
                maximum: 9007199254740991
              earnings:
                type: array
                items:
                  type: object
                  properties:
                    amount:
                      type: integer
                    hours:
                      type: number
                    name:
                      type: string
                      minLength: 1
                    type:
                      type: string
                      enum:
                        - bonus
                        - commission
                        - double_overtime
                        - other
                        - overtime
                        - pto
                        - reimbursement
                        - salary
                        - severance
                        - sick
                        - tips
                        - wage
                        - '1099'
              taxes:
                type: array
                items:
                  type: object
                  properties:
                    amount:
                      type: integer
                    name:
                      type: string
                      minLength: 1
                    employer:
                      type: boolean
                    type:
                      type: string
                      enum:
                        - federal
                        - fica
                        - local
                        - state
              employee_deductions:
                type: array
                items:
                  type: object
                  properties:
                    amount:
                      type: integer
                    name:
                      type: string
                      minLength: 1
                      description: The deduction name. Required when type is specified.
                    pre_tax:
                      type: boolean
                    type:
                      type: string
                      enum:
                        - '457'
                        - 401k
                        - 401k_roth
                        - 401k_loan
                        - 403b
                        - 403b_roth
                        - 457_roth
                        - commuter
                        - custom_post_tax
                        - custom_pre_tax
                        - fsa_dependent_care
                        - fsa_medical
                        - hsa_post
                        - hsa_pre
                        - s125_dental
                        - s125_medical
                        - s125_vision
                        - simple
                        - simple_ira
              employer_contributions:
                type: array
                items:
                  type: object
                  properties:
                    amount:
                      type: integer
                    name:
                      type: string
                      minLength: 1
                      description: The contribution name. Required when type is specified.
                    type:
                      type: string
                      enum:
                        - '457'
                        - 401k
                        - 401k_roth
                        - 401k_loan
                        - 403b
                        - 403b_roth
                        - 457_roth
                        - commuter
                        - custom_post_tax
                        - custom_pre_tax
                        - fsa_dependent_care
                        - fsa_medical
                        - hsa_post
                        - hsa_pre
                        - s125_dental
                        - s125_medical
                        - s125_vision
                        - simple
                        - simple_ira
            required:
              - individual_id
          maxItems: 10000
          default: []
          description: Array of pay statements to include in the payment.
      description: >-
        Fields to configure the payment. Takes all fields from the `/payment`
        endpoint. All fields are optional.
    PaymentIdentifiers:
      type: object
      properties:
        payment_id:
          type: string
          description: The ID of the payment.
        pay_date:
          type: string
          description: The date of the payment.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Please use your Access Token

````