curl --request POST \
--url https://api.justpaid.io/api/v1/invoice/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_uuid": "123e4567-e89b-12d3-a456-426614174000",
"line_items": [
{
"name": "Product A",
"unit_price": 100,
"description": "Detailed description of the product or service",
"quantity": 2,
"flat_fee": 10,
"discount_amount": 5,
"discount_percent": 10,
"tax_rate": 10,
"tax_name": "Sales Tax",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"display_order": 2
}
],
"invoice_number": "INV-2024-001",
"invoice_date": "2024-03-21",
"due_date": "2024-04-21",
"currency": "USD",
"description": "Monthly services for March 2024",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"notes": "<string>",
"recipients": [
"<string>"
],
"custom_fields": [
{}
],
"invoice_status": "draft"
}
'import requests
url = "https://api.justpaid.io/api/v1/invoice/"
payload = {
"customer_uuid": "123e4567-e89b-12d3-a456-426614174000",
"line_items": [
{
"name": "Product A",
"unit_price": 100,
"description": "Detailed description of the product or service",
"quantity": 2,
"flat_fee": 10,
"discount_amount": 5,
"discount_percent": 10,
"tax_rate": 10,
"tax_name": "Sales Tax",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"display_order": 2
}
],
"invoice_number": "INV-2024-001",
"invoice_date": "2024-03-21",
"due_date": "2024-04-21",
"currency": "USD",
"description": "Monthly services for March 2024",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"notes": "<string>",
"recipients": ["<string>"],
"custom_fields": [{}],
"invoice_status": "draft"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_uuid: '123e4567-e89b-12d3-a456-426614174000',
line_items: [
{
name: 'Product A',
unit_price: 100,
description: 'Detailed description of the product or service',
quantity: 2,
flat_fee: 10,
discount_amount: 5,
discount_percent: 10,
tax_rate: 10,
tax_name: 'Sales Tax',
service_start_date: '2024-03-01',
service_end_date: '2024-03-31',
display_order: 2
}
],
invoice_number: 'INV-2024-001',
invoice_date: '2024-03-21',
due_date: '2024-04-21',
currency: 'USD',
description: 'Monthly services for March 2024',
service_start_date: '2024-03-01',
service_end_date: '2024-03-31',
notes: '<string>',
recipients: ['<string>'],
custom_fields: [{}],
invoice_status: 'draft'
})
};
fetch('https://api.justpaid.io/api/v1/invoice/', 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.justpaid.io/api/v1/invoice/",
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([
'customer_uuid' => '123e4567-e89b-12d3-a456-426614174000',
'line_items' => [
[
'name' => 'Product A',
'unit_price' => 100,
'description' => 'Detailed description of the product or service',
'quantity' => 2,
'flat_fee' => 10,
'discount_amount' => 5,
'discount_percent' => 10,
'tax_rate' => 10,
'tax_name' => 'Sales Tax',
'service_start_date' => '2024-03-01',
'service_end_date' => '2024-03-31',
'display_order' => 2
]
],
'invoice_number' => 'INV-2024-001',
'invoice_date' => '2024-03-21',
'due_date' => '2024-04-21',
'currency' => 'USD',
'description' => 'Monthly services for March 2024',
'service_start_date' => '2024-03-01',
'service_end_date' => '2024-03-31',
'notes' => '<string>',
'recipients' => [
'<string>'
],
'custom_fields' => [
[
]
],
'invoice_status' => 'draft'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.justpaid.io/api/v1/invoice/"
payload := strings.NewReader("{\n \"customer_uuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"line_items\": [\n {\n \"name\": \"Product A\",\n \"unit_price\": 100,\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n }\n ],\n \"invoice_number\": \"INV-2024-001\",\n \"invoice_date\": \"2024-03-21\",\n \"due_date\": \"2024-04-21\",\n \"currency\": \"USD\",\n \"description\": \"Monthly services for March 2024\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"notes\": \"<string>\",\n \"recipients\": [\n \"<string>\"\n ],\n \"custom_fields\": [\n {}\n ],\n \"invoice_status\": \"draft\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.justpaid.io/api/v1/invoice/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_uuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"line_items\": [\n {\n \"name\": \"Product A\",\n \"unit_price\": 100,\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n }\n ],\n \"invoice_number\": \"INV-2024-001\",\n \"invoice_date\": \"2024-03-21\",\n \"due_date\": \"2024-04-21\",\n \"currency\": \"USD\",\n \"description\": \"Monthly services for March 2024\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"notes\": \"<string>\",\n \"recipients\": [\n \"<string>\"\n ],\n \"custom_fields\": [\n {}\n ],\n \"invoice_status\": \"draft\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.justpaid.io/api/v1/invoice/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_uuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"line_items\": [\n {\n \"name\": \"Product A\",\n \"unit_price\": 100,\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n }\n ],\n \"invoice_number\": \"INV-2024-001\",\n \"invoice_date\": \"2024-03-21\",\n \"due_date\": \"2024-04-21\",\n \"currency\": \"USD\",\n \"description\": \"Monthly services for March 2024\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"notes\": \"<string>\",\n \"recipients\": [\n \"<string>\"\n ],\n \"custom_fields\": [\n {}\n ],\n \"invoice_status\": \"draft\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"invoice_status": "draft",
"amount": 1000,
"currency": "USD",
"invoice_number": "INV-2024-001",
"invoice_date": "2024-03-21",
"due_date": "2024-04-21",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"description": "Monthly services for March 2024",
"created_at": "2024-03-21T10:00:00Z",
"is_recurring": false,
"from_external_source": false,
"external_source": "stripe",
"external_source_id": "inv_123456",
"payment_link": "https://app.justpaid.ai/portal/inv/123",
"line_items": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"unit_price": 123,
"quantity": 1,
"amount": 123,
"currency": "USD",
"description": "<string>",
"flat_fee": 123,
"tax_rate": 0,
"tax_amount": 0,
"tax_name": "<string>",
"discount_amount": 123,
"discount_percent": 123,
"service_start_date": "2023-12-25",
"service_end_date": "2023-12-25",
"display_order": 123
}
],
"file_url": "https://api.justpaid.ai/invoices/123.pdf",
"customer": {
"external_id": "CUST-001",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"contact_name": "<string>",
"email": "<string>",
"additional_emails": [
"<unknown>"
],
"billing_emails": [
"<unknown>"
],
"phone_number": "<string>",
"currency": "USD",
"tax_id": "<string>"
}
}{}{}Invoice Create Api
Creates a new invoice with line items. PDF is auto-generated.
curl --request POST \
--url https://api.justpaid.io/api/v1/invoice/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_uuid": "123e4567-e89b-12d3-a456-426614174000",
"line_items": [
{
"name": "Product A",
"unit_price": 100,
"description": "Detailed description of the product or service",
"quantity": 2,
"flat_fee": 10,
"discount_amount": 5,
"discount_percent": 10,
"tax_rate": 10,
"tax_name": "Sales Tax",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"display_order": 2
}
],
"invoice_number": "INV-2024-001",
"invoice_date": "2024-03-21",
"due_date": "2024-04-21",
"currency": "USD",
"description": "Monthly services for March 2024",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"notes": "<string>",
"recipients": [
"<string>"
],
"custom_fields": [
{}
],
"invoice_status": "draft"
}
'import requests
url = "https://api.justpaid.io/api/v1/invoice/"
payload = {
"customer_uuid": "123e4567-e89b-12d3-a456-426614174000",
"line_items": [
{
"name": "Product A",
"unit_price": 100,
"description": "Detailed description of the product or service",
"quantity": 2,
"flat_fee": 10,
"discount_amount": 5,
"discount_percent": 10,
"tax_rate": 10,
"tax_name": "Sales Tax",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"display_order": 2
}
],
"invoice_number": "INV-2024-001",
"invoice_date": "2024-03-21",
"due_date": "2024-04-21",
"currency": "USD",
"description": "Monthly services for March 2024",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"notes": "<string>",
"recipients": ["<string>"],
"custom_fields": [{}],
"invoice_status": "draft"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_uuid: '123e4567-e89b-12d3-a456-426614174000',
line_items: [
{
name: 'Product A',
unit_price: 100,
description: 'Detailed description of the product or service',
quantity: 2,
flat_fee: 10,
discount_amount: 5,
discount_percent: 10,
tax_rate: 10,
tax_name: 'Sales Tax',
service_start_date: '2024-03-01',
service_end_date: '2024-03-31',
display_order: 2
}
],
invoice_number: 'INV-2024-001',
invoice_date: '2024-03-21',
due_date: '2024-04-21',
currency: 'USD',
description: 'Monthly services for March 2024',
service_start_date: '2024-03-01',
service_end_date: '2024-03-31',
notes: '<string>',
recipients: ['<string>'],
custom_fields: [{}],
invoice_status: 'draft'
})
};
fetch('https://api.justpaid.io/api/v1/invoice/', 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.justpaid.io/api/v1/invoice/",
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([
'customer_uuid' => '123e4567-e89b-12d3-a456-426614174000',
'line_items' => [
[
'name' => 'Product A',
'unit_price' => 100,
'description' => 'Detailed description of the product or service',
'quantity' => 2,
'flat_fee' => 10,
'discount_amount' => 5,
'discount_percent' => 10,
'tax_rate' => 10,
'tax_name' => 'Sales Tax',
'service_start_date' => '2024-03-01',
'service_end_date' => '2024-03-31',
'display_order' => 2
]
],
'invoice_number' => 'INV-2024-001',
'invoice_date' => '2024-03-21',
'due_date' => '2024-04-21',
'currency' => 'USD',
'description' => 'Monthly services for March 2024',
'service_start_date' => '2024-03-01',
'service_end_date' => '2024-03-31',
'notes' => '<string>',
'recipients' => [
'<string>'
],
'custom_fields' => [
[
]
],
'invoice_status' => 'draft'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.justpaid.io/api/v1/invoice/"
payload := strings.NewReader("{\n \"customer_uuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"line_items\": [\n {\n \"name\": \"Product A\",\n \"unit_price\": 100,\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n }\n ],\n \"invoice_number\": \"INV-2024-001\",\n \"invoice_date\": \"2024-03-21\",\n \"due_date\": \"2024-04-21\",\n \"currency\": \"USD\",\n \"description\": \"Monthly services for March 2024\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"notes\": \"<string>\",\n \"recipients\": [\n \"<string>\"\n ],\n \"custom_fields\": [\n {}\n ],\n \"invoice_status\": \"draft\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.justpaid.io/api/v1/invoice/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_uuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"line_items\": [\n {\n \"name\": \"Product A\",\n \"unit_price\": 100,\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n }\n ],\n \"invoice_number\": \"INV-2024-001\",\n \"invoice_date\": \"2024-03-21\",\n \"due_date\": \"2024-04-21\",\n \"currency\": \"USD\",\n \"description\": \"Monthly services for March 2024\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"notes\": \"<string>\",\n \"recipients\": [\n \"<string>\"\n ],\n \"custom_fields\": [\n {}\n ],\n \"invoice_status\": \"draft\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.justpaid.io/api/v1/invoice/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_uuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"line_items\": [\n {\n \"name\": \"Product A\",\n \"unit_price\": 100,\n \"description\": \"Detailed description of the product or service\",\n \"quantity\": 2,\n \"flat_fee\": 10,\n \"discount_amount\": 5,\n \"discount_percent\": 10,\n \"tax_rate\": 10,\n \"tax_name\": \"Sales Tax\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"display_order\": 2\n }\n ],\n \"invoice_number\": \"INV-2024-001\",\n \"invoice_date\": \"2024-03-21\",\n \"due_date\": \"2024-04-21\",\n \"currency\": \"USD\",\n \"description\": \"Monthly services for March 2024\",\n \"service_start_date\": \"2024-03-01\",\n \"service_end_date\": \"2024-03-31\",\n \"notes\": \"<string>\",\n \"recipients\": [\n \"<string>\"\n ],\n \"custom_fields\": [\n {}\n ],\n \"invoice_status\": \"draft\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"invoice_status": "draft",
"amount": 1000,
"currency": "USD",
"invoice_number": "INV-2024-001",
"invoice_date": "2024-03-21",
"due_date": "2024-04-21",
"service_start_date": "2024-03-01",
"service_end_date": "2024-03-31",
"description": "Monthly services for March 2024",
"created_at": "2024-03-21T10:00:00Z",
"is_recurring": false,
"from_external_source": false,
"external_source": "stripe",
"external_source_id": "inv_123456",
"payment_link": "https://app.justpaid.ai/portal/inv/123",
"line_items": [
{
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"unit_price": 123,
"quantity": 1,
"amount": 123,
"currency": "USD",
"description": "<string>",
"flat_fee": 123,
"tax_rate": 0,
"tax_amount": 0,
"tax_name": "<string>",
"discount_amount": 123,
"discount_percent": 123,
"service_start_date": "2023-12-25",
"service_end_date": "2023-12-25",
"display_order": 123
}
],
"file_url": "https://api.justpaid.ai/invoices/123.pdf",
"customer": {
"external_id": "CUST-001",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"contact_name": "<string>",
"email": "<string>",
"additional_emails": [
"<unknown>"
],
"billing_emails": [
"<unknown>"
],
"phone_number": "<string>",
"currency": "USD",
"tax_id": "<string>"
}
}{}{}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Input schema for creating an invoice.
UUID of the customer (required, must exist)
"123e4567-e89b-12d3-a456-426614174000"
Invoice line items (at least one required)
1Show child attributes
Show child attributes
Unique invoice number (auto-generated if not provided)
100"INV-2024-001"
Invoice date (defaults to today)
"2024-03-21"
Payment due date
"2024-04-21"
ISO 4217 currency code
"USD"
Invoice description
"Monthly services for March 2024"
Service period start date
"2024-03-01"
Service period end date
"2024-03-31"
Internal notes for the invoice
Additional email recipients
Custom fields as list of {field_name, field_value}
Initial invoice status (draft, ready-to-send, or sent)
"draft"
Response
Invoice created successfully
Output schema for invoice information.
The unique identifier for the invoice
"123e4567-e89b-12d3-a456-426614174000"
The current status of the invoice
"draft"
The total amount due for the invoice
1000
The currency code for the invoice
"USD"
The unique invoice number
"INV-2024-001"
The date when the invoice was created
"2024-03-21"
The date by which the invoice must be paid
"2024-04-21"
The start date of the service period
"2024-03-01"
The end date of the service period
"2024-03-31"
A description of the invoice
"Monthly services for March 2024"
The timestamp when the invoice was created
"2024-03-21T10:00:00Z"
Indicates if this is a recurring invoice
false
Indicates if the invoice was created from an external source
false
The name of the external source if applicable
"stripe"
The ID of the invoice in the external system
"inv_123456"
URL where the customer can pay this invoice
"https://app.justpaid.ai/portal/inv/123"
List of line items included in this invoice
Show child attributes
Show child attributes
URL to download the invoice PDF
"https://api.justpaid.ai/invoices/123.pdf"
Details of the customer associated with this invoice
Show child attributes
Show child attributes
Was this page helpful?
