curl --request PATCH \
--url https://api.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"internalComment": "<string>",
"externalOrderNumber": "<string>",
"referenceOrderNumber": "<string>",
"requestedDeliveryDate": "2023-11-07T05:31:56Z",
"isConfirmed": true
}
'import requests
url = "https://api.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}"
payload = {
"internalComment": "<string>",
"externalOrderNumber": "<string>",
"referenceOrderNumber": "<string>",
"requestedDeliveryDate": "2023-11-07T05:31:56Z",
"isConfirmed": True
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
internalComment: '<string>',
externalOrderNumber: '<string>',
referenceOrderNumber: '<string>',
requestedDeliveryDate: '2023-11-07T05:31:56Z',
isConfirmed: true
})
};
fetch('https://api.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}', 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.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'internalComment' => '<string>',
'externalOrderNumber' => '<string>',
'referenceOrderNumber' => '<string>',
'requestedDeliveryDate' => '2023-11-07T05:31:56Z',
'isConfirmed' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}"
payload := strings.NewReader("{\n \"internalComment\": \"<string>\",\n \"externalOrderNumber\": \"<string>\",\n \"referenceOrderNumber\": \"<string>\",\n \"requestedDeliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isConfirmed\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
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.patch("https://api.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"internalComment\": \"<string>\",\n \"externalOrderNumber\": \"<string>\",\n \"referenceOrderNumber\": \"<string>\",\n \"requestedDeliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isConfirmed\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"internalComment\": \"<string>\",\n \"externalOrderNumber\": \"<string>\",\n \"referenceOrderNumber\": \"<string>\",\n \"requestedDeliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isConfirmed\": true\n}"
response = http.request(request)
puts response.read_body{
"purchaseOrderId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"supplierId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"status": 0,
"currencyIso": "<string>",
"currencyFactor": 123,
"isConfirmed": true,
"lineItems": [
{
"lineItemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItemType": 0,
"quantity": 123,
"deliveredQuantity": 123,
"openQuantity": 123,
"netPurchasePriceAmount": 123,
"vatRatePercentage": 123,
"sortOrder": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"itemNumber": "<string>",
"supplierItemNumber": "<string>",
"name": "<string>",
"supplierItemName": "<string>",
"deliveryTimeInDays": 123,
"deliveryDate": "2023-11-07T05:31:56Z",
"note": "<string>",
"packagingUnit": "<string>",
"packagingQuantity": 123,
"confirmedQuantity": 123,
"confirmedDeliveryDate": "2023-11-07T05:31:56Z",
"confirmedPrice": 123,
"isLineItemConfirmed": true
}
],
"supplierName": "<string>",
"orderNumber": "<string>",
"externalOrderNumber": "<string>",
"referenceOrderNumber": "<string>",
"requestedDeliveryDate": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"warehouseId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"internalComment": "<string>",
"deliveryAddress": {
"salutation": "<string>",
"title": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"companyName": "<string>",
"additionalCompanyLine": "<string>",
"street": "<string>",
"additionalAddressLine": "<string>",
"postalCode": "<string>",
"city": "<string>",
"state": "<string>",
"countryIso": "<string>",
"phoneNumber": "<string>",
"faxNumber": "<string>",
"mobilePhoneNumber": "<string>",
"emailAddress": "<string>"
},
"billingAddress": {
"salutation": "<string>",
"title": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"companyName": "<string>",
"additionalCompanyLine": "<string>",
"street": "<string>",
"additionalAddressLine": "<string>",
"postalCode": "<string>",
"city": "<string>",
"state": "<string>",
"countryIso": "<string>",
"phoneNumber": "<string>",
"faxNumber": "<string>",
"mobilePhoneNumber": "<string>",
"emailAddress": "<string>"
},
"supplier": {
"companyName": "<string>",
"additionalCompanyLine": "<string>",
"street": "<string>",
"additionalAddressLine": "<string>",
"postalCode": "<string>",
"city": "<string>",
"state": "<string>",
"countryIso": "<string>",
"phoneNumber": "<string>",
"faxNumber": "<string>",
"mobilePhoneNumber": "<string>",
"emailAddress": "<string>",
"contactSalutation": "<string>",
"contactFirstName": "<string>",
"contactLastName": "<string>"
}
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}Update Purchase Order
Patches an existing purchase order’s header: editable fields and a status transition, in any combination. Every field is optional — an omitted field leaves its column unchanged. Field editability depends on the order’s status (structural fields only while Open or Released, confirmation fields in every status except Completed, annotations always) and is evaluated against the status BEFORE any transition requested in the same call. LINE ITEMS ARE NOT PART OF THIS ENDPOINT: they are addressed individually through purchase-orders//line-items, one operation per position. Returns the full re-queried order, so the caller sees the side effects the write triggers.
curl --request PATCH \
--url https://api.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"internalComment": "<string>",
"externalOrderNumber": "<string>",
"referenceOrderNumber": "<string>",
"requestedDeliveryDate": "2023-11-07T05:31:56Z",
"isConfirmed": true
}
'import requests
url = "https://api.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}"
payload = {
"internalComment": "<string>",
"externalOrderNumber": "<string>",
"referenceOrderNumber": "<string>",
"requestedDeliveryDate": "2023-11-07T05:31:56Z",
"isConfirmed": True
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
internalComment: '<string>',
externalOrderNumber: '<string>',
referenceOrderNumber: '<string>',
requestedDeliveryDate: '2023-11-07T05:31:56Z',
isConfirmed: true
})
};
fetch('https://api.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}', 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.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'internalComment' => '<string>',
'externalOrderNumber' => '<string>',
'referenceOrderNumber' => '<string>',
'requestedDeliveryDate' => '2023-11-07T05:31:56Z',
'isConfirmed' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}"
payload := strings.NewReader("{\n \"internalComment\": \"<string>\",\n \"externalOrderNumber\": \"<string>\",\n \"referenceOrderNumber\": \"<string>\",\n \"requestedDeliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isConfirmed\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
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.patch("https://api.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"internalComment\": \"<string>\",\n \"externalOrderNumber\": \"<string>\",\n \"referenceOrderNumber\": \"<string>\",\n \"requestedDeliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isConfirmed\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/v2/purchase-orders/{purchaseOrderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"internalComment\": \"<string>\",\n \"externalOrderNumber\": \"<string>\",\n \"referenceOrderNumber\": \"<string>\",\n \"requestedDeliveryDate\": \"2023-11-07T05:31:56Z\",\n \"isConfirmed\": true\n}"
response = http.request(request)
puts response.read_body{
"purchaseOrderId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"supplierId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"status": 0,
"currencyIso": "<string>",
"currencyFactor": 123,
"isConfirmed": true,
"lineItems": [
{
"lineItemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItemType": 0,
"quantity": 123,
"deliveredQuantity": 123,
"openQuantity": 123,
"netPurchasePriceAmount": 123,
"vatRatePercentage": 123,
"sortOrder": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"itemNumber": "<string>",
"supplierItemNumber": "<string>",
"name": "<string>",
"supplierItemName": "<string>",
"deliveryTimeInDays": 123,
"deliveryDate": "2023-11-07T05:31:56Z",
"note": "<string>",
"packagingUnit": "<string>",
"packagingQuantity": 123,
"confirmedQuantity": 123,
"confirmedDeliveryDate": "2023-11-07T05:31:56Z",
"confirmedPrice": 123,
"isLineItemConfirmed": true
}
],
"supplierName": "<string>",
"orderNumber": "<string>",
"externalOrderNumber": "<string>",
"referenceOrderNumber": "<string>",
"requestedDeliveryDate": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"warehouseId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"internalComment": "<string>",
"deliveryAddress": {
"salutation": "<string>",
"title": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"companyName": "<string>",
"additionalCompanyLine": "<string>",
"street": "<string>",
"additionalAddressLine": "<string>",
"postalCode": "<string>",
"city": "<string>",
"state": "<string>",
"countryIso": "<string>",
"phoneNumber": "<string>",
"faxNumber": "<string>",
"mobilePhoneNumber": "<string>",
"emailAddress": "<string>"
},
"billingAddress": {
"salutation": "<string>",
"title": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"companyName": "<string>",
"additionalCompanyLine": "<string>",
"street": "<string>",
"additionalAddressLine": "<string>",
"postalCode": "<string>",
"city": "<string>",
"state": "<string>",
"countryIso": "<string>",
"phoneNumber": "<string>",
"faxNumber": "<string>",
"mobilePhoneNumber": "<string>",
"emailAddress": "<string>"
},
"supplier": {
"companyName": "<string>",
"additionalCompanyLine": "<string>",
"street": "<string>",
"additionalAddressLine": "<string>",
"postalCode": "<string>",
"city": "<string>",
"state": "<string>",
"countryIso": "<string>",
"phoneNumber": "<string>",
"faxNumber": "<string>",
"mobilePhoneNumber": "<string>",
"emailAddress": "<string>",
"contactSalutation": "<string>",
"contactFirstName": "<string>",
"contactLastName": "<string>"
}
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}{
"type": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/route",
"traceId": "0HMPNHL0JHL76:00000001",
"detail": "<string>",
"errors": [
{
"name": "Error or field name",
"reason": "Error reason",
"code": "<string>",
"severity": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Optional, client-generated key for deduplicating repeated write requests. A repeated request with the same key returns the originally recorded result instead of executing the effect again.
1 - 255The tenant ID for the target ERP instance.
Path Parameters
ID of the purchase order to patch. Der LieferantenBestellung Schlüssel.
"b45f6432-2462-4c6f-b00f-1d9d01000000"
Query Parameters
Indicates whether automatic workflows should be suppressed for this update. Defaults to false when omitted.
Body
Request model for UpdatePurchaseOrder command endpoint. Route parameters bind from the route, query parameters from the query string, everything else from the body.
Internal comment on the order, not communicated to the supplier. Editable in every status including Completed (annotations tier).
The buyer's own external reference for this order (free text, at most 255 characters). Editable in every status (annotations tier). Not the order's own number, which the server assigns and which this API never lets a client change.
The reference order number — the "Zugehörige Auftragsnummer" field, free text, at most 255 characters. Editable in every status (annotations tier).
The delivery date requested from the supplier. Editable in every status (annotations tier) — unlike a LINE ITEM's delivery date, the header date drives no stock posting of its own.
Whether the order as a whole is confirmed. Editable in every status except Completed (confirmations tier), and bidirectional — an explicit false is a valid reset. An independent flag, never derived from the line items' own confirmation flags; only a genuine false-to-true change raises the confirmation event.
The status to transition the order into. Omit to leave the status untouched; setting the status the order already has is an accepted no-op. Permitted transitions are Open to Released, Open to InProgress, Released to InProgress, Released to Completed, InProgress to Completed, PartiallyDelivered to Completed and Overdue to Completed. Anything else is rejected with PURCHASE_ORDER_INVALID_STATUS_TRANSITION — in particular Open to Completed, any transition back to Released, and any transition out of Completed.
0, 5, 20, 30, 50, 500 Response
The purchase order was updated successfully. The body is the full re-queried order, including its line items, so the caller can observe the side effects of the write (the in-progress timestamp, recalculated open quantities, and any stock consequence).
The full detail of a purchase order, including its line items, addresses and the supplier snapshot.
Unique ID of the purchase order.
"b45f6432-2462-4c6f-b00f-1d9d01000000"
ID of the supplier the order was placed with.
"b45f6432-2462-4c6f-b00f-1d9d01000000"
The order's current status.
0, 5, 20, 30, 50, 500 ISO code of the order's currency.
Conversion factor of the order's currency.
Whether the order has been confirmed by the supplier.
The order's line items.
Show child attributes
Show child attributes
The supplier's current display name, resolved at read time. NULL if the supplier could not be resolved.
The order's own number.
The buyer's own order number.
A reference order number.
The delivery date requested from the supplier.
Date the order was created.
Target warehouse of the incoming goods.
"b45f6432-2462-4c6f-b00f-1d9d01000000"
The company the order was placed for.
"b45f6432-2462-4c6f-b00f-1d9d01000000"
Internal comment on the order, not communicated to the supplier.
Delivery address of the order.
Show child attributes
Show child attributes
Billing address of the order.
Show child attributes
Show child attributes
Snapshot of the supplier's master data at the time the order was created.
Show child attributes
Show child attributes
Was this page helpful?