Create an expense
curl --request POST \
--url https://api.sellfern.com/expenses \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"category": "Software",
"amount": 49.99,
"date": "2026-06-01",
"store_id": "<string>",
"description": "Monthly design tool subscription",
"currency": "USD",
"original_currency": "USD",
"base_amount": 123,
"bhxh_amount": 123,
"bhxh_rate": 123,
"bhxh_type": "<string>",
"employee_name": "<string>"
}
'import requests
url = "https://api.sellfern.com/expenses"
payload = {
"category": "Software",
"amount": 49.99,
"date": "2026-06-01",
"store_id": "<string>",
"description": "Monthly design tool subscription",
"currency": "USD",
"original_currency": "USD",
"base_amount": 123,
"bhxh_amount": 123,
"bhxh_rate": 123,
"bhxh_type": "<string>",
"employee_name": "<string>"
}
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({
category: 'Software',
amount: 49.99,
date: '2026-06-01',
store_id: '<string>',
description: 'Monthly design tool subscription',
currency: 'USD',
original_currency: 'USD',
base_amount: 123,
bhxh_amount: 123,
bhxh_rate: 123,
bhxh_type: '<string>',
employee_name: '<string>'
})
};
fetch('https://api.sellfern.com/expenses', 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.sellfern.com/expenses",
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([
'category' => 'Software',
'amount' => 49.99,
'date' => '2026-06-01',
'store_id' => '<string>',
'description' => 'Monthly design tool subscription',
'currency' => 'USD',
'original_currency' => 'USD',
'base_amount' => 123,
'bhxh_amount' => 123,
'bhxh_rate' => 123,
'bhxh_type' => '<string>',
'employee_name' => '<string>'
]),
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.sellfern.com/expenses"
payload := strings.NewReader("{\n \"category\": \"Software\",\n \"amount\": 49.99,\n \"date\": \"2026-06-01\",\n \"store_id\": \"<string>\",\n \"description\": \"Monthly design tool subscription\",\n \"currency\": \"USD\",\n \"original_currency\": \"USD\",\n \"base_amount\": 123,\n \"bhxh_amount\": 123,\n \"bhxh_rate\": 123,\n \"bhxh_type\": \"<string>\",\n \"employee_name\": \"<string>\"\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.sellfern.com/expenses")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"Software\",\n \"amount\": 49.99,\n \"date\": \"2026-06-01\",\n \"store_id\": \"<string>\",\n \"description\": \"Monthly design tool subscription\",\n \"currency\": \"USD\",\n \"original_currency\": \"USD\",\n \"base_amount\": 123,\n \"bhxh_amount\": 123,\n \"bhxh_rate\": 123,\n \"bhxh_type\": \"<string>\",\n \"employee_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sellfern.com/expenses")
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 \"category\": \"Software\",\n \"amount\": 49.99,\n \"date\": \"2026-06-01\",\n \"store_id\": \"<string>\",\n \"description\": \"Monthly design tool subscription\",\n \"currency\": \"USD\",\n \"original_currency\": \"USD\",\n \"base_amount\": 123,\n \"bhxh_amount\": 123,\n \"bhxh_rate\": 123,\n \"bhxh_type\": \"<string>\",\n \"employee_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 42,
"store_id": "<string>",
"store_name": "<string>",
"category": "Payroll",
"amount": 123,
"original_amount": 123,
"original_currency": "USD",
"date": "2023-12-25",
"description": "<string>",
"base_amount": 123,
"bhxh_amount": 123,
"bhxh_rate": 123,
"bhxh_type": "<string>",
"employee_name": "<string>",
"created_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "<string>"
}
}{
"success": false,
"error": {
"code": "validation_error",
"message": "Request validation failed."
},
"meta": {
"request_id": "<string>"
}
}{
"success": false,
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key."
},
"meta": {
"request_id": "<string>"
}
}{
"success": false,
"error": {
"code": "missing_scope",
"message": "Missing required scope."
},
"meta": {
"request_id": "<string>"
}
}{
"success": false,
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded."
},
"meta": {
"request_id": "<string>"
}
}Expenses
Create an expense
Creates an operating or payroll expense for the authenticated organization. Requires expenses:write. Send an Idempotency-Key header for safe retries.
POST
/
expenses
Create an expense
curl --request POST \
--url https://api.sellfern.com/expenses \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"category": "Software",
"amount": 49.99,
"date": "2026-06-01",
"store_id": "<string>",
"description": "Monthly design tool subscription",
"currency": "USD",
"original_currency": "USD",
"base_amount": 123,
"bhxh_amount": 123,
"bhxh_rate": 123,
"bhxh_type": "<string>",
"employee_name": "<string>"
}
'import requests
url = "https://api.sellfern.com/expenses"
payload = {
"category": "Software",
"amount": 49.99,
"date": "2026-06-01",
"store_id": "<string>",
"description": "Monthly design tool subscription",
"currency": "USD",
"original_currency": "USD",
"base_amount": 123,
"bhxh_amount": 123,
"bhxh_rate": 123,
"bhxh_type": "<string>",
"employee_name": "<string>"
}
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({
category: 'Software',
amount: 49.99,
date: '2026-06-01',
store_id: '<string>',
description: 'Monthly design tool subscription',
currency: 'USD',
original_currency: 'USD',
base_amount: 123,
bhxh_amount: 123,
bhxh_rate: 123,
bhxh_type: '<string>',
employee_name: '<string>'
})
};
fetch('https://api.sellfern.com/expenses', 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.sellfern.com/expenses",
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([
'category' => 'Software',
'amount' => 49.99,
'date' => '2026-06-01',
'store_id' => '<string>',
'description' => 'Monthly design tool subscription',
'currency' => 'USD',
'original_currency' => 'USD',
'base_amount' => 123,
'bhxh_amount' => 123,
'bhxh_rate' => 123,
'bhxh_type' => '<string>',
'employee_name' => '<string>'
]),
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.sellfern.com/expenses"
payload := strings.NewReader("{\n \"category\": \"Software\",\n \"amount\": 49.99,\n \"date\": \"2026-06-01\",\n \"store_id\": \"<string>\",\n \"description\": \"Monthly design tool subscription\",\n \"currency\": \"USD\",\n \"original_currency\": \"USD\",\n \"base_amount\": 123,\n \"bhxh_amount\": 123,\n \"bhxh_rate\": 123,\n \"bhxh_type\": \"<string>\",\n \"employee_name\": \"<string>\"\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.sellfern.com/expenses")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"Software\",\n \"amount\": 49.99,\n \"date\": \"2026-06-01\",\n \"store_id\": \"<string>\",\n \"description\": \"Monthly design tool subscription\",\n \"currency\": \"USD\",\n \"original_currency\": \"USD\",\n \"base_amount\": 123,\n \"bhxh_amount\": 123,\n \"bhxh_rate\": 123,\n \"bhxh_type\": \"<string>\",\n \"employee_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sellfern.com/expenses")
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 \"category\": \"Software\",\n \"amount\": 49.99,\n \"date\": \"2026-06-01\",\n \"store_id\": \"<string>\",\n \"description\": \"Monthly design tool subscription\",\n \"currency\": \"USD\",\n \"original_currency\": \"USD\",\n \"base_amount\": 123,\n \"bhxh_amount\": 123,\n \"bhxh_rate\": 123,\n \"bhxh_type\": \"<string>\",\n \"employee_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 42,
"store_id": "<string>",
"store_name": "<string>",
"category": "Payroll",
"amount": 123,
"original_amount": 123,
"original_currency": "USD",
"date": "2023-12-25",
"description": "<string>",
"base_amount": 123,
"bhxh_amount": 123,
"bhxh_rate": 123,
"bhxh_type": "<string>",
"employee_name": "<string>",
"created_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "<string>"
}
}{
"success": false,
"error": {
"code": "validation_error",
"message": "Request validation failed."
},
"meta": {
"request_id": "<string>"
}
}{
"success": false,
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key."
},
"meta": {
"request_id": "<string>"
}
}{
"success": false,
"error": {
"code": "missing_scope",
"message": "Missing required scope."
},
"meta": {
"request_id": "<string>"
}
}{
"success": false,
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded."
},
"meta": {
"request_id": "<string>"
}
}Authorizations
Sellfern public API key scoped to the authenticated organization. Do not use user JWTs for public integrations.
Headers
Client-generated key to prevent duplicate expense creation.
Body
application/json
Example:
"Software"
Example:
49.99
Example:
"2026-06-01"
Store ID. Omit or set null for consolidated overhead expenses.
Example:
"Monthly design tool subscription"
Alias for original_currency.
Example:
"USD"
Example:
"USD"
Optional payroll base amount.
Optional payroll insurance amount.
Optional payroll insurance rate.
Optional payroll insurance type.
Optional employee name for payroll expenses.
⌘I
