Create a draft invoice from line items.
curl --request POST \
--url https://dash.dmly.io/api/v1/invoices \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"contact_id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"currency": "USD",
"issue_date": "2026-06-29",
"due_date": "2026-07-13",
"discount_total": 10,
"client_notes": "Thanks for your business!",
"line_items": [
{
"item_type": "custom",
"name": "Consulting session",
"description": "60-minute strategy call",
"unit_price": 150,
"quantity": 2,
"tax": {
"rate": 20,
"inclusive": false
}
}
]
}
'import requests
url = "https://dash.dmly.io/api/v1/invoices"
payload = {
"contact_id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"currency": "USD",
"issue_date": "2026-06-29",
"due_date": "2026-07-13",
"discount_total": 10,
"client_notes": "Thanks for your business!",
"line_items": [
{
"item_type": "custom",
"name": "Consulting session",
"description": "60-minute strategy call",
"unit_price": 150,
"quantity": 2,
"tax": {
"rate": 20,
"inclusive": False
}
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contact_id: '9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f',
currency: 'USD',
issue_date: '2026-06-29',
due_date: '2026-07-13',
discount_total: 10,
client_notes: 'Thanks for your business!',
line_items: [
{
item_type: 'custom',
name: 'Consulting session',
description: '60-minute strategy call',
unit_price: 150,
quantity: 2,
tax: {rate: 20, inclusive: false}
}
]
})
};
fetch('https://dash.dmly.io/api/v1/invoices', 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://dash.dmly.io/api/v1/invoices",
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([
'contact_id' => '9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f',
'currency' => 'USD',
'issue_date' => '2026-06-29',
'due_date' => '2026-07-13',
'discount_total' => 10,
'client_notes' => 'Thanks for your business!',
'line_items' => [
[
'item_type' => 'custom',
'name' => 'Consulting session',
'description' => '60-minute strategy call',
'unit_price' => 150,
'quantity' => 2,
'tax' => [
'rate' => 20,
'inclusive' => false
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://dash.dmly.io/api/v1/invoices"
payload := strings.NewReader("{\n \"contact_id\": \"9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-06-29\",\n \"due_date\": \"2026-07-13\",\n \"discount_total\": 10,\n \"client_notes\": \"Thanks for your business!\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Consulting session\",\n \"description\": \"60-minute strategy call\",\n \"unit_price\": 150,\n \"quantity\": 2,\n \"tax\": {\n \"rate\": 20,\n \"inclusive\": false\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://dash.dmly.io/api/v1/invoices")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contact_id\": \"9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-06-29\",\n \"due_date\": \"2026-07-13\",\n \"discount_total\": 10,\n \"client_notes\": \"Thanks for your business!\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Consulting session\",\n \"description\": \"60-minute strategy call\",\n \"unit_price\": 150,\n \"quantity\": 2,\n \"tax\": {\n \"rate\": 20,\n \"inclusive\": false\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_id\": \"9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-06-29\",\n \"due_date\": \"2026-07-13\",\n \"discount_total\": 10,\n \"client_notes\": \"Thanks for your business!\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Consulting session\",\n \"description\": \"60-minute strategy call\",\n \"unit_price\": 150,\n \"quantity\": 2,\n \"tax\": {\n \"rate\": 20,\n \"inclusive\": false\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Creates a draft invoice from snapshotted line items via InvoiceService::createFromLineItems. contact_id is the optional contact uuid; supplying it converts the contact to a client. Each line item snapshots name/unit_price/tax at invoice time. Totals are computed server-side. Returns 201 with the created invoice.
POST
/
invoices
Create a draft invoice from line items.
curl --request POST \
--url https://dash.dmly.io/api/v1/invoices \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"contact_id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"currency": "USD",
"issue_date": "2026-06-29",
"due_date": "2026-07-13",
"discount_total": 10,
"client_notes": "Thanks for your business!",
"line_items": [
{
"item_type": "custom",
"name": "Consulting session",
"description": "60-minute strategy call",
"unit_price": 150,
"quantity": 2,
"tax": {
"rate": 20,
"inclusive": false
}
}
]
}
'import requests
url = "https://dash.dmly.io/api/v1/invoices"
payload = {
"contact_id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"currency": "USD",
"issue_date": "2026-06-29",
"due_date": "2026-07-13",
"discount_total": 10,
"client_notes": "Thanks for your business!",
"line_items": [
{
"item_type": "custom",
"name": "Consulting session",
"description": "60-minute strategy call",
"unit_price": 150,
"quantity": 2,
"tax": {
"rate": 20,
"inclusive": False
}
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contact_id: '9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f',
currency: 'USD',
issue_date: '2026-06-29',
due_date: '2026-07-13',
discount_total: 10,
client_notes: 'Thanks for your business!',
line_items: [
{
item_type: 'custom',
name: 'Consulting session',
description: '60-minute strategy call',
unit_price: 150,
quantity: 2,
tax: {rate: 20, inclusive: false}
}
]
})
};
fetch('https://dash.dmly.io/api/v1/invoices', 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://dash.dmly.io/api/v1/invoices",
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([
'contact_id' => '9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f',
'currency' => 'USD',
'issue_date' => '2026-06-29',
'due_date' => '2026-07-13',
'discount_total' => 10,
'client_notes' => 'Thanks for your business!',
'line_items' => [
[
'item_type' => 'custom',
'name' => 'Consulting session',
'description' => '60-minute strategy call',
'unit_price' => 150,
'quantity' => 2,
'tax' => [
'rate' => 20,
'inclusive' => false
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://dash.dmly.io/api/v1/invoices"
payload := strings.NewReader("{\n \"contact_id\": \"9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-06-29\",\n \"due_date\": \"2026-07-13\",\n \"discount_total\": 10,\n \"client_notes\": \"Thanks for your business!\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Consulting session\",\n \"description\": \"60-minute strategy call\",\n \"unit_price\": 150,\n \"quantity\": 2,\n \"tax\": {\n \"rate\": 20,\n \"inclusive\": false\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://dash.dmly.io/api/v1/invoices")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contact_id\": \"9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-06-29\",\n \"due_date\": \"2026-07-13\",\n \"discount_total\": 10,\n \"client_notes\": \"Thanks for your business!\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Consulting session\",\n \"description\": \"60-minute strategy call\",\n \"unit_price\": 150,\n \"quantity\": 2,\n \"tax\": {\n \"rate\": 20,\n \"inclusive\": false\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_id\": \"9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-06-29\",\n \"due_date\": \"2026-07-13\",\n \"discount_total\": 10,\n \"client_notes\": \"Thanks for your business!\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Consulting session\",\n \"description\": \"60-minute strategy call\",\n \"unit_price\": 150,\n \"quantity\": 2,\n \"tax\": {\n \"rate\": 20,\n \"inclusive\": false\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Authorizations
apiKeyAuthbearerAuth
Your workspace API key. It both authenticates the caller and selects the workspace.
Body
application/json
Response
Success.
Was this page helpful?
⌘I

