Contents
Labels and documents
When the merchant has Nucleo create the carrier labels (through the shipping platform connected to
Nucleo), you download them here instead of making your own. shipping.labels_by on the order tells
you who makes them: nucleo or warehouse. The carrier and service come from the order
(shipping.carrier_code, shipping.service_code), the tracking numbers from the labels. At most 10
labels (parcels) per order and warehouse. Documents (invoices, customs documents, inserts) are
available for every order.
Base URL, authentication and conventions of this API are on the Fulfillment API page.
/orders/{number}/labelsGet labels
The carrier labels Nucleo created for the order, one per parcel, as base64 content (PDF, 10×15 cm,
or ZPL). A label that could not be created has status: failed and no content: create it again with
Create labels. After your shipment it shows the labels the shipment left with.
Reading never creates anything.
Only when Nucleo makes the labels (shipping.labels_by: nucleo); otherwise 422 labels_not_enabled.
Path parameters
numberstringrequiredThe merchant's order number. The leading
#can be omitted, or encoded as%23.Example:1042
Responses
200Labels of the order.application/json
HeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
dataarray of LabelrequiredAttributes of each item
parcelintegerParcel number, from 1.
statusstringOne ofreadyfailedcarrier_codestring | nullcarrier_namestring | nulltracking_numberstring | nullformatstringOne ofpdfzplcontent_typestringOne ofapplication/pdfapplication/x-zplcontent_base64string | nullThe label file, base64-encoded;
nullwhenstatusisfailed.
401Missing or invalid API key (
unauthorized).application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
403The connection is paused (
connection_paused) or not active yet (connection_not_active). Nothing was read or changed: retry later. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
404
order_not_foundorreturn_not_found— it does not exist or it belongs to another warehouse;not_foundfor an unknown path. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
422Valid JSON that cannot be applied:
unknown_item(an item that is not on the order or not known, withdetailsper line),too_many_items,labels_not_enabled. Nothing was changed. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
429
rate_limited: more calls in a minute than the connection allows (600 by default, all endpoints together; the merchant can set another limit), or too many failed authentications from your IP. Wait the seconds inRetry-After. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.Retry-AfterSeconds to wait before retrying.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
curl -X GET https://api-commerce.nucleoplatform.com/api/fulfillment/v1/orders/1042/labels \
-H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
-H 'Accept: application/json'const res = await fetch("https://api-commerce.nucleoplatform.com/api/fulfillment/v1/orders/1042/labels", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.NUCLEO_ACCESS_TOKEN}`,
Accept: "application/json",
},
});
const data = await res.json();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api-commerce.nucleoplatform.com/api/fulfillment/v1/orders/1042/labels', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('NUCLEO_ACCESS_TOKEN'),
'Accept' => 'application/json',
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();{
"data": [
{
"parcel": 1,
"status": "ready",
"carrier_code": "EXAMPLE",
"carrier_name": "Example Express",
"tracking_number": "1234567890",
"format": "pdf",
"content_type": "application/pdf",
"content_base64": "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFI+PgpzdHJlYW0K"
}
]
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key.",
"request_id": "0b6c3e4f-1a2d-4c5b-8e7f-9a0b1c2d3e4f"
}
}{
"error": {
"code": "connection_paused",
"message": "This connection is paused: nothing was changed.",
"request_id": "3c2b1a0f-9e8d-4c7b-a6f5-4e3d2c1b0a9f"
}
}{
"error": {
"code": "order_not_found",
"message": "Order 1042 not found.",
"request_id": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a"
}
}{
"error": {
"code": "unknown_item",
"message": "Some lines do not match an item of this order assigned to your warehouse. Nothing was changed.",
"request_id": "2e1d0c9b-8a7f-4e6d-9c5b-4a3f2e1d0c9b",
"details": {
"lines.1": [
"Not an item of this order assigned to your warehouse."
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests: retry after the number of seconds in Retry-After.",
"request_id": "4f3e2d1c-0b9a-4f8e-8d7c-6b5a4f3e2d1c"
}
}/orders/{number}/labelsCreate labels
Makes sure there is one label for each parcel from 1 to parcels (at most 10): creates the missing
ones and retries the failed ones; labels already created are kept. Answers with all the labels of
the order. Only once your part is accepted (409 order_not_accepted before), and while you still
have something to ship: after a partial shipment it creates new labels for the rest, and the next
shipment without parcels takes them. Not for a cancelled part (409 order_cancelled,
409 order_cancel_requested), nor when your part is shipped in full or given up (409 invalid_state).
Path parameters
numberstringrequiredThe merchant's order number. The leading
#can be omitted, or encoded as%23.Example:1042
Headers
Idempotency-KeystringAny unique string you generate (1–255 printable ASCII characters, no spaces), for example a UUID. For 48 hours, the same key with the same request — same method, same path written the same way (
/orders/1042and/orders/%231042differ) and same body — returns the stored answer without doing the work again (headerIdempotent-Replayed: true; the replayed body keeps the originalrequest_id, theX-Request-Idheader is the new call's). The same key with a different request answers409 idempotency_key_reused; while the first request is still running,409 idempotency_key_in_progress. A key left in progress for more than 2 minutes (an interrupted call) is free again. Keys are per connection. Server errors (5xx) and429are not stored: retry them with the same key.max length 255Example:2f0c9a1e-6b4d-4f3a-9e7c-5d1b8a2c4e6f
Request bodyapplication/json
parcelsintegerrequiredNumber of parcels the order ships in.
min 1max 10
Responses
201Labels of the order, including the new ones.application/json
HeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
dataarray of LabelrequiredAttributes of each item
parcelintegerParcel number, from 1.
statusstringOne ofreadyfailedcarrier_codestring | nullcarrier_namestring | nulltracking_numberstring | nullformatstringOne ofpdfzplcontent_typestringOne ofapplication/pdfapplication/x-zplcontent_base64string | nullThe label file, base64-encoded;
nullwhenstatusisfailed.
400The request is not valid:
validation_failed(withdetailsper field),invalid_json,invalid_cursor. Nothing was changed. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
401Missing or invalid API key (
unauthorized).application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
403The connection is paused (
connection_paused) or not active yet (connection_not_active). Nothing was read or changed: retry later. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
404
order_not_foundorreturn_not_found— it does not exist or it belongs to another warehouse;not_foundfor an unknown path. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
409The request conflicts with the current state:
order_not_ready,order_not_accepted,order_already_accepted,order_cancelled,order_cancel_requested,order_already_shipped,invalid_state,documents_not_ready,labels_not_ready; or with anIdempotency-Key:idempotency_key_reused,idempotency_key_in_progress(withRetry-After). Read the order or return again before retrying. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.Retry-AfterSeconds to wait before retrying.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
422Valid JSON that cannot be applied:
unknown_item(an item that is not on the order or not known, withdetailsper line),too_many_items,labels_not_enabled. Nothing was changed. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
429
rate_limited: more calls in a minute than the connection allows (600 by default, all endpoints together; the merchant can set another limit), or too many failed authentications from your IP. Wait the seconds inRetry-After. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.Retry-AfterSeconds to wait before retrying.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
curl -X POST https://api-commerce.nucleoplatform.com/api/fulfillment/v1/orders/1042/labels \
-H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
-H 'Idempotency-Key: 2f0c9a1e-6b4d-4f3a-9e7c-5d1b8a2c4e6f' \
-H 'Content-Type: application/json' \
-d '{
"parcels": 2
}'const res = await fetch("https://api-commerce.nucleoplatform.com/api/fulfillment/v1/orders/1042/labels", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.NUCLEO_ACCESS_TOKEN}`,
"Idempotency-Key": "2f0c9a1e-6b4d-4f3a-9e7c-5d1b8a2c4e6f",
"Content-Type": "application/json",
},
body: JSON.stringify({
"parcels": 2
}),
});
const data = await res.json();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('POST', 'https://api-commerce.nucleoplatform.com/api/fulfillment/v1/orders/1042/labels', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('NUCLEO_ACCESS_TOKEN'),
'Idempotency-Key' => '2f0c9a1e-6b4d-4f3a-9e7c-5d1b8a2c4e6f',
],
'json' => [
'parcels' => 2,
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();{
"data": [
{
"parcel": 1,
"status": "ready",
"carrier_code": "string",
"carrier_name": "string",
"tracking_number": "string",
"format": "pdf",
"content_type": "application/pdf",
"content_base64": "string"
}
]
}{
"error": {
"code": "validation_failed",
"message": "The request is not valid.",
"request_id": "1f7e3c2a-9b8d-4e6f-a5c4-3b2a1d0e9f8c",
"details": {
"lines.0.quantity": [
"The lines.0.quantity field must be at least 0."
],
"reason_code": [
"The reason code field is required."
]
}
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key.",
"request_id": "0b6c3e4f-1a2d-4c5b-8e7f-9a0b1c2d3e4f"
}
}{
"error": {
"code": "connection_paused",
"message": "This connection is paused: nothing was changed.",
"request_id": "3c2b1a0f-9e8d-4c7b-a6f5-4e3d2c1b0a9f"
}
}{
"error": {
"code": "order_not_found",
"message": "Order 1042 not found.",
"request_id": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a"
}
}{
"error": {
"code": "order_not_accepted",
"message": "Accept order",
"request_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
}
}{
"error": {
"code": "unknown_item",
"message": "Some lines do not match an item of this order assigned to your warehouse. Nothing was changed.",
"request_id": "2e1d0c9b-8a7f-4e6d-9c5b-4a3f2e1d0c9b",
"details": {
"lines.1": [
"Not an item of this order assigned to your warehouse."
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests: retry after the number of seconds in Retry-After.",
"request_id": "4f3e2d1c-0b9a-4f8e-8d7c-6b5a4f3e2d1c"
}
}/orders/{number}/documentsGet documents
Documents to print and put in the parcel, as base64 PDFs: the order's documents (invoice, customs
documents) with kind: order_document, and the merchant's inserts in the customer's language
(return instructions, leaflets) with kind: insert. position says whether a document goes
inside the parcel (internal) or in the document pouch outside (external).
When the order needs customs documents that are not ready yet, 409 documents_not_ready: retry
later. Such orders do not appear in to_fulfill until their documents are ready.
Path parameters
numberstringrequiredThe merchant's order number. The leading
#can be omitted, or encoded as%23.Example:1042
Responses
200Documents of the order (possibly none).application/json
HeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
dataarray of DocumentrequiredAttributes of each item
idstringnamestringkindstringOne oforder_documentinsertpositionstring | nullOne ofinternalexternalnullpage_formatstringExample:A4content_type"application/pdf"content_base64string
401Missing or invalid API key (
unauthorized).application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
403The connection is paused (
connection_paused) or not active yet (connection_not_active). Nothing was read or changed: retry later. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
404
order_not_foundorreturn_not_found— it does not exist or it belongs to another warehouse;not_foundfor an unknown path. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
409The request conflicts with the current state:
order_not_ready,order_not_accepted,order_already_accepted,order_cancelled,order_cancel_requested,order_already_shipped,invalid_state,documents_not_ready,labels_not_ready; or with anIdempotency-Key:idempotency_key_reused,idempotency_key_in_progress(withRetry-After). Read the order or return again before retrying. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.Retry-AfterSeconds to wait before retrying.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
429
rate_limited: more calls in a minute than the connection allows (600 by default, all endpoints together; the merchant can set another limit), or too many failed authentications from your IP. Wait the seconds inRetry-After. application/jsonHeadersX-Request-IdIdentifier of the call. Quote it when you contact support; it is alsoerror.request_id.Retry-AfterSeconds to wait before retrying.
errorobjectrequiredChild attributes
codestringrequiredStable, machine-readable code. Branch on it, not on
message.One ofvalidation_failedinvalid_jsoninvalid_cursorunauthorizedconnection_pausedconnection_not_activenot_foundmethod_not_allowedorder_not_foundreturn_not_foundorder_not_readyorder_not_acceptedorder_already_acceptedorder_cancelledorder_cancel_requestedorder_already_shippedinvalid_statedocuments_not_readylabels_not_readyidempotency_key_reusedidempotency_key_in_progresspayload_too_largeunknown_itemtoo_many_itemslabels_not_enabledrate_limitedinternal_errormessagestringrequiredExplanation in English for people. It can change; never parse it.
request_idstring (uuid)requiredSame as the
X-Request-Idheader.detailsobjectValidation and item errors per field:
{"lines.0.quantity": ["…"]}.
curl -X GET https://api-commerce.nucleoplatform.com/api/fulfillment/v1/orders/1042/documents \
-H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
-H 'Accept: application/json'const res = await fetch("https://api-commerce.nucleoplatform.com/api/fulfillment/v1/orders/1042/documents", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.NUCLEO_ACCESS_TOKEN}`,
Accept: "application/json",
},
});
const data = await res.json();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api-commerce.nucleoplatform.com/api/fulfillment/v1/orders/1042/documents', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('NUCLEO_ACCESS_TOKEN'),
'Accept' => 'application/json',
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();{
"data": [
{
"id": "7d1c2b3a-4e5f-4a6b-9c8d-1e2f3a4b5c6d",
"name": "Invoice-2026-001042",
"kind": "order_document",
"position": "external",
"page_format": "A4",
"content_type": "application/pdf",
"content_base64": "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFI+PgpzdHJlYW0K"
}
]
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key.",
"request_id": "0b6c3e4f-1a2d-4c5b-8e7f-9a0b1c2d3e4f"
}
}{
"error": {
"code": "connection_paused",
"message": "This connection is paused: nothing was changed.",
"request_id": "3c2b1a0f-9e8d-4c7b-a6f5-4e3d2c1b0a9f"
}
}{
"error": {
"code": "order_not_found",
"message": "Order 1042 not found.",
"request_id": "6d5c4b3a-2f1e-4d0c-9b8a-7f6e5d4c3b2a"
}
}{
"error": {
"code": "order_not_accepted",
"message": "Accept order",
"request_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests: retry after the number of seconds in Retry-After.",
"request_id": "4f3e2d1c-0b9a-4f8e-8d7c-6b5a4f3e2d1c"
}
}