Sandbox tutorial: run the demo yourself
The quickstart proves the contract works. This is the longer walk: nine sections, every one a request you can paste, ending with a placed order and a working mental model of how linear trades on VAMOS. Budget half an hour.
The sandbox seller is Acme Broadcasting. It sells four products across one quarter, and it answers differently to different questions: a week that is nearly gone costs more than a week that is wide open, one week is dark, and one product exists on two dates only.
1. Get set up
You need two bearer secrets, one per side. The buyer secret drives the catalog and order calls; the seller secret makes the approval decision in section 6. Ask for both when you request sandbox access.
export VAMOS=https://api.sandbox.vamos.simulmedia.com/v1 export VAMOS_BUYER=<your buyer secret> export VAMOS_SELLER=<your seller secret> export VAMOS_SESSION=$(uuidgen)
The sandbox keeps every run in its own namespace, keyed by the X-Sandbox-Session header, so nobody else's traffic can move your orders. Generate the value once and send it on every request in this walkthrough, both sides included: the buyer creates the order and the seller decides it, and they must be looking at the same run. Omit the header and the sandbox mints a fresh session, returns it to you in the response header, and your next call lands somewhere else.
Two shell helpers for the rest of the page:
buyer() { curl -s -H "Authorization: Bearer $VAMOS_BUYER" -H "X-Sandbox-Session: $VAMOS_SESSION" "$@"; }
seller() { curl -s -H "Authorization: Bearer $VAMOS_SELLER" -H "X-Sandbox-Session: $VAMOS_SESSION" "$@"; }
Responses below are piped through jq where the full payload is longer than the point being made.
2. See what Acme sells
Start with who exists, then with what they publish. Five sellers are shown here; this walkthrough buys from Acme, and each row also carries its networks and catalog_url.
buyer $VAMOS/sellers | jq '[.sellers[] | {seller, name, level}]' [ { "seller": "acme", "name": "Acme Broadcasting", "level": 2 }, { "seller": "northlight", "name": "Northlight Networks", "level": 3 }, { "seller": "cordillera", "name": "Cordillera Media Group", "level": 2 }, { "seller": "halcyon", "name": "Halcyon Entertainment", "level": 1 }, { "seller": "meridian", "name": "Meridian Sports Net", "level": 0 } ]
level is the seller level: how much of the flow this seller can do, from file drops up to synchronous holds. Acme is a level 2 seller. Whatever the level, a person at the seller approves every order (section 6).
buyer $VAMOS/sellers/acme/catalog \ | jq '[.products[] | {product_id, type, distribution, buy_types}]' [ { "product_id": "acme-prime", "type": "daypart", "distribution": "network", "buy_types": ["preemptible","non_preemptible","fixed_position","audience_guaranteed"] }, { "product_id": "acme-morning-syndicated", "type": "sponsorship", "distribution": "syndication", "buy_types": ["non_preemptible","fixed_position","audience_guaranteed"] }, { "product_id": "acme-daytime", "type": "daypart", "distribution": "network", "buy_types": ["preemptible","non_preemptible"] }, { "product_id": "acme-gameday", "type": "program", "distribution": "network", "buy_types": ["fixed_position","audience_guaranteed"] } ]
Three of these fields carry the vocabulary the rest of the walkthrough uses.
typeis the shape of the inventory. Adaypartrecurs weekly. Aprogramexists on the dates it airs and nowhere else. Asponsorshipattaches to a program rather than filling its breaks, which is why this one carries abillboard. See products.distributionis which layer the inventory sits in:network,syndication, orspot. It says whose clearance this is; it is not geography.buy_typesis what the seller will sell you on that product.acme-daytimesells two of the four;acme-gamedaydoes not sell preemptible at all. Read the four in the deal model.
Filter on either field:
buyer "$VAMOS/sellers/acme/catalog?buy_type=fixed_position" | jq '[.products[].product_id]' [ "acme-prime", "acme-morning-syndicated", "acme-gameday" ] buyer "$VAMOS/sellers/acme/catalog?distribution=syndication" | jq '[.products[].product_id]' [ "acme-morning-syndicated" ]
3. Compare two weeks
Acme's quarter is thirteen ISO weeks, 2026-W40 through 2026-W52. Ask about two of them at once. product_id and weeks are both repeatable, so one call covers a whole flight.
buyer "$VAMOS/sellers/acme/avails?product_id=acme-prime&weeks=2026-W40&weeks=2026-W47" \ | jq '[.avails[] | {week: .period.start, state, sellout_level, spots, preemptible: ([.rates[] | select(.buy_type=="preemptible" and .spot_length==30) | .gross_rate_unit] | first)}]' [ { "week": "2026-W40", "state": "available", "sellout_level": 0.2, "spots": { "available": 64 }, "preemptible": 320 }, { "week": "2026-W47", "state": "available", "sellout_level": 0.88, "spots": { "available": 10 }, "preemptible": 545 } ]
Same product, same spot length, same market class. One costs 320 a spot and one costs 545: 2026-W40 is the quarter opening with 64 of 80 spots left, and 2026-W47 is the pre-holiday peak with 10. Inventory is priced by scarcity, so every rate carries the week it applies to.
Try the whole quarter and read the curve: cheap at the open, level through the middle, peak at 2026-W47, and cheapest of all at 2026-W52 as the quarter closes out.
buyer "$VAMOS/sellers/acme/avails?product_id=acme-prime$(printf '&weeks=2026-W%d' $(seq 40 52))" \
| jq -r '.avails[] | "\(.period.start) \(.state) sellout=\(.sellout_level) preemptible=\(
[.rates[] | select(.buy_type=="preemptible" and .spot_length==30)
| .gross_rate_unit] | first)"'
2026-W40 available sellout=0.2 preemptible=320
2026-W41 available sellout=0.62 preemptible=405
2026-W42 available sellout=0.94 preemptible=470
2026-W43 unavailable sellout=1 preemptible=405
2026-W44 available sellout=0.55 preemptible=405
2026-W45 available sellout=0.55 preemptible=405
2026-W46 available sellout=0.55 preemptible=405
2026-W47 available sellout=0.88 preemptible=545
2026-W48 available sellout=0.55 preemptible=405
2026-W49 available sellout=0.55 preemptible=405
2026-W50 available sellout=0.55 preemptible=405
2026-W51 projected sellout=0.7 preemptible=355
2026-W52 available sellout=0.15 preemptible=250
Two of those states are not available, and both matter. 2026-W43 is unavailable: the seller is telling you there is nothing to sell, before you write an order. 2026-W51 is projected: quotable, not yet firmly clearable, because the week has not been scheduled down to the break. See the tri-state answer.
4. Compare two buy types
Now hold the week still and change what you are buying. spot_length=30 holds the creative length still too; length is its own axis of the card, and dropping the filter returns every length Acme prices (section 4b). This is the same 2026-W41 thirty-second cell four different ways.
buyer "$VAMOS/sellers/acme/avails?product_id=acme-prime&weeks=2026-W41&spot_length=30" | jq '.avails[0].rates'
[
{ "market_class": "scatter", "advertiser_class": "general", "spot_length": 30,
"buy_type": "preemptible", "clearance_tier": "P2", "rate_basis": "per_unit",
"gross_rate_unit": 405, "locked_rate_id": "lr_88c1", "currency": "USD" },
{ "market_class": "scatter", "advertiser_class": "general", "spot_length": 30,
"buy_type": "non_preemptible", "rate_basis": "per_unit",
"gross_rate_unit": 520, "locked_rate_id": "lr_88c2", "currency": "USD" },
{ "market_class": "scatter", "advertiser_class": "general", "spot_length": 30,
"buy_type": "fixed_position", "rate_basis": "per_unit",
"gross_rate_unit": 640, "locked_rate_id": "lr_88c4", "currency": "USD" },
{ "market_class": "scatter", "advertiser_class": "general", "spot_length": 30,
"buy_type": "audience_guaranteed", "rate_basis": "per_unit",
"gross_rate_unit": 435.2,
"guaranteed_impressions": 128000, "audience_code": "hh",
"locked_rate_id": "lr_88c3", "currency": "USD" }
]
405, 520, 640. Each rung buys more certainty, and the rungs are classes of time the trade and the FCC already recognize.
preemptibleat 405. Cheapest, and the seller may bump it for a better-paying buyer.clearance_tier: "P2"says how much notice you get; the tier appears only on this buy type.non_preemptibleat 520. A 28% premium, and what it buys is that the spot airs.fixed_positionat 640. A further step, and what the extra 120 buys is where: a named position, not just somewhere in the week.audience_guaranteedat 435.20 a unit. A different axis, not a rung. Here you buy delivered households, andguaranteed_impressionsis the seller stating how many one unit delivers: 128,000. Noterate_basis: "per_unit". A guarantee books in units at a fixed price like every other buy type, so you vary how many guarantee units you buy, not an impression count.audience_code: "hh"names the audience the guarantee is denominated in, andgross_rate_unitis what you transact on. The entry carries no CPM field: the equivalent CPM is your own arithmetic, 435.20 against 128,000 households being $3.40. The cell reconciles to the spot cell on the same product, 405 against 128,000 households a spot being a $3.16 CPM, plus about 7% for the seller carrying the delivery risk.
Every cell carries a locked_rate_id. That handle goes on the order line, and it is the price-clearance invariant: you transact the price you were shown, or the order fails instead of clearing at another price.
4b. Change the length
Now hold the buy type still and change the creative length. Drop the spot_length filter and Acme prices three of them on this product.
buyer "$VAMOS/sellers/acme/avails?product_id=acme-prime&weeks=2026-W41" \
| jq -r '.avails[0].rates[] | select(.buy_type=="preemptible")
| "\(.spot_length)s \(.gross_rate_unit)"'
15s 315
30s 405
60s 750
315, 405, 750. A :15 is 78% of the :30 here, not 50%, and a :60 is 1.85x, not 2x. Those ratios are Acme's pricing: each length is its own cell on the card, with its own locked_rate_id, and the platform does not derive one length's price from another's. Ask the same question in the quarter's peak week:
buyer "$VAMOS/sellers/acme/avails?product_id=acme-prime&weeks=2026-W47" \
| jq -r '.avails[0].rates[] | select(.buy_type=="preemptible")
| "\(.spot_length)s \(.gross_rate_unit)"'
15s 545
30s 545
60s 1010
In 2026-W47 the :15 costs what the :30 costs: short inventory is as scarce as long inventory that week, so the discount disappears. Rate cards price lengths, not seconds.
The other products price the lengths they sell: acme-daytime and acme-morning-syndicated sell :15 and :30, and acme-gameday sells :30 and :60. audience_guaranteed is priced at :30 only in this sandbox.
5. Place an order and watch it move
Six preemptible spots in 2026-W41, at the rate you just read. The line quotes unit_cost and locked_rate_id together, and rate_version names the catalog commit you priced against. Each line can also name its creative_id: the creative that will run, by reference into your own registry. It is optional at every state; an order placed without one gets its creative later, as a traffic instruction.
Timestamps in these examples are illustrative. The sandbox stamps every event, receipt, and as_of at the moment of the call, so a response you get back carries today's instant rather than the one printed here. What the examples fix is the shape and the ordering: stamps on one order are strictly increasing, and two calls a minute apart are a minute apart in the log.
buyer -X POST $VAMOS/orders -H "Content-Type: application/json" -d '{ "seller": "acme", "external_order_id": "tutorial-flight-01", "rate_version": "acme-2026q4-v1", "line_items": [ { "product_id": "acme-prime", "period": { "grain": "week", "start": "2026-W41" }, "units": 6, "spot_length": 30, "creative_id": "crt_9c2e5b71f048", "rate": { "market_class": "scatter", "advertiser_class": "general", "buy_type": "preemptible", "clearance_tier": "P2", "unit_cost": 405, "locked_rate_id": "lr_88c1", "currency": "USD" } }], "buyer_metadata": { "advertiser_id": "adv_4c1f7a2b9e03", "campaign_id": "cmp_6b2f81d40a9e" } }' { "order_id": "ord_608cd9a032c5", "external_order_id": "tutorial-flight-01", "buyer_entity": "yourco", "status": "submitted", "created_at": "2026-10-01T14:02:11Z" }
external_order_id is your key, and it is the idempotency key too: repeat the call with the same bytes and you get the same order back with X-Idempotent-Replay: true. Change the bytes under the same id and you get a 409. The replay check compares the raw request body, so reformatting the same order (different whitespace, reordered keys) reads as a different payload and conflicts. If your client re-serializes between attempts, keep one serialized body per external_order_id and resend that. Save the order id:
export VAMOS_ORDER=ord_608cd9a032c5
The snapshot is always authoritative. Ask it where the order is:
buyer $VAMOS/orders/$VAMOS_ORDER \
| jq '{order_id, status, last_seq, totals,
line_items: [.line_items[] | {unit_id, period, units, status, num_accepted}]}'
{
"order_id": "ord_608cd9a032c5",
"status": "seller_review",
"last_seq": 4,
"totals": { "gross": 2430, "currency": "USD" },
"line_items": [
{ "unit_id": "u-0001", "period": { "grain": "week", "start": "2026-W41" }, "units": 6,
"status": "pending", "num_accepted": 0 }
]
}
It stopped at seller_review. Nothing is booked yet, and num_accepted is 0. The event stream shows how it got there, one sequenced step at a time:
buyer "$VAMOS/events?order=$VAMOS_ORDER" | jq '[.events[] | {seq, status, occurred_at}]'
[
{ "seq": 1, "status": "submitted", "occurred_at": "2026-10-01T14:02:11Z" },
{ "seq": 2, "status": "validating", "occurred_at": "2026-10-01T14:02:12Z" },
{ "seq": 3, "status": "confirmed", "occurred_at": "2026-10-01T14:02:13Z" },
{ "seq": 4, "status": "seller_review", "occurred_at": "2026-10-01T14:02:14Z" }
]
seq is monotonic per order, so you can replay from any point with &after_seq= without missing or double-counting a transition. In production the same events arrive at your notify_url; the stream is the catch-up path, not a second source of truth. The full rail is in the state machine.
6. Be the seller
The order is waiting on a person at the seller, and buyer-side retrying will not move it. Switch secrets and be that person.
seller -X POST $VAMOS/me/orders/$VAMOS_ORDER/decide -H "Content-Type: application/json" -d '{ "decision": "approve", "actor": "sales@acmebroadcasting.example", "units": [ { "unit_id": "u-0001", "action": "accept", "num_accepted": 6 } ] }' { "order_id": "ord_608cd9a032c5", "status": "placed", "units_accepted": 6, "units_countered": 0, "units_rejected": 0 }
The decision is per unit: a seller accepts, rejects, or counters each line on its own, so units_accepted, units_countered, and units_rejected are three separate counts. Now read the order back:
buyer $VAMOS/orders/$VAMOS_ORDER \
| jq '{status, line_items: [.line_items[] | {status, num_accepted, allocation}], artifacts}'
{
"status": "placed",
"line_items": [
{ "status": "accepted", "num_accepted": 6,
"allocation": [ { "date": "2026-10-05", "units": 2 },
{ "date": "2026-10-07", "units": 2 },
{ "date": "2026-10-09", "units": 2 } ] }
],
"artifacts": [
{ "seq": 5, "name": "placement_receipt", "seller_order_id": "ACME-77120",
"daylocks": [ { "unit_id": "u-0001", "date": "2026-10-05", "units": 2 },
{ "unit_id": "u-0001", "date": "2026-10-07", "units": 2 },
{ "unit_id": "u-0001", "date": "2026-10-09", "units": 2 } ],
"placed_at": "2026-10-01T14:02:15Z" }
]
}
placed means booked. allocation lists the dates the six spots landed on, and placement_receipt carries the seller's own order id, so you can reconcile the buy in both systems.
7. Now make it interesting
Four outcomes to trigger, because you will meet all four in production.
Partial acceptance. Ask for 10 spots and have the seller take 6. Create the order the same way as section 5, changing external_order_id to tutorial-partial-01 and units to 10; the sandbox returns ord_4bbfb549b3a6. Then decide with num_accepted: 6:
seller -X POST $VAMOS/me/orders/ord_4bbfb549b3a6/decide -H "Content-Type: application/json" -d '{
"decision": "approve", "actor": "sales@acmebroadcasting.example",
"units": [ { "unit_id": "u-0001", "action": "accept", "num_accepted": 6 } ]
}'
{ "order_id": "ord_4bbfb549b3a6", "status": "placed",
"units_accepted": 6, "units_countered": 0, "units_rejected": 4 }
buyer $VAMOS/orders/ord_4bbfb549b3a6 \
| jq '{status, line_items: [.line_items[] | {unit_id, status, units, num_accepted}]}'
{ "status": "placed",
"line_items": [ { "unit_id": "u-0001", "status": "accepted",
"units": 10, "num_accepted": 6 } ] }
The order is placed and the unit is accepted at 6 of the 10 you asked for. There is no separate partial status to branch on, and an order is not all-or-nothing: plan against num_accepted, not against what you asked for.
A counter, and your answer. Create the order as in section 5 with external_order_id: "tutorial-counter-01" and "units": 4; the sandbox returns ord_1bc3d8c629d4. Then have the seller counter it on price rather than accept it:
seller -X POST $VAMOS/me/orders/ord_1bc3d8c629d4/decide -H "Content-Type: application/json" -d '{ "decision": "counter", "actor": "sales@acmebroadcasting.example", "units": [ { "unit_id": "u-0001", "action": "counter", "counter": { "week": "2026-W41", "unit_cost": 455.00, "num_offered": 4 }, "reason": "Prime is tight that week. Four units at the higher rate." } ] }' { "order_id": "ord_1bc3d8c629d4", "status": "negotiating", "units_accepted": 0, "units_countered": 4, "units_rejected": 0 }
The order is negotiating and it now carries two lines: your ask, still pending, and the seller's offer beside it at countered, priced at its own quote commit with a quote_expires_at. Nothing was replaced, so every unit you asked for is still accounted for. Now answer it as the buyer:
buyer -X POST $VAMOS/orders/ord_1bc3d8c629d4/respond -H "Content-Type: application/json" -d '{ "action": "accept", "actor": "buyer@yourco.com" }' { "order_id": "ord_1bc3d8c629d4", "status": "placed", "units_accepted": 4, "units_rejected": 4 } buyer $VAMOS/orders/ord_1bc3d8c629d4 \ | jq '{status, gross: .totals.gross, line_items: [.line_items[] | {unit_id, status, num_accepted, unit_cost: .rate.unit_cost}]}' { "status": "placed", "gross": 1820, "line_items": [ { "unit_id": "u-0001", "status": "rejected", "num_accepted": 0, "unit_cost": 405 }, { "unit_id": "u-0001-c1", "status": "accepted", "num_accepted": 4, "unit_cost": 455 } ] }
placed, at the seller's price: the offer booked at its own quote, the ask it answered resolved rejected, and gross is four units at 455.00 rather than the 1,620.00 you asked for. The quote's window applies to accepting: leave it past quote_expires_at and the same call returns 409 STALE_RATE_CARD naming the commit that lapsed, with the order still negotiating. action: "withdraw" is the other way out, and it cancels the order with the reason you give. Countering back as the buyer is published and not served by the sandbox yet: it answers 422 naming the two actions that are.
Inventory unavailable. Order into 2026-W43, the dark week. The request is well formed; the answer is still no. Use external_order_id: "tutorial-w43-01", period.start set to 2026-W43, "units": 4, and that week's own rate handle lr_pr43p. Create still returns 201 and ord_433e6f626dba, because intake accepted a valid request; the rejection lands on the stream:
buyer "$VAMOS/events?order=ord_433e6f626dba&after_seq=2" | jq '.events'
[
{ "event_type": "order.status_changed", "buyer_entity": "yourco",
"seq": 3, "status": "rejected", "prior_status": "validating",
"substatus": null, "artifact": null,
"error": { "error_code": "INVENTORY_UNAVAILABLE",
"error_message": "Requested period lacks availability",
"stage": "availability", "recoverable": true, "details": {} },
"occurred_at": "2026-10-01T14:02:13Z",
"units": [ { "unit_id": "u-0001", "status": "rejected", "num_accepted": 0,
"reason": "Inventory is unavailable for the requested period",
"allocation": [] } ] }
]
Availability is the only business reason an order gets rejected outright, and the check runs at create. recoverable: true is the actionable part: refetch avails, pick a week that exists, order again.
Stale rate card. Send a rate_version behind the current one and the platform refuses it. Repeat the section 5 create with external_order_id: "tutorial-stale-01" and "rate_version": "acme-2026q4-v0". You get ord_5a9ec49da4bf, and then:
buyer "$VAMOS/events?order=ord_5a9ec49da4bf&after_seq=2" | jq '.events'
[
{ "event_type": "order.status_changed", "buyer_entity": "yourco",
"seq": 3, "status": "failed", "prior_status": "validating",
"substatus": null, "artifact": null,
"error": { "error_code": "STALE_RATE_CARD",
"error_message": "rate_version acme-2026q4-v0 is behind acme-2026q4-v1",
"stage": "validation", "recoverable": true,
"details": { "rate_drift": [ { "unit_id": "u-0001",
"locked_rate_id": "lr_88c1",
"your_cost": 405,
"current_cost": 405 } ] } },
"occurred_at": "2026-10-01T14:02:13Z" }
]
rate_drift shows, per unit, what you locked against what the card says now. Here the numbers match, so re-submitting at the current version costs you nothing. When they do not match, you learn the difference before you own it: that is the invariant, and why the order is failed rather than recleared at the new price. Full list of codes on the errors page.
X-Sandbox-Session and you get byte-identical answers, apart from timestamps. The sandbox is deterministic, so a failing integration test means your code changed.8. Where to go next
- Point an agent at it. The MCP surface exposes the same calls as tools, so a buying agent can run this walkthrough itself. Buy with MCP is the working session.
- Learn the objects properly. The object model, then the deal model for the four buy types and guarantees for the tri-state avail.
- Widen the flight. One line per week is the grain, so a four-week buy is four lines in one order. Try
2026-W44through2026-W47and watch the totals cross the price curve. - Buy the other products.
acme-gamedayonly exists on2026-11-22and2026-12-20, andacme-morning-syndicatedreconciles under a tighter posting policy than Prime. One order may carry lines from both, each under its own product's terms. - Read the reference. API overview for the surface, objects for every field, conventions for idempotency and errors.