Invoices
Create, list, update and void invoices, record payments against them, and get a payment link, with the FieldCamp Invoices API.
The Invoices API creates and reads invoices, records payments against
them, voids them, and returns a payment link the customer can pay through.
The path is /api/v1/invoices. For the in-app workflow, see
Creating invoices.
Reads need the invoices:read scope and writes need invoices:write.
Payments have their own scopes: payments:read and payments:write.
How an invoice is structured
- Header —
clientId,title,date,dueDate,poNumber,paymentTerms(days),paymentInstructions,comments,privateNotes, and a document-leveldiscountwithdiscountType(1= percent,2= amount). Also accepted:documentPreFix(the prefix before the invoice number, defaultINV),clientDetails(a snapshot of the client details printed on the invoice; filled from the client when left out), andmarkupwithmarkupType, which are stored as sent and do not change the total. - Line items — the
itemsarray. Each line takesitemId,name,description,quantity,rate(the unit price),taxIds,exemptFromTax,unitType,itemTypeandcode. - Totals —
subTotal,total,exclusiveTaxAmountandinclusiveTaxAmountare worked out by FieldCamp from the lines, the account's tax rates and the discount. - Payment state —
paidAmount,paymentStatus(unpaid,partial,paid,overdue,void) anddepositDateare read-only. They change when a payment is recorded or the invoice is voided.
FieldCamp does the arithmetic
You do not have to send subTotal or total. If you do send them, they are
checked against the server's figures and a mismatch returns 422 with the
computed value in error.details. Amounts you send are never stored as
they are.
Create an invoice
POST /api/v1/invoices requires clientId and a non-empty items array.
curl -X POST https://api.fieldcamp.ai/api/v1/invoices \
-H "Authorization: Bearer $FIELDCAMP_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: invoice-2026-0412" \
-d '{
"clientId": "665f1c2ab7e4a91d3c0f8a11",
"title": "Annual HVAC tune-up",
"date": "2026-05-29",
"dueDate": "2026-06-12",
"discount": 5,
"discountType": 1,
"items": [
{
"itemId": "665f1c2ab7e4a91d3c0f8b22",
"quantity": 1
},
{
"name": "Filter replacement",
"quantity": 2,
"rate": 18.5,
"taxIds": ["665f1c2ab7e4a91d3c0f8c33"]
}
]
}'How a line is filled:
| You send | What FieldCamp does |
|---|---|
itemId only | Takes the name, description, price, tax-exempt flag and default taxes from that item. |
itemId plus name, rate or taxIds | Your values replace the item's defaults for this line. |
No itemId | name is required. quantity defaults to 1 and rate to 0. |
taxIds | Each must be one of the account's taxes. The tax amount is computed from the rate. |
exemptFromTax: true | The line carries no tax. |
Validation:
- A field the API does not know returns
422naming it. - An
itemIdor tax ID that is not on the account returns422. - A
clientIdthat is not on the account returns404. dateanddueDatetakeYYYY-MM-DDor an ISO-8601 timestamp.- The invoice number comes from the account's invoice sequence.
The response is the same shape as GET /api/v1/invoices/{id}.
Filtering and paging
GET /api/v1/invoices accepts:
clientId— invoices for one client.status— filters onpaymentStatus.since— ISO-8601 timestamp; returns invoices whoseupdatedAtis at or after it. Send it with a timezone (…Zor an offset), or addtimezone(an IANA name such asAmerica/Denver) for a zone-less value.limit— default30, maximum100.cursor— set tometa.next.cursorfrom the previous response.meta.nextisnullon the last page.sortandpage— the older offset paging.sortisfield:directiononcreatedAt,updatedAt,total,paymentStatus,dueDateordocumentNumber.
curl "https://api.fieldcamp.ai/api/v1/invoices?clientId=$CLIENT_ID&status=unpaid" \
-H "Authorization: Bearer $FIELDCAMP_API_KEY"Update an invoice
PUT /api/v1/invoices/{id} is a partial update: send only what changes.
- Header fields are replaced with the values you send.
- Changing
items,discountordiscountTypemakes FieldCamp work out the totals again. paidAmountandpaymentStatusare not accepted here. Sending either returns422. Record a payment or void the invoice instead.actionStatus(0pending,1approved,2declined) can be set on update, not on create.
items can be sent in two forms. Do not mix them in one request.
| Form | How it works |
|---|---|
| Replace | No line carries action. The list is the new set: a line with id updates that line, a line without id is added, and lines you leave out are removed. |
| Delta | Every line carries action: 1 add, 2 update, 3 remove. Lines you do not mention stay as they are. |
An invoice must keep at least one line.
Record a payment
POST /api/v1/invoices/{id}/payments records a payment the same way the
Record payment action in FieldCamp does. The key needs payments:write.
curl -X POST https://api.fieldcamp.ai/api/v1/invoices/$INVOICE_ID/payments \
-H "Authorization: Bearer $FIELDCAMP_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: payment-ext-88213" \
-d '{
"amount": 120.50,
"date": "2026-06-02",
"method": "Bank transfer",
"note": "Reference 88213"
}'| Field | Required | Description |
|---|---|---|
amount | Yes | A number greater than 0, and not more than the balance still due. |
date | No | YYYY-MM-DD or an ISO-8601 timestamp. Defaults to today. |
method | No | Free text, for example Cash or Bank transfer. |
note | No | Free text. |
paymentTypeCode | No | Your own code for the payment type. |
What happens next:
- The invoice's
paidAmountgoes up and itspaymentStatusis worked out again:partialwhile a balance remains,paidwhen it reaches zero. - A
payment.recordedevent is sent, andinvoice.paidwhen the payment settles the invoice. See Webhook events. - The response is the payment, with status
201.
Refusals:
| Status | When |
|---|---|
422 | amount is missing, not a positive number, or more than the balance due. error.details carries balanceDue. |
422 | The body has a field the API does not know. |
409 | The invoice is void. |
404 | The invoice is not on this account. |
A payment cannot be changed or deleted through the API.
GET /api/v1/invoices/{id}/payments lists the payments on one invoice. See
Payments for the fields and for reading
payments across all invoices.
Send an Idempotency-Key
A retried request without one records the payment twice. See Idempotency.
Void an invoice
POST /api/v1/invoices/{id}/void sets paymentStatus to void. It takes no
body and needs invoices:write.
- The invoice keeps its lines and total.
- A void invoice takes no more payments.
- An
invoice.voidedevent is sent. - The response is the invoice, in the
GET /api/v1/invoices/{id}shape.
It returns 409 when the invoice already has a payment recorded against it,
or is already void.
Delete an invoice
DELETE /api/v1/invoices/{id} removes the invoice whatever its state and
returns { id, deleted: true }. Prefer voiding when you want the invoice to
stay in your reports.
Issue a Stripe payment link
If your tenant has connected Stripe, call GET /api/v1/invoices/{id}/payment-link for a payment URL to send to the customer.
It returns four fields:
{
"success": true,
"data": {
"paymentUrl": "https://app.fieldcamp.ai/documentView?token=…&docId=…",
"invoiceId": "6a84…",
"amount": 272.5,
"currency": "usd"
}
}What the fields mean:
amountis the invoicetotal, not the balance still due. On a part-paid invoice it is still the full total; the page the customer opens shows the current balance.currencyis the invoice's currency, orusdwhen none is stored.- The link's host is
app.fieldcamp.ai, or your own link domain when your account has one set up.
The route needs the invoices:read scope. It returns 404 when the invoice
is not on this account, and 400 INTEGRATION_NOT_CONNECTED when Stripe is
not connected and switched on for payments.
paymentUrl is a FieldCamp-hosted invoice page where the customer pays through your connected Stripe account — it is not a Stripe Checkout URL, so there is no stripePaymentIntentId to reconcile against and no expiresAt.
The link is stable and non-expiring: the view token is minted once per invoice and reused, so calling this endpoint again returns the same URL. That is deliberate — a link already sitting in a customer's inbox keeps working. It is safe to call repeatedly, and safe to store.
curl https://api.fieldcamp.ai/api/v1/invoices/$INVOICE_ID/payment-link \
-H "Authorization: Bearer $FIELDCAMP_API_KEY"You can email the same link to the client via two-way text messaging, or embed it in your own customer portal. Stripe handles the card capture; FieldCamp posts the payment back against the invoice automatically and moves paymentStatus from unpaid (or partial) to paid when the balance hits zero. For deposit-style up-front payments, see Deposits and partial payments.
FAQs
Do I have to calculate tax and totals myself?
No. Send the lines, the tax IDs and the discount. FieldCamp computes the tax
amounts, subTotal and total.
How do I mark an invoice as paid?
Record a payment for the balance with POST /api/v1/invoices/{id}/payments.
paymentStatus cannot be set directly.
Can I filter the list by both clientId and status?
Yes. clientId, status and since can be combined.
What happens if Stripe is not connected?
GET /api/v1/invoices/{id}/payment-link returns 400 with code
INTEGRATION_NOT_CONNECTED. Connect Stripe via
Connect Stripe for online payments
and retry.
Troubleshooting
422onsubTotalortotal— the figures you sent differ from the server's. Leave both fields out, or send thecomputedvalue fromerror.details.422 Unknown field(s): paidAmount— payment fields are read-only. Use the payments route.409when voiding — the invoice has a payment recorded, or is already void.sincenot returning new rows —sincematchesupdatedAt, not the invoice date. See Incremental sync.
Endpoints
/api/v1/invoicesAuthorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Query Parameters
Page number, 1-based.
Rows per page. Values above 100 are clamped to 100.
Return only rows whose updatedAt is at or after this ISO-8601 timestamp — the incremental-sync cursor. A value that is not a date returns 400 rather than being ignored.
Order the result as field:direction. Direction is asc or desc (default desc). Sortable fields: createdAt, updatedAt, total, paymentStatus, dueDate, documentNumber. An unsupported field returns 400.
Return only invoices for this client id.
Filter by payment status, matched case-insensitively — paid or unpaid. Matching is on the whole value, so paid never also returns unpaid.
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/invoices"{}/api/v1/invoicesAuthorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/invoices" \ -H "Content-Type: application/json" \ -d '{}'{}/api/v1/invoices/{id}Authorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Response Body
application/json
application/json
curl -X GET "https://example.com/api/v1/invoices/665f1c2ab3e4d5f6a7b8c9d0"{}/api/v1/invoices/{id}Authorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/api/v1/invoices/665f1c2ab3e4d5f6a7b8c9d0" \ -H "Content-Type: application/json" \ -d '{}'{}/api/v1/invoices/{id}Authorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Response Body
application/json
application/json
application/json
curl -X DELETE "https://example.com/api/v1/invoices/665f1c2ab3e4d5f6a7b8c9d0"{}/api/v1/invoices/{id}/paymentsAuthorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Query Parameters
1–100, default 50.
meta.next.cursor of the previous page.
ISO-8601; only rows updated since.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/invoices/665f1c2ab3e4d5f6a7b8c9d0/payments"{ "success": true, "code": "success.created", "message": "Client created successfully", "data": null}/api/v1/invoices/{id}/paymentsAuthorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/invoices/665f1c2ab3e4d5f6a7b8c9d0/payments" \ -H "Content-Type: application/json" \ -d '{ "amount": 0 }'{ "success": true, "code": "success.created", "message": "Client created successfully", "data": null}/api/v1/invoices/{id}/voidAuthorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/invoices/665f1c2ab3e4d5f6a7b8c9d0/void"{ "success": true, "code": "success.created", "message": "Client created successfully", "data": null}/api/v1/invoices/{id}/payment-linkAuthorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Response Body
application/json
application/json
curl -X GET "https://example.com/api/v1/invoices/665f1c2ab3e4d5f6a7b8c9d0/payment-link"{}Related articles
- Authentication
- Errors
- Idempotency
- Rate limits
- Webhooks
- Clients (API)
- Jobs (API)
- Visits (API)
- Items (API)
- Payments (API)
- Taxes (API)
- Creating invoices
- Invoice views and analytics
- Digital signatures on estimates and invoices
- Connect Stripe for online payments
- Deposits and partial payments
- Managing products and services
- Price book and bundles
- Custom dashboards and boards
- Job and visit statuses
- Client detail page
- Two-way text messaging
- Recurring jobs