curl --request POST \
--url https://api.sandbox.goteal.co/accounts \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"user_id": "95a0e70b-fe02-4f47-aef9-2efff279df71",
"payroll_provider": "quickbooks",
"from": "2019-05-17T00:00:00.000Z",
"to": "2019-05-17T00:00:00.000Z",
"user_name": "john.smith@company.com",
"password": "very-secret-password",
"extra_login_params": {
"company_name": "ACME Corp"
}
}
'import requests
url = "https://api.sandbox.goteal.co/accounts"
payload = {
"user_id": "95a0e70b-fe02-4f47-aef9-2efff279df71",
"payroll_provider": "quickbooks",
"from": "2019-05-17T00:00:00.000Z",
"to": "2019-05-17T00:00:00.000Z",
"user_name": "john.smith@company.com",
"password": "very-secret-password",
"extra_login_params": { "company_name": "ACME Corp" }
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '95a0e70b-fe02-4f47-aef9-2efff279df71',
payroll_provider: 'quickbooks',
from: '2019-05-17T00:00:00.000Z',
to: '2019-05-17T00:00:00.000Z',
user_name: 'john.smith@company.com',
password: 'very-secret-password',
extra_login_params: {company_name: 'ACME Corp'}
})
};
fetch('https://api.sandbox.goteal.co/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.goteal.co/accounts",
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([
'user_id' => '95a0e70b-fe02-4f47-aef9-2efff279df71',
'payroll_provider' => 'quickbooks',
'from' => '2019-05-17T00:00:00.000Z',
'to' => '2019-05-17T00:00:00.000Z',
'user_name' => 'john.smith@company.com',
'password' => 'very-secret-password',
'extra_login_params' => [
'company_name' => 'ACME Corp'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.goteal.co/accounts"
payload := strings.NewReader("{\n \"user_id\": \"95a0e70b-fe02-4f47-aef9-2efff279df71\",\n \"payroll_provider\": \"quickbooks\",\n \"from\": \"2019-05-17T00:00:00.000Z\",\n \"to\": \"2019-05-17T00:00:00.000Z\",\n \"user_name\": \"john.smith@company.com\",\n \"password\": \"very-secret-password\",\n \"extra_login_params\": {\n \"company_name\": \"ACME Corp\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.goteal.co/accounts")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"95a0e70b-fe02-4f47-aef9-2efff279df71\",\n \"payroll_provider\": \"quickbooks\",\n \"from\": \"2019-05-17T00:00:00.000Z\",\n \"to\": \"2019-05-17T00:00:00.000Z\",\n \"user_name\": \"john.smith@company.com\",\n \"password\": \"very-secret-password\",\n \"extra_login_params\": {\n \"company_name\": \"ACME Corp\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.goteal.co/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"95a0e70b-fe02-4f47-aef9-2efff279df71\",\n \"payroll_provider\": \"quickbooks\",\n \"from\": \"2019-05-17T00:00:00.000Z\",\n \"to\": \"2019-05-17T00:00:00.000Z\",\n \"user_name\": \"john.smith@company.com\",\n \"password\": \"very-secret-password\",\n \"extra_login_params\": {\n \"company_name\": \"ACME Corp\"\n }\n}"
response = http.request(request)
puts response.read_body{
"account_id": "95a0e70b-fe02-4f47-aef9-2efff279df71",
"payroll_provider": "quickbooks",
"user_name": "john.smith@company.com",
"created_at": "2019-05-17T00:00:00.000Z",
"status": "PENDING",
"mfa_enabled": true,
"latest_pay_date": "2019-05-17T00:00:00.000Z",
"authorization_url": "https://provider/authenticate?redirect_url=https://api.teal.com/auth&state=state&scope=read",
"mfa_method": {
"type": "Code",
"source": "AUTHENTICATOR_APP"
}
}{
"errors": [
"The request is missing the required field `name`"
]
}{
"errors": [
"No X-API-KEY header provided or wrong value"
]
}Create an account
curl --request POST \
--url https://api.sandbox.goteal.co/accounts \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"user_id": "95a0e70b-fe02-4f47-aef9-2efff279df71",
"payroll_provider": "quickbooks",
"from": "2019-05-17T00:00:00.000Z",
"to": "2019-05-17T00:00:00.000Z",
"user_name": "john.smith@company.com",
"password": "very-secret-password",
"extra_login_params": {
"company_name": "ACME Corp"
}
}
'import requests
url = "https://api.sandbox.goteal.co/accounts"
payload = {
"user_id": "95a0e70b-fe02-4f47-aef9-2efff279df71",
"payroll_provider": "quickbooks",
"from": "2019-05-17T00:00:00.000Z",
"to": "2019-05-17T00:00:00.000Z",
"user_name": "john.smith@company.com",
"password": "very-secret-password",
"extra_login_params": { "company_name": "ACME Corp" }
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '95a0e70b-fe02-4f47-aef9-2efff279df71',
payroll_provider: 'quickbooks',
from: '2019-05-17T00:00:00.000Z',
to: '2019-05-17T00:00:00.000Z',
user_name: 'john.smith@company.com',
password: 'very-secret-password',
extra_login_params: {company_name: 'ACME Corp'}
})
};
fetch('https://api.sandbox.goteal.co/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.goteal.co/accounts",
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([
'user_id' => '95a0e70b-fe02-4f47-aef9-2efff279df71',
'payroll_provider' => 'quickbooks',
'from' => '2019-05-17T00:00:00.000Z',
'to' => '2019-05-17T00:00:00.000Z',
'user_name' => 'john.smith@company.com',
'password' => 'very-secret-password',
'extra_login_params' => [
'company_name' => 'ACME Corp'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.goteal.co/accounts"
payload := strings.NewReader("{\n \"user_id\": \"95a0e70b-fe02-4f47-aef9-2efff279df71\",\n \"payroll_provider\": \"quickbooks\",\n \"from\": \"2019-05-17T00:00:00.000Z\",\n \"to\": \"2019-05-17T00:00:00.000Z\",\n \"user_name\": \"john.smith@company.com\",\n \"password\": \"very-secret-password\",\n \"extra_login_params\": {\n \"company_name\": \"ACME Corp\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.goteal.co/accounts")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"95a0e70b-fe02-4f47-aef9-2efff279df71\",\n \"payroll_provider\": \"quickbooks\",\n \"from\": \"2019-05-17T00:00:00.000Z\",\n \"to\": \"2019-05-17T00:00:00.000Z\",\n \"user_name\": \"john.smith@company.com\",\n \"password\": \"very-secret-password\",\n \"extra_login_params\": {\n \"company_name\": \"ACME Corp\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.goteal.co/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"95a0e70b-fe02-4f47-aef9-2efff279df71\",\n \"payroll_provider\": \"quickbooks\",\n \"from\": \"2019-05-17T00:00:00.000Z\",\n \"to\": \"2019-05-17T00:00:00.000Z\",\n \"user_name\": \"john.smith@company.com\",\n \"password\": \"very-secret-password\",\n \"extra_login_params\": {\n \"company_name\": \"ACME Corp\"\n }\n}"
response = http.request(request)
puts response.read_body{
"account_id": "95a0e70b-fe02-4f47-aef9-2efff279df71",
"payroll_provider": "quickbooks",
"user_name": "john.smith@company.com",
"created_at": "2019-05-17T00:00:00.000Z",
"status": "PENDING",
"mfa_enabled": true,
"latest_pay_date": "2019-05-17T00:00:00.000Z",
"authorization_url": "https://provider/authenticate?redirect_url=https://api.teal.com/auth&state=state&scope=read",
"mfa_method": {
"type": "Code",
"source": "AUTHENTICATOR_APP"
}
}{
"errors": [
"The request is missing the required field `name`"
]
}{
"errors": [
"No X-API-KEY header provided or wrong value"
]
}x-teal-authorisation-id header to specify which authorisation to use; otherwise the system will resolve a valid authorisation automatically.
See Authorisations for more details.Authorizations
Headers
Optional authorisation ID to associate with this request. If not provided, the system will attempt to resolve a valid authorisation for the user automatically.
"7f3b8c2a-1d4e-4f6a-8b8c-9a0b1c2d3e4f"
Body
The id of the user
"95a0e70b-fe02-4f47-aef9-2efff279df71"
The payroll provider to use
"quickbooks"
Optional start date filter for payroll data retrieval
"2019-05-17T00:00:00.000Z"
Optional end date filter for payroll data retrieval
"2019-05-17T00:00:00.000Z"
The login of the user
"john.smith@company.com"
The password of the user
"very-secret-password"
Optional extra login parameters required by some providers.
Dayforce connections require extra_login_params.company_name.
Show child attributes
Show child attributes
{ "company_name": "ACME Corp" }
Response
Created
The id of the account
"95a0e70b-fe02-4f47-aef9-2efff279df71"
The payroll provider to use
"quickbooks"
The login of the user
"john.smith@company.com"
"2019-05-17T00:00:00.000Z"
Status of account
"PENDING"
Is mfa enabled for this account
The latest pay date of the payroll under this account
"2019-05-17T00:00:00.000Z"
Authrorization url for provider using OAUTH2
"https://provider/authenticate?redirect_url=https://api.teal.com/auth&state=state&scope=read"
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
{ "type": "Code", "source": "AUTHENTICATOR_APP" }