Mark Invoice as Paid
curl --request POST \
--url https://api.meetcampfire.com/coa/api/v1/invoice/{invoice_id}/pay/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_match_id": 123,
"transactions": [
{
"amount": 0,
"transaction_match_id": 123,
"transaction_id": 123,
"transaction_ids": [
123
],
"account_id": 123,
"amount_payable": 0,
"credit_account_id": 123,
"writeoff_account_id": 123,
"withholding_amount": 0,
"withholding_tax_rate_id": 123
}
],
"credit_memos": [
{
"credit_memo_id": 123,
"amount": 0,
"posted_at": "2023-12-25"
}
],
"debit_memos": [
{
"debit_memo_id": 123,
"amount": 0,
"posted_at": "2023-12-25"
}
],
"empty_transactions": [
{
"account_id": 123,
"account_name": "<string>",
"amount": 0,
"payment_date": "2023-12-25",
"department_id": 123,
"tag_ids": [
123
],
"memo": "<string>",
"external_id": "<string>",
"currency": "<string>",
"amount_in_invoice_currency": 0,
"amount_in_bill_currency": 0,
"withholding_amount": 0,
"withholding_tax_rate_id": 123
}
]
}
'import requests
url = "https://api.meetcampfire.com/coa/api/v1/invoice/{invoice_id}/pay/"
payload = {
"transaction_match_id": 123,
"transactions": [
{
"amount": 0,
"transaction_match_id": 123,
"transaction_id": 123,
"transaction_ids": [123],
"account_id": 123,
"amount_payable": 0,
"credit_account_id": 123,
"writeoff_account_id": 123,
"withholding_amount": 0,
"withholding_tax_rate_id": 123
}
],
"credit_memos": [
{
"credit_memo_id": 123,
"amount": 0,
"posted_at": "2023-12-25"
}
],
"debit_memos": [
{
"debit_memo_id": 123,
"amount": 0,
"posted_at": "2023-12-25"
}
],
"empty_transactions": [
{
"account_id": 123,
"account_name": "<string>",
"amount": 0,
"payment_date": "2023-12-25",
"department_id": 123,
"tag_ids": [123],
"memo": "<string>",
"external_id": "<string>",
"currency": "<string>",
"amount_in_invoice_currency": 0,
"amount_in_bill_currency": 0,
"withholding_amount": 0,
"withholding_tax_rate_id": 123
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_match_id: 123,
transactions: [
{
amount: 0,
transaction_match_id: 123,
transaction_id: 123,
transaction_ids: [123],
account_id: 123,
amount_payable: 0,
credit_account_id: 123,
writeoff_account_id: 123,
withholding_amount: 0,
withholding_tax_rate_id: 123
}
],
credit_memos: [{credit_memo_id: 123, amount: 0, posted_at: '2023-12-25'}],
debit_memos: [{debit_memo_id: 123, amount: 0, posted_at: '2023-12-25'}],
empty_transactions: [
{
account_id: 123,
account_name: '<string>',
amount: 0,
payment_date: '2023-12-25',
department_id: 123,
tag_ids: [123],
memo: '<string>',
external_id: '<string>',
currency: '<string>',
amount_in_invoice_currency: 0,
amount_in_bill_currency: 0,
withholding_amount: 0,
withholding_tax_rate_id: 123
}
]
})
};
fetch('https://api.meetcampfire.com/coa/api/v1/invoice/{invoice_id}/pay/', 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/{invoice_id}/pay/",
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([
'transaction_match_id' => 123,
'transactions' => [
[
'amount' => 0,
'transaction_match_id' => 123,
'transaction_id' => 123,
'transaction_ids' => [
123
],
'account_id' => 123,
'amount_payable' => 0,
'credit_account_id' => 123,
'writeoff_account_id' => 123,
'withholding_amount' => 0,
'withholding_tax_rate_id' => 123
]
],
'credit_memos' => [
[
'credit_memo_id' => 123,
'amount' => 0,
'posted_at' => '2023-12-25'
]
],
'debit_memos' => [
[
'debit_memo_id' => 123,
'amount' => 0,
'posted_at' => '2023-12-25'
]
],
'empty_transactions' => [
[
'account_id' => 123,
'account_name' => '<string>',
'amount' => 0,
'payment_date' => '2023-12-25',
'department_id' => 123,
'tag_ids' => [
123
],
'memo' => '<string>',
'external_id' => '<string>',
'currency' => '<string>',
'amount_in_invoice_currency' => 0,
'amount_in_bill_currency' => 0,
'withholding_amount' => 0,
'withholding_tax_rate_id' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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/{invoice_id}/pay/"
payload := strings.NewReader("{\n \"transaction_match_id\": 123,\n \"transactions\": [\n {\n \"amount\": 0,\n \"transaction_match_id\": 123,\n \"transaction_id\": 123,\n \"transaction_ids\": [\n 123\n ],\n \"account_id\": 123,\n \"amount_payable\": 0,\n \"credit_account_id\": 123,\n \"writeoff_account_id\": 123,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ],\n \"credit_memos\": [\n {\n \"credit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"debit_memos\": [\n {\n \"debit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"empty_transactions\": [\n {\n \"account_id\": 123,\n \"account_name\": \"<string>\",\n \"amount\": 0,\n \"payment_date\": \"2023-12-25\",\n \"department_id\": 123,\n \"tag_ids\": [\n 123\n ],\n \"memo\": \"<string>\",\n \"external_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount_in_invoice_currency\": 0,\n \"amount_in_bill_currency\": 0,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.meetcampfire.com/coa/api/v1/invoice/{invoice_id}/pay/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_match_id\": 123,\n \"transactions\": [\n {\n \"amount\": 0,\n \"transaction_match_id\": 123,\n \"transaction_id\": 123,\n \"transaction_ids\": [\n 123\n ],\n \"account_id\": 123,\n \"amount_payable\": 0,\n \"credit_account_id\": 123,\n \"writeoff_account_id\": 123,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ],\n \"credit_memos\": [\n {\n \"credit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"debit_memos\": [\n {\n \"debit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"empty_transactions\": [\n {\n \"account_id\": 123,\n \"account_name\": \"<string>\",\n \"amount\": 0,\n \"payment_date\": \"2023-12-25\",\n \"department_id\": 123,\n \"tag_ids\": [\n 123\n ],\n \"memo\": \"<string>\",\n \"external_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount_in_invoice_currency\": 0,\n \"amount_in_bill_currency\": 0,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetcampfire.com/coa/api/v1/invoice/{invoice_id}/pay/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_match_id\": 123,\n \"transactions\": [\n {\n \"amount\": 0,\n \"transaction_match_id\": 123,\n \"transaction_id\": 123,\n \"transaction_ids\": [\n 123\n ],\n \"account_id\": 123,\n \"amount_payable\": 0,\n \"credit_account_id\": 123,\n \"writeoff_account_id\": 123,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ],\n \"credit_memos\": [\n {\n \"credit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"debit_memos\": [\n {\n \"debit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"empty_transactions\": [\n {\n \"account_id\": 123,\n \"account_name\": \"<string>\",\n \"amount\": 0,\n \"payment_date\": \"2023-12-25\",\n \"department_id\": 123,\n \"tag_ids\": [\n 123\n ],\n \"memo\": \"<string>\",\n \"external_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount_in_invoice_currency\": 0,\n \"amount_in_bill_currency\": 0,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"journal_entry_ids": [
123
],
"payment_ids": [
123
],
"auto_created_credit_memos": [
{
"id": 123,
"credit_memo_number": "<string>"
}
]
}Accounts Receivable
Mark Invoice as Paid
Mark an invoice as paid, allowing partial payments.
This endpoint supports multiple payment methods:
- Apply existing transactions as payments
- Apply credit memos to reduce the invoice balance
- Create manual payments without a transaction
The request body should contain at least one of:
- transactions: List of transaction payments to apply
- credit_memos: List of credit memos to apply
- empty_transactions: List of manual payments without transactions
POST
/
coa
/
api
/
v1
/
invoice
/
{invoice_id}
/
pay
/
Mark Invoice as Paid
curl --request POST \
--url https://api.meetcampfire.com/coa/api/v1/invoice/{invoice_id}/pay/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_match_id": 123,
"transactions": [
{
"amount": 0,
"transaction_match_id": 123,
"transaction_id": 123,
"transaction_ids": [
123
],
"account_id": 123,
"amount_payable": 0,
"credit_account_id": 123,
"writeoff_account_id": 123,
"withholding_amount": 0,
"withholding_tax_rate_id": 123
}
],
"credit_memos": [
{
"credit_memo_id": 123,
"amount": 0,
"posted_at": "2023-12-25"
}
],
"debit_memos": [
{
"debit_memo_id": 123,
"amount": 0,
"posted_at": "2023-12-25"
}
],
"empty_transactions": [
{
"account_id": 123,
"account_name": "<string>",
"amount": 0,
"payment_date": "2023-12-25",
"department_id": 123,
"tag_ids": [
123
],
"memo": "<string>",
"external_id": "<string>",
"currency": "<string>",
"amount_in_invoice_currency": 0,
"amount_in_bill_currency": 0,
"withholding_amount": 0,
"withholding_tax_rate_id": 123
}
]
}
'import requests
url = "https://api.meetcampfire.com/coa/api/v1/invoice/{invoice_id}/pay/"
payload = {
"transaction_match_id": 123,
"transactions": [
{
"amount": 0,
"transaction_match_id": 123,
"transaction_id": 123,
"transaction_ids": [123],
"account_id": 123,
"amount_payable": 0,
"credit_account_id": 123,
"writeoff_account_id": 123,
"withholding_amount": 0,
"withholding_tax_rate_id": 123
}
],
"credit_memos": [
{
"credit_memo_id": 123,
"amount": 0,
"posted_at": "2023-12-25"
}
],
"debit_memos": [
{
"debit_memo_id": 123,
"amount": 0,
"posted_at": "2023-12-25"
}
],
"empty_transactions": [
{
"account_id": 123,
"account_name": "<string>",
"amount": 0,
"payment_date": "2023-12-25",
"department_id": 123,
"tag_ids": [123],
"memo": "<string>",
"external_id": "<string>",
"currency": "<string>",
"amount_in_invoice_currency": 0,
"amount_in_bill_currency": 0,
"withholding_amount": 0,
"withholding_tax_rate_id": 123
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction_match_id: 123,
transactions: [
{
amount: 0,
transaction_match_id: 123,
transaction_id: 123,
transaction_ids: [123],
account_id: 123,
amount_payable: 0,
credit_account_id: 123,
writeoff_account_id: 123,
withholding_amount: 0,
withholding_tax_rate_id: 123
}
],
credit_memos: [{credit_memo_id: 123, amount: 0, posted_at: '2023-12-25'}],
debit_memos: [{debit_memo_id: 123, amount: 0, posted_at: '2023-12-25'}],
empty_transactions: [
{
account_id: 123,
account_name: '<string>',
amount: 0,
payment_date: '2023-12-25',
department_id: 123,
tag_ids: [123],
memo: '<string>',
external_id: '<string>',
currency: '<string>',
amount_in_invoice_currency: 0,
amount_in_bill_currency: 0,
withholding_amount: 0,
withholding_tax_rate_id: 123
}
]
})
};
fetch('https://api.meetcampfire.com/coa/api/v1/invoice/{invoice_id}/pay/', 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/{invoice_id}/pay/",
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([
'transaction_match_id' => 123,
'transactions' => [
[
'amount' => 0,
'transaction_match_id' => 123,
'transaction_id' => 123,
'transaction_ids' => [
123
],
'account_id' => 123,
'amount_payable' => 0,
'credit_account_id' => 123,
'writeoff_account_id' => 123,
'withholding_amount' => 0,
'withholding_tax_rate_id' => 123
]
],
'credit_memos' => [
[
'credit_memo_id' => 123,
'amount' => 0,
'posted_at' => '2023-12-25'
]
],
'debit_memos' => [
[
'debit_memo_id' => 123,
'amount' => 0,
'posted_at' => '2023-12-25'
]
],
'empty_transactions' => [
[
'account_id' => 123,
'account_name' => '<string>',
'amount' => 0,
'payment_date' => '2023-12-25',
'department_id' => 123,
'tag_ids' => [
123
],
'memo' => '<string>',
'external_id' => '<string>',
'currency' => '<string>',
'amount_in_invoice_currency' => 0,
'amount_in_bill_currency' => 0,
'withholding_amount' => 0,
'withholding_tax_rate_id' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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/{invoice_id}/pay/"
payload := strings.NewReader("{\n \"transaction_match_id\": 123,\n \"transactions\": [\n {\n \"amount\": 0,\n \"transaction_match_id\": 123,\n \"transaction_id\": 123,\n \"transaction_ids\": [\n 123\n ],\n \"account_id\": 123,\n \"amount_payable\": 0,\n \"credit_account_id\": 123,\n \"writeoff_account_id\": 123,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ],\n \"credit_memos\": [\n {\n \"credit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"debit_memos\": [\n {\n \"debit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"empty_transactions\": [\n {\n \"account_id\": 123,\n \"account_name\": \"<string>\",\n \"amount\": 0,\n \"payment_date\": \"2023-12-25\",\n \"department_id\": 123,\n \"tag_ids\": [\n 123\n ],\n \"memo\": \"<string>\",\n \"external_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount_in_invoice_currency\": 0,\n \"amount_in_bill_currency\": 0,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.meetcampfire.com/coa/api/v1/invoice/{invoice_id}/pay/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_match_id\": 123,\n \"transactions\": [\n {\n \"amount\": 0,\n \"transaction_match_id\": 123,\n \"transaction_id\": 123,\n \"transaction_ids\": [\n 123\n ],\n \"account_id\": 123,\n \"amount_payable\": 0,\n \"credit_account_id\": 123,\n \"writeoff_account_id\": 123,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ],\n \"credit_memos\": [\n {\n \"credit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"debit_memos\": [\n {\n \"debit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"empty_transactions\": [\n {\n \"account_id\": 123,\n \"account_name\": \"<string>\",\n \"amount\": 0,\n \"payment_date\": \"2023-12-25\",\n \"department_id\": 123,\n \"tag_ids\": [\n 123\n ],\n \"memo\": \"<string>\",\n \"external_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount_in_invoice_currency\": 0,\n \"amount_in_bill_currency\": 0,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetcampfire.com/coa/api/v1/invoice/{invoice_id}/pay/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction_match_id\": 123,\n \"transactions\": [\n {\n \"amount\": 0,\n \"transaction_match_id\": 123,\n \"transaction_id\": 123,\n \"transaction_ids\": [\n 123\n ],\n \"account_id\": 123,\n \"amount_payable\": 0,\n \"credit_account_id\": 123,\n \"writeoff_account_id\": 123,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ],\n \"credit_memos\": [\n {\n \"credit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"debit_memos\": [\n {\n \"debit_memo_id\": 123,\n \"amount\": 0,\n \"posted_at\": \"2023-12-25\"\n }\n ],\n \"empty_transactions\": [\n {\n \"account_id\": 123,\n \"account_name\": \"<string>\",\n \"amount\": 0,\n \"payment_date\": \"2023-12-25\",\n \"department_id\": 123,\n \"tag_ids\": [\n 123\n ],\n \"memo\": \"<string>\",\n \"external_id\": \"<string>\",\n \"currency\": \"<string>\",\n \"amount_in_invoice_currency\": 0,\n \"amount_in_bill_currency\": 0,\n \"withholding_amount\": 0,\n \"withholding_tax_rate_id\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"journal_entry_ids": [
123
],
"payment_ids": [
123
],
"auto_created_credit_memos": [
{
"id": 123,
"credit_memo_number": "<string>"
}
]
}Authorizations
Token-based authentication with required prefix "Token"
Path Parameters
ID of the invoice to mark as paid
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Response
200 - application/json
200 payload for the mark-invoice-paid endpoint.
The endpoint returns ids of the records it created rather than the invoice itself.
auto_created_credit_memos is only present when an overpayment produced one.
⌘I