YOM Docs

Bulk order modification


PUT {{URL_BASE}}/orders/admin/bulk

Applies to several orders what Order modification does to a single one: it accepts both the content of each order and its status and delivery date.

Each order in the batch is processed independently: the response carries one result per order, and the failure of one does not stop the rest.

<aside> πŸ“

Within each order, the only required field is id. Only what it contains is modified; the rest of the order is left intact. Any other field sent is ignored.

</aside>

What to send


Field Type Requirement Description Examples
data πŸ”‘ List of Objects β†’ Order 🟒 Required Between 1 and 500 orders. See details below.

No other fields are allowed at the top level of the request body.

Order

Each data record.

Field Type Requirement Description Examples
id πŸ“ Text 🟒 Required Identifier of the order to modify. Accepts the YOM _id or the orderId from the customer's ERP.
The order number is not accepted.* "66f0a1b2c3d4e5f6a7b8c9d0"
products πŸ”‘ List of Objects βšͺ Optional Order line items. It supports the same two formats as the single-order endpoint.
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 *id, 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"

When an order includes status fields, its 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.

External status

In addition to status, each 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. It is for display only: it does not replace status or modify it, and changing it does not trigger ERP submissions, emails, notifications, or credit movements.

It is sent as an object with a single key field, and it can be sent on its own, without status. The key must match one of the external statuses configured for the customer.

<aside> ⚠️

</aside>

YOM records which external statuses each order has passed through, and that sequence is what draws the order tracking in the B2B portal. YOM maintains that history: it is not sent in the request. Sending the same key the order already has produces no change.

Valid values for status

| --- | --- |

Example

PUT {{URL_BASE}}/orders/admin/bulk

{
  "data": [
    {
      "id": "66f0a1b2c3d4e5f6a7b8c9d0",
      "status": "shipped",
      "estimatedDeliverAt": "2030-01-15T00:00:00.000Z"
    },
    {
      "id": "ERP-99812",
      "products": [
        { "productId": "650a1b2c3d4e5f6a7b8c9d01", "quantity": 8 }
      ]
    },
    {
      "id": "66f0a1b2c3d4e5f6a7b8c9d2",
      "observation": "Entregar por la maΓ±ana",
      "status": "delivered"
    },
    {
      "id": "66f0a1b2c3d4e5f6a7b8c9d3",
      "externalStatus": { "key": "en_bodega" }
    }
  ]
}

What it returns