Measura API documentation · v1
Edit built-in or custom measured lines, split eligible lines, and adjust supported fulfilled lines with durable operation receipts.
PATCH /api/v1/orders/{orderId}
Headers:
Authorization: Bearer <api-key>
Content-Type: application/json
Idempotency-Key: order-change-unique-keyScroll horizontally to see all columns.
| Parameter | Type | Description |
|---|---|---|
orderId | string | Required — Numeric Shopify order legacy (REST) ID; do not send a GraphQL GID. |
{
"expectedRevision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"edits": [
{
"operation": "update",
"lineItemId": "111",
"variantId": "333",
"quantity": 1,
"measurement": {
"value": 1.5,
"unit": "kg",
"type": "weight"
}
}
],
"notifyCustomer": false,
"staffNote": "Adjust measured amount"
}{
"success": true,
"data": {
"order": {
"id": "1234567890",
"name": "#1001",
"currencyCode": "USD",
"revision": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"updatedAt": "2026-10-19T00:01:00Z",
"cancelledAt": null,
"financialStatus": "PAID",
"fulfillmentStatus": "UNFULFILLED",
"items": [
{
"lineItemId": "112",
"productId": "222",
"variantId": "333",
"quantity": 1,
"measurement": {
"type": "weight",
"value": 1.5,
"unit": "kg"
},
"unitPrice": "$10.00 per kg",
"totalPrice": 15.0,
"title": "Measured product",
"originalLineItemId": "111",
"previousLineItemId": "111",
"originalProductId": "222",
"originalVariantId": "333",
"unfulfilledQuantity": 1,
"fulfilledQuantity": 0,
"editability": {
"canEdit": true,
"canSplit": true,
"canAdjustFulfilled": false,
"canReturn": false,
"reason": null
}
}
],
"totals": {
"total": {
"amount": "15.00",
"currencyCode": "USD"
},
"tax": {
"amount": "0.00",
"currencyCode": "USD"
},
"shipping": {
"amount": "0.00",
"currencyCode": "USD"
},
"outstanding": {
"amount": "0.00",
"currencyCode": "USD"
}
},
"paymentSettlement": "separate"
},
"lineMappings": [
{
"sourceLineItemId": "111",
"originalLineItemId": "111",
"resultingLineItemIds": [
"112"
]
}
],
"paymentSettlement": "separate",
"operationId": "123e4567-e89b-42d3-a456-426614174000",
"operationStatus": "completed"
},
"error": null
}Scroll horizontally to see all columns.
| Field | Type | Description |
|---|---|---|
data.order | object | Current full order state, using the same schema as Get order details. |
data.lineMappings | array | For each previous measured line: sourceLineItemId, originalLineItemId, and resultingLineItemIds. Empty resultingLineItemIds can indicate removal. |
data.operationId / operationStatus | string | Durable operation UUID and completed status. Use operationId as editId on the edit detail endpoint. |
data.paymentSettlement | string | Always separate; no automatic collection or monetary refund. |
Scroll horizontally to see all columns.
| Status code | Description |
|---|---|
| 400 | bad_request — Invalid JSON, missing Idempotency-Key or expectedRevision, unsupported fields, invalid measurements or quantities, duplicate lines, or mixed workflows. |
| 405 | method_not_allowed — Use GET or PATCH; Allow: GET, PATCH. |
| 404 | not_found — Order not found or unavailable. |
| 409 | conflict — Stale revision; reload the order and submit a new request with its new revision and a new idempotency key. |
| 409 | idempotency_key_reused — The same key was used for a different method, resource, or request body. |
| 409 | operation_in_progress / resource_in_progress — This operation or another operation on the order is still running. Retry-After: 2 may be returned. |
| 409 | operation_requires_review — Changes may have applied, or receipt persistence is uncertain. Retrieve the operation and reconcile before another write. |
| 422 | unprocessable_entity — Cancelled order, unavailable action, wrong line ownership or measurement workflow, or another unsupported order state. |
| 401 | unauthorized — Missing or invalid API key. |
| 403 | forbidden — The Order edit add-on is not ACTIVE for this shop. |
| 500 | internal_error — The request could not be processed. |
Note
Related:
Scroll horizontally to see all columns.
| Field | Type | Description |
|---|---|---|
expectedRevision | string | Required — revision copied from the latest GET order response. |
edits | array | Built-in changes. operation defaults to update; supported: add, update, remove, reprice. Every entry requires variantId and measurement. Non-add operations require lineItemId. Quantity is required except for remove. Use source variantId and lines with canEdit. |
edits[].fixedLinePrice | number | Optional nonnegative finite explicit price; allowed only for operation reprice. |
splits | array | Each {lineItemId, pieces} needs at least two pieces, each {quantity, measurement}. Source must have canSplit; all pieces retain its measurement type. Do not send internal splitFromLineItemId fields. |
fulfilledEdits | array | Built-in lines with canAdjustFulfilled. Entries contain lineItemId, quantity, measurement, and optional nonnegative fixedLinePrice. Measurement is the target per-copy amount; quantity is the target copy count. |
discountRepairLineItemIds | string[] | Optional non-empty list of up to 100 active replacement-line IDs. Server derives trusted historical percentage discount data. |
catalogPricing | object | Optional standard-workflow concurrency snapshot: {snapshot: {companyLocationId: string | null, currencyCode: string, prices: {[variantId]: {amount: string, currencyCode: string}}, productPrices?: object}, repriceLineItemIds: string[]}. Up to 100 selected legacy line IDs; actual applied catalog amounts are derived by the server. |
customEdits | array | Custom-unit add/update/remove changes. Require operation and variantId; update/remove require lineItemId. Add/update require quantity, positive finite amount, unitId, saleId, and historical selection revision. Prices are derived by the server. |
notifyCustomer | boolean | Optional — Request customer notification from the edit workflow. |
staffNote | string | Optional — At most 2000 characters. Not supported for customEdits. |
{
"expectedRevision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"splits": [
{
"lineItemId": "111",
"pieces": [
{
"quantity": 1,
"measurement": {
"type": "weight",
"unit": "kg",
"value": 0.75
}
},
{
"quantity": 1,
"measurement": {
"type": "weight",
"unit": "kg",
"value": 0.5
}
}
]
}
]
}{
"expectedRevision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"customEdits": [
{
"operation": "update",
"lineItemId": "111",
"variantId": "333",
"quantity": 1,
"amount": 2,
"unitId": "custom:case",
"saleId": "sale:case",
"revision": "sale-revision-from-selection"
}
]
}