FujnBUSINESS API

One 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.

Introduction

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.

Getting your key

  1. Sign in to Fujn and open the affiliate dashboard.
  2. Go to the API tab and submit the service you will integrate, together with your markup.
  3. An admin reviews every request. Once approved, your key can create live orders and you are notified by email.
  4. Copy your API key and secret and keep them safe. The secret is shown only once.
Open API management

Authentication

Data is sent as JSON with UTF-8 encoding. Every request must carry these headers:

Base URLhttps://api.fujn.com/api/v1

Content-Typeapplication/json; charset=UTF-8

X-API-KEYyour public API key

X-API-SIGNhmac_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"

Request limits

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.

POST/v1/ccies1 weight unit

List 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"
    }
  ]
}

POST/v1/price1 weight unit

Get a quote for a pair: the rate, the receive amount, and the minimum and maximum for the exchange. Pass afftax to add your markup.

NameTypeRequiredDescription
typestringyes"fixed" or "float".
fromCcystringyesCode of the currency the client sends.
toCcystringyesCode of the currency the client receives.
directionstringyes"from" if amount is the send amount, "to" if it is the receive amount.
amountnumberyesThe amount, read per direction.
afftaxnumbernoYour 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": []
  }
}

POST/v1/create50 weight units

Create an exchange order for a pair, amount and destination address. The response includes the deposit address and an order token used to track it.

NameTypeRequiredDescription
typestringyes"fixed" or "float".
fromCcystringyesCode of the currency the client sends.
toCcystringyesCode of the currency the client receives.
directionstringyes"from" or "to".
amountnumberyesThe amount, read per direction.
toAddressstringyesDestination address the exchanged funds are sent to.
tagstringnoMEMO or destination tag, if the receiving address needs one.
afftaxnumbernoYour 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 }
  }
}

POST/v1/order1 weight unit

Fetch the live status of an order. Use the id and the token returned by create.

NameTypeRequiredDescription
idstringyesOrder ID.
tokenstringyesOrder 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" }
  }
}

Errors

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 }
codeHTTPMeaning
0200Success.
1401Authentication failed: missing or invalid X-API-KEY or X-API-SIGN.
2403API key is not active: pending approval, suspended or blocked.
3400Invalid request: a required field is missing or malformed.
4400Unsupported currency or pair.
5422Amount is below the minimum or above the maximum.
6502Could not generate a deposit address. Please retry.
7503Exchange temporarily unavailable.
8429Rate limit exceeded.

Your earnings

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