JavaScript
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);from finch import Finch
client = Finch(
access_token="My Access Token",
)
payment = client.sandbox.payment.create()
print(payment.payment_id)package main
import (
"context"
"fmt"
"github.com/Finch-API/finch-api-go/v2"
"github.com/Finch-API/finch-api-go/v2/option"
)
func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
payment, err := client.Sandbox.Payment.New(context.TODO(), finchgo.SandboxPaymentNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", payment.PaymentID)
}
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();
}
}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()
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
payment = finch.sandbox.payment.create
puts(payment)curl --request POST \
--url https://api.tryfinch.com/sandbox/payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"pay_statements": [
{
"individual_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "regular_payroll",
"payment_method": "direct_deposit",
"total_hours": 1,
"gross_pay": 4503599627370495,
"net_pay": 123,
"earnings": [
{
"amount": 123,
"hours": 123,
"name": "<string>"
}
],
"taxes": [
{
"amount": 123,
"name": "<string>",
"employer": true
}
],
"employee_deductions": [
{
"amount": 123,
"name": "<string>",
"pre_tax": true
}
],
"employer_contributions": [
{
"amount": 123,
"name": "<string>"
}
]
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/sandbox/payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'pay_statements' => [
[
'individual_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'regular_payroll',
'payment_method' => 'direct_deposit',
'total_hours' => 1,
'gross_pay' => 4503599627370495,
'net_pay' => 123,
'earnings' => [
[
'amount' => 123,
'hours' => 123,
'name' => '<string>'
]
],
'taxes' => [
[
'amount' => 123,
'name' => '<string>',
'employer' => true
]
],
'employee_deductions' => [
[
'amount' => 123,
'name' => '<string>',
'pre_tax' => true
]
],
'employer_contributions' => [
[
'amount' => 123,
'name' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"payment_id": "some-payment-id",
"pay_date": "2024-01-01"
}Sandbox
Add a new sandbox payment
POST
/
sandbox
/
payment
JavaScript
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);from finch import Finch
client = Finch(
access_token="My Access Token",
)
payment = client.sandbox.payment.create()
print(payment.payment_id)package main
import (
"context"
"fmt"
"github.com/Finch-API/finch-api-go/v2"
"github.com/Finch-API/finch-api-go/v2/option"
)
func main() {
client := finchgo.NewClient(
option.WithAccessToken("My Access Token"),
)
payment, err := client.Sandbox.Payment.New(context.TODO(), finchgo.SandboxPaymentNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", payment.PaymentID)
}
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();
}
}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()
}require "finch_api"
finch = FinchAPI::Client.new(access_token: "My Access Token")
payment = finch.sandbox.payment.create
puts(payment)curl --request POST \
--url https://api.tryfinch.com/sandbox/payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"pay_statements": [
{
"individual_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "regular_payroll",
"payment_method": "direct_deposit",
"total_hours": 1,
"gross_pay": 4503599627370495,
"net_pay": 123,
"earnings": [
{
"amount": 123,
"hours": 123,
"name": "<string>"
}
],
"taxes": [
{
"amount": 123,
"name": "<string>",
"employer": true
}
],
"employee_deductions": [
{
"amount": 123,
"name": "<string>",
"pre_tax": true
}
],
"employer_contributions": [
{
"amount": 123,
"name": "<string>"
}
]
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryfinch.com/sandbox/payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'pay_statements' => [
[
'individual_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'regular_payroll',
'payment_method' => 'direct_deposit',
'total_hours' => 1,
'gross_pay' => 4503599627370495,
'net_pay' => 123,
'earnings' => [
[
'amount' => 123,
'hours' => 123,
'name' => '<string>'
]
],
'taxes' => [
[
'amount' => 123,
'name' => '<string>',
'employer' => true
]
],
'employee_deductions' => [
[
'amount' => 123,
'name' => '<string>',
'pre_tax' => true
]
],
'employer_contributions' => [
[
'amount' => 123,
'name' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"payment_id": "some-payment-id",
"pay_date": "2024-01-01"
}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).Authorizations
Please use your Access Token
Body
application/json
Fields to configure the payment. Takes all fields from the /payment endpoint. All fields are optional.
Was this page helpful?