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));
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 |
{- "amount": "0.001",
- "rate": "92784.12",
- "book": "asks",
- "market": "btc_mxn"
}
{- "success": true
}
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 |
{- "address": "bc1qdqxdzgd28tdqknt4hvevf4t63g47yfhj03lp90",
- "fee": 2,
- "amount": "0.1234",
- "symbol": "BTC",
- "extra": {
- "selectedNetwork": 0
}, - "description": "This is a free text description max of 256 chars",
- "addToCatalog": true
}
{- "success": true
}
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 |
{- "slug": "string",
- "currency": "MXN",
- "amount": "string",
- "customer_data": {
- "email": "user@example.com"
}, - "generateQR": true
}
{- "success": true,
- "oid": "string",
- "payload": {
- "original_amount": "100",
- "original_currency": "MXN",
- "pos_id": 20,
- "pos_slug": "domitai-pos",
- "created_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z",
- "customer_data": {
- "email": "test@example.com"
}, - "status": "waiting_payment",
- "accepted": [
- {
- "currency": "BTCt",
- "amount": "0.00105691",
- "label": "Compatible",
- "address": "2MzNBSgQbftvHps1hTMKxyebB8jZBSqfqPD",
- "rate": "94615.60270",
- "uri": "bitcoin:2MzNBSgQbftvHps1hTMKxyebB8jZBSqfqPD?message=Domitai&amount=0.00105691"
}
]
}
}
{- "success": true,
- "payload": [
- {
- "volume": "0",
- "variation": "0",
- "high": "0",
- "last": "101737.2072",
- "low": "0",
- "vwap": "0",
- "ask": "101737.2072",
- "bid": "97750.0314",
- "vwask": "101737.2072",
- "vwbid": "97750.0314",
- "book": "btct_mxnt",
- "created_at": 1556476316957,
- "base": "BTCt",
- "quote": "MXNt",
- "base_decimals": 8,
- "quote_decimals": 5
}
]
}
marketId required | string The market id in lowercase |
{- "success": true,
- "payload": {
- "volume": "0",
- "variation": "0",
- "high": "0",
- "last": "101737.2072",
- "low": "0",
- "vwap": "0",
- "ask": "101737.2072",
- "bid": "97750.0314",
- "vwask": "101737.2072",
- "vwbid": "97750.0314",
- "book": "btct_mxnt",
- "created_at": 1556476316957,
- "base": "BTCt",
- "quote": "MXNt",
- "base_decimals": 8,
- "quote_decimals": 5
}
}
marketId required | string The market id in lowercase |
aggregate | string Aggregate equal prices. Currently waiting for development window |
{- "success": true,
- "payload": {
- "bids": [
- {
- "amount": "176.70747524",
- "rate": "97750.0314",
- "id": 66346
}
], - "asks": [
- {
- "amount": "176.70747524",
- "rate": "97750.0314",
- "id": 66346
}
], - "created_at": 1556507596422
}
}
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 |
{- "symbol": "MXN",
- "amount": "10",
- "relatedAddress": "test@somedomain.com",
- "lnSymbol": "BTC"
}
{- "success": true,
- "type": "success",
- "code": 200,
- "message": "Nuevo recibo de pago generado",
- "payload": {
- "id": "77dabf6d-5128-42c7-ac1d-436144f4700c",
- "owner": "77be59df-743e-4ecd-86f4-21d969d123ba",
- "related_address": "someuser@somedomain.com",
- "invoice_status": "created",
- "symbol": "MXN",
- "ln_symbol": "BTC",
- "amount": "10.00",
- "paid_amount": "0.00",
- "created_at": "2022-08-02T19:16:38.603Z",
- "expires_at": "2022-08-02T19:36:38.603Z",
- "payment_options": {
- "BTC": {
- "symbol": "BTC",
- "label": "Bitcoin",
- "amount": "0.00002271",
- "paidAmount": "0.00000000",
- "rate": "440234.87",
- "labels": [ ],
- "lnInvoice": {
- "r_hash": "403308cbfc0a005f16cf415e5d4740ab4380833feba2d5d293049d9f05a05a8a",
- "payment_request": "lnbc22710n1p3wj7qhpp5gqes3jlupgq979k0g909636q4dpcpqelaw3dt55nqjwe7pdqt29qdzjf38z63z0f4y4gs2f94p9gsedxcmxgetyvcmxgtf4xyerstf5xf3nwttpvvckgtf5xvmrzdp5vc6rwvpsvvcqzpgxqyz5vqsp5llms7wz2vucrpyhcj5aan6d7un8q89cky9vjfcc06yjth38aaeas9qyyssq8vhnrkggwedctng8h0fm0gwepg6t89uv748qeun2vr5k9r8ypel3amd65tz8jf7zmxn8xlcj298ndsn7j858m6kp8qn2kvhzs9glq5qpmjmt2v",
- "add_index": "108",
- "payment_addr": "fff70f384a67303092f8953bd9e9bee4ce039716215924e30fd124bbc4fdee7b",
- "memo": "LN-DOMITAI-BTC-66dedf6d-5128-42c7-ac1d-436144f4700c",
- "description_hash": "66dedf6d512842c7ac1d436144f4700cee18f1ba5fd"
}
}
}, - "payment_transactions": [ ]
}
}
invoiceId required | string The UUIDv4 Invoice ID |
{- "success": true,
- "type": "success",
- "code": 200,
- "message": "Estatus del pago obtenido",
- "payload": {
- "invoice_status": "created",
- "amount": "10.00000000000000000000000000000000000000000000000000",
- "paid_amount": "0.00000000000000000000000000000000000000000000000000",
- "payment_transactions": [ ]
}
}
{- "success": true,
- "type": "success",
- "code": 200,
- "message": "Estatus del pago obtenido",
- "payload": {
- "id": "77dabf6d-5128-42c7-ac1d-436144f4700c",
- "owner": "77be59df-743e-4ecd-86f4-21d969d123ba",
- "related_address": "someuser@somedomain.com",
- "invoice_status": "created",
- "symbol": "MXN",
- "ln_symbol": "BTC",
- "amount": "10.00",
- "paid_amount": "0.00",
- "created_at": "2022-08-02T19:16:38.603Z",
- "expires_at": "2022-08-02T19:36:38.603Z",
- "payment_options": {
- "BTC": {
- "symbol": "BTC",
- "label": "Bitcoin",
- "amount": "0.00002271",
- "paidAmount": "0.00000000",
- "rate": "440234.87",
- "labels": [ ],
- "lnInvoice": {
- "r_hash": "403308cbfc0a005f16cf415e5d4740ab4380833feba2d5d293049d9f05a05a8a",
- "payment_request": "lnbc22710n1p3wj7qhpp5gqes3jlupgq979k0g909636q4dpcpqelaw3dt55nqjwe7pdqt29qdzjf38z63z0f4y4gs2f94p9gsedxcmxgetyvcmxgtf4xyerstf5xf3nwttpvvckgtf5xvmrzdp5vc6rwvpsvvcqzpgxqyz5vqsp5llms7wz2vucrpyhcj5aan6d7un8q89cky9vjfcc06yjth38aaeas9qyyssq8vhnrkggwedctng8h0fm0gwepg6t89uv748qeun2vr5k9r8ypel3amd65tz8jf7zmxn8xlcj298ndsn7j858m6kp8qn2kvhzs9glq5qpmjmt2v",
- "add_index": "108",
- "payment_addr": "fff70f384a67303092f8953bd9e9bee4ce039716215924e30fd124bbc4fdee7b",
- "memo": "LN-DOMITAI-BTC-66dedf6d-5128-42c7-ac1d-436144f4700c",
- "description_hash": "66dedf6d512842c7ac1d436144f4700cee18f1ba5fd"
}
}
}, - "payment_transactions": [ ]
}
}
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 |
{- "symbol": "MXN",
- "amount": "10",
- "relatedAddress": "test@somedomain.com",
- "lnSymbol": "BTC"
}
{- "success": true,
- "type": "success",
- "code": 200,
- "message": "Nuevo recibo de pago generado",
- "payload": {
- "id": "77dabf6d-5128-42c7-ac1d-436144f4700c",
- "owner": "77be59df-743e-4ecd-86f4-21d969d123ba",
- "related_address": "someuser@somedomain.com",
- "invoice_status": "created",
- "symbol": "MXN",
- "ln_symbol": "BTC",
- "amount": "10.00",
- "paid_amount": "0.00",
- "created_at": "2022-08-02T19:16:38.603Z",
- "expires_at": "2022-08-02T19:36:38.603Z",
- "payment_options": {
- "BTC": {
- "symbol": "BTC",
- "label": "Bitcoin",
- "amount": "0.00002271",
- "paidAmount": "0.00000000",
- "rate": "440234.87",
- "labels": [ ],
- "lnInvoice": {
- "r_hash": "403308cbfc0a005f16cf415e5d4740ab4380833feba2d5d293049d9f05a05a8a",
- "payment_request": "lnbc22710n1p3wj7qhpp5gqes3jlupgq979k0g909636q4dpcpqelaw3dt55nqjwe7pdqt29qdzjf38z63z0f4y4gs2f94p9gsedxcmxgetyvcmxgtf4xyerstf5xf3nwttpvvckgtf5xvmrzdp5vc6rwvpsvvcqzpgxqyz5vqsp5llms7wz2vucrpyhcj5aan6d7un8q89cky9vjfcc06yjth38aaeas9qyyssq8vhnrkggwedctng8h0fm0gwepg6t89uv748qeun2vr5k9r8ypel3amd65tz8jf7zmxn8xlcj298ndsn7j858m6kp8qn2kvhzs9glq5qpmjmt2v",
- "add_index": "108",
- "payment_addr": "fff70f384a67303092f8953bd9e9bee4ce039716215924e30fd124bbc4fdee7b",
- "memo": "LN-DOMITAI-BTC-66dedf6d-5128-42c7-ac1d-436144f4700c",
- "description_hash": "66dedf6d512842c7ac1d436144f4700cee18f1ba5fd"
}
}
}, - "payment_transactions": [ ]
}
}
invoiceId required | string The UUIDv4 Invoice ID |
{- "success": true,
- "type": "success",
- "code": 200,
- "message": "Estatus del pago obtenido",
- "payload": {
- "invoice_status": "created",
- "amount": "10.00000000000000000000000000000000000000000000000000",
- "paid_amount": "0.00000000000000000000000000000000000000000000000000",
- "payment_transactions": [ ]
}
}
{- "success": true,
- "type": "success",
- "code": 200,
- "message": "Estatus del pago obtenido",
- "payload": {
- "id": "77dabf6d-5128-42c7-ac1d-436144f4700c",
- "owner": "77be59df-743e-4ecd-86f4-21d969d123ba",
- "related_address": "someuser@somedomain.com",
- "invoice_status": "created",
- "symbol": "MXN",
- "ln_symbol": "BTC",
- "amount": "10.00",
- "paid_amount": "0.00",
- "created_at": "2022-08-02T19:16:38.603Z",
- "expires_at": "2022-08-02T19:36:38.603Z",
- "payment_options": {
- "BTC": {
- "symbol": "BTC",
- "label": "Bitcoin",
- "amount": "0.00002271",
- "paidAmount": "0.00000000",
- "rate": "440234.87",
- "labels": [ ],
- "lnInvoice": {
- "r_hash": "403308cbfc0a005f16cf415e5d4740ab4380833feba2d5d293049d9f05a05a8a",
- "payment_request": "lnbc22710n1p3wj7qhpp5gqes3jlupgq979k0g909636q4dpcpqelaw3dt55nqjwe7pdqt29qdzjf38z63z0f4y4gs2f94p9gsedxcmxgetyvcmxgtf4xyerstf5xf3nwttpvvckgtf5xvmrzdp5vc6rwvpsvvcqzpgxqyz5vqsp5llms7wz2vucrpyhcj5aan6d7un8q89cky9vjfcc06yjth38aaeas9qyyssq8vhnrkggwedctng8h0fm0gwepg6t89uv748qeun2vr5k9r8ypel3amd65tz8jf7zmxn8xlcj298ndsn7j858m6kp8qn2kvhzs9glq5qpmjmt2v",
- "add_index": "108",
- "payment_addr": "fff70f384a67303092f8953bd9e9bee4ce039716215924e30fd124bbc4fdee7b",
- "memo": "LN-DOMITAI-BTC-66dedf6d-5128-42c7-ac1d-436144f4700c",
- "description_hash": "66dedf6d512842c7ac1d436144f4700cee18f1ba5fd"
}
}
}, - "payment_transactions": [ ]
}
}