Request a hedge
A physical contract needs covering. The request becomes a hedge in the Mercora Inbox for an operator to send to the broker; nothing is sent from the API. A request that cannot be planned is still recorded: 201 with state: failed and the reason (unknown book, no Agiboo position, contract already on another hedge).
Scope: hedge_requests.
Authorizations
A workspace API key (mk_…), made under Settings → Administration → API.
Body
Your own id for this request, any string. Sending it again returns the hedge already staged instead of a second one.
1 - 200A book id from GET /hedge-books. It sets the commodity, exchange, futures symbol, lot size and broker.
1 - 100The physical contract the hedge covers, e.g. "CO25-AC-014". A contract can be on one hedge only.
1 - 100Supplier or buyer on that contract.
1 - 200SELL hedges a purchase, BUY hedges a sale.
BUY, SELL Tonnes to hedge: the contract's quantity, or the part of it to cover.
x <= 1000000Futures month to cover, as YYYY-MM.
^(\d{4})-(0[1-9]|1[0-2])$Lots to trade, when you have decided them; sent to the broker as is. Absent: the tonnes over the book's lot size, rounded to the nearest lot, at least 1.
x <= 10000Who asked, in your system. Shown on the Inbox card.
1 - 200Shown on the Inbox card.
1 - 2000Only for a workspace that books hedges in Agiboo.
Response
Same external_id, same body: the hedge already staged.
Mercora's id for the hedge: GET /hedge-requests/{id}.
The caller's own id it was sent with.
processing: being planned · awaiting_approval: planned, waiting for an operator to send, accumulate or dismiss it · accumulated: parked to go out with a later hedge on the same month · merged: folded into another hedge's order · sending: the broker order is going out · awaiting_fill: order sent, waiting for the broker's fill · filled: fill recorded · closed: closed without a recorded fill · dismissed: an operator dismissed it · failed: could not be planned or sent; reason says why
processing, awaiting_approval, accumulated, merged, sending, awaiting_fill, filled, closed, dismissed, failed Why it failed, when state is failed.
The order Mercora planned. Null while processing and when planning failed.
The broker's fill, once recorded.
The executed trade in Mercora's futures ledger, once filled.
Only for a workspace that books hedges in Agiboo; null when the hedge names no Agiboo position.
ISO 8601 timestamp.
The hedge in the Mercora Inbox.