Please wait
|BUSINESS APIOne signed REST API to create crypto exchanges from inside your own product. Set your markup, keep it as revenue, and let Fujn handle live pricing, settlement and on-chain tracking. HMAC-signed, predictable JSON, and a request model your team can integrate in an afternoon.
The Fujn Business API gives your product programmatic access to live rates and instant exchange orders, with the same execution quality Fujn runs on. You quote, you create, you track. Every order carries the markup you set on top of our rate, and that markup is yours, paid out as revenue.
To use the API you need an API key and an API secret. Requesting a key enrols you in the affiliate program automatically, so earnings, balance and payouts all live in one dashboard.
Data is sent as JSON with UTF-8 encoding. Every request must carry these headers:
https://api.fujn.com/api/v1application/json; charset=UTF-8your public API keyhmac_sha256(raw_json_body, your_secret)The X-API-SIGN header is an HMAC-SHA256 signature of the exact JSON body string, keyed with your API secret, in hex. Always sign the precise bytes you send. For requests without a body, sign an empty JSON object.
# Build the body, sign it with your secret, then send it.
BODY='{"type":"float","fromCcy":"BTC","toCcy":"ETH","direction":"from","amount":0.1,"toAddress":"0xYourAddress"}'
SIGN=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$API_SECRET" | sed 's/^.* //')
curl -X POST "https://api.fujn.com/api/v1/create" \
-H "X-API-KEY: $API_KEY" \
-H "X-API-SIGN: $SIGN" \
-H "Content-Type: application/json; charset=UTF-8" \
-d "$BODY"
The request limit is 250 weight units per minute. The /v1/create request costs 50 weight units, every other request costs 1 weight unit. If you exceed the limit your key is temporarily throttled, and the wait grows on each repeat.
/v1/ccies1 weight unitList the currencies and networks Fujn supports, with availability for sending and receiving.
Response
{
"code": 0,
"msg": "",
"data": [
{
"code": "BTC",
"coin": "BTC",
"network": "BTC",
"name": "Bitcoin",
"recv": true,
"send": true,
"tag": null,
"logo": "https://assets.fujn.com/images/coins/svg/btc.svg",
"color": "#f7931a"
}
]
}/v1/price1 weight unitGet a quote for a pair: the rate, the receive amount, and the minimum and maximum for the exchange. Pass afftax to add your markup.
| Name | Type | Required | Description |
|---|---|---|---|
type | string | yes | "fixed" or "float". |
fromCcy | string | yes | Code of the currency the client sends. |
toCcy | string | yes | Code of the currency the client receives. |
direction | string | yes | "from" if amount is the send amount, "to" if it is the receive amount. |
amount | number | yes | The amount, read per direction. |
afftax | number | no | Your markup percentage, added on top of our rate. |
Response
{
"code": 0,
"msg": "",
"data": {
"from": { "code": "BTC", "amount": 0.1, "rate": 17.72, "min": 0.0004, "max": 1.51 },
"to": { "code": "ETH", "amount": 1.7715, "rate": 0.0564 },
"errors": []
}
}/v1/create50 weight unitsCreate an exchange order for a pair, amount and destination address. The response includes the deposit address and an order token used to track it.
| Name | Type | Required | Description |
|---|---|---|---|
type | string | yes | "fixed" or "float". |
fromCcy | string | yes | Code of the currency the client sends. |
toCcy | string | yes | Code of the currency the client receives. |
direction | string | yes | "from" or "to". |
amount | number | yes | The amount, read per direction. |
toAddress | string | yes | Destination address the exchanged funds are sent to. |
tag | string | no | MEMO or destination tag, if the receiving address needs one. |
afftax | number | no | Your markup percentage, paid to you as earnings. |
Response
{
"code": 0,
"msg": "",
"data": {
"id": "FJ7C2A9E4B1D8F",
"type": "float",
"status": "NEW",
"token": "a1b2c3d4...your_order_token",
"from": {
"code": "BTC",
"amount": "0.10000000",
"address": "bc1qm8e58htm6qlhz5u7awhe4a5kxt3w86ffwtl9j0",
"tag": null
},
"to": {
"code": "ETH",
"amount": "1.77150000",
"address": "0xYourDestinationAddress"
},
"time": { "reg": 1676458603, "expiration": 1676460403, "left": 1800 }
}
}/v1/order1 weight unitFetch the live status of an order. Use the id and the token returned by create.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | Order ID. |
token | string | yes | Order security token from create. |
Response
{
"code": 0,
"msg": "",
"data": {
"id": "FJ7C2A9E4B1D8F",
"status": "PENDING",
"from": { "code": "BTC", "amount": "0.10000000" },
"to": { "code": "ETH", "amount": "1.77150000" }
}
}Every response carries a code and a msg. A code of 0 means success. Any other value is an error, with a readable reason in msg and the matching HTTP status.
{ "code": 4, "msg": "Pair BTC to XYZ is not supported", "data": null }| code | HTTP | Meaning |
|---|---|---|
0 | 200 | Success. |
1 | 401 | Authentication failed: missing or invalid X-API-KEY or X-API-SIGN. |
2 | 403 | API key is not active: pending approval, suspended or blocked. |
3 | 400 | Invalid request: a required field is missing or malformed. |
4 | 400 | Unsupported currency or pair. |
5 | 422 | Amount is below the minimum or above the maximum. |
6 | 502 | Could not generate a deposit address. Please retry. |
7 | 503 | Exchange temporarily unavailable. |
8 | 429 | Rate limit exceeded. |
You set a markup on top of our base rate, up to 5%. That markup is yours. It accrues to your affiliate balance for every order you create through the API, and you withdraw it from the same dashboard. Requesting an API key enrols you automatically.
Open API management