curl --request POST \
--url https://api.meetcampfire.com/coa/api/v1/invoice \
--header 'Content-Type: application/json' \
--data '
{
"terms": "net_30",
"invoice_date": "2025-07-01",
"due_date": "2025-07-31",
"lines": [
{
"service_date": "2025-07-01",
"amount": 50,
"product": "2545",
"product_name": "Product A",
"product_is_taxable": false,
"anrok_item_id": null,
"rate": 50,
"description": "Invoice Line Item",
"quantity": 1,
"tax": 5
}
],
"entity": "54",
"entity_name": "Top Level",
"entity_currency": "USD",
"entity_invoice_message": "Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software",
"currency": "USD",
"message_on_invoice": "Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software",
"stripe_connection": "",
"stripe_connection_name": "",
"stripe_connection_entity": "54",
"exchange_rate_book": 1,
"exchange_rate": 1,
"client": "33973",
"client_name": "Client A",
"client_email": null,
"client_invoice_message": null,
"billing_address": "",
"shipping_address": "",
"contract": "12954",
"contract_name": "Campfire",
"invoice_number": "987654321",
"purchase_order_number": "123456789",
"item_date": "2025-07-01",
"period_start": "2025-07-01",
"period_end": "2025-07-31"
}
'import requests
url = "https://api.meetcampfire.com/coa/api/v1/invoice"
payload = {
"terms": "net_30",
"invoice_date": "2025-07-01",
"due_date": "2025-07-31",
"lines": [
{
"service_date": "2025-07-01",
"amount": 50,
"product": "2545",
"product_name": "Product A",
"product_is_taxable": False,
"anrok_item_id": None,
"rate": 50,
"description": "Invoice Line Item",
"quantity": 1,
"tax": 5
}
],
"entity": "54",
"entity_name": "Top Level",
"entity_currency": "USD",
"entity_invoice_message": "Please make a payment to the following bank:
Bank Name: JP Morgan Chase
Bank Address: 456 Another Rd, San Francisco, CA, USA
SWIFT/BIC Code: XYZBUS22
Account Number: 123456789
Account Type: Checking
Account Name: Campfire Software",
"currency": "USD",
"message_on_invoice": "Please make a payment to the following bank:
Bank Name: JP Morgan Chase
Bank Address: 456 Another Rd, San Francisco, CA, USA
SWIFT/BIC Code: XYZBUS22
Account Number: 123456789
Account Type: Checking
Account Name: Campfire Software",
"stripe_connection": "",
"stripe_connection_name": "",
"stripe_connection_entity": "54",
"exchange_rate_book": 1,
"exchange_rate": 1,
"client": "33973",
"client_name": "Client A",
"client_email": None,
"client_invoice_message": None,
"billing_address": "",
"shipping_address": "",
"contract": "12954",
"contract_name": "Campfire",
"invoice_number": "987654321",
"purchase_order_number": "123456789",
"item_date": "2025-07-01",
"period_start": "2025-07-01",
"period_end": "2025-07-31"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
terms: 'net_30',
invoice_date: '2025-07-01',
due_date: '2025-07-31',
lines: [
{
service_date: '2025-07-01',
amount: 50,
product: '2545',
product_name: 'Product A',
product_is_taxable: false,
anrok_item_id: null,
rate: 50,
description: 'Invoice Line Item',
quantity: 1,
tax: 5
}
],
entity: '54',
entity_name: 'Top Level',
entity_currency: 'USD',
entity_invoice_message: 'Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software',
currency: 'USD',
message_on_invoice: 'Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software',
stripe_connection: '',
stripe_connection_name: '',
stripe_connection_entity: '54',
exchange_rate_book: 1,
exchange_rate: 1,
client: '33973',
client_name: 'Client A',
client_email: null,
client_invoice_message: null,
billing_address: '',
shipping_address: '',
contract: '12954',
contract_name: 'Campfire',
invoice_number: '987654321',
purchase_order_number: '123456789',
item_date: '2025-07-01',
period_start: '2025-07-01',
period_end: '2025-07-31'
})
};
fetch('https://api.meetcampfire.com/coa/api/v1/invoice', 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.meetcampfire.com/coa/api/v1/invoice",
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([
'terms' => 'net_30',
'invoice_date' => '2025-07-01',
'due_date' => '2025-07-31',
'lines' => [
[
'service_date' => '2025-07-01',
'amount' => 50,
'product' => '2545',
'product_name' => 'Product A',
'product_is_taxable' => false,
'anrok_item_id' => null,
'rate' => 50,
'description' => 'Invoice Line Item',
'quantity' => 1,
'tax' => 5
]
],
'entity' => '54',
'entity_name' => 'Top Level',
'entity_currency' => 'USD',
'entity_invoice_message' => 'Please make a payment to the following bank:
Bank Name: JP Morgan Chase
Bank Address: 456 Another Rd, San Francisco, CA, USA
SWIFT/BIC Code: XYZBUS22
Account Number: 123456789
Account Type: Checking
Account Name: Campfire Software',
'currency' => 'USD',
'message_on_invoice' => 'Please make a payment to the following bank:
Bank Name: JP Morgan Chase
Bank Address: 456 Another Rd, San Francisco, CA, USA
SWIFT/BIC Code: XYZBUS22
Account Number: 123456789
Account Type: Checking
Account Name: Campfire Software',
'stripe_connection' => '',
'stripe_connection_name' => '',
'stripe_connection_entity' => '54',
'exchange_rate_book' => 1,
'exchange_rate' => 1,
'client' => '33973',
'client_name' => 'Client A',
'client_email' => null,
'client_invoice_message' => null,
'billing_address' => '',
'shipping_address' => '',
'contract' => '12954',
'contract_name' => 'Campfire',
'invoice_number' => '987654321',
'purchase_order_number' => '123456789',
'item_date' => '2025-07-01',
'period_start' => '2025-07-01',
'period_end' => '2025-07-31'
]),
CURLOPT_HTTPHEADER => [
"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://api.meetcampfire.com/coa/api/v1/invoice"
payload := strings.NewReader("{\n \"terms\": \"net_30\",\n \"invoice_date\": \"2025-07-01\",\n \"due_date\": \"2025-07-31\",\n \"lines\": [\n {\n \"service_date\": \"2025-07-01\",\n \"amount\": 50,\n \"product\": \"2545\",\n \"product_name\": \"Product A\",\n \"product_is_taxable\": false,\n \"anrok_item_id\": null,\n \"rate\": 50,\n \"description\": \"Invoice Line Item\",\n \"quantity\": 1,\n \"tax\": 5\n }\n ],\n \"entity\": \"54\",\n \"entity_name\": \"Top Level\",\n \"entity_currency\": \"USD\",\n \"entity_invoice_message\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"currency\": \"USD\",\n \"message_on_invoice\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"stripe_connection\": \"\",\n \"stripe_connection_name\": \"\",\n \"stripe_connection_entity\": \"54\",\n \"exchange_rate_book\": 1,\n \"exchange_rate\": 1,\n \"client\": \"33973\",\n \"client_name\": \"Client A\",\n \"client_email\": null,\n \"client_invoice_message\": null,\n \"billing_address\": \"\",\n \"shipping_address\": \"\",\n \"contract\": \"12954\",\n \"contract_name\": \"Campfire\",\n \"invoice_number\": \"987654321\",\n \"purchase_order_number\": \"123456789\",\n \"item_date\": \"2025-07-01\",\n \"period_start\": \"2025-07-01\",\n \"period_end\": \"2025-07-31\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.meetcampfire.com/coa/api/v1/invoice")
.header("Content-Type", "application/json")
.body("{\n \"terms\": \"net_30\",\n \"invoice_date\": \"2025-07-01\",\n \"due_date\": \"2025-07-31\",\n \"lines\": [\n {\n \"service_date\": \"2025-07-01\",\n \"amount\": 50,\n \"product\": \"2545\",\n \"product_name\": \"Product A\",\n \"product_is_taxable\": false,\n \"anrok_item_id\": null,\n \"rate\": 50,\n \"description\": \"Invoice Line Item\",\n \"quantity\": 1,\n \"tax\": 5\n }\n ],\n \"entity\": \"54\",\n \"entity_name\": \"Top Level\",\n \"entity_currency\": \"USD\",\n \"entity_invoice_message\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"currency\": \"USD\",\n \"message_on_invoice\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"stripe_connection\": \"\",\n \"stripe_connection_name\": \"\",\n \"stripe_connection_entity\": \"54\",\n \"exchange_rate_book\": 1,\n \"exchange_rate\": 1,\n \"client\": \"33973\",\n \"client_name\": \"Client A\",\n \"client_email\": null,\n \"client_invoice_message\": null,\n \"billing_address\": \"\",\n \"shipping_address\": \"\",\n \"contract\": \"12954\",\n \"contract_name\": \"Campfire\",\n \"invoice_number\": \"987654321\",\n \"purchase_order_number\": \"123456789\",\n \"item_date\": \"2025-07-01\",\n \"period_start\": \"2025-07-01\",\n \"period_end\": \"2025-07-31\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetcampfire.com/coa/api/v1/invoice")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"terms\": \"net_30\",\n \"invoice_date\": \"2025-07-01\",\n \"due_date\": \"2025-07-31\",\n \"lines\": [\n {\n \"service_date\": \"2025-07-01\",\n \"amount\": 50,\n \"product\": \"2545\",\n \"product_name\": \"Product A\",\n \"product_is_taxable\": false,\n \"anrok_item_id\": null,\n \"rate\": 50,\n \"description\": \"Invoice Line Item\",\n \"quantity\": 1,\n \"tax\": 5\n }\n ],\n \"entity\": \"54\",\n \"entity_name\": \"Top Level\",\n \"entity_currency\": \"USD\",\n \"entity_invoice_message\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"currency\": \"USD\",\n \"message_on_invoice\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"stripe_connection\": \"\",\n \"stripe_connection_name\": \"\",\n \"stripe_connection_entity\": \"54\",\n \"exchange_rate_book\": 1,\n \"exchange_rate\": 1,\n \"client\": \"33973\",\n \"client_name\": \"Client A\",\n \"client_email\": null,\n \"client_invoice_message\": null,\n \"billing_address\": \"\",\n \"shipping_address\": \"\",\n \"contract\": \"12954\",\n \"contract_name\": \"Campfire\",\n \"invoice_number\": \"987654321\",\n \"purchase_order_number\": \"123456789\",\n \"item_date\": \"2025-07-01\",\n \"period_start\": \"2025-07-01\",\n \"period_end\": \"2025-07-31\"\n}"
response = http.request(request)
puts response.read_body{
"id": 145055,
"lines": [
{
"id": 337587,
"product_name": "Product A",
"stripe_product_id": null,
"product_is_taxable": false,
"anrok_item_id": null,
"service_date": "2025-07-01",
"description": "Invoice Line Item",
"quantity": 1,
"rate": 50,
"currency": "USD",
"amount": 50,
"tax": 5,
"tax_description": null,
"created_at": "2025-07-25T18:54:43+00:00",
"last_modified_at": "2025-07-25T18:54:43+00:00",
"product": 2545
}
],
"payments": [],
"payment_journal_entries": [],
"client_name": "Client A",
"client_email": null,
"client_invoice_message": null,
"client_use_stripe_auto_bill": false,
"status": "open",
"past_due_days": null,
"entity_name": "Top Level",
"entity_currency": "USD",
"entity_invoice_message": "Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software",
"total_amount": 55,
"amount_paid": 0,
"amount_due": 55,
"contract_name": "Campfire",
"attachments": [],
"invoice_number": "987654321",
"item_date": "2025-07-01",
"voided_journal_entry_order": null,
"auto_send_invoice": false,
"auto_send_invoice_at": null,
"auto_sent_at": null,
"reminder_sent_dates": {},
"billing_address": "",
"shipping_address": "",
"terms": "net_30",
"ref_number": null,
"purchase_order_number": "123456789",
"invoice_date": "2025-07-01",
"due_date": "2025-07-31",
"shipping_date": null,
"paid_date": null,
"uncollectible_date": null,
"sent_date": null,
"period_start": "2025-07-01",
"period_end": "2025-07-31",
"location_of_sale": null,
"message_on_invoice": "Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software",
"payment_status": "open",
"warning_message": null,
"created_at": "2025-07-25T18:54:43+00:00",
"last_modified_at": "2025-07-25T18:54:43+00:00",
"currency": "USD",
"exchange_rate": 1,
"exchange_rate_book": 1,
"last_sent_at": null,
"integration_id": null,
"integration_context": null,
"use_stripe_auto_bill": false,
"stripe_payment_link_id": null,
"stripe_payment_intent_id": null,
"stripe_invoice_id": null,
"stripe_pdf_url": null,
"stripe_payment_link": null,
"source": null,
"source_id": null,
"voided_date": null,
"entity": 54,
"client": 33973,
"bad_debt_journal_entry": null,
"journal_entry": 7491952,
"contract": 12954,
"avalara_connection": null,
"sphere_connection": null,
"anrok_connection": null,
"tax_rate": null,
"stripe_connection": null,
"source_file": null,
"voided_journal_entry": null
}Create Invoice
Creates a new accounting invoice with line items and automatic journal entry generation.
This endpoint allows for comprehensive invoice creation with:
- Multiple line items with different products, rates, quantities, and tax handling
- Automatic accounts receivable journal entry creation
- Tax calculations and tax account handling
- Multi-currency support with exchange rate handling
- Product-based taxation rules
- Service date tracking for revenue recognition
- Contract and purchase order integration
- Stripe payment integration support
Key features:
- Credits revenue accounts for each line item amount
- Debits accounts receivable for the total amount
- Handles tax calculations with appropriate tax accounts
- Supports entity-specific currency conversions
- Creates proper double-entry accounting transactions
- Validates client, entity, and product relationships
- Integrates with Stripe for payment processing
Requirements:
- All referenced products, clients, and entities must exist and be active
- Client must be of type ‘customer’
- Line items must have valid amounts, quantities, and rates
- Currency must be valid for the entity
- Tax calculations must comply with configured tax rules
curl --request POST \
--url https://api.meetcampfire.com/coa/api/v1/invoice \
--header 'Content-Type: application/json' \
--data '
{
"terms": "net_30",
"invoice_date": "2025-07-01",
"due_date": "2025-07-31",
"lines": [
{
"service_date": "2025-07-01",
"amount": 50,
"product": "2545",
"product_name": "Product A",
"product_is_taxable": false,
"anrok_item_id": null,
"rate": 50,
"description": "Invoice Line Item",
"quantity": 1,
"tax": 5
}
],
"entity": "54",
"entity_name": "Top Level",
"entity_currency": "USD",
"entity_invoice_message": "Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software",
"currency": "USD",
"message_on_invoice": "Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software",
"stripe_connection": "",
"stripe_connection_name": "",
"stripe_connection_entity": "54",
"exchange_rate_book": 1,
"exchange_rate": 1,
"client": "33973",
"client_name": "Client A",
"client_email": null,
"client_invoice_message": null,
"billing_address": "",
"shipping_address": "",
"contract": "12954",
"contract_name": "Campfire",
"invoice_number": "987654321",
"purchase_order_number": "123456789",
"item_date": "2025-07-01",
"period_start": "2025-07-01",
"period_end": "2025-07-31"
}
'import requests
url = "https://api.meetcampfire.com/coa/api/v1/invoice"
payload = {
"terms": "net_30",
"invoice_date": "2025-07-01",
"due_date": "2025-07-31",
"lines": [
{
"service_date": "2025-07-01",
"amount": 50,
"product": "2545",
"product_name": "Product A",
"product_is_taxable": False,
"anrok_item_id": None,
"rate": 50,
"description": "Invoice Line Item",
"quantity": 1,
"tax": 5
}
],
"entity": "54",
"entity_name": "Top Level",
"entity_currency": "USD",
"entity_invoice_message": "Please make a payment to the following bank:
Bank Name: JP Morgan Chase
Bank Address: 456 Another Rd, San Francisco, CA, USA
SWIFT/BIC Code: XYZBUS22
Account Number: 123456789
Account Type: Checking
Account Name: Campfire Software",
"currency": "USD",
"message_on_invoice": "Please make a payment to the following bank:
Bank Name: JP Morgan Chase
Bank Address: 456 Another Rd, San Francisco, CA, USA
SWIFT/BIC Code: XYZBUS22
Account Number: 123456789
Account Type: Checking
Account Name: Campfire Software",
"stripe_connection": "",
"stripe_connection_name": "",
"stripe_connection_entity": "54",
"exchange_rate_book": 1,
"exchange_rate": 1,
"client": "33973",
"client_name": "Client A",
"client_email": None,
"client_invoice_message": None,
"billing_address": "",
"shipping_address": "",
"contract": "12954",
"contract_name": "Campfire",
"invoice_number": "987654321",
"purchase_order_number": "123456789",
"item_date": "2025-07-01",
"period_start": "2025-07-01",
"period_end": "2025-07-31"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
terms: 'net_30',
invoice_date: '2025-07-01',
due_date: '2025-07-31',
lines: [
{
service_date: '2025-07-01',
amount: 50,
product: '2545',
product_name: 'Product A',
product_is_taxable: false,
anrok_item_id: null,
rate: 50,
description: 'Invoice Line Item',
quantity: 1,
tax: 5
}
],
entity: '54',
entity_name: 'Top Level',
entity_currency: 'USD',
entity_invoice_message: 'Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software',
currency: 'USD',
message_on_invoice: 'Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software',
stripe_connection: '',
stripe_connection_name: '',
stripe_connection_entity: '54',
exchange_rate_book: 1,
exchange_rate: 1,
client: '33973',
client_name: 'Client A',
client_email: null,
client_invoice_message: null,
billing_address: '',
shipping_address: '',
contract: '12954',
contract_name: 'Campfire',
invoice_number: '987654321',
purchase_order_number: '123456789',
item_date: '2025-07-01',
period_start: '2025-07-01',
period_end: '2025-07-31'
})
};
fetch('https://api.meetcampfire.com/coa/api/v1/invoice', 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.meetcampfire.com/coa/api/v1/invoice",
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([
'terms' => 'net_30',
'invoice_date' => '2025-07-01',
'due_date' => '2025-07-31',
'lines' => [
[
'service_date' => '2025-07-01',
'amount' => 50,
'product' => '2545',
'product_name' => 'Product A',
'product_is_taxable' => false,
'anrok_item_id' => null,
'rate' => 50,
'description' => 'Invoice Line Item',
'quantity' => 1,
'tax' => 5
]
],
'entity' => '54',
'entity_name' => 'Top Level',
'entity_currency' => 'USD',
'entity_invoice_message' => 'Please make a payment to the following bank:
Bank Name: JP Morgan Chase
Bank Address: 456 Another Rd, San Francisco, CA, USA
SWIFT/BIC Code: XYZBUS22
Account Number: 123456789
Account Type: Checking
Account Name: Campfire Software',
'currency' => 'USD',
'message_on_invoice' => 'Please make a payment to the following bank:
Bank Name: JP Morgan Chase
Bank Address: 456 Another Rd, San Francisco, CA, USA
SWIFT/BIC Code: XYZBUS22
Account Number: 123456789
Account Type: Checking
Account Name: Campfire Software',
'stripe_connection' => '',
'stripe_connection_name' => '',
'stripe_connection_entity' => '54',
'exchange_rate_book' => 1,
'exchange_rate' => 1,
'client' => '33973',
'client_name' => 'Client A',
'client_email' => null,
'client_invoice_message' => null,
'billing_address' => '',
'shipping_address' => '',
'contract' => '12954',
'contract_name' => 'Campfire',
'invoice_number' => '987654321',
'purchase_order_number' => '123456789',
'item_date' => '2025-07-01',
'period_start' => '2025-07-01',
'period_end' => '2025-07-31'
]),
CURLOPT_HTTPHEADER => [
"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://api.meetcampfire.com/coa/api/v1/invoice"
payload := strings.NewReader("{\n \"terms\": \"net_30\",\n \"invoice_date\": \"2025-07-01\",\n \"due_date\": \"2025-07-31\",\n \"lines\": [\n {\n \"service_date\": \"2025-07-01\",\n \"amount\": 50,\n \"product\": \"2545\",\n \"product_name\": \"Product A\",\n \"product_is_taxable\": false,\n \"anrok_item_id\": null,\n \"rate\": 50,\n \"description\": \"Invoice Line Item\",\n \"quantity\": 1,\n \"tax\": 5\n }\n ],\n \"entity\": \"54\",\n \"entity_name\": \"Top Level\",\n \"entity_currency\": \"USD\",\n \"entity_invoice_message\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"currency\": \"USD\",\n \"message_on_invoice\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"stripe_connection\": \"\",\n \"stripe_connection_name\": \"\",\n \"stripe_connection_entity\": \"54\",\n \"exchange_rate_book\": 1,\n \"exchange_rate\": 1,\n \"client\": \"33973\",\n \"client_name\": \"Client A\",\n \"client_email\": null,\n \"client_invoice_message\": null,\n \"billing_address\": \"\",\n \"shipping_address\": \"\",\n \"contract\": \"12954\",\n \"contract_name\": \"Campfire\",\n \"invoice_number\": \"987654321\",\n \"purchase_order_number\": \"123456789\",\n \"item_date\": \"2025-07-01\",\n \"period_start\": \"2025-07-01\",\n \"period_end\": \"2025-07-31\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.meetcampfire.com/coa/api/v1/invoice")
.header("Content-Type", "application/json")
.body("{\n \"terms\": \"net_30\",\n \"invoice_date\": \"2025-07-01\",\n \"due_date\": \"2025-07-31\",\n \"lines\": [\n {\n \"service_date\": \"2025-07-01\",\n \"amount\": 50,\n \"product\": \"2545\",\n \"product_name\": \"Product A\",\n \"product_is_taxable\": false,\n \"anrok_item_id\": null,\n \"rate\": 50,\n \"description\": \"Invoice Line Item\",\n \"quantity\": 1,\n \"tax\": 5\n }\n ],\n \"entity\": \"54\",\n \"entity_name\": \"Top Level\",\n \"entity_currency\": \"USD\",\n \"entity_invoice_message\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"currency\": \"USD\",\n \"message_on_invoice\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"stripe_connection\": \"\",\n \"stripe_connection_name\": \"\",\n \"stripe_connection_entity\": \"54\",\n \"exchange_rate_book\": 1,\n \"exchange_rate\": 1,\n \"client\": \"33973\",\n \"client_name\": \"Client A\",\n \"client_email\": null,\n \"client_invoice_message\": null,\n \"billing_address\": \"\",\n \"shipping_address\": \"\",\n \"contract\": \"12954\",\n \"contract_name\": \"Campfire\",\n \"invoice_number\": \"987654321\",\n \"purchase_order_number\": \"123456789\",\n \"item_date\": \"2025-07-01\",\n \"period_start\": \"2025-07-01\",\n \"period_end\": \"2025-07-31\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetcampfire.com/coa/api/v1/invoice")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"terms\": \"net_30\",\n \"invoice_date\": \"2025-07-01\",\n \"due_date\": \"2025-07-31\",\n \"lines\": [\n {\n \"service_date\": \"2025-07-01\",\n \"amount\": 50,\n \"product\": \"2545\",\n \"product_name\": \"Product A\",\n \"product_is_taxable\": false,\n \"anrok_item_id\": null,\n \"rate\": 50,\n \"description\": \"Invoice Line Item\",\n \"quantity\": 1,\n \"tax\": 5\n }\n ],\n \"entity\": \"54\",\n \"entity_name\": \"Top Level\",\n \"entity_currency\": \"USD\",\n \"entity_invoice_message\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"currency\": \"USD\",\n \"message_on_invoice\": \"Please make a payment to the following bank:\\n\\nBank Name: JP Morgan Chase\\nBank Address: 456 Another Rd, San Francisco, CA, USA\\nSWIFT/BIC Code: XYZBUS22\\nAccount Number: 123456789\\nAccount Type: Checking\\nAccount Name: Campfire Software\",\n \"stripe_connection\": \"\",\n \"stripe_connection_name\": \"\",\n \"stripe_connection_entity\": \"54\",\n \"exchange_rate_book\": 1,\n \"exchange_rate\": 1,\n \"client\": \"33973\",\n \"client_name\": \"Client A\",\n \"client_email\": null,\n \"client_invoice_message\": null,\n \"billing_address\": \"\",\n \"shipping_address\": \"\",\n \"contract\": \"12954\",\n \"contract_name\": \"Campfire\",\n \"invoice_number\": \"987654321\",\n \"purchase_order_number\": \"123456789\",\n \"item_date\": \"2025-07-01\",\n \"period_start\": \"2025-07-01\",\n \"period_end\": \"2025-07-31\"\n}"
response = http.request(request)
puts response.read_body{
"id": 145055,
"lines": [
{
"id": 337587,
"product_name": "Product A",
"stripe_product_id": null,
"product_is_taxable": false,
"anrok_item_id": null,
"service_date": "2025-07-01",
"description": "Invoice Line Item",
"quantity": 1,
"rate": 50,
"currency": "USD",
"amount": 50,
"tax": 5,
"tax_description": null,
"created_at": "2025-07-25T18:54:43+00:00",
"last_modified_at": "2025-07-25T18:54:43+00:00",
"product": 2545
}
],
"payments": [],
"payment_journal_entries": [],
"client_name": "Client A",
"client_email": null,
"client_invoice_message": null,
"client_use_stripe_auto_bill": false,
"status": "open",
"past_due_days": null,
"entity_name": "Top Level",
"entity_currency": "USD",
"entity_invoice_message": "Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software",
"total_amount": 55,
"amount_paid": 0,
"amount_due": 55,
"contract_name": "Campfire",
"attachments": [],
"invoice_number": "987654321",
"item_date": "2025-07-01",
"voided_journal_entry_order": null,
"auto_send_invoice": false,
"auto_send_invoice_at": null,
"auto_sent_at": null,
"reminder_sent_dates": {},
"billing_address": "",
"shipping_address": "",
"terms": "net_30",
"ref_number": null,
"purchase_order_number": "123456789",
"invoice_date": "2025-07-01",
"due_date": "2025-07-31",
"shipping_date": null,
"paid_date": null,
"uncollectible_date": null,
"sent_date": null,
"period_start": "2025-07-01",
"period_end": "2025-07-31",
"location_of_sale": null,
"message_on_invoice": "Please make a payment to the following bank:\n\nBank Name: JP Morgan Chase\nBank Address: 456 Another Rd, San Francisco, CA, USA\nSWIFT/BIC Code: XYZBUS22\nAccount Number: 123456789\nAccount Type: Checking\nAccount Name: Campfire Software",
"payment_status": "open",
"warning_message": null,
"created_at": "2025-07-25T18:54:43+00:00",
"last_modified_at": "2025-07-25T18:54:43+00:00",
"currency": "USD",
"exchange_rate": 1,
"exchange_rate_book": 1,
"last_sent_at": null,
"integration_id": null,
"integration_context": null,
"use_stripe_auto_bill": false,
"stripe_payment_link_id": null,
"stripe_payment_intent_id": null,
"stripe_invoice_id": null,
"stripe_pdf_url": null,
"stripe_payment_link": null,
"source": null,
"source_id": null,
"voided_date": null,
"entity": 54,
"client": 33973,
"bad_debt_journal_entry": null,
"journal_entry": 7491952,
"contract": 12954,
"avalara_connection": null,
"sphere_connection": null,
"anrok_connection": null,
"tax_rate": null,
"stripe_connection": null,
"source_file": null,
"voided_journal_entry": null
}Body
Expose a stable two-decimal overage total on invoice serializers.
Show child attributes
Show child attributes
Write-only. Revenue transaction IDs to link to this invoice. This field is never included in responses.
Contract billing-schedule invoice to link this AR invoice to at creation.
Revenue contract to link this AR invoice to at creation, outside its billing schedule.
Upload run to record this row against; must be one of your own runs. Ignored on update.
Spreadsheet row this document starts on (the header is row 1), recorded with it. Ignored on update.
2 <= x <= 1048576Dictionary tracking when reminders were sent for each day overdue (e.g., {'5': '2024-01-15', '10': '2024-01-20'})
Dictionary tracking when pre-due reminders were sent for each day before due date (e.g., {'3': '2024-01-10', '7': '2024-01-06'})
255255custom- Customnet_5- Net 5net_7- Net 7net_10- Net 10net_15- Net 15net_20- Net 20net_30- Net 30net_40- Net 40net_45- Net 45net_60- Net 60net_90- Net 90net_105- Net 105net_120- Net 120due_on_receipt- Due on Receipt
custom, net_5, net_7, net_10, net_15, net_20, net_30, net_40, net_45, net_60, net_90, net_105, net_120, due_on_receipt 1201209^\d{9}$draft- Draftopen- Opensent- Sentpartial- Partially Paidpaid- Paiduncollectible- Uncollectiblevoided- Voided
draft, open, sent, partial, paid, uncollectible, voided ID of the transaction in Anrok (set when transaction is created)
255When true, no tax is calculated through, and no transaction is created in, the entity's tax connection for this invoice. Set at creation; cannot be changed.
3-100000000000000 < x < 100000000000000-100000000000000 < x < 100000000000000250250Set when the stamped vat_number came from the invoice's contract; the PDF then prints it instead of the client's current tax ID.
Set when the stamped shipping_address came from the invoice's contract; connector tax is then quoted at that address instead of the client's.
Snapshot of the contract's tax exemption when the invoice was generated; no tax is calculated.
Discount amount for the invoice
-1000000000000000000 < x < 1000000000000000000Discount amount applied based on payment term early payment discount
-1000000000000000000 < x < 1000000000000000000500500500250True for invoices imported via opening balance migration (no finalization JE).
10-2147483648 <= x <= 2147483647Response
Expose a stable two-decimal overage total on invoice serializers.
Invoice-currency overage before tax, as a two-decimal string.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
-1000000000000000000 < x < 1000000000000000000-1000000000000000000 < x < 1000000000000000000Withholding context for the invoice's entity.
estimated_withholding_amount covers only the remaining amount due (null once
fully paid); withheld_to_date is the signed sum of posted withholding, so
actuals replace the estimate as receipts come in. Certificate-based schemes
estimate from the entity certificate's rate (falling back to the scheme
default); rules-based schemes sum each line's selected rate over the line
amount, scaled by the remaining-due proportion.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
-1000000 < x < 1000000Show child attributes
Show child attributes
Accounts Receivable account for this invoice. Populated for single-AR and migrated invoices. NULL for multi-AR invoices (aging uses ChartTransactions instead).
Dictionary tracking when reminders were sent for each day overdue (e.g., {'5': '2024-01-15', '10': '2024-01-20'})
Dictionary tracking when pre-due reminders were sent for each day before due date (e.g., {'3': '2024-01-10', '7': '2024-01-06'})
255255custom- Customnet_5- Net 5net_7- Net 7net_10- Net 10net_15- Net 15net_20- Net 20net_30- Net 30net_40- Net 40net_45- Net 45net_60- Net 60net_90- Net 90net_105- Net 105net_120- Net 120due_on_receipt- Due on Receipt
custom, net_5, net_7, net_10, net_15, net_20, net_30, net_40, net_45, net_60, net_90, net_105, net_120, due_on_receipt 1201209^\d{9}$draft- Draftopen- Opensent- Sentpartial- Partially Paidpaid- Paiduncollectible- Uncollectiblevoided- Voided
draft, open, sent, partial, paid, uncollectible, voided ID of the transaction in Anrok (set when transaction is created)
255When true, no tax is calculated through, and no transaction is created in, the entity's tax connection for this invoice. Set at creation; cannot be changed.
3-100000000000000 < x < 100000000000000-100000000000000 < x < 100000000000000250250Set when the stamped vat_number came from the invoice's contract; the PDF then prints it instead of the client's current tax ID.
Set when the stamped shipping_address came from the invoice's contract; connector tax is then quoted at that address instead of the client's.
Snapshot of the contract's tax exemption when the invoice was generated; no tax is calculated.
Discount amount for the invoice
-1000000000000000000 < x < 1000000000000000000Discount amount applied based on payment term early payment discount
-1000000000000000000 < x < 1000000000000000000500500500250True for invoices imported via opening balance migration (no finalization JE).
10-2147483648 <= x <= 2147483647