Create an invoice (draft)
curl --request POST \
--url http://localhost/v1/invoices/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customerName": "<string>",
"lines": [
{
"description": "<string>",
"quantity": "<string>",
"unitPrice": "<string>",
"taxRateBps": 0
}
],
"customerEmail": "jsmith@example.com",
"customerCountry": "<string>",
"dueDate": "2023-11-07T05:31:56Z",
"notes": "<string>"
}
'import requests
url = "http://localhost/v1/invoices/"
payload = {
"customerName": "<string>",
"lines": [
{
"description": "<string>",
"quantity": "<string>",
"unitPrice": "<string>",
"taxRateBps": 0
}
],
"customerEmail": "jsmith@example.com",
"customerCountry": "<string>",
"dueDate": "2023-11-07T05:31:56Z",
"notes": "<string>"
}
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({
customerName: '<string>',
lines: [
{
description: '<string>',
quantity: '<string>',
unitPrice: '<string>',
taxRateBps: 0
}
],
customerEmail: 'jsmith@example.com',
customerCountry: '<string>',
dueDate: '2023-11-07T05:31:56Z',
notes: '<string>'
})
};
fetch('http://localhost/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 => "http://localhost/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([
'customerName' => '<string>',
'lines' => [
[
'description' => '<string>',
'quantity' => '<string>',
'unitPrice' => '<string>',
'taxRateBps' => 0
]
],
'customerEmail' => 'jsmith@example.com',
'customerCountry' => '<string>',
'dueDate' => '2023-11-07T05:31:56Z',
'notes' => '<string>'
]),
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 := "http://localhost/v1/invoices/"
payload := strings.NewReader("{\n \"customerName\": \"<string>\",\n \"lines\": [\n {\n \"description\": \"<string>\",\n \"quantity\": \"<string>\",\n \"unitPrice\": \"<string>\",\n \"taxRateBps\": 0\n }\n ],\n \"customerEmail\": \"jsmith@example.com\",\n \"customerCountry\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\"\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("http://localhost/v1/invoices/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customerName\": \"<string>\",\n \"lines\": [\n {\n \"description\": \"<string>\",\n \"quantity\": \"<string>\",\n \"unitPrice\": \"<string>\",\n \"taxRateBps\": 0\n }\n ],\n \"customerEmail\": \"jsmith@example.com\",\n \"customerCountry\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/v1/invoices/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerName\": \"<string>\",\n \"lines\": [\n {\n \"description\": \"<string>\",\n \"quantity\": \"<string>\",\n \"unitPrice\": \"<string>\",\n \"taxRateBps\": 0\n }\n ],\n \"customerEmail\": \"jsmith@example.com\",\n \"customerCountry\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"id": "<string>",
"number": "<string>",
"customerName": "<string>",
"customerEmail": "<string>",
"total": "<string>",
"amountPaid": "<string>",
"issueDate": "<string>",
"dueDate": "<string>",
"customerCountry": "<string>",
"subtotal": "<string>",
"taxAmount": "<string>",
"notes": "<string>",
"paymentUrl": "<string>",
"paidAt": "<string>",
"lines": [
{
"id": "<string>",
"description": "<string>",
"quantity": "<string>",
"unitPrice": "<string>",
"taxRateBps": 123,
"total": "<string>"
}
],
"feeBps": 123,
"feeFixedEUR": "<string>",
"feeAmount": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}invoices
Create an invoice (draft)
POST
/
v1
/
invoices
/
Create an invoice (draft)
curl --request POST \
--url http://localhost/v1/invoices/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customerName": "<string>",
"lines": [
{
"description": "<string>",
"quantity": "<string>",
"unitPrice": "<string>",
"taxRateBps": 0
}
],
"customerEmail": "jsmith@example.com",
"customerCountry": "<string>",
"dueDate": "2023-11-07T05:31:56Z",
"notes": "<string>"
}
'import requests
url = "http://localhost/v1/invoices/"
payload = {
"customerName": "<string>",
"lines": [
{
"description": "<string>",
"quantity": "<string>",
"unitPrice": "<string>",
"taxRateBps": 0
}
],
"customerEmail": "jsmith@example.com",
"customerCountry": "<string>",
"dueDate": "2023-11-07T05:31:56Z",
"notes": "<string>"
}
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({
customerName: '<string>',
lines: [
{
description: '<string>',
quantity: '<string>',
unitPrice: '<string>',
taxRateBps: 0
}
],
customerEmail: 'jsmith@example.com',
customerCountry: '<string>',
dueDate: '2023-11-07T05:31:56Z',
notes: '<string>'
})
};
fetch('http://localhost/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 => "http://localhost/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([
'customerName' => '<string>',
'lines' => [
[
'description' => '<string>',
'quantity' => '<string>',
'unitPrice' => '<string>',
'taxRateBps' => 0
]
],
'customerEmail' => 'jsmith@example.com',
'customerCountry' => '<string>',
'dueDate' => '2023-11-07T05:31:56Z',
'notes' => '<string>'
]),
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 := "http://localhost/v1/invoices/"
payload := strings.NewReader("{\n \"customerName\": \"<string>\",\n \"lines\": [\n {\n \"description\": \"<string>\",\n \"quantity\": \"<string>\",\n \"unitPrice\": \"<string>\",\n \"taxRateBps\": 0\n }\n ],\n \"customerEmail\": \"jsmith@example.com\",\n \"customerCountry\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\"\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("http://localhost/v1/invoices/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customerName\": \"<string>\",\n \"lines\": [\n {\n \"description\": \"<string>\",\n \"quantity\": \"<string>\",\n \"unitPrice\": \"<string>\",\n \"taxRateBps\": 0\n }\n ],\n \"customerEmail\": \"jsmith@example.com\",\n \"customerCountry\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/v1/invoices/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerName\": \"<string>\",\n \"lines\": [\n {\n \"description\": \"<string>\",\n \"quantity\": \"<string>\",\n \"unitPrice\": \"<string>\",\n \"taxRateBps\": 0\n }\n ],\n \"customerEmail\": \"jsmith@example.com\",\n \"customerCountry\": \"<string>\",\n \"dueDate\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"id": "<string>",
"number": "<string>",
"customerName": "<string>",
"customerEmail": "<string>",
"total": "<string>",
"amountPaid": "<string>",
"issueDate": "<string>",
"dueDate": "<string>",
"customerCountry": "<string>",
"subtotal": "<string>",
"taxAmount": "<string>",
"notes": "<string>",
"paymentUrl": "<string>",
"paidAt": "<string>",
"lines": [
{
"id": "<string>",
"description": "<string>",
"quantity": "<string>",
"unitPrice": "<string>",
"taxRateBps": 123,
"total": "<string>"
}
],
"feeBps": 123,
"feeFixedEUR": "<string>",
"feeAmount": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
bearerAuthcookieAuth
JWT utilisateur ou clé API kp_<env>_xxx
Body
application/json
Required string length:
1 - 180Available options:
XOF, XAF, NGN, GHS, CDF, EUR, USD, USDC, USDT Required array length:
1 - 50 elementsShow child attributes
Show child attributes
Required string length:
2Maximum string length:
2000⌘I
