Skip to main content
POST
Request a hedge

Authorizations

Authorization
string
header
required

A workspace API key (mk_…), made under Settings → Administration → API.

Body

application/json
external_id
string
required

Your own id for this request, any string. Sending it again returns the hedge already staged instead of a second one.

Required string length: 1 - 200
book
string
required

A book id from GET /hedge-books. It sets the commodity, exchange, futures symbol, lot size and broker.

Required string length: 1 - 100
contract_ref
string
required

The physical contract the hedge covers, e.g. "CO25-AC-014". A contract can be on one hedge only.

Required string length: 1 - 100
counterparty
string
required

Supplier or buyer on that contract.

Required string length: 1 - 200
direction
enum<string>
required

SELL hedges a purchase, BUY hedges a sale.

Available options:
BUY,
SELL
quantity_tonnes
number
required

Tonnes to hedge: the contract's quantity, or the part of it to cover.

Required range: x <= 1000000
cover_month
string
required

Futures month to cover, as YYYY-MM.

Pattern: ^(\d{4})-(0[1-9]|1[0-2])$
lots
integer

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.

Required range: x <= 10000
requested_by
string

Who asked, in your system. Shown on the Inbox card.

Required string length: 1 - 200
note
string

Shown on the Inbox card.

Required string length: 1 - 2000
agiboo
object

Only for a workspace that books hedges in Agiboo.

Response

Same external_id, same body: the hedge already staged.

id
string
required

Mercora's id for the hedge: GET /hedge-requests/{id}.

external_id
string
required

The caller's own id it was sent with.

state
enum<string>
required

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

Available options:
processing,
awaiting_approval,
accumulated,
merged,
sending,
awaiting_fill,
filled,
closed,
dismissed,
failed
reason
string | null
required

Why it failed, when state is failed.

plan
object | null
required

The order Mercora planned. Null while processing and when planning failed.

fill
object | null
required

The broker's fill, once recorded.

futures_trade_id
string | null
required

The executed trade in Mercora's futures ledger, once filled.

agiboo
object | null
required

Only for a workspace that books hedges in Agiboo; null when the hedge names no Agiboo position.

created_at
string
required

ISO 8601 timestamp.

url
string
required

The hedge in the Mercora Inbox.