Create an invoice
curl --request POST \
--url https://payouts.api.trykarat.com/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invoiceNumber": "INV-2026-001",
"recipient": {
"name": "Acme Inc",
"email": "billing@example.com"
},
"lineItems": [
{
"description": "Design services",
"quantity": 2,
"unitPrice": 12500
}
],
"invoiceDate": "2026-10-05",
"dueDate": "2026-11-04",
"sender": {
"name": "Example Studio",
"email": "billing@example.org"
},
"destinationAccountId": "4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86",
"sendEmailToRecipient": false
}
'import requests
url = "https://payouts.api.trykarat.com/invoices"
payload = {
"invoiceNumber": "INV-2026-001",
"recipient": {
"name": "Acme Inc",
"email": "billing@example.com"
},
"lineItems": [
{
"description": "Design services",
"quantity": 2,
"unitPrice": 12500
}
],
"invoiceDate": "2026-10-05",
"dueDate": "2026-11-04",
"sender": {
"name": "Example Studio",
"email": "billing@example.org"
},
"destinationAccountId": "4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86",
"sendEmailToRecipient": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoiceNumber: 'INV-2026-001',
recipient: {name: 'Acme Inc', email: 'billing@example.com'},
lineItems: [{description: 'Design services', quantity: 2, unitPrice: 12500}],
invoiceDate: '2026-10-05',
dueDate: '2026-11-04',
sender: {name: 'Example Studio', email: 'billing@example.org'},
destinationAccountId: '4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86',
sendEmailToRecipient: false
})
};
fetch('https://payouts.api.trykarat.com/invoices', 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://payouts.api.trykarat.com/invoices",
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([
'invoiceNumber' => 'INV-2026-001',
'recipient' => [
'name' => 'Acme Inc',
'email' => 'billing@example.com'
],
'lineItems' => [
[
'description' => 'Design services',
'quantity' => 2,
'unitPrice' => 12500
]
],
'invoiceDate' => '2026-10-05',
'dueDate' => '2026-11-04',
'sender' => [
'name' => 'Example Studio',
'email' => 'billing@example.org'
],
'destinationAccountId' => '4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86',
'sendEmailToRecipient' => false
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://payouts.api.trykarat.com/invoices"
payload := strings.NewReader("{\n \"invoiceNumber\": \"INV-2026-001\",\n \"recipient\": {\n \"name\": \"Acme Inc\",\n \"email\": \"billing@example.com\"\n },\n \"lineItems\": [\n {\n \"description\": \"Design services\",\n \"quantity\": 2,\n \"unitPrice\": 12500\n }\n ],\n \"invoiceDate\": \"2026-10-05\",\n \"dueDate\": \"2026-11-04\",\n \"sender\": {\n \"name\": \"Example Studio\",\n \"email\": \"billing@example.org\"\n },\n \"destinationAccountId\": \"4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86\",\n \"sendEmailToRecipient\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://payouts.api.trykarat.com/invoices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoiceNumber\": \"INV-2026-001\",\n \"recipient\": {\n \"name\": \"Acme Inc\",\n \"email\": \"billing@example.com\"\n },\n \"lineItems\": [\n {\n \"description\": \"Design services\",\n \"quantity\": 2,\n \"unitPrice\": 12500\n }\n ],\n \"invoiceDate\": \"2026-10-05\",\n \"dueDate\": \"2026-11-04\",\n \"sender\": {\n \"name\": \"Example Studio\",\n \"email\": \"billing@example.org\"\n },\n \"destinationAccountId\": \"4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86\",\n \"sendEmailToRecipient\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://payouts.api.trykarat.com/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoiceNumber\": \"INV-2026-001\",\n \"recipient\": {\n \"name\": \"Acme Inc\",\n \"email\": \"billing@example.com\"\n },\n \"lineItems\": [\n {\n \"description\": \"Design services\",\n \"quantity\": 2,\n \"unitPrice\": 12500\n }\n ],\n \"invoiceDate\": \"2026-10-05\",\n \"dueDate\": \"2026-11-04\",\n \"sender\": {\n \"name\": \"Example Studio\",\n \"email\": \"billing@example.org\"\n },\n \"destinationAccountId\": \"4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86\",\n \"sendEmailToRecipient\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoiceNumber": "<string>",
"status": "open",
"recipient": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "jsmith@example.com"
},
"total": 123,
"paidAmount": 123,
"lineItems": [
{
"description": "<string>",
"quantity": 123,
"unitPrice": 123,
"amount": 123
}
],
"invoiceDate": "2023-12-25",
"dueDate": "2023-12-25",
"poNumber": "<string>",
"payerMemo": "<string>",
"paymentInstructions": "<string>",
"paymentAccount": {
"accountNumber": "<string>",
"routingNumber": "<string>"
},
"automaticReconciliationEnabled": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"emailSent": true
}
}{
"error": {
"message": "amount: amount must be positive"
}
}{
"error": {
"message": "Invalid api key"
}
}Create an invoice
Creates an invoice using your organization’s invoice settings. Monetary inputs and outputs are integer cents. The API computes totals, reuses or creates an invoice recipient by email, and sends email only when requested. See the invoice guide for prerequisites.
POST
/
invoices
Create an invoice
curl --request POST \
--url https://payouts.api.trykarat.com/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invoiceNumber": "INV-2026-001",
"recipient": {
"name": "Acme Inc",
"email": "billing@example.com"
},
"lineItems": [
{
"description": "Design services",
"quantity": 2,
"unitPrice": 12500
}
],
"invoiceDate": "2026-10-05",
"dueDate": "2026-11-04",
"sender": {
"name": "Example Studio",
"email": "billing@example.org"
},
"destinationAccountId": "4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86",
"sendEmailToRecipient": false
}
'import requests
url = "https://payouts.api.trykarat.com/invoices"
payload = {
"invoiceNumber": "INV-2026-001",
"recipient": {
"name": "Acme Inc",
"email": "billing@example.com"
},
"lineItems": [
{
"description": "Design services",
"quantity": 2,
"unitPrice": 12500
}
],
"invoiceDate": "2026-10-05",
"dueDate": "2026-11-04",
"sender": {
"name": "Example Studio",
"email": "billing@example.org"
},
"destinationAccountId": "4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86",
"sendEmailToRecipient": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoiceNumber: 'INV-2026-001',
recipient: {name: 'Acme Inc', email: 'billing@example.com'},
lineItems: [{description: 'Design services', quantity: 2, unitPrice: 12500}],
invoiceDate: '2026-10-05',
dueDate: '2026-11-04',
sender: {name: 'Example Studio', email: 'billing@example.org'},
destinationAccountId: '4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86',
sendEmailToRecipient: false
})
};
fetch('https://payouts.api.trykarat.com/invoices', 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://payouts.api.trykarat.com/invoices",
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([
'invoiceNumber' => 'INV-2026-001',
'recipient' => [
'name' => 'Acme Inc',
'email' => 'billing@example.com'
],
'lineItems' => [
[
'description' => 'Design services',
'quantity' => 2,
'unitPrice' => 12500
]
],
'invoiceDate' => '2026-10-05',
'dueDate' => '2026-11-04',
'sender' => [
'name' => 'Example Studio',
'email' => 'billing@example.org'
],
'destinationAccountId' => '4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86',
'sendEmailToRecipient' => false
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://payouts.api.trykarat.com/invoices"
payload := strings.NewReader("{\n \"invoiceNumber\": \"INV-2026-001\",\n \"recipient\": {\n \"name\": \"Acme Inc\",\n \"email\": \"billing@example.com\"\n },\n \"lineItems\": [\n {\n \"description\": \"Design services\",\n \"quantity\": 2,\n \"unitPrice\": 12500\n }\n ],\n \"invoiceDate\": \"2026-10-05\",\n \"dueDate\": \"2026-11-04\",\n \"sender\": {\n \"name\": \"Example Studio\",\n \"email\": \"billing@example.org\"\n },\n \"destinationAccountId\": \"4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86\",\n \"sendEmailToRecipient\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://payouts.api.trykarat.com/invoices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoiceNumber\": \"INV-2026-001\",\n \"recipient\": {\n \"name\": \"Acme Inc\",\n \"email\": \"billing@example.com\"\n },\n \"lineItems\": [\n {\n \"description\": \"Design services\",\n \"quantity\": 2,\n \"unitPrice\": 12500\n }\n ],\n \"invoiceDate\": \"2026-10-05\",\n \"dueDate\": \"2026-11-04\",\n \"sender\": {\n \"name\": \"Example Studio\",\n \"email\": \"billing@example.org\"\n },\n \"destinationAccountId\": \"4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86\",\n \"sendEmailToRecipient\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://payouts.api.trykarat.com/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoiceNumber\": \"INV-2026-001\",\n \"recipient\": {\n \"name\": \"Acme Inc\",\n \"email\": \"billing@example.com\"\n },\n \"lineItems\": [\n {\n \"description\": \"Design services\",\n \"quantity\": 2,\n \"unitPrice\": 12500\n }\n ],\n \"invoiceDate\": \"2026-10-05\",\n \"dueDate\": \"2026-11-04\",\n \"sender\": {\n \"name\": \"Example Studio\",\n \"email\": \"billing@example.org\"\n },\n \"destinationAccountId\": \"4f266e59-5dae-49f7-9ef9-9bdf6d2b7c86\",\n \"sendEmailToRecipient\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoiceNumber": "<string>",
"status": "open",
"recipient": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "jsmith@example.com"
},
"total": 123,
"paidAmount": 123,
"lineItems": [
{
"description": "<string>",
"quantity": 123,
"unitPrice": 123,
"amount": 123
}
],
"invoiceDate": "2023-12-25",
"dueDate": "2023-12-25",
"poNumber": "<string>",
"payerMemo": "<string>",
"paymentInstructions": "<string>",
"paymentAccount": {
"accountNumber": "<string>",
"routingNumber": "<string>"
},
"automaticReconciliationEnabled": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"emailSent": true
}
}{
"error": {
"message": "amount: amount must be positive"
}
}{
"error": {
"message": "Invalid api key"
}
}Authorizations
Body
application/json