curl --request POST \
--url https://dash.dmly.io/api/v1/invoices/bulk \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"segment_id": "5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b",
"currency": "USD",
"issue_date": "2026-09-01",
"due_date": "2026-09-15",
"client_notes": "Autumn term tuition.",
"line_items": [
{
"item_type": "custom",
"name": "Autumn term tuition",
"unit_price": 450,
"quantity": 1
}
],
"send": true,
"run_automations": true
}
'import requests
url = "https://dash.dmly.io/api/v1/invoices/bulk"
payload = {
"segment_id": "5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b",
"currency": "USD",
"issue_date": "2026-09-01",
"due_date": "2026-09-15",
"client_notes": "Autumn term tuition.",
"line_items": [
{
"item_type": "custom",
"name": "Autumn term tuition",
"unit_price": 450,
"quantity": 1
}
],
"send": True,
"run_automations": True
}
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({
segment_id: '5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b',
currency: 'USD',
issue_date: '2026-09-01',
due_date: '2026-09-15',
client_notes: 'Autumn term tuition.',
line_items: [
{item_type: 'custom', name: 'Autumn term tuition', unit_price: 450, quantity: 1}
],
send: true,
run_automations: true
})
};
fetch('https://dash.dmly.io/api/v1/invoices/bulk', 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/bulk",
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([
'segment_id' => '5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b',
'currency' => 'USD',
'issue_date' => '2026-09-01',
'due_date' => '2026-09-15',
'client_notes' => 'Autumn term tuition.',
'line_items' => [
[
'item_type' => 'custom',
'name' => 'Autumn term tuition',
'unit_price' => 450,
'quantity' => 1
]
],
'send' => true,
'run_automations' => true
]),
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/bulk"
payload := strings.NewReader("{\n \"segment_id\": \"5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-09-01\",\n \"due_date\": \"2026-09-15\",\n \"client_notes\": \"Autumn term tuition.\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Autumn term tuition\",\n \"unit_price\": 450,\n \"quantity\": 1\n }\n ],\n \"send\": true,\n \"run_automations\": true\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/bulk")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"segment_id\": \"5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-09-01\",\n \"due_date\": \"2026-09-15\",\n \"client_notes\": \"Autumn term tuition.\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Autumn term tuition\",\n \"unit_price\": 450,\n \"quantity\": 1\n }\n ],\n \"send\": true,\n \"run_automations\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/invoices/bulk")
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 \"segment_id\": \"5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-09-01\",\n \"due_date\": \"2026-09-15\",\n \"client_notes\": \"Autumn term tuition.\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Autumn term tuition\",\n \"unit_price\": 450,\n \"quantity\": 1\n }\n ],\n \"send\": true,\n \"run_automations\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Create one invoice per contact in an audience (bulk).
Bills a whole class, segment, tag or list of contacts with the same line items: one invoice per contact, each with its own number from the workspace sequence. Name exactly one audience: contact_ids (up to 1000 contact uuids), segment_id (a segment uuid), tag (a tag uuid or name) or class_session_id (a class session uuid; its roster is everyone booked, attended or marked no-show). line_items, currency, dates, client_notes and discount_total take the same shape as POST /invoices. The run is queued and returns 202 with its summary, whose id you poll on the retrieve-a-bulk-run endpoint. Contacts that no longer exist are skipped and listed with a reason. With send true, each invoice is posted and delivered on WhatsApp, else SMS, else email (or on the channels you name), under the same opt-out and template rules as sending one invoice; anyone not reached is listed under not_delivered. Each invoice fires its invoice.created (and, when sent, invoice.sent) event from a background job, once per invoice: webhooks always hear it, and run_automations (default true) decides whether the workspace automations for those events start. Pass run_automations false to raise the run without them. A retried run never raises a second invoice for a contact, and never fires an invoice event twice.
curl --request POST \
--url https://dash.dmly.io/api/v1/invoices/bulk \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"segment_id": "5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b",
"currency": "USD",
"issue_date": "2026-09-01",
"due_date": "2026-09-15",
"client_notes": "Autumn term tuition.",
"line_items": [
{
"item_type": "custom",
"name": "Autumn term tuition",
"unit_price": 450,
"quantity": 1
}
],
"send": true,
"run_automations": true
}
'import requests
url = "https://dash.dmly.io/api/v1/invoices/bulk"
payload = {
"segment_id": "5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b",
"currency": "USD",
"issue_date": "2026-09-01",
"due_date": "2026-09-15",
"client_notes": "Autumn term tuition.",
"line_items": [
{
"item_type": "custom",
"name": "Autumn term tuition",
"unit_price": 450,
"quantity": 1
}
],
"send": True,
"run_automations": True
}
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({
segment_id: '5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b',
currency: 'USD',
issue_date: '2026-09-01',
due_date: '2026-09-15',
client_notes: 'Autumn term tuition.',
line_items: [
{item_type: 'custom', name: 'Autumn term tuition', unit_price: 450, quantity: 1}
],
send: true,
run_automations: true
})
};
fetch('https://dash.dmly.io/api/v1/invoices/bulk', 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/bulk",
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([
'segment_id' => '5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b',
'currency' => 'USD',
'issue_date' => '2026-09-01',
'due_date' => '2026-09-15',
'client_notes' => 'Autumn term tuition.',
'line_items' => [
[
'item_type' => 'custom',
'name' => 'Autumn term tuition',
'unit_price' => 450,
'quantity' => 1
]
],
'send' => true,
'run_automations' => true
]),
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/bulk"
payload := strings.NewReader("{\n \"segment_id\": \"5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-09-01\",\n \"due_date\": \"2026-09-15\",\n \"client_notes\": \"Autumn term tuition.\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Autumn term tuition\",\n \"unit_price\": 450,\n \"quantity\": 1\n }\n ],\n \"send\": true,\n \"run_automations\": true\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/bulk")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"segment_id\": \"5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-09-01\",\n \"due_date\": \"2026-09-15\",\n \"client_notes\": \"Autumn term tuition.\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Autumn term tuition\",\n \"unit_price\": 450,\n \"quantity\": 1\n }\n ],\n \"send\": true,\n \"run_automations\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/invoices/bulk")
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 \"segment_id\": \"5b2a8f0e-1c3d-4e5f-9a7b-6c8d0e1f2a3b\",\n \"currency\": \"USD\",\n \"issue_date\": \"2026-09-01\",\n \"due_date\": \"2026-09-15\",\n \"client_notes\": \"Autumn term tuition.\",\n \"line_items\": [\n {\n \"item_type\": \"custom\",\n \"name\": \"Autumn term tuition\",\n \"unit_price\": 450,\n \"quantity\": 1\n }\n ],\n \"send\": true,\n \"run_automations\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Authorizations
Body
Response
Accepted. The run is queued; the body is its summary.
Was this page helpful?

