Upload Invoice
{ printf '%s' $'-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n "type": "INVOICE",\n "sellerId": "4711",\n "orderId": "43523-43432-43532",\n "invoiceNumber": "<string>",\n "transactionDate": "2023-11-07T05:31:56Z",\n "taxCalculationDate": "2023-11-07T05:31:56Z",\n "currency": "<string>",\n "billingAddress": {\n "lastName": "Nym",\n "street": "Leyboldstrasse",\n "city": "Hürth",\n "country": "DE",\n "firstName": "Arno",\n "companyName": "<string>",\n "houseNumber": "14a",\n "addition": "1. UG",\n "postcode": "50354",\n "phone": "+49 0221 123456",\n "state": "NRW"\n },\n "originalInvoiceNumber": "<string>",\n "transactionDetails": "<string>",\n "shipmentDate": "2023-11-07T05:31:56Z",\n "exportOutsideEu": true,\n "shipFromCountry": "PL",\n "sellerVatNumber": "<string>",\n "buyerVatNumber": "<string>",\n "orderList": [\n {\n "orderId": "43523-43432-43532",\n "purchasedAt": "2023-11-07T05:31:56Z",\n "transactionItemList": [\n {\n "orderItemId": "<string>",\n "totalGrossPriceWithDiscounts": 1,\n "totalNetPriceWithDiscounts": 1,\n "totalVatAmountWithDiscounts": 1,\n "vatRate": 1,\n "sku": "<string>",\n "title": "<string>",\n "quantity": 1,\n "taxCategory": "INTRA_COMMUNITY_SUPPLY",\n "discounts": [\n {\n "totalGrossPrice": 0,\n "totalNetPrice": 0,\n "totalVatAmount": 0,\n "name": "10% Winter Sale",\n "discountId": "D1265327",\n "vatRate": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename="example-file"\r\n\r\n'; cat -- example-file; printf '%s' $'\r\n-----011000010111000001101001--'; } | curl --request POST \
--url https://scx-sbx.api.jtl-software.com/v1/channel/order/invoice \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/x-www-form-urlencoded; boundary=---011000010111000001101001' \
--data-binary @-import requests
url = "https://scx-sbx.api.jtl-software.com/v1/channel/order/invoice"
payload = b"".join([
"-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n".encode(),
open("example-file", "rb").read(),
"\r\n-----011000010111000001101001--".encode(),
])
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/x-www-form-urlencoded; boundary=---011000010111000001101001"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const fileFor = (name) => {
const input = document.querySelector(`input[type="file"][data-name="${CSS.escape(name)}"]`);
if (!input?.files?.[0]) throw new Error(`Select a file for ${name}`);
return input.files[0];
};
const framedBody = new Blob([
"-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n",
fileFor("example-file"),
"\r\n-----011000010111000001101001--",
]);
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'multipart/x-www-form-urlencoded; boundary=---011000010111000001101001'
},
body: framedBody
};
fetch('https://scx-sbx.api.jtl-software.com/v1/channel/order/invoice', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
$file1 = file_get_contents("example-file");
if ($file1 === false) { throw new RuntimeException("unable to read example-file"); }
$payload = "-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n" . $file1 . "\r\n-----011000010111000001101001--";
curl_setopt_array($curl, [
CURLOPT_URL => "https://scx-sbx.api.jtl-software.com/v1/channel/order/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 => $payload,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/x-www-form-urlencoded; boundary=---011000010111000001101001"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"bytes"
"fmt"
"net/http"
"io"
"os"
)
func main() {
url := "https://scx-sbx.api.jtl-software.com/v1/channel/order/invoice"
var payload bytes.Buffer
payload.WriteString("-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n")
file0, err := os.ReadFile("example-file")
if err != nil {
panic(err)
}
payload.Write(file0)
payload.WriteString("\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, &payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "multipart/x-www-form-urlencoded; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}java.io.ByteArrayOutputStream payload = new java.io.ByteArrayOutputStream();
byte[] part0 = "-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n".getBytes(java.nio.charset.StandardCharsets.UTF_8);
payload.write(part0, 0, part0.length);
byte[] part1 = java.nio.file.Files.readAllBytes(java.nio.file.Paths.get("example-file"));
payload.write(part1, 0, part1.length);
byte[] part2 = "\r\n-----011000010111000001101001--".getBytes(java.nio.charset.StandardCharsets.UTF_8);
payload.write(part2, 0, part2.length);
HttpResponse<String> response = Unirest.post("https://scx-sbx.api.jtl-software.com/v1/channel/order/invoice")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "multipart/x-www-form-urlencoded; boundary=---011000010111000001101001")
.body(payload.toByteArray())
.asString();require 'uri'
require 'net/http'
url = URI("https://scx-sbx.api.jtl-software.com/v1/channel/order/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"] = 'multipart/x-www-form-urlencoded; boundary=---011000010111000001101001'
request.body = [
"-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n",
File.binread("example-file"),
"\r\n-----011000010111000001101001--",
].map(&:b).join
response = http.request(request)
puts response.read_body{
"errorList": [
{
"code": "VAL100",
"message": "Required field sellerId not found",
"severity": "error",
"hint": "Check the field `sellerId` — it must be a non-empty string."
}
]
}{
"errorList": [
{
"code": "GEN404",
"message": "Not found",
"severity": "error",
"hint": null
}
]
}{
"errorList": [
{
"code": "GEN500",
"message": "Internal Server Error",
"severity": "error",
"hint": null
}
]
}Order
Upload Invoice
Upload an invoice document for an order.
The invoice document is mandatory on this endpoint. A request without a document part is rejected
with 400 and error code CHN707. Use POST /v1/channel/order/invoice-data to submit invoice
data without a document.
POST
/
v1
/
channel
/
order
/
invoice
Upload Invoice
{ printf '%s' $'-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n "type": "INVOICE",\n "sellerId": "4711",\n "orderId": "43523-43432-43532",\n "invoiceNumber": "<string>",\n "transactionDate": "2023-11-07T05:31:56Z",\n "taxCalculationDate": "2023-11-07T05:31:56Z",\n "currency": "<string>",\n "billingAddress": {\n "lastName": "Nym",\n "street": "Leyboldstrasse",\n "city": "Hürth",\n "country": "DE",\n "firstName": "Arno",\n "companyName": "<string>",\n "houseNumber": "14a",\n "addition": "1. UG",\n "postcode": "50354",\n "phone": "+49 0221 123456",\n "state": "NRW"\n },\n "originalInvoiceNumber": "<string>",\n "transactionDetails": "<string>",\n "shipmentDate": "2023-11-07T05:31:56Z",\n "exportOutsideEu": true,\n "shipFromCountry": "PL",\n "sellerVatNumber": "<string>",\n "buyerVatNumber": "<string>",\n "orderList": [\n {\n "orderId": "43523-43432-43532",\n "purchasedAt": "2023-11-07T05:31:56Z",\n "transactionItemList": [\n {\n "orderItemId": "<string>",\n "totalGrossPriceWithDiscounts": 1,\n "totalNetPriceWithDiscounts": 1,\n "totalVatAmountWithDiscounts": 1,\n "vatRate": 1,\n "sku": "<string>",\n "title": "<string>",\n "quantity": 1,\n "taxCategory": "INTRA_COMMUNITY_SUPPLY",\n "discounts": [\n {\n "totalGrossPrice": 0,\n "totalNetPrice": 0,\n "totalVatAmount": 0,\n "name": "10% Winter Sale",\n "discountId": "D1265327",\n "vatRate": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename="example-file"\r\n\r\n'; cat -- example-file; printf '%s' $'\r\n-----011000010111000001101001--'; } | curl --request POST \
--url https://scx-sbx.api.jtl-software.com/v1/channel/order/invoice \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/x-www-form-urlencoded; boundary=---011000010111000001101001' \
--data-binary @-import requests
url = "https://scx-sbx.api.jtl-software.com/v1/channel/order/invoice"
payload = b"".join([
"-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n".encode(),
open("example-file", "rb").read(),
"\r\n-----011000010111000001101001--".encode(),
])
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/x-www-form-urlencoded; boundary=---011000010111000001101001"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const fileFor = (name) => {
const input = document.querySelector(`input[type="file"][data-name="${CSS.escape(name)}"]`);
if (!input?.files?.[0]) throw new Error(`Select a file for ${name}`);
return input.files[0];
};
const framedBody = new Blob([
"-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n",
fileFor("example-file"),
"\r\n-----011000010111000001101001--",
]);
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'multipart/x-www-form-urlencoded; boundary=---011000010111000001101001'
},
body: framedBody
};
fetch('https://scx-sbx.api.jtl-software.com/v1/channel/order/invoice', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
$file1 = file_get_contents("example-file");
if ($file1 === false) { throw new RuntimeException("unable to read example-file"); }
$payload = "-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n" . $file1 . "\r\n-----011000010111000001101001--";
curl_setopt_array($curl, [
CURLOPT_URL => "https://scx-sbx.api.jtl-software.com/v1/channel/order/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 => $payload,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/x-www-form-urlencoded; boundary=---011000010111000001101001"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"bytes"
"fmt"
"net/http"
"io"
"os"
)
func main() {
url := "https://scx-sbx.api.jtl-software.com/v1/channel/order/invoice"
var payload bytes.Buffer
payload.WriteString("-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n")
file0, err := os.ReadFile("example-file")
if err != nil {
panic(err)
}
payload.Write(file0)
payload.WriteString("\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, &payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "multipart/x-www-form-urlencoded; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}java.io.ByteArrayOutputStream payload = new java.io.ByteArrayOutputStream();
byte[] part0 = "-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n".getBytes(java.nio.charset.StandardCharsets.UTF_8);
payload.write(part0, 0, part0.length);
byte[] part1 = java.nio.file.Files.readAllBytes(java.nio.file.Paths.get("example-file"));
payload.write(part1, 0, part1.length);
byte[] part2 = "\r\n-----011000010111000001101001--".getBytes(java.nio.charset.StandardCharsets.UTF_8);
payload.write(part2, 0, part2.length);
HttpResponse<String> response = Unirest.post("https://scx-sbx.api.jtl-software.com/v1/channel/order/invoice")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "multipart/x-www-form-urlencoded; boundary=---011000010111000001101001")
.body(payload.toByteArray())
.asString();require 'uri'
require 'net/http'
url = URI("https://scx-sbx.api.jtl-software.com/v1/channel/order/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"] = 'multipart/x-www-form-urlencoded; boundary=---011000010111000001101001'
request.body = [
"-----011000010111000001101001\r\nContent-Type: application/json\r\n\r\n{\n \"type\": \"INVOICE\",\n \"sellerId\": \"4711\",\n \"orderId\": \"43523-43432-43532\",\n \"invoiceNumber\": \"<string>\",\n \"transactionDate\": \"2023-11-07T05:31:56Z\",\n \"taxCalculationDate\": \"2023-11-07T05:31:56Z\",\n \"currency\": \"<string>\",\n \"billingAddress\": {\n \"lastName\": \"Nym\",\n \"street\": \"Leyboldstrasse\",\n \"city\": \"Hürth\",\n \"country\": \"DE\",\n \"firstName\": \"Arno\",\n \"companyName\": \"<string>\",\n \"houseNumber\": \"14a\",\n \"addition\": \"1. UG\",\n \"postcode\": \"50354\",\n \"phone\": \"+49 0221 123456\",\n \"state\": \"NRW\"\n },\n \"originalInvoiceNumber\": \"<string>\",\n \"transactionDetails\": \"<string>\",\n \"shipmentDate\": \"2023-11-07T05:31:56Z\",\n \"exportOutsideEu\": true,\n \"shipFromCountry\": \"PL\",\n \"sellerVatNumber\": \"<string>\",\n \"buyerVatNumber\": \"<string>\",\n \"orderList\": [\n {\n \"orderId\": \"43523-43432-43532\",\n \"purchasedAt\": \"2023-11-07T05:31:56Z\",\n \"transactionItemList\": [\n {\n \"orderItemId\": \"<string>\",\n \"totalGrossPriceWithDiscounts\": 1,\n \"totalNetPriceWithDiscounts\": 1,\n \"totalVatAmountWithDiscounts\": 1,\n \"vatRate\": 1,\n \"sku\": \"<string>\",\n \"title\": \"<string>\",\n \"quantity\": 1,\n \"taxCategory\": \"INTRA_COMMUNITY_SUPPLY\",\n \"discounts\": [\n {\n \"totalGrossPrice\": 0,\n \"totalNetPrice\": 0,\n \"totalVatAmount\": 0,\n \"name\": \"10% Winter Sale\",\n \"discountId\": \"D1265327\",\n \"vatRate\": 0\n }\n ]\n }\n ]\n }\n ]\n}\r\n-----011000010111000001101001\r\nContent-Type: application/pdf\r\nContent-Disposition: attachment; filename=\"example-file\"\r\n\r\n",
File.binread("example-file"),
"\r\n-----011000010111000001101001--",
].map(&:b).join
response = http.request(request)
puts response.read_body{
"errorList": [
{
"code": "VAL100",
"message": "Required field sellerId not found",
"severity": "error",
"hint": "Check the field `sellerId` — it must be a non-empty string."
}
]
}{
"errorList": [
{
"code": "GEN404",
"message": "Not found",
"severity": "error",
"hint": null
}
]
}{
"errorList": [
{
"code": "GEN500",
"message": "Internal Server Error",
"severity": "error",
"hint": null
}
]
}Authorizations
Bearer JWT issued to a seller after they sign up for a JTL-Scx subscription via the JTL
Customer Center. Usage format: Bearer <JWT>.
Body
multipart/x-www-form-urlencoded
Invoice metadata together with the binary PDF document for a marketplace order.
Response
Invoice received
Was this page helpful?