curl --request POST \
--url https://thirdparty.qonto.com/v2/client_invoices/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'client_invoices=<string>' \
--form client_invoices.items='@example-file'import requests
url = "https://thirdparty.qonto.com/v2/client_invoices/bulk"
files = { "client_invoices.items": ("example-file", open("example-file", "rb")) }
payload = { "client_invoices": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('client_invoices', '<string>');
form.append('client_invoices.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://thirdparty.qonto.com/v2/client_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://thirdparty.qonto.com/v2/client_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 => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://thirdparty.qonto.com/v2/client_invoices/bulk"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://thirdparty.qonto.com/v2/client_invoices/bulk")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://thirdparty.qonto.com/v2/client_invoices/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"client_invoices": [
{
"invoice_id": "019c688e-4adc-795b-b0fb-c9be149262dd",
"file_name": "invoice1.pdf"
},
{
"invoice_id": "019c6890-1f2a-7b3c-9d4e-2a1b3c4d5e6f",
"file_name": "invoice2.pdf"
}
]
}{
"errors": [
{
"status": "400",
"code": "bad_request",
"detail": "The request is malformed or contains invalid data"
}
]
}{
"errors": [
{
"status": "401",
"code": "unauthorized",
"detail": "Authentication is required to access this resource"
}
]
}{
"errors": [
{
"status": "403",
"code": "forbidden",
"detail": "You do not have permission to access this resource"
}
]
}{
"errors": [
{
"status": "422",
"code": "invalid",
"detail": "`due_date` should be greater or equal than `issue_date`.",
"source": {
"pointer": "/data/attributes/due_date"
},
"meta": {
"validation_param": "IssueDate"
}
}
]
}{
"errors": [
{
"status": "500",
"code": "internal_server_error",
"detail": "An internal server error occurred while processing the request"
}
]
}Import client invoices in bulk
OAuth scope: client_invoice.write
Imports already-issued client invoices in bulk by uploading their files (1 to 5 per request).
Unlike creating a client invoice, this endpoint does not regenerate the document: the original file you upload is preserved as-is. This makes it the right choice when your ERP or billing system already produces compliant Factur-X invoices that must be transmitted unchanged.
The whole request body is limited to 15 MB, with a maximum of 5 files of 5 MB each per request.
To preserve the embedded XML for e-invoicing in France, upload PDF files that follow the Factur-X standard.
Bulk import is all-or-nothing: if any file in the request is rejected (unsupported format, larger than 5 MB, or more than 5 files), the whole request fails and no invoices are created. Fix the offending file and retry the batch.
Re-importing a file that has already been imported is idempotent: instead of creating a duplicate, the endpoint returns the invoice_id of the existing invoice.
Bulk import is not available to Italian organizations; their requests return 403 Forbidden.
curl --request POST \
--url https://thirdparty.qonto.com/v2/client_invoices/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'client_invoices=<string>' \
--form client_invoices.items='@example-file'import requests
url = "https://thirdparty.qonto.com/v2/client_invoices/bulk"
files = { "client_invoices.items": ("example-file", open("example-file", "rb")) }
payload = { "client_invoices": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('client_invoices', '<string>');
form.append('client_invoices.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://thirdparty.qonto.com/v2/client_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://thirdparty.qonto.com/v2/client_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 => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://thirdparty.qonto.com/v2/client_invoices/bulk"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://thirdparty.qonto.com/v2/client_invoices/bulk")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://thirdparty.qonto.com/v2/client_invoices/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"client_invoices": [
{
"invoice_id": "019c688e-4adc-795b-b0fb-c9be149262dd",
"file_name": "invoice1.pdf"
},
{
"invoice_id": "019c6890-1f2a-7b3c-9d4e-2a1b3c4d5e6f",
"file_name": "invoice2.pdf"
}
]
}{
"errors": [
{
"status": "400",
"code": "bad_request",
"detail": "The request is malformed or contains invalid data"
}
]
}{
"errors": [
{
"status": "401",
"code": "unauthorized",
"detail": "Authentication is required to access this resource"
}
]
}{
"errors": [
{
"status": "403",
"code": "forbidden",
"detail": "You do not have permission to access this resource"
}
]
}{
"errors": [
{
"status": "422",
"code": "invalid",
"detail": "`due_date` should be greater or equal than `issue_date`.",
"source": {
"pointer": "/data/attributes/due_date"
},
"meta": {
"validation_param": "IssueDate"
}
}
]
}{
"errors": [
{
"status": "500",
"code": "internal_server_error",
"detail": "An internal server error occurred while processing the request"
}
]
}Authorizations
Bearer authorization header: Bearer <token>, where <token> is the access token received from the authorization server at the end of the OAuth 2.0 flow.
Headers
Required only for Sandbox API requests; to get one, please sign up to the Developer Portal.
Body
You have to specify multipart form data in order to attach the files to the request. Repeat the client_invoices field once per file. When using curl it will look like this:
curl --location --request POST 'https://thirdparty.qonto.com/v2/client_invoices/bulk' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--form 'client_invoices=@"/path/to/invoice1.pdf"' \
--form 'client_invoices=@"/path/to/invoice2.pdf"'
The invoice files to import (repeat the client_invoices field once per file). Supported formats:
- PDF (.pdf), including Factur-X
- JPEG (.jpeg, .jpg)
- PNG (.png)
Each file must not exceed 5 MB, and the whole request must not exceed 15 MB.
5Response
Returns the list of successfully imported client invoices.
Show child attributes
Show child attributes
Was this page helpful?