App order metadata
For admin.order-details.action.render, with installation Partners version 2026-10 or a later version publishing this endpoint. An App reads and writes only its own JSON namespace on an order; other Apps' and platform-internal metadata are not exposed.
Request shape
The Host accepts these two requests. The path must contain a complete order UUID. Arbitrary URLs, headers, and other endpoints are not supported.
const api = globalThis.gowarehouse;
const orderId = api.data.selected[0]?.id;
if (!orderId) throw new Error('order_required');
const current = await api.request({
method: 'GET',
path: `/orders/${orderId}/metadata`,
});
if (!current.success) throw new Error(current.message);
const saved = await api.request({
method: 'PATCH',
path: `/orders/${orderId}/metadata`,
body: { reviewed: true, note: 'Checked by this App' },
});
if (!saved.success) throw new Error(saved.message);This is a JavaScript example of the Host runtime contract, for use inside an event handler that handles rejections. SDK 0.1.0 TypeScript types do not yet cover GET or general patches. See Your first App for a typed SDK example and Host SDK for the differences.
GET has no body. PATCH requires a non-empty JSON object.
Response
{
"success": true,
"data": {
"order_id": "01900000-0000-7000-8000-000000000001",
"metadata": { "reviewed": true, "note": "Checked by this App" }
}
}data.metadata is already your App's content; do not wrap it in apps or your handle. A normal denial returns { "success": false, "message": "error_code" }; transport, validation, or lifecycle failures may instead reject. Do not assume the SDK exposes status, headers, or Retry-After for every failure.
Merge and size limits
PATCH uses JSON Merge Patch: objects merge recursively, arrays are replaced in full, and a key set to null is deleted. A null inside an array remains an array value, not a delete instruction.
| Original | Patch | Result |
|---|---|---|
{"reviewed":true,"note":"A"} | {"note":null} | {"reviewed":true} |
{"tags":["A","B"]} | {"tags":["C"]} | {"tags":["C"]} |
{"review":{"status":"new","by":"A"}} | {"review":{"status":"done"}} | {"review":{"status":"done","by":"A"}} |
Both the patch and the merged App namespace are limited to 16 KiB of JSON-encoded bytes, not characters. A small patch can still exceed the limit when merged with existing data. Removing a key you added can restore the previous shape. Other instances of the same App may also modify data; do not write back an entire stale snapshot as a patch.
Permissions and errors
Reads require the installation's orders:read, and writes require orders:write. The current Admin Host entry also requires the user's order edit permission for both reads and writes. The usable installation, live instance, actor permissions, and merchant boundary are rechecked at execution time.
| Situation | Action |
|---|---|
| Missing scope or user permission | Check installation consent and current user permissions; reinstalling does not replace proper authorization |
| Closed or expired instance | Reopen the action instead of reusing its API object |
| Missing or invisible order, or unsupported version | Check the UUID, installation owner, merchant, and API version |
| Invalid patch or excessive merged size | Correct the data before sending it again |
| Rate limit | Delay the operation; do not retry in a tight UI loop |
An App backend can use an App grant with the corresponding Partners metadata endpoints. Ordinary Integration tokens cannot use this App-specific capability. See Troubleshooting.