All requests in this flow assume you have a valid access token attached in your request headers. See our authentication guide for more information.
Creating an invoice
This section will guide you through the process of creating an invoice in Campfire.1
Fetch related data
We’ll need to grab some object references for related objects to create our invoice. We’ll need to pass in the id’s of the related objects where applicable in the invoice creation request. Linked here are the filter endpoints for the applicable objects. These include:
2
Assemble the request
We can now create our request body by filling in the related fields. Here are the required fields:
Line Item Fields:
Example request body:
Field | Description | Example |
---|---|---|
terms | Payment terms (default is net_30, can be: 7, 10, 15, 20, 30, 40, 45, 60, 90, 105, 120 or due_on_receipt) | "net_30" |
invoice_date | Accounting date for the invoice in YYYY-MM-DD format | "2025-07-01" |
due_date | Due date for the invoice in YYYY-MM-DD format | "2025-07-31" |
lines | Array of line items for the invoice | See line item fields below |
entity | ID from entity | "54" |
currency | Currency code | "USD" |
message_on_invoice | Message to display on invoice | "Invoice Message" |
exchange_rate_book | Exchange rate between transactional and entity currency (auto-computed if not provided) | 1 |
exchange_rate | Exchange rate between entity and consolidation currency (auto-computed if not provided) | 1 |
client | ID from client | "24020" |
billing_address | Billing address | "Billing Address" |
shipping_address | Shipping address | "Shipping Address" |
contract | ID from contract (optional) | "24899" |
purchase_order_number | Purchase order number | "123456789" |
invoice_number | Invoice number | "1234567890" |
location_of_sale | Location of sale description | "Location of sale desc" |
item_date | Bill date in YYYY-MM-DD format | "2025-07-01" |
period_start | Period start date in YYYY-MM-DD format | "2025-07-01" |
period_end | Period end date in YYYY-MM-DD format | "2025-07-31" |
shipping_date | Shipping date in YYYY-MM-DD format | "2025-07-01" |
Field | Description | Example |
---|---|---|
service_date | Service date in YYYY-MM-DD format | "2025-07-01" |
amount | Line item amount | 300 |
product | ID from product | "3560" |
rate | Rate per unit | 15 |
description | Line item description | "Line desc" |
quantity | Quantity | 20 |
tax | Tax amount | 12 |
3
Post the invoice
Now that we have the request we can post it via the Create Invoice endpoint.Congrats! You’ve created your first invoice!
Paying an invoice
This section will walk you through posting a payment to an invoice.1
Get a Journal & Transaction
We need to get a transaction id to reference in the payment.You have two options for this:
2
Assembling the payment
Now that we have a transaction id, we can create our payment request body.Payments that don’t use the full amount of a transaction will bump out a new line of the journal based on the referenced transaction.
Example request body:
You can apply multiple transactions to an invoice at the same time. Each transaction will be a separate payment.
Field | Description | Example |
---|---|---|
transaction_id | ID from transaction | "1234" |
amount | Payment amount | 10000 |
account | ID from account (If you want to categorize the transaction at the same time) | "1234" |
3
Post the payment
Now that we have the request we can post it via the Create Payment endpoint.Congrats! You’ve paid your invoice!