An order that already exists is modified with PUT {{URL_BASE}}/orders/admin/{id}, which accepts both the content of the order and its status and delivery date.
| What you want to change | Endpoint |
|---|---|
| Line items, delivery address, observation, type, distribution center, status, delivery date | PUT {{URL_BASE}}/orders/admin/{id} |
| Only the status and the delivery date, or identifying the order by its number | POST {{URL_BASE}}/orders/status/{order_id} |
PUT {{URL_BASE}}/orders/admin/{id}
{id} accepts two identifiers:
_id β the order identifier in YOM, the one returned when it is created.orderId β the order identifier in the customer's ERP.<aside> π
All fields are optional. Only what comes in the request body is modified; the rest of the order is left intact. Any other field sent is ignored.
</aside>
| Field | Type | Requirement | Description | Examples |
|---|---|---|---|---|
products |
π‘ List of Objects | βͺ Optional | Order line items. Two formats are supported, see below. | |
sellerDiscounts |
π‘ List of Objects | βͺ Optional | Discounts applied by the Seller. | |
shippingAddress |
π Object | βͺ Optional | Delivery address for the order. | |
observation |
π Text | βͺ Optional | Order observation. | "Entregar por la maΓ±ana" |
externalPurchaseOrderId |
π Text | βͺ Optional | Purchase order in the customer's system. | "OC-88231" |
type |
π Text | βͺ Optional | Order type. | |
"order" β order |
||||
"quote" β quote |
"order" |
|||
distributionCenterId |
π ObjectId | βͺ Optional | Order distribution center. | |
*\*Accepts *null to leave it unassigned. |
"650a1b2c3d4e5f6a7b8c9d99" |
|||
distributionCenterName |
π Text | βͺ Optional | Distribution center name. | |
*\*Accepts *null to leave it unassigned. |
"CD Santiago" |
|||
status |
π Text | βͺ Optional | New order status. See valid values below. | "shipped" |
externalStatus |
π Object | βͺ Optional | Order external status, for display only. It carries a single key field, which must match one of the statuses configured for the customer. See external status below. |
{ "key": "en_bodega" } |
estimatedDeliverAt |
π Date | βͺ Optional | Delivery date, in ISO 8601 format. | |
| *\An invalid date is ignored and the previous one is kept. | "2030-01-15T00:00:00.000Z" |
|||
orderId |
π Text | βͺ Optional | Order identifier in the customer's ERP. | |
| *\If the order was identified by its ERP number in the URL, this field can only repeat that same value. | "ERP-99812" |
|||
orderCode |
π Text | βͺ Optional | Order code. | "COD-4471" |
integrationErrorDetails |
π Text | βͺ Optional | Integration error details. | "Timeout al conectar con el ERP" |
<aside> π
</aside>
When the request includes status fields, the content changes are applied first and the totals are recalculated, and only then is the status transition executed β this way notifications and the ERP submission see the order already in its final form.
Each item carries sku and/or productId plus quantity, without pricing. Only the line items you want to modify are sent; the rest of the order stays as it is.
PUT {{URL_BASE}}/orders/admin/66f0a1b2c3d4e5f6a7b8c9d0
{
"products": [
{ "productId": "650a1b2c3d4e5f6a7b8c9d01", "quantity": 8 }
]
}
Each item carries its own pricing. The complete order must be sent: line items that are not included are dropped from the order.
PUT {{URL_BASE}}/orders/admin/66f0a1b2c3d4e5f6a7b8c9d0
{
"products": [
{
"sku": "ABC-1",
"productId": "650a1b2c3d4e5f6a7b8c9d01",
"quantity": 3,
"pricing": { "pricePerUnit": 1000 },
"pricingAfterDiscounts": { "pricePerUnit": 900 }
}
]
}
In addition to status, an order can carry an external status of the customer's own: a label with its name and its color, which YOM displays as is in the B2B portal, the admin panel, and the mobile app.
<aside> π
</aside>