The broker gateway
You execute FX trades for companies that use ELEGG FX: send them straight into their account, with their authorization. They have nothing left to re-enter.
How it works
- ELEGG Finance registers you as a partner broker and gives you an "elegg_partner_…" key. It identifies your company, not a client.
- Your client authorizes you in ELEGG FX (Settings → Brokers): they get a single-use link code, valid seven days, which they pass on to you.
- You present that code with your own client reference ("customer_ref"): the link is made. From then on, you always designate that client by this reference.
- You send the trades executed for this client. You can only read those back: never their needs, their exposure, or their trades with other banks.
- The client can withdraw the authorization at any time: your next sends for them are refused (403 not_linked).
Endpoints
Base URL: https://eleggfinance.com/api/partner/v1. Authorization: Bearer elegg_partner_… on every call. 120 calls per minute per key.
| POST | /links | Makes the link: { code, customer_ref }. |
| GET | /links | Your linked clients: reference, company, link date. |
| PUT | /trades | Creates or updates trades: { customer_ref, trades: [ … ] }. |
| GET | /trades?customer_ref=… | The trades you sent for this client, with their status in ELEGG FX. |
| DELETE | /trades?customer_ref=…&reference=… | Cancels a trade. |
curl -X POST https://eleggfinance.com/api/partner/v1/links \
-H "Authorization: Bearer elegg_partner_…" \
-H "Content-Type: application/json" \
-d '{ "code": "LIEN-7K2Q-9XMD-4TRA", "customer_ref": "CLI-00042" }'Sending trades
Each trade has the fields of a hedge in the client API: reference (your deal number), product_type (forward, forward_open, ndf, vanilla, tunnel, leveraged, ki_forward), currency, side (buy: the client buys the currency; sell: they sell it), notional, maturity_date and, depending on the product, rate, trade_date, option_kind, strike_short, barrier_type, barrier_level…
Resending the same reference updates the trade: you are the source of truth for your trades. All or nothing, 1000 trades per call at most. Dates as YYYY-MM-DD, rates as currency per 1 euro.
curl -X PUT https://eleggfinance.com/api/partner/v1/trades \
-H "Authorization: Bearer elegg_partner_…" \
-H "Content-Type: application/json" \
-d '{
"customer_ref": "CLI-00042",
"trades": [
{
"reference": "DEAL-2026-118204",
"product_type": "forward",
"currency": "USD",
"side": "buy",
"notional": 250000,
"rate": 1.0912,
"maturity_date": "2027-01-29",
"trade_date": "2026-10-19"
}
]
}'{
"imported": 1,
"pending": 0,
"updated": 0,
"results": [
{ "reference": "DEAL-2026-118204", "status": "imported", "hedge_id": "3c1e…", "change": "created" }
]
}What happens to a trade
- imported: it is saved as a hedge in the client's account.
- pending: it looks like a hedge the client had already entered (same currency and side, maturity within three days, amount within 1%). The client decides: merge, add or dismiss. Nothing is counted twice without them seeing it.
- merged: the client merged it with their entry; the hedge takes the values of your confirmation.
- dismissed: the client dismissed it. Your updates are kept, and so is their decision.
- cancelled: you cancelled it. A hedge you had created is removed; a hedge the client entered and then merged stays with them.
Errors
Same format as the client API: { "error": { "code", "message", "details" } } (messages in French).
- 401 missing_key / invalid_key: key missing, unknown, revoked, or broker suspended.
- 403 not_linked: no client linked under this reference, or authorization withdrawn.
- 404 invalid_code / 410 invalid_code: link code unknown, already used or expired.
- 409 conflict: this client reference is already linked to an account.
- 422 validation_failed: at least one trade rejected; "details" lists them all, nothing is written.
- 429 rate_limited: too many calls, retry in a moment.