YOM Docs

Order modification

Base URL configuration

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}

Edit an order

PUT {{URL_BASE}}/orders/admin/{id}

{id} accepts two identifiers:

<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>

What to send

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.

Format A β€” change quantities only

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 }
  ]
}

Format B β€” replace all line items

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 }
    }
  ]
}

External status

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>