curl --request POST \
--url https://api.meetcampfire.com/rev/api/v1/contracts/{id}/link-invoice \
--header 'Content-Type: application/json' \
--data '{
"invoice": 123
}'import requests
url = "https://api.meetcampfire.com/rev/api/v1/contracts/{id}/link-invoice"
payload = { "invoice": 123 }
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({invoice: 123})
};
fetch('https://api.meetcampfire.com/rev/api/v1/contracts/{id}/link-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/rev/api/v1/contracts/{id}/link-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([
'invoice' => 123
]),
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/rev/api/v1/contracts/{id}/link-invoice"
payload := strings.NewReader("{\n \"invoice\": 123\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/rev/api/v1/contracts/{id}/link-invoice")
.header("Content-Type", "application/json")
.body("{\n \"invoice\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetcampfire.com/rev/api/v1/contracts/{id}/link-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 \"invoice\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"contract": 123,
"contract_name": "<string>",
"contract_number": "<string>",
"entity": 123,
"entity_name": "",
"client": 123,
"client_name": "",
"invoice": 123,
"journal_entry": 123,
"journal_entry_number": "<string>",
"issue_date": "2023-12-25",
"tax_rate_name": "",
"anrok_connection_name": "",
"avalara_connection_name": "",
"sphere_connection_name": "",
"stripe_connection_name": "",
"subtotal": 0,
"is_linked": true,
"needs_live_date_fx_recalc": true,
"lines": [
{
"id": 123,
"invoice": 123,
"product_name": "",
"department_name": "",
"created_at": "2023-11-07T05:31:56Z",
"last_modified_at": "2023-11-07T05:31:56Z",
"contract_line": 123,
"product": 123,
"description": "<string>",
"service_start": "2023-12-25",
"service_end": "2023-12-25",
"currency": "<string>",
"quantity": 0,
"rate": 0,
"amount": 0,
"tax": 0,
"tax_description": "<string>",
"discount": 0,
"department": 123,
"tags": [
123
]
}
],
"created_at": "2023-11-07T05:31:56Z",
"last_modified_at": "2023-11-07T05:31:56Z",
"ordinal": 1073741823,
"invoice_number": "<string>",
"status": "DRAFT",
"accounting_date": "2023-12-25",
"due_date": "2023-12-25",
"payment_term": 123,
"bill_to_snapshot": "<unknown>",
"currency": "<string>",
"purchase_order_number": "<string>",
"period_start": "2023-12-25",
"period_end": "2023-12-25",
"shipping_date": "2023-12-25",
"location_of_sale": "<string>",
"vat_number": "<string>",
"billing_address": "<string>",
"billing_addressee": "<string>",
"shipping_address": "<string>",
"shipping_addressee": "<string>",
"message_on_invoice": "<string>",
"tax_rate": 123,
"anrok_connection": 123,
"avalara_connection": 123,
"sphere_connection": 123,
"stripe_connection": 123,
"use_stripe_auto_bill": true,
"discount": 0,
"total_amount": 0
}Link Existing Invoice To Contract
Attach an existing AR invoice to a contract. The contract gets a mirrored invoice row and lines plus the INVOICE subledger entry, posted against the AR invoice’s GL journal. The link is made from the contract only.
curl --request POST \
--url https://api.meetcampfire.com/rev/api/v1/contracts/{id}/link-invoice \
--header 'Content-Type: application/json' \
--data '{
"invoice": 123
}'import requests
url = "https://api.meetcampfire.com/rev/api/v1/contracts/{id}/link-invoice"
payload = { "invoice": 123 }
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({invoice: 123})
};
fetch('https://api.meetcampfire.com/rev/api/v1/contracts/{id}/link-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/rev/api/v1/contracts/{id}/link-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([
'invoice' => 123
]),
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/rev/api/v1/contracts/{id}/link-invoice"
payload := strings.NewReader("{\n \"invoice\": 123\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/rev/api/v1/contracts/{id}/link-invoice")
.header("Content-Type", "application/json")
.body("{\n \"invoice\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetcampfire.com/rev/api/v1/contracts/{id}/link-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 \"invoice\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"contract": 123,
"contract_name": "<string>",
"contract_number": "<string>",
"entity": 123,
"entity_name": "",
"client": 123,
"client_name": "",
"invoice": 123,
"journal_entry": 123,
"journal_entry_number": "<string>",
"issue_date": "2023-12-25",
"tax_rate_name": "",
"anrok_connection_name": "",
"avalara_connection_name": "",
"sphere_connection_name": "",
"stripe_connection_name": "",
"subtotal": 0,
"is_linked": true,
"needs_live_date_fx_recalc": true,
"lines": [
{
"id": 123,
"invoice": 123,
"product_name": "",
"department_name": "",
"created_at": "2023-11-07T05:31:56Z",
"last_modified_at": "2023-11-07T05:31:56Z",
"contract_line": 123,
"product": 123,
"description": "<string>",
"service_start": "2023-12-25",
"service_end": "2023-12-25",
"currency": "<string>",
"quantity": 0,
"rate": 0,
"amount": 0,
"tax": 0,
"tax_description": "<string>",
"discount": 0,
"department": 123,
"tags": [
123
]
}
],
"created_at": "2023-11-07T05:31:56Z",
"last_modified_at": "2023-11-07T05:31:56Z",
"ordinal": 1073741823,
"invoice_number": "<string>",
"status": "DRAFT",
"accounting_date": "2023-12-25",
"due_date": "2023-12-25",
"payment_term": 123,
"bill_to_snapshot": "<unknown>",
"currency": "<string>",
"purchase_order_number": "<string>",
"period_start": "2023-12-25",
"period_end": "2023-12-25",
"shipping_date": "2023-12-25",
"location_of_sale": "<string>",
"vat_number": "<string>",
"billing_address": "<string>",
"billing_addressee": "<string>",
"shipping_address": "<string>",
"shipping_addressee": "<string>",
"message_on_invoice": "<string>",
"tax_rate": 123,
"anrok_connection": 123,
"avalara_connection": 123,
"sphere_connection": 123,
"stripe_connection": 123,
"use_stripe_auto_bill": true,
"discount": 0,
"total_amount": 0
}Path Parameters
Body
Response
Base serializer that injects the request user's customer on create and restricts related-object querysets to the same customer.
-10000000000000 < x < 10000000000000Created by attaching an existing AR invoice to the contract rather than by issuing a billing-schedule row. The AR invoice is the source of truth: this row mirrors it, and deleting the AR invoice removes the row instead of returning it to Draft.
Set when Create All Now issued this row before its invoice date in a currency other than the entity book currency. Cleared after FX is recalculated on the invoice date.
Show child attributes
Show child attributes
0 <= x <= 2147483647255DRAFT- DraftSCHEDULED- ScheduledOPEN- OpenSENT- SentPAID- PaidVOIDED- Voided
DRAFT, SCHEDULED, OPEN, SENT, PAID, VOIDED Accounting date used as the issued AR invoice date; defaults to the issue date.
Terms behind the due date; None means due on receipt or a manually set date.
3120250255255Draft override for Anrok. Null inherits the entity's tax connector at issuance.
Draft override for Avalara. Null inherits the entity's tax connector at issuance.
Draft override for Sphere. Null inherits the entity's tax connector at issuance.
Draft override for Stripe. Null inherits the contract's Stripe connection.
Draft override for Stripe auto-bill. Null inherits the contract setting.
This invoice's prorated share of the contract-wide discount.
-10000000000000 < x < 10000000000000-10000000000000 < x < 10000000000000