API reference
Invoices
20 endpoints. Click one to see its parameters, fields and an example. Code samples use the region you pick.
GET/v1/invoicesInvoices you can see (managers: their sites; staff: their own), newest first, with outstanding totals
Invoices you can see (managers: their sites; staff: their own), newest first, with outstanding totals
Query parameters
| Name | Type | Description |
|---|---|---|
status | string | |
customer_id | string | |
location_id | string | |
project_id | string | |
from | string | |
to | string | |
search | string | |
mine | "0" | "1" | "true" | "false" | |
limit | integer | |
cursor | string |
Example
curl "https://ca-api.clocklap.com/v1/invoices" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
POST/v1/invoicesCreate a draft invoice (add_hours_for_date adds that day's unbilled hours as labour; customer quick-creates a client)
Create a draft invoice (add_hours_for_date adds that day's unbilled hours as labour; customer quick-creates a client)
Body (JSON)
| Name | Type | Description |
|---|---|---|
customer_id | string or null | |
customer | object | |
customer.namerequired | string | |
customer.email | string (email) or null | |
customer.phone | string or null | |
customer.address | string or null | |
location_id | string or null | |
project_id | string or null | |
issue_date | string | |
due_date | string | |
currency | "CAD" | "USD" | |
lines | array of object | Default [] |
lines[].id | string | |
lines[].kindrequired | "labour" | "material" | "flat" | "discount" | |
lines[].descriptionrequired | string | |
lines[].qtyrequired | number | |
lines[].unit | string or null | |
lines[].unit_price_centsrequired | integer | |
lines[].tax_code | "taxable" | "exempt" | Default "taxable" |
lines[].time_entry_ids | array of string | |
add_hours_for_date | string | |
notes | string or null | |
tax_profile | object | |
tax_profile.presetrequired | string | |
tax_profile.ratesrequired | array of object | |
client_ref | string |
Example
curl -X POST "https://ca-api.clocklap.com/v1/invoices" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Responses
200
GET/v1/invoices/{id}Get one invoice
Get one invoice
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Example
curl "https://ca-api.clocklap.com/v1/invoices/{id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
PATCH/v1/invoices/{id}Edit a draft (lines, client, dates, taxes); notes, photos and signature can change until it is paid
Edit a draft (lines, client, dates, taxes); notes, photos and signature can change until it is paid
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
customer_id | string or null | |
location_id | string or null | |
project_id | string or null | |
issue_date | string | |
due_date | string | |
currency | "CAD" | "USD" | |
lines | array of object | |
lines[].id | string | |
lines[].kindrequired | "labour" | "material" | "flat" | "discount" | |
lines[].descriptionrequired | string | |
lines[].qtyrequired | number | |
lines[].unit | string or null | |
lines[].unit_price_centsrequired | integer | |
lines[].tax_code | "taxable" | "exempt" | Default "taxable" |
lines[].time_entry_ids | array of string | |
notes | string or null | |
tax_profile | object | |
tax_profile.presetrequired | string | |
tax_profile.ratesrequired | array of object | |
signature_svg | string or null | |
signed_name | string or null | |
media_ids | array of string | |
version | integer |
Example
curl -X PATCH "https://ca-api.clocklap.com/v1/invoices/{id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Responses
200
GET/v1/invoices/{id}/accountingWhere this invoice was sent: one row per accounting connection, with its number and link there
Where this invoice was sent: one row per accounting connection, with its number and link there
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Example
curl "https://ca-api.clocklap.com/v1/invoices/{id}/accounting" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
POST/v1/invoices/{id}/paymentsRecord a cash, cheque, e-transfer, card-terminal or other payment (negative = refund)
Record a cash, cheque, e-transfer, card-terminal or other payment (negative = refund)
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
amount_centsrequired | integer | |
methodrequired | "cash" | "cheque" | "etransfer" | "card_terminal" | "other" | |
paid_at | string (date-time) | |
reference | string or null | |
note | string or null | |
media_id | string or null | |
client_ref | string |
Example
curl -X POST "https://ca-api.clocklap.com/v1/invoices/{id}/payments" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount_cents":2500,"method":"cash"}'Responses
200
GET/v1/invoices/{id}/pdfThe invoice as a PDF
The invoice as a PDF
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Example
curl "https://ca-api.clocklap.com/v1/invoices/{id}/pdf" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
POST/v1/invoices/{id}/sendFinalize and email the invoice with its PDF and payment link (send_email: false = mark sent only)
Finalize and email the invoice with its PDF and payment link (send_email: false = mark sent only)
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
email | string (email) | |
message | string | |
send_email | boolean | Default true |
Example
curl -X POST "https://ca-api.clocklap.com/v1/invoices/{id}/send" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","message":"string","send_email":true}'Responses
200
GET/v1/invoices/{id}/syncThe invoice in the shape accounting connections push
The invoice in the shape accounting connections push
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Example
curl "https://ca-api.clocklap.com/v1/invoices/{id}/sync" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
POST/v1/invoices/{id}/voidVoid (cancel) an invoice. Its number stays used.
Void (cancel) an invoice. Its number stays used.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
reason | string or null |
Example
curl -X POST "https://ca-api.clocklap.com/v1/invoices/{id}/void" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason":"string"}'Responses
200
GET/v1/invoices/contextCan I invoice here? Effective settings, the client, and my unbilled hours for a day at a site/project
Can I invoice here? Effective settings, the client, and my unbilled hours for a day at a site/project
Query parameters
| Name | Type | Description |
|---|---|---|
location_id | string | |
project_id | string | |
date | string |
Example
curl "https://ca-api.clocklap.com/v1/invoices/context" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
GET/v1/invoices/settingsWorkspace invoicing settings, sites and projects with their own, and the next number
Workspace invoicing settings, sites and projects with their own, and the next number
Example
curl "https://ca-api.clocklap.com/v1/invoices/settings" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
PATCH/v1/invoices/settingsChange workspace invoicing settings (numbering, taxes, terms, who can create)
Change workspace invoicing settings (numbering, taxes, terms, who can create)
Body (JSON)
| Name | Type | Description |
|---|---|---|
enabled | boolean | |
who_can_create | "staff" | "managers" | |
default_rate_cents | integer or null | |
currency | "CAD" | "USD" | |
tax_profile | object | |
tax_profile.presetrequired | string | |
tax_profile.ratesrequired | array of object | |
terms_days | integer | |
prefix | string | |
notes | string | |
require_photo | boolean | |
require_signature | boolean |
Example
curl -X PATCH "https://ca-api.clocklap.com/v1/invoices/settings" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Responses
200
PUT/v1/invoices/settings/locations/{id}Invoicing for one location (e.g. {enabled: true}); null = inherit again
Invoicing for one location (e.g. {enabled: true}); null = inherit again
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | string |
Body (JSON)
| Name | Type | Description |
|---|---|---|
enabled | boolean | |
who_can_create | "staff" | "managers" | |
default_rate_cents | integer or null | |
currency | "CAD" | "USD" | |
tax_profile | object or null | |
tax_profile.presetrequired | string | |
tax_profile.ratesrequired | array of object | |
terms_days | integer | |
prefix | string | |
notes | string | |
require_photo | boolean | |
require_signature | boolean |
Example
curl -X PUT "https://ca-api.clocklap.com/v1/invoices/settings/locations/{id}" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Responses
200
GET/v1/payments/settingsOnline payments: whether the workspace's Stripe is connected and can take card payments
Online payments: whether the workspace's Stripe is connected and can take card payments
Example
curl "https://ca-api.clocklap.com/v1/payments/settings" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
DELETE/v1/payments/stripeDisconnect Stripe. Invoices stay; "Pay now" disappears.
Disconnect Stripe. Invoices stay; "Pay now" disappears.
Example
curl -X DELETE "https://ca-api.clocklap.com/v1/payments/stripe" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200
POST/v1/payments/stripe/connectStart connecting the workspace's own Stripe account; open the returned URL
Start connecting the workspace's own Stripe account; open the returned URL
Body (JSON)
| Name | Type | Description |
|---|---|---|
return_url | string (uri) |
Example
curl -X POST "https://ca-api.clocklap.com/v1/payments/stripe/connect" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"return_url":"https://example.com/clocklap-webhook"}'Responses
200
POST/v1/payments/stripe/refreshRe-check the connected Stripe account (after finishing Stripe's steps)
Re-check the connected Stripe account (after finishing Stripe's steps)
Example
curl -X POST "https://ca-api.clocklap.com/v1/payments/stripe/refresh" \
-H "Authorization: Bearer $CLOCKLAP_API_KEY"Responses
200