API reference › Finance › Invoices
Create a new invoice
POST /v1/finance/invoices
- Scope
finance:write- Roles
- admin, scheduler
Creates an invoice. Work items (assignments/shifts) already paid for this client are excluded from services_charges. When duplicating (source_document_id), if the source is paid, amounts are zeroed unless full_copy=true (reverse-and-cancel reissue).
Parameters
None of its own.
Every call also sends Authorization and X-Tenant-ID; see Getting started.
Request body required
25 top-level fields; 9 hold nested fields, listed below.
| Field | Type | Description |
|---|---|---|
override_locks | boolean or null | Edit a paid document past its locks. Send on the retry after a save asks. |
override_reason | object (2 nested) | |
override_reason_text | string or null | max length 1000. |
override_delivery | string or null | One of: |
confirmation | boolean or null | Confirms the resend prompt a save on a sent document raises. |
resend_delivery | string or null | One of: |
overpayment_confirmation | boolean or null | Accept a payment that exceeds the balance due. |
id | string or null | Existing invoice to save. Omit to create. Example |
client_id required | object (2 nested) | The client billed. id is a CLT- user id. |
source_document_id | string or null | Invoice being duplicated. If it is paid (status Paid or balance due <= 0), amounts are zeroed unless full_copy=true. Example |
full_copy | boolean or null | Keep full charges when duplicating a paid invoice (reverse-and-cancel reissue). Example |
billable_entities required | array of object (2 nested) | Work items billed. Work items already paid for this client are left out of the service charges. |
billable_entities_billing | array of object or null (19 nested) | |
line_items | array of object or null (6 nested) | type.id is credit, charges or reimbursement. |
summary | object (9 nested) | Tax type and amount become required when the organization charges tax on invoices. |
status | object (2 nested) | Financial status. id required when saving an existing published invoice. |
payment_terms | object (2 nested) | Required when published. |
issue_date | string (date) or null | Example |
due_date | string (date) or null | Required when published; on or after issue_date. Example |
notes | string or null | Shown to the client. max length 2000. |
internalNotes | string or null | min length 2, max length 2000. |
is_published | boolean or null | Defaults to true. false saves a draft. Example |
documents | array of object or null (10 nested) | |
customFields | object or null | Custom field values keyed by field id. |
externalCustomFields | object or null | Values for the external custom fields, keyed by field id. |
Nested fields
override_reason 2 fields
| Field | Type | Description |
|---|---|---|
override_reason.id | integer or string | Example |
override_reason.label | string or null | Example |
client_id 2 fields
| Field | Type | Description |
|---|---|---|
client_id.id | integer or string | Example |
client_id.label | string or null | Example |
billable_entities 2 fields
| Field | Type | Description |
|---|---|---|
billable_entities[].type required | string | One of: |
billable_entities[].id required | string | Example |
billable_entities_billing 19 fields
| Field | Type | Description |
|---|---|---|
billable_entities_billing[].id required | string | A work item listed in billable_entities. Example |
billable_entities_billing[].billing_mode | string or null | One of: |
billable_entities_billing[].bill_service | boolean or null | |
billable_entities_billing[].bill_expenses | boolean or null | Example |
billable_entities_billing[].bill_admin_fee | boolean or null | Example |
billable_entities_billing[].adminFeeBreakdown | object or null | |
billable_entities_billing[].adminFeeBreakdown.feeSource | string or null | One of: |
billable_entities_billing[].adminFeeBreakdown.clients | array of object or null | |
billable_entities_billing[].adminFeeBreakdown.clients[].id | string or null | Client or provider user id. Example |
billable_entities_billing[].adminFeeBreakdown.clients[].feeSource | string or null | Providers only. One of: |
billable_entities_billing[].adminFeeBreakdown.clients[].method | string or null | One of: |
billable_entities_billing[].adminFeeBreakdown.clients[].value | number or null | min 0. Example |
billable_entities_billing[].adminFeeBreakdown.clients[].source | string or null | Clients only: where the fee was resolved from. One of: |
billable_entities_billing[].adminFeeBreakdown.providers | array of object or null | |
billable_entities_billing[].adminFeeBreakdown.providers[].id | string or null | Client or provider user id. Example |
billable_entities_billing[].adminFeeBreakdown.providers[].feeSource | string or null | Providers only. One of: |
billable_entities_billing[].adminFeeBreakdown.providers[].method | string or null | One of: |
billable_entities_billing[].adminFeeBreakdown.providers[].value | number or null | min 0. Example |
billable_entities_billing[].adminFeeBreakdown.providers[].source | string or null | Clients only: where the fee was resolved from. One of: |
line_items 6 fields
| Field | Type | Description |
|---|---|---|
line_items[].name | string or null | max length 255. Example |
line_items[].description | string or null | max length 1000. |
line_items[].amount required | number | min 0. Example |
line_items[].type | object | The allowed ids depend on the document type. |
line_items[].type.id | string | Example |
line_items[].type.label | string or null | Example |
summary 9 fields
| Field | Type | Description |
|---|---|---|
summary.tax_type | object or null | |
summary.tax_type.id | string | One of: |
summary.tax_type.label | string | Example |
summary.tax_amount | number or null | min 0. Example |
summary.discount_type | object or null | |
summary.discount_type.id | string | One of: |
summary.discount_type.label | string | Example |
summary.discount_amount | number or null | min 0. Example |
summary.payments_applied | number or null | min 0. |
status 2 fields
| Field | Type | Description |
|---|---|---|
status.id | integer or string | Example |
status.label | string or null | Example |
payment_terms 2 fields
| Field | Type | Description |
|---|---|---|
payment_terms.id | integer or string | Example |
payment_terms.label | string or null | Example |
documents 10 fields
| Field | Type | Description |
|---|---|---|
documents[].id | integer or null | Example |
documents[].file | string (binary) or null | The uploaded file. Omit when only the categories or tags of an existing document change. |
documents[].fileName | string or null | Example |
documents[].categories | array of object | Existing categories by |
documents[].categories[].id | integer or string | Example |
documents[].categories[].label | string or null | Example |
documents[].tags | array of object | Existing tags by |
documents[].tags[].id | integer or string | Example |
documents[].tags[].label | string or null | Example |
documents[].isPublic | boolean or null | Visible to the client and consumer, not only to staff. Example |
Example
{
"override_locks": true,
"override_reason": {
"id": 1,
"label": "Example"
},
"override_reason_text": "string",
"override_delivery": "internal_only",
"confirmation": true,
"resend_delivery": "send_updated",
"overpayment_confirmation": true,
"id": "INV-EWDM3W",
"client_id": {
"id": 1,
"label": "Example"
},
"source_document_id": "INV-ABC123",
"full_copy": false,
"billable_entities": [
{
"type": "assignment",
"id": "ASG-YZXCIT"
}
],
"billable_entities_billing": [
{
"id": "ASG-YZXCIT",
"billing_mode": "bill",
"bill_service": true,
"bill_expenses": true,
"bill_admin_fee": true,
"adminFeeBreakdown": {
"feeSource": "calculated",
"clients": [
{
"id": "CLT-N3B72G",
"feeSource": null,
"method": null,
"value": 5,
"source": null
}
],
"providers": [
{
"id": "CLT-N3B72G",
"feeSource": null,
"method": null,
"value": 5,
"source": null
}
]
}
}
],
"line_items": [
{
"name": "Parking reimbursement",
"description": "string",
"amount": 25,
"type": {
"id": "charges",
"label": "Additional Charge"
}
}
],
"summary": {
"tax_type": {
"id": "Percentage",
"label": "Percentage"
},
"tax_amount": 8.25,
"discount_type": {
"id": "Fixed",
"label": "Fixed"
},
"discount_amount": 10,
"payments_applied": 0
},
"status": {
"id": 1,
"label": "Example"
},
"payment_terms": {
"id": 1,
"label": "Example"
},
"issue_date": "2025-01-15",
"due_date": "2025-01-30",
"notes": "string",
"internalNotes": "string",
"is_published": true,
"documents": [
{
"id": 12,
"file": "string",
"fileName": "intake-form.pdf",
"categories": [
{
"id": 1,
"label": "Example"
}
],
"tags": [
{
"id": 1,
"label": "Example"
}
],
"isPublic": false
}
],
"customFields": {},
"externalCustomFields": {}
}Example request
curl -X POST "https://api.fetchfido.ai/v1/finance/invoices" \
-H "Authorization: Bearer $FIDO_API_KEY" \
-H "X-Tenant-ID: $FIDO_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{"override_locks":true,"override_reason":{"id":1,"label":"Example"},"override_reason_text":"string","override_delivery":"internal_only","confirmation":true,"resend_delivery":"send_updated","overpayment_confirmation":true,"id":"INV-EWDM3W","client_id":{"id":1,"label":"Example"},"source_document_id":"INV-ABC123","full_copy":false,"billable_entities":[{"type":"assignment","id":"ASG-YZXCIT"}],"billable_entities_billing":[{"id":"ASG-YZXCIT","billing_mode":"bill","bill_service":true,"bill_expenses":true,"bill_admin_fee":true,"adminFeeBreakdown":{"feeSource":"calculated","clients":[{"id":"CLT-N3B72G","feeSource":null,"method":null,"value":5,"source":null}],"providers":[{"id":"CLT-N3B72G","feeSource":null,"method":null,"value":5,"source":null}]}}],"line_items":[{"name":"Parking reimbursement","description":"string","amount":25,"type":{"id":"charges","label":"Additional Charge"}}],"summary":{"tax_type":{"id":"Percentage","label":"Percentage"},"tax_amount":8.25,"discount_type":{"id":"Fixed","label":"Fixed"},"discount_amount":10,"payments_applied":0},"status":{"id":1,"label":"Example"},"payment_terms":{"id":1,"label":"Example"},"issue_date":"2025-01-15","due_date":"2025-01-30","notes":"string","internalNotes":"string","is_published":true,"documents":[{"id":12,"file":"string","fileName":"intake-form.pdf","categories":[{"id":1,"label":"Example"}],"tags":[{"id":1,"label":"Example"}],"isPublic":false}],"customFields":{},"externalCustomFields":{}}'Try it
Responses
200 Existing invoice saved (id was sent)
Existing invoice saved (id was sent).
{
"success": true,
"message": "Invoice updated successfully.",
"data": {
"id": "INV-EWDM3W"
}
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
data | object | |
data.id | string | Example |
201 Invoice created successfully
Invoice created successfully
{
"success": true,
"message": "Invoice created successfully.",
"data": {
"id": "INV-EWDM3W"
}
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
data | object | |
data.id | string | Example |
401 Not signed in
Missing, invalid or expired API key.
{
"success": false,
"message": "Invalid API key. Org and user tier keys must send an X-Tenant-ID header naming the organization the key was issued for.",
"errors": null,
"code": "API_KEY_MISSING"
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | any or null | Null on this status. |
code | string | Machine-readable reason, for branching on in client code. One of: |
403 Not allowed
The caller may not save this invoice.
{
"success": false,
"message": "You don't have permission to access this endpoint. This API key is missing the 'finance:write' scope.",
"errors": null,
"code": ""
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | any or null | Null on this status. |
code | string | Always empty on this status. Example |
422 Validation failed
Validation error. A status change that needs confirmation also comes back as 422, with requires_confirmation=true and data {current_status, target_status, payment_details}; resend with the confirmation fields to proceed.
{
"success": false,
"message": "Validation failed",
"errors": {
"client_id": [
"Client is required."
]
}
}Response fields (3)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | object |
429 Too many requests
Rate limit exceeded. See Retry-After.
{
"success": false,
"message": "You've exceeded this API key's rate limit of 120 requests per minute. Try again in 37 seconds.",
"errors": null,
"code": "RATE_LIMITED"
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | any or null | Null on this status. |
code | string | Machine-readable reason, for branching on in client code. One of: |
500 Server error
Unexpected error
{
"success": false,
"errors": "Invoice creation failed",
"message": "An unexpected error occurred ? please try again."
}Response fields (3)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
errors | string or null | Null in production. The exception message only when the application runs with debug on. Example |
message | string | Example |
503 The invoice was saved but could not be moved to Sent
The invoice was saved but could not be moved to Sent.
{
"success": false,
"message": "The document could not be set to Sent. Please try again.",
"errors": null,
"code": ""
}Response fields (4)
| Field | Type | Description |
|---|---|---|
success | boolean | Example |
message | string | Example |
errors | string or null | Null in production. The exception message only when the application runs with debug on, so nothing is leaked to an integrator. |
code | string | Always empty: the server-error response carries no error code. Example |