curl --request POST \
--url https://thirdparty.qonto.com/v2/client_invoices/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form client_invoices_upload='@example-file'import requests
url = "https://thirdparty.qonto.com/v2/client_invoices/uploads"
files = { "client_invoices_upload": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('client_invoices_upload', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://thirdparty.qonto.com/v2/client_invoices/uploads', 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/uploads",
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_upload\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\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/uploads"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices_upload\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\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/uploads")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices_upload\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://thirdparty.qonto.com/v2/client_invoices/uploads")
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_upload\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"data": {
"type": "client_invoices_upload",
"id": "019c688e-4adc-795b-b0fb-c9be149262dd",
"attributes": {
"id": "4d5418bb-bd0d-4df4-865c-c07afab8bb48",
"organization_id": "9f8e7d6c-5b4a-3c2d-1e0f-1a2b3c4d5e6f",
"filename": "invoice_document.pdf",
"content_type": "application/pdf",
"file_size": 524288,
"url": "https://qonto-uploads.s3.eu-central-1.amazonaws.com/uploads/4d5418bb-bd0d-4df4-865c-c07afab8bb48/invoice_document.pdf",
"created_at": "2022-03-04T17:58:30+02:00",
"updated_at": "2022-03-04T17:58:30+02:00"
}
}
}{
"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"
}
]
}Create a client invoice upload
OAuth scope: client_invoice.write
Uploads a file (PDF, JPEG, or PNG) for client invoices or quotes. The uploaded file can later be referenced when creating or updating a client invoice or quote by providing the upload ID.
Qonto does not convert uploaded files to Factur-X format. If you upload a non-Factur-X PDF, it will remain non-Factur-X. To send an invoice via e-invoice in France, make sure the PDF you upload already follows the Factur-X standard, or create the invoice directly on Qonto so Factur-X is generated automatically upon finalization.
curl --request POST \
--url https://thirdparty.qonto.com/v2/client_invoices/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form client_invoices_upload='@example-file'import requests
url = "https://thirdparty.qonto.com/v2/client_invoices/uploads"
files = { "client_invoices_upload": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('client_invoices_upload', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://thirdparty.qonto.com/v2/client_invoices/uploads', 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/uploads",
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_upload\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\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/uploads"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices_upload\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\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/uploads")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_invoices_upload\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://thirdparty.qonto.com/v2/client_invoices/uploads")
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_upload\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"data": {
"type": "client_invoices_upload",
"id": "019c688e-4adc-795b-b0fb-c9be149262dd",
"attributes": {
"id": "4d5418bb-bd0d-4df4-865c-c07afab8bb48",
"organization_id": "9f8e7d6c-5b4a-3c2d-1e0f-1a2b3c4d5e6f",
"filename": "invoice_document.pdf",
"content_type": "application/pdf",
"file_size": 524288,
"url": "https://qonto-uploads.s3.eu-central-1.amazonaws.com/uploads/4d5418bb-bd0d-4df4-865c-c07afab8bb48/invoice_document.pdf",
"created_at": "2022-03-04T17:58:30+02:00",
"updated_at": "2022-03-04T17:58:30+02:00"
}
}
}{
"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
The file to upload. Supported formats:
- PDF (.pdf)
- JPEG (.jpeg, .jpg)
- PNG (.png)
Response
Returns the client invoice upload created.
Show child attributes
Show child attributes
Was this page helpful?