Domitai Crypto Exchange (0.0.5)

Download OpenAPI specification:Download

This is the API for Domitai. It includes public and private API, callable using REST or Websocket. For Websocket you need to check our node library (to be published)

The Private API requires authentication, that is done with JWT (JSON Web Token), you can learn more at https://jwt.io/

A NodeJS example on how to authenticate is here

  const request = require('superagent');
  const jwt = require('jsonwebtoken');
  const moment = require('moment');

  const auth = () => {
    const token = jwt.sign({ key: API_KEY, nonce: moment().valueOf() }, API_SECRET);
    return { 'Authorization': `bearer ${token}`, 'Content-Type': 'application/json' };
  };

  return request.get('/api/balances').set(auth())
    .then(balances => console.log('Balances: %o', balances.body))
    .then(() => request.get('/api/balance/MXN').set(auth()))
    .then(balance => console.log('Balance MXN: %o', balance.body));

Private API

Returns the balance of a all the accounts

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "payload": {
    }
}

Returns the balance of a specific account

path Parameters
symbol
required
string

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "payload": "127.38233"
}

Returns the list of account balances

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "payload": [
    ]
}

Add a new order

Request Body schema: application/json

Order object that needs to be added to the market

amount
string

The amount of the currency to be in the order

rate
string

The expected price of the currency to be in the order. All orders are type limit, so the prices will be always the expected or better

total
string

The amount of the currency to be in the order, useful when you want to buy an exact amount of one currency and stop once it is bought

book
string
Enum: "bids" "asks"

The amount of the currency to be in the order

market
string

The amount of the currency to be in the order

reserved_only
string

Fill the order until all the reserved amount is consumed if true, if false, stop when all the amount is consumed for sell or the total for buy

Responses

Request samples

Content type
application/json
{
  • "amount": "0.001",
  • "rate": "92784.12",
  • "book": "asks",
  • "market": "btc_mxn"
}

Response samples

Content type
application/json
{
  • "success": true
}

Returns an existing order

path Parameters
orderId
required
integer

The order id

Responses

Response samples

Content type
application/json
{
  • "success": false,
  • "message": "string"
}

Removes an existing order

path Parameters
orderId
required
string

Responses

Response samples

Content type
application/json
{
  • "success": true
}

Issues a new withdrawal

Request Body schema: application/json

Instruction of withdrawal funds

address
string

The address of destination account

fee
number
Enum: 0 1 2 3 4

From 0 to 4, the default is 2. The 0 is fastest/highest price, 4 is slowest/cheaper

amount
string

The amount of the currency to be in the order

symbol
string

The currency that is going to be used

object
description
string

Free text, up to 256 characters

addToCatalog
boolean

If true, the account is added as frequent used accounts. Available only on MXN

Responses

Request samples

Content type
application/json
{
  • "address": "bc1qdqxdzgd28tdqknt4hvevf4t63g47yfhj03lp90",
  • "fee": 2,
  • "amount": "0.1234",
  • "symbol": "BTC",
  • "extra": {
    },
  • "description": "This is a free text description max of 256 chars",
  • "addToCatalog": true
}

Response samples

Content type
application/json
{
  • "success": true
}

Point of Sale (PoS) API

Creates a new Point of Sale order

Request Body schema: application/json

PoS order data

slug
required
string
currency
required
string
Enum: "MXN" "MXNt"
amount
required
string
object

Optional customer data object, can contain whaterver the user wants

generateQR
boolean

If true then the response includes the base64 encoded QR

Responses

Request samples

Content type
application/json
{
  • "slug": "string",
  • "currency": "MXN",
  • "amount": "string",
  • "customer_data": {
    },
  • "generateQR": true
}

Response samples

Content type
application/json
{
  • "success": true,
  • "oid": "string",
  • "payload": {
    }
}

Public API

Return the list of available books at Domitai

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "payload": [
    ]
}

Returns the market ticker with useful information about it like prices, volumes and more

path Parameters
marketId
required
string

The market id in lowercase

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "payload": {
    }
}

Returns the market depth with all the orders

path Parameters
marketId
required
string

The market id in lowercase

query Parameters
aggregate
string

Aggregate equal prices. Currently waiting for development window

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "payload": {
    }
}

Returns a Lightning Network invoice for receiving a deposit

Request Body schema: application/json

Instruction for creating a lightning network invoice

symbol
required
string

The symbol to calculate the amount of Bitcoin

amount
required
string

The amount in symbol, for example 100 MXN, numeric string

relatedAddress
required
string

The address of the domitai account, any address or UserID is accepted, could be user id (uuidv4) or email (username)

lnSymbol
string

NA

Responses

Request samples

Content type
application/json
{
  • "symbol": "MXN",
  • "amount": "10",
  • "relatedAddress": "test@somedomain.com",
  • "lnSymbol": "BTC"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "type": "success",
  • "code": 200,
  • "message": "Nuevo recibo de pago generado",
  • "payload": {
    }
}

Returns the status of an LN Invoice

path Parameters
invoiceId
required
string

The UUIDv4 Invoice ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "type": "success",
  • "code": 200,
  • "message": "Estatus del pago obtenido",
  • "payload": {
    }
}

Returns the LN Invoice

path Parameters
invoiceId
required
string

The UUIDv4 Invoice ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "type": "success",
  • "code": 200,
  • "message": "Estatus del pago obtenido",
  • "payload": {
    }
}

Lightning Network

Returns a Lightning Network invoice for receiving a deposit

Request Body schema: application/json

Instruction for creating a lightning network invoice

symbol
required
string

The symbol to calculate the amount of Bitcoin

amount
required
string

The amount in symbol, for example 100 MXN, numeric string

relatedAddress
required
string

The address of the domitai account, any address or UserID is accepted, could be user id (uuidv4) or email (username)

lnSymbol
string

NA

Responses

Request samples

Content type
application/json
{
  • "symbol": "MXN",
  • "amount": "10",
  • "relatedAddress": "test@somedomain.com",
  • "lnSymbol": "BTC"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "type": "success",
  • "code": 200,
  • "message": "Nuevo recibo de pago generado",
  • "payload": {
    }
}

Returns the status of an LN Invoice

path Parameters
invoiceId
required
string

The UUIDv4 Invoice ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "type": "success",
  • "code": 200,
  • "message": "Estatus del pago obtenido",
  • "payload": {
    }
}

Returns the LN Invoice

path Parameters
invoiceId
required
string

The UUIDv4 Invoice ID

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "type": "success",
  • "code": 200,
  • "message": "Estatus del pago obtenido",
  • "payload": {
    }
}