Create a new invoice
curl --request POST \
--url https://api.devdraft.ai/api/v0/invoices \
--header 'Content-Type: application/json' \
--header 'x-client-secret: <api-key>' \
--data '
{
"name": "<string>",
"email": "<string>",
"customer_id": "<string>",
"items": {},
"due_date": "2025-05-20",
"payment_link": true,
"payment_methods": [],
"partial_payment": true,
"address": "<string>",
"phone_number": "<string>",
"send_date": "2025-05-20",
"logo": "<string>",
"taxId": "<string>"
}
'import requests
url = "https://api.devdraft.ai/api/v0/invoices"
payload = {
"name": "<string>",
"email": "<string>",
"customer_id": "<string>",
"items": {},
"due_date": "2025-05-20",
"payment_link": True,
"payment_methods": [],
"partial_payment": True,
"address": "<string>",
"phone_number": "<string>",
"send_date": "2025-05-20",
"logo": "<string>",
"taxId": "<string>"
}
headers = {
"x-client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-client-secret': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: '<string>',
customer_id: '<string>',
items: {},
due_date: '2025-05-20',
payment_link: true,
payment_methods: [],
partial_payment: true,
address: '<string>',
phone_number: '<string>',
send_date: '2025-05-20',
logo: '<string>',
taxId: '<string>'
})
};
fetch('https://api.devdraft.ai/api/v0/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://api.devdraft.ai/api/v0/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([
'name' => '<string>',
'email' => '<string>',
'customer_id' => '<string>',
'items' => [
],
'due_date' => '2025-05-20',
'payment_link' => true,
'payment_methods' => [
],
'partial_payment' => true,
'address' => '<string>',
'phone_number' => '<string>',
'send_date' => '2025-05-20',
'logo' => '<string>',
'taxId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-secret: <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://api.devdraft.ai/api/v0/invoices"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"items\": {},\n \"due_date\": \"2025-05-20\",\n \"payment_link\": true,\n \"payment_methods\": [],\n \"partial_payment\": true,\n \"address\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"send_date\": \"2025-05-20\",\n \"logo\": \"<string>\",\n \"taxId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-secret", "<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://api.devdraft.ai/api/v0/invoices")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"items\": {},\n \"due_date\": \"2025-05-20\",\n \"payment_link\": true,\n \"payment_methods\": [],\n \"partial_payment\": true,\n \"address\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"send_date\": \"2025-05-20\",\n \"logo\": \"<string>\",\n \"taxId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devdraft.ai/api/v0/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"items\": {},\n \"due_date\": \"2025-05-20\",\n \"payment_link\": true,\n \"payment_methods\": [],\n \"partial_payment\": true,\n \"address\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"send_date\": \"2025-05-20\",\n \"logo\": \"<string>\",\n \"taxId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyInvoices
Create a new invoice
POST
/
api
/
v0
/
invoices
Create a new invoice
curl --request POST \
--url https://api.devdraft.ai/api/v0/invoices \
--header 'Content-Type: application/json' \
--header 'x-client-secret: <api-key>' \
--data '
{
"name": "<string>",
"email": "<string>",
"customer_id": "<string>",
"items": {},
"due_date": "2025-05-20",
"payment_link": true,
"payment_methods": [],
"partial_payment": true,
"address": "<string>",
"phone_number": "<string>",
"send_date": "2025-05-20",
"logo": "<string>",
"taxId": "<string>"
}
'import requests
url = "https://api.devdraft.ai/api/v0/invoices"
payload = {
"name": "<string>",
"email": "<string>",
"customer_id": "<string>",
"items": {},
"due_date": "2025-05-20",
"payment_link": True,
"payment_methods": [],
"partial_payment": True,
"address": "<string>",
"phone_number": "<string>",
"send_date": "2025-05-20",
"logo": "<string>",
"taxId": "<string>"
}
headers = {
"x-client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-client-secret': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: '<string>',
customer_id: '<string>',
items: {},
due_date: '2025-05-20',
payment_link: true,
payment_methods: [],
partial_payment: true,
address: '<string>',
phone_number: '<string>',
send_date: '2025-05-20',
logo: '<string>',
taxId: '<string>'
})
};
fetch('https://api.devdraft.ai/api/v0/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://api.devdraft.ai/api/v0/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([
'name' => '<string>',
'email' => '<string>',
'customer_id' => '<string>',
'items' => [
],
'due_date' => '2025-05-20',
'payment_link' => true,
'payment_methods' => [
],
'partial_payment' => true,
'address' => '<string>',
'phone_number' => '<string>',
'send_date' => '2025-05-20',
'logo' => '<string>',
'taxId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-secret: <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://api.devdraft.ai/api/v0/invoices"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"items\": {},\n \"due_date\": \"2025-05-20\",\n \"payment_link\": true,\n \"payment_methods\": [],\n \"partial_payment\": true,\n \"address\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"send_date\": \"2025-05-20\",\n \"logo\": \"<string>\",\n \"taxId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-secret", "<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://api.devdraft.ai/api/v0/invoices")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"items\": {},\n \"due_date\": \"2025-05-20\",\n \"payment_link\": true,\n \"payment_methods\": [],\n \"partial_payment\": true,\n \"address\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"send_date\": \"2025-05-20\",\n \"logo\": \"<string>\",\n \"taxId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devdraft.ai/api/v0/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"items\": {},\n \"due_date\": \"2025-05-20\",\n \"payment_link\": true,\n \"payment_methods\": [],\n \"partial_payment\": true,\n \"address\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"send_date\": \"2025-05-20\",\n \"logo\": \"<string>\",\n \"taxId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
x-client-secretx-client-key
Your secret API key. Keep this secure and never expose it in client-side code.
Body
application/json
Name of the invoice
Email address
Customer ID
Currency for the invoice
Available options:
usdc, eurc Due date of the invoice
Example:
"2025-05-20"
Delivery method
Available options:
EMAIL, MANUALLY Whether to generate a payment link
Array of accepted payment methods
Available options:
ACH, BANK_TRANSFER, CREDIT_CARD, CASH, MOBILE_MONEY, CRYPTO Invoice status
Available options:
DRAFT, OPEN, PASTDUE, PAID, PARTIALLYPAID Allow partial payments
Address
Phone number
Send date
Example:
"2025-05-20"
Logo URL
Tax ID
Response
The invoice has been successfully created.
Was this page helpful?
