YOM Docs

Untitled

Delivery price

YOM can delegate the calculation of an order's delivery cost to the customer's system. When a commerce or a seller quotes or confirms an order, YOM sends an HTTP POST request to the customer's endpoint with the Order details. The customer responds with the net delivery cost, or indicates that it cannot quote it.

<aside> πŸ“

The customer only needs to expose the endpoint and give YOM its URL. No other configuration is required.

</aside>

When YOM calls it


The query happens at four moments, always synchronously:

A single order therefore produces more than one call: at least one when quoting on screen and another when confirming it.

<aside> ⚠️

The query is skipped entirely when the commerce has no code in the customer's system. Without order.externalId there is no quote and the order is created with delivery at 0.

</aside>

Endpoint


POST <tu_dominio>/webhooks/yom/order/delivery-price

Request body

{
  "order": { ... }
}

Fields


Order

The order entity, inside the body's order key.

Field Type Requirement Description Examples
externalId πŸ“ Text 🟒 Required Code of the Commerce in the customer's system. It is the only field whose absence prevents the query. "10023456"
domain πŸ“ Text 🟒 Required Domain of the customer the order belongs to. "cliente.youorder.me"
shippingAddress πŸ“ Object β†’ ShippingAddress 🟒 Required Delivery address of the order. See details below.
products πŸ”‘ List of Objects 🟒 Required Lines of the order, with sku, quantity, and pricing. Useful for quoting by weight or volume.
pricing πŸ“ Object 🟒 Required Totals of the order. On the outbound call, pricing.shipping is sent with its default values at 0. {"totalPrice": 35880}
estimatedDeliverAt πŸ“… Date βšͺ Optional Planned delivery date, in ISO 8601 format. "2026-09-18T00:00:00.000Z"
distributionCenterId πŸ†” ObjectId βšͺ Optional Distribution Center associated with the order. "650a1b2c3d4e5f6a7b8c9d99"
commerceId
commerceName πŸ“ Text βšͺ Optional Identifier and name of the Commerce in YOM. "Minimarket Los Aromos"
sellerId πŸ”‘ List of Texts βšͺ Optional Identifiers of the Seller or Sellers associated with the order. ["186"]
type πŸ“ Text βšͺ Optional Order type.
"order" β†’ order
"quote" β†’ quote "order"
observation πŸ“ Text βšͺ Optional Note on the order. "Entregar por la maΓ±ana"

ShippingAddress

The order.shippingAddress object, with the delivery destination.

Field Type Requirement Description Examples
address πŸ“ Text 🟒 Required Street and number of the delivery address. "Av. Siempre Viva 742"
commune πŸ“ Text 🟒 Required Destination commune. It is the field most rate tables use to determine coverage. "MaipΓΊ"
city πŸ“ Text βšͺ Optional Destination city. "Santiago"
name
phone πŸ“ Text βšͺ Optional Name and phone number of the person receiving the delivery. "Bodega central"
metadata.coordinates πŸ“ Object βšͺ Optional Coordinates of the destination, with latitude and longitude. {"latitude": -33.5110, "longitude": -70.7580}
metadata.administrativeAreaLevel1 πŸ“ Object βšͺ Optional Region or province of the destination; the name is sent in longName. {"longName": "RegiΓ³n Metropolitana"}
metadata.country πŸ“ Object βšͺ Optional Country of the destination; the name is sent in longName. {"longName": "Chile"}

<aside> ℹ️

In advance quotes the order does not exist yet: it is a draft built from what is on screen. Only the fields marked as required are guaranteed; the rest may arrive empty or absent.

</aside>

Expected response


The endpoint must respond 200 with Content-Type: application/json.

Field Type Requirement Description Examples
transportationCost πŸ”’ Number 🟒 Required Delivery cost excluding tax. It is the field YOM validates to decide whether a quote was returned.
The value 0 is valid and means free delivery. 1500
netValue πŸ”’ Number 🟒 Required Delivery cost excluding tax. It is the value stored on the order and the one sent to the customer's system. It must match transportationCost. 1500
netTaxedValue πŸ”’ Number 🟒 Required Delivery cost including tax. It is the value shown to the buyer. 1785
taxesApplied.code πŸ”’ Number βšͺ Optional Code of the tax applied to the delivery. 14
taxesApplied.value πŸ”’ Number βšͺ Optional Tax rate expressed as a fraction, not as a percentage.
0.19 equals 19%. 0.19

<aside> 🚨

The netValue field must always be present. YOM validates transportationCost but stores netValue: a response that carries the first and omits the second is accepted as a valid quote and leaves the order with delivery at 0, with no visible error. This is the most common failure when connecting a new integration.

</aside>

Quoted delivery

{
  "transportationCost": 1500,
  "netValue": 1500,
  "netTaxedValue": 1785,
  "taxesApplied": {"code": 14, "value": 0.19}
}

Free delivery

{
  "transportationCost": 0,
  "netValue": 0,
  "netTaxedValue": 0,
  "taxesApplied": {"code": 14, "value": 0.19}
}

No quote

A 200 response that does not include transportationCost is interpreted as no quote having been returned. The order is still created, with delivery at 0, unless the customer has the quote requirement turned on.

{}

Rejection with a reason


When the delivery cannot be quoted for a business reason β€” commune outside the coverage area, maximum weight exceeded, delivery window unavailable β€”, the endpoint must respond with a 4xx status and the explanation in the body. YOM takes it and shows it to the user as is.

The text is looked up, in this order, in errors.message, detail, or message; if the body is plain text, the whole body is used.

HTTP/1.1 422
Content-Type: application/json

{
  "message": "No existen parΓ‘metros de despacho hacia la comuna de destino."
}

The user sees that same text on screen and the order does not move forward.

<aside> πŸ›‘

A 5xx is never interpreted as a rejection. A server error is an infrastructure failure, not a business decision: it turns into a generic error the buyer cannot resolve. To communicate a reason, you must respond 4xx.

</aside>

Example


POST <https://api.cliente.com/webhooks/yom/order/delivery-price>
Content-Type: application/json
Accept: application/json
x-auth-token: 6a5a8ee27726337b51c72405
origin: legacy.youorder.me

{
  "order": {
    "externalId": "10023456",
    "domain": "cliente.youorder.me",
    "commerceId": "6412f0a1b2c3d4e5f6a7b8c9",
    "commerceName": "Minimarket Los Aromos",
    "distributionCenterId": "64aa11bb22cc33dd44ee55ff",
    "estimatedDeliverAt": "2026-09-18T00:00:00.000Z",
    "type": "order",
    "status": "pending",
    "shippingAddress": {
      "name": "Bodega central",
      "address": "Av. Siempre Viva 742",
      "commune": "MaipΓΊ",
      "city": "Santiago",
      "metadata": {
        "coordinates": {"latitude": -33.5110, "longitude": -70.7580},
        "administrativeAreaLevel1": {"longName": "RegiΓ³n Metropolitana"},
        "country": {"longName": "Chile"}
      }
    },
    "products": [
      {"sku": "SKU-001", "quantity": 12, "pricing": {"totalPrice": 35880}}
    ],
    "pricing": {
      "totalPrice": 35880,
      "netTotalPrice": 30151,
      "finalTotalPrice": 35880,
      "shipping": {"netValue": 0, "netTaxedValue": 0}
    }
  }
}
curl -X POST \
  '<https://api.cliente.com/webhooks/yom/order/delivery-price>' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-auth-token: 6a5a8ee27726337b51c72405' \
  -d '{"order": { ... }}'

Considerations


<aside> ⏱️

The endpoint must respond in less than 30 seconds. After 60 seconds the connection is dropped and the quote is lost.

</aside>