Flow
- Masnet delivers the
com.masnet.price_request.requested.v1event to the channel destination, or leaves it in the events log if the channel has no webhook. - The system answers the webhook with a 2xx and processes the request asynchronously.
- If
truncatedincludeslines, it reads every line withGET …/price-requests/{id}/lines. - It quotes and sends a single answer with
POST …/price-requests/{id}/responsebeforerespond_by. - Masnet applies every line in one transaction and returns the result per line. The request becomes
appliedeven if some lines have problems.
Requirements
- A production integration of the company designated as the price request channel. Only one integration per company can be the channel. Designating and withdrawing it require a second factor and are audited. An integration of the
testenvironment cannot be the channel, but it does receive the test request. - The designation grants the
price_requestsdomain: the API client usesread:price_requeststo read andwrite:price_requeststo answer.read:price_requestsincludes the current products and prices of the bid lines. - The channel destination is subscribed to the
com.masnet.price_request.requested.v1type. Without a destination, the system reads the event from the events log withread:events. - The client authenticates as in the rest of the data API, with base
https://daas.masnet.com/api/v1/integrations.
The event is signed like any Masnet webhook. Verify the signature before parsing the body: Node.js, Python, Java or C#.
The event
data.object is a price-request.v1 object: the tender, the bid, the deadline and up to 200 lines. Each line carries its line_key, the buyer description and quantity, and the product and price the bid has today.
{
"specversion": "1.0",
"id": "evt_01JD3K8W5F2Q9X7M4N6P8R0T2V",
"type": "com.masnet.price_request.requested.v1",
"subject": "price_request/0b7d5c2e-6f1a-4c4e-9a37-1f8f3c2d9e10",
"dataschema": "https://masnet.com/developers/schemas/price_request/v1.json",
"data": {
"object": {
"contract_version": "price-request.v1",
"id": "0b7d5c2e-6f1a-4c4e-9a37-1f8f3c2d9e10",
"status": "requested",
"requested_at": "2026-11-17T14:02:11Z",
"respond_by": "2026-11-17T14:32:11Z",
"requested_by": {
"id": "5d1e9a3c-2b7f-4c6d-8e0a-1f2b3c4d5e6f"
},
"tender": {
"code": "1075963-358-LP26",
"purchase_channel": "LP",
"title": "Adquisición de medicamentos oncológicos",
"status": "published",
"buyer": {
"code": "7248",
"name": "Hospital Regional",
"rut": "61.608.000-0"
}
},
"bid": {
"id": "9f8e7d6c-5b4a-4321-8fed-cba987654321",
"name": "Oferta principal",
"kind": "principal",
"currency": "CLP"
},
"lines_total": 3,
"lines": [
{
"line_key": "a3f1c0de5b7e4f2a9c1d8e6b4a2f0c19",
"item_number": 1,
"tender_item_id": "8812345",
"buyer": {
"description": "Afatinib 40 mg comprimido",
"quantity": "120",
"unit": "Unidad"
},
"offer": {
"status": "offered",
"product": {
"catalog_item_id": "90211",
"internal_code": "AF-40",
"name": "Afatinib 40 mg x 30"
},
"unit_price": {
"value": "15400.00",
"currency": "CLP"
},
"price_requested": true
}
},
{
"line_key": "b9c2d4e6f8a0b2c4d6e8f0a2b4c6d8e0",
"item_number": 2,
"tender_item_id": "8812346",
"buyer": {
"description": "Ondansetrón 8 mg comprimido",
"quantity": "600",
"unit": "Unidad"
},
"offer": {
"status": "not_started",
"product": null,
"unit_price": null,
"price_requested": true
}
},
{
"line_key": "c004e1f2a3b4c5d6e7f8091a2b3c4d5e",
"item_number": 3,
"tender_item_id": "8812347",
"buyer": {
"description": "Filgrastim 300 mcg jeringa prellenada",
"quantity": "40",
"unit": "Unidad"
},
"offer": {
"status": "offered",
"product": {
"catalog_item_id": "90377",
"internal_code": "FG-300",
"name": "Filgrastim 300 mcg"
},
"unit_price": null,
"price_requested": true
}
}
],
"truncated": [],
"links": {
"self": "https://daas.masnet.com/api/v1/integrations/data/price-requests/0b7d5c2e-6f1a-4c4e-9a37-1f8f3c2d9e10",
"lines": "https://daas.masnet.com/api/v1/integrations/data/price-requests/0b7d5c2e-6f1a-4c4e-9a37-1f8f3c2d9e10/lines",
"response": "https://daas.masnet.com/api/v1/integrations/data/price-requests/0b7d5c2e-6f1a-4c4e-9a37-1f8f3c2d9e10/response"
}
},
"previous": null,
"changed_fields": [],
"actor": {
"type": "user"
},
"evidence": "masnet_record"
}
}line_keyidentifies the bid line and is the key the answer must return.offer.price_requestedtells whether the line asks for a price. A line without a product travels as context: the system may propose a product and a price.respond_byis the answer deadline. Delivery retries of the event also end at that time, not after the 72 hours of other events.webhook-idis kept across retries. Discard repeats with a 2xx. The same request is never emitted again.
Read every line
If the request has more than 200 lines, truncated includes lines and the event carries only the first ones. Read the full list in pages of up to 500 lines, ordered by item_number. next_cursor is opaque and is null on the last page.
GET /api/v1/integrations/data/price-requests/0b7d5c2e-6f1a-4c4e-9a37-1f8f3c2d9e10/lines?limit=500 HTTP/1.1
Host: daas.masnet.com
Authorization: Bearer <token con read:price_requests>
HTTP/1.1 200 OK
{ "lines": [ … ], "next_cursor": "500:a3f1c0de5b7e4f2a9c1d8e6b4a2f0c19" }GET …/price-requests/{id} returns the same object with its current status and, once applied, the summary and the results per line. A request of another integration or another company answers 404.
Answer
POST /api/v1/integrations/data/price-requests/0b7d5c2e-6f1a-4c4e-9a37-1f8f3c2d9e10/response HTTP/1.1
Host: daas.masnet.com
Authorization: Bearer <token con write:price_requests>
Content-Type: application/json
Idempotency-Key: COT-2026-00123-1
{
"contract_version": "price-response.v1",
"erp_reference": "COT-2026-00123",
"currency": "CLP",
"lines": [
{
"line_key": "a3f1c0de5b7e4f2a9c1d8e6b4a2f0c19",
"result": "priced",
"product": {
"internal_code": "AF-40"
},
"unit_price": "15100.00"
},
{
"line_key": "b9c2d4e6f8a0b2c4d6e8f0a2b4c6d8e0",
"result": "priced",
"product": {
"internal_code": "ON-08"
},
"unit_price": "820.00",
"note": "Precio con stock en Santiago"
},
{
"line_key": "c004e1f2a3b4c5d6e7f8091a2b3c4d5e",
"result": "unavailable",
"note": "Sin stock"
}
]
}resultispriced(withproductandunit_price) orunavailable(with an optionalnote). A system that cannot quote answers every lineunavailable. There is no other way to reject.productcarries exactly one of the keyscatalog_item_id,internal_codeorexternal_id.external_idis valid only if the channel integration has a catalog source. Every key must match a single active product of the company catalog.unit_priceis a positive decimal as text, with up to 14 integer digits and 4 decimals. Nothing is rounded.currencymust be the bid currency.noteis plain text of up to 500 characters. The answer admits up to 2000 lines, eachline_keyonce, and a body of 4 MiB at most.Idempotency-Keyis required: 1 to 255 visible ASCII characters. Use the same key when retrying the same answer.- The quantity is the buyer quantity and the answer does not change it. It does not reactivate a line marked "Do not bid" either.
Result per line
An accepted answer returns 200 with the summary and the result of each line:
{
"price_request_id": "0b7d5c2e-6f1a-4c4e-9a37-1f8f3c2d9e10",
"status": "applied",
"replayed": false,
"summary": {
"total": 3,
"by_result": {
"price_set": 1,
"product_added": 1,
"no_price": 1
}
},
"lines": [
{
"line_key": "a3f1c0de5b7e4f2a9c1d8e6b4a2f0c19",
"line_number": 1,
"result": "price_set"
},
{
"line_key": "b9c2d4e6f8a0b2c4d6e8f0a2b4c6d8e0",
"line_number": 2,
"result": "product_added"
},
{
"line_key": "c004e1f2a3b4c5d6e7f8091a2b3c4d5e",
"line_number": 3,
"result": "no_price"
}
],
"rejected_lines": []
}result | When | What changes in the bid |
|---|---|---|
price_set | Same product, new price | The price, marked as coming from the ERP |
product_added | Line without a product, and the system brings product and price | Product and price |
product_replaced | A product other than the one the line had | Product and price |
unchanged | Same product and same price | Nothing |
no_price | result: unavailable | Nothing. The bid shows the note |
not_returned | A requested line the answer does not include | Nothing |
invalid | A price that does not match the format, or a currency other than the bid currency | Nothing |
product_unknown | A key without an active product, or external_id without a catalog source | Nothing |
product_ambiguous | The key matches more than one active product | Nothing |
line_fixed | The field is fixed by an approval | Nothing |
line_changed | The line changed after the request was sent | Nothing. The bid shows the proposal |
line_not_offered | The line is marked "Do not bid" | Nothing. The bid shows the proposal |
rejected_unknown_line | The line_key is not part of the request | Nothing |
Deadline, retries and errors
| Response | When | What to do |
|---|---|---|
200 with replayed: true | A repeat of the same content already applied (header Idempotent-Replayed: true) | Nothing: it is the stored result, not applied again |
503 with Retry-After | The transaction did not finish and nothing was applied | Retry with the same Idempotency-Key and the same body |
| PRICE_RESPONSE_INVALID (400) | The body does not match price-response.v1. issues tells where | Fix the body |
| idempotency_key_required (400) | Idempotency-Key is missing or malformed | Send the header |
| PRICE_REQUEST_NOT_AWAITING (409) | The request was cancelled or its delivery failed | Do not retry |
| PRICE_REQUEST_EXPIRED (409) | respond_by has passed | Do not retry. The person can request again |
| PRICE_RESPONSE_CONFLICT (409) | Another answer with different content was already applied | Do not retry: the first accepted answer wins |
{
"type": "https://masnet.com/developers/errors/PRICE_REQUEST_EXPIRED",
"title": "Plazo vencido",
"status": 409,
"detail": "Venció el plazo de respuesta de la solicitud (respond_by).",
"code": "PRICE_REQUEST_EXPIRED",
"correlation_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}Error responses use RFC 9457, like the rest of the API. The full catalog is in Errors. While the request is open, the requested lines stay locked in the bid. They are released when the request expires, is cancelled or is answered.
Test request
The destination test sends a request with fixed content and a test_… id of 32 hexadecimal digits. It does not come from a bid and locks no lines. The system reads it and answers it through the same routes.
- The answer returns 200 with
status: validatedandtest: true: the result of every line under the rules above, with the product keys looked up in the company catalog in read-only mode. Nothing is applied. - It can be answered for 30 minutes, plus 5 minutes of grace. After that it answers
PRICE_REQUEST_EXPIRED. - It works for production and test integrations, whether or not they are the channel.
Schemas
- price-request.v1: the request object, in the event and in the read.
- price-response.v1: the answer body and the applied result (
$defs/applied). - The event
dataschemais price_request, which describesdata. Both schemas are byte for byte copies of the ones Masnet validates.