1.0.2 Groot Payment API Documentation

Groot Payment API

Complete API reference for the Grootbit Payment platform. Manage clients, crypto wallets, balances, withdrawals, invoices and real-time events.

Base URL
https://api.grootbit.com
Auth
Bearer Token (JWT)
Format
JSON
Production
mTLS Required

Authentication

To start using the Groot Payment API you need to authenticate using your Partner ID and Partner Secret. These credentials are provided by email to your manager. If you don't know your ID or Secret, please contact us.

Include the token in every request using the Authorization header:
Authorization: Bearer <your_token>
Tokens expire after 15 minutes. Refresh before expiration.
The production environment requires mTLS (mutual TLS). Ensure you use the certificate provided by the Grootbit team when making production requests.

Auth

Retrieve a JWT token to be used for the next 15 minutes.

POST /login Get authentication token

Authenticate with your Partner ID and Secret to receive a bearer token.

Request Body

ParameterTypeDescription
partnerId REQUIRED string Your unique partner identifier
partnerSecret REQUIRED string Your secret API key
Request
{
  "partnerId": "663917f2763b1bff22ec5ce9",
  "partnerSecret": "04d03a20-f280-488f-8d71-87b69256015a"
}
200 OK
Response
{
  "expiresAt": "2024-05-06T21:32:31.198Z",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
403 Forbidden
Error Response
{
  "message": "wrong-secret",
  "error": "Forbidden",
  "statusCode": 403
}
Implementation Examples
cURL
curl -X POST https://api.grootbit.com/login \
  -H "Content-Type: application/json" \
  -d '{
    "partnerId": "663917f2763b1bff22ec5ce9",
    "partnerSecret": "04d03a20-f280-488f-8d71-87b69256015a"
  }'
Node.js
const response = await fetch('https://api.grootbit.com/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    partnerId: '663917f2763b1bff22ec5ce9',
    partnerSecret: '04d03a20-f280-488f-8d71-87b69256015a'
  })
});

const data = await response.json();
console.log(data.token);
Python
import requests

response = requests.post(
    'https://api.grootbit.com/login',
    json={
        'partnerId': '663917f2763b1bff22ec5ce9',
        'partnerSecret': '04d03a20-f280-488f-8d71-87b69256015a'
    }
)

data = response.json()
print(data['token'])
C#
using System.Net.Http;
using System.Text;
using System.Text.Json;

var client = new HttpClient();
var content = new StringContent(
    JsonSerializer.Serialize(new {
        partnerId = "663917f2763b1bff22ec5ce9",
        partnerSecret = "04d03a20-f280-488f-8d71-87b69256015a"
    }),
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync(
    "https://api.grootbit.com/login", content
);
var data = await response.Content.ReadAsStringAsync();
Java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
String json = """
    {
        "partnerId": "663917f2763b1bff22ec5ce9",
        "partnerSecret": "04d03a20-f280-488f-8d71-87b69256015a"
    }
    """;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.grootbit.com/login"))
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString()
);

Client

The /client endpoints allow you to register new clients. Each client receives a set of crypto wallets upon registration.

POST /client Register a new client
Bearer Token Required

Register a client using their document number. The response will contain all crypto wallets registered for this client.

Request Body

ParameterTypeDescription
document REQUIRED string Client's document number (e.g. CPF)
Request
{
  "document": "06260544863"
}
201 Created
Response
{
  "document": "06260544863",
  "partnerId": "663917f2763b1bff22ec5ce9",
  "createdAt": "2024-05-06T21:22:15.882Z",
  "updatedAt": "2024-05-06T21:22:15.882Z",
  "id": "66394a073b428e21809703cb",
  "wallets": [
    { "coin": "btc", "network": "bitcoin", "address": "bc1qzjweah64wrf3xa4fhmjpjz8d2r56zt7mhayekn" },
    { "coin": "eth", "network": "ethereum", "address": "0xd52eedd0a7daf1b560a5ea38a0aa9d8fb55056b3" },
    { "coin": "usdt", "network": "ethereum", "address": "0xd52eedd0a7daf1b560a5ea38a0aa9d8fb55056b3" },
    { "coin": "usdc", "network": "ethereum", "address": "0xd52eedd0a7daf1b560a5ea38a0aa9d8fb55056b3" },
    { "coin": "trx", "network": "tron", "address": "TDCwaU4zxrfh2U4KxtrQ7EYCbzXGSmZ4PU" },
    { "coin": "usdt", "network": "tron", "address": "TDCwaU4zxrfh2U4KxtrQ7EYCbzXGSmZ4PU" }
  ]
}
409 Conflict
Error Response
{
  "message": "client-already-exists",
  "error": "Conflict",
  "statusCode": 409
}
Implementation Examples
cURL
curl -X POST https://api.grootbit.com/client \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "document": "06260544863"
  }'
Node.js
const response = await fetch('https://api.grootbit.com/client', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`
  },
  body: JSON.stringify({
    document: '06260544863'
  })
});

const client = await response.json();
console.log(client.wallets);
Python
import requests

response = requests.post(
    'https://api.grootbit.com/client',
    headers={'Authorization': f'Bearer {token}'},
    json={'document': '06260544863'}
)

client = response.json()
print(client['wallets'])
C#
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var content = new StringContent(
    JsonSerializer.Serialize(new { document = "06260544863" }),
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync(
    "https://api.grootbit.com/client", content
);
var result = await response.Content.ReadAsStringAsync();
Java
HttpClient client = HttpClient.newHttpClient();
String json = "{ \"document\": \"06260544863\" }";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.grootbit.com/client"))
    .header("Content-Type", "application/json")
    .header("Authorization", "Bearer " + token)
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString()
);

Balance

Retrieve balance information for clients and the partner account.

GET /balance/:clientId Get Client Balance
Bearer Token Required

Get the current balance of a registered client across all supported coins.

Path Parameters

ParameterTypeDescription
clientId REQUIRED string The unique identifier of the client
200 OK
Response
{
  "clientId": "664283ecbc1dd982429d9098",
  "partnerId": "663917f2763b1bff22ec5ce9",
  "balances": {
    "btc": 0,
    "trx": 0,
    "usdt": 1900,
    "usdc": 0,
    "eth": 0
  }
}
Implementation Examples
cURL
curl -X GET https://api.grootbit.com/balance/664283ecbc1dd982429d9098 \
  -H "Authorization: Bearer YOUR_TOKEN"
Node.js
const clientId = '664283ecbc1dd982429d9098';
const response = await fetch(
  `https://api.grootbit.com/balance/${clientId}`,
  {
    headers: {
      'Authorization': `Bearer ${token}`
    }
  }
);

const balance = await response.json();
console.log(balance.balances);
Python
import requests

client_id = '664283ecbc1dd982429d9098'
response = requests.get(
    f'https://api.grootbit.com/balance/{client_id}',
    headers={'Authorization': f'Bearer {token}'}
)

balance = response.json()
print(balance['balances'])
C#
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var clientId = "664283ecbc1dd982429d9098";
var response = await client.GetAsync(
    $"https://api.grootbit.com/balance/{clientId}"
);
var balance = await response.Content.ReadAsStringAsync();
Java
HttpClient client = HttpClient.newHttpClient();
String clientId = "664283ecbc1dd982429d9098";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.grootbit.com/balance/" + clientId))
    .header("Authorization", "Bearer " + token)
    .GET()
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString()
);
GET /balance Get Partner Balance
Bearer Token Required

Get the current balance of the partner's main account. This balance can be distributed to client accounts.

200 OK
Response
{
  "clientId": null,
  "partnerId": "663917f2763b1bff22ec5ce9",
  "balances": {
    "btc": 0,
    "trx": 0,
    "usdt": 100,
    "usdc": 0,
    "eth": 0
  }
}
Implementation Examples
cURL
curl -X GET https://api.grootbit.com/balance \
  -H "Authorization: Bearer YOUR_TOKEN"
Node.js
const response = await fetch('https://api.grootbit.com/balance', {
  headers: {
    'Authorization': `Bearer ${token}`
  }
});

const balance = await response.json();
console.log(balance.balances);
Python
import requests

response = requests.get(
    'https://api.grootbit.com/balance',
    headers={'Authorization': f'Bearer {token}'}
)

balance = response.json()
print(balance['balances'])
C#
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var response = await client.GetAsync(
    "https://api.grootbit.com/balance"
);
var balance = await response.Content.ReadAsStringAsync();
Java
HttpClient client = HttpClient.newHttpClient();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.grootbit.com/balance"))
    .header("Authorization", "Bearer " + token)
    .GET()
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString()
);

Transfer

Fund client accounts. The balance used will be from the partner's main account.

POST /fund Add or remove client's balance
Bearer Token Required

Add or remove balance from a client's account. Use positive values to add and negative values to remove. All available coins can be used: btc, trx, usdt, usdc, eth. Removed money from the client's account will be available on the partner account.

Two balance update webhook events will be triggered: one for the client and another for the partner.

Request Body

ParameterTypeDescription
clientId REQUIRED string The target client identifier
btc / eth / usdt / usdc / trx number Amount to add (positive) or remove (negative)
Request
{
  "clientId": "664283ecbc1dd982429d9098",
  "usdt": -100
}
200 OK
Response
{
  "clientId": "664283ecbc1dd982429d9098",
  "partnerId": "663917f2763b1bff22ec5ce9",
  "balances": {
    "btc": 0,
    "eth": 0,
    "usdt": 1900,
    "usdc": 0,
    "trx": 0
  }
}
Implementation Examples
cURL
curl -X POST https://api.grootbit.com/fund \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "clientId": "664283ecbc1dd982429d9098",
    "usdt": -100
  }'
Node.js
const response = await fetch('https://api.grootbit.com/fund', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`
  },
  body: JSON.stringify({
    clientId: '664283ecbc1dd982429d9098',
    usdt: -100
  })
});

const result = await response.json();
console.log(result.balances);
Python
import requests

response = requests.post(
    'https://api.grootbit.com/fund',
    headers={'Authorization': f'Bearer {token}'},
    json={
        'clientId': '664283ecbc1dd982429d9098',
        'usdt': -100
    }
)

result = response.json()
print(result['balances'])
C#
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var content = new StringContent(
    JsonSerializer.Serialize(new {
        clientId = "664283ecbc1dd982429d9098",
        usdt = -100
    }),
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync(
    "https://api.grootbit.com/fund", content
);
var result = await response.Content.ReadAsStringAsync();
Java
HttpClient client = HttpClient.newHttpClient();
String json = """
    {
        "clientId": "664283ecbc1dd982429d9098",
        "usdt": -100
    }
    """;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.grootbit.com/fund"))
    .header("Content-Type", "application/json")
    .header("Authorization", "Bearer " + token)
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString()
);

Withdraw

Request cryptocurrency withdrawals to external wallets.

POST /withdraw Request a new withdraw
Bearer Token Required

Request a withdrawal of crypto to an external wallet address. A fee will be deducted from the requested amount.

Request Body

ParameterTypeDescription
coin REQUIRED string Cryptocurrency to withdraw (btc, eth, usdt, usdc, trx)
amount REQUIRED number Amount to withdraw
wallet REQUIRED string Destination wallet address (must be a valid ETH, BTC or TRX address)
clientId REQUIRED string Client identifier
Request
{
  "coin": "usdt",
  "amount": 1824.12,
  "wallet": "TZF9xjZXbe9kXXU6AM6fckcPc5FuhohdCX",
  "clientId": "66417972bc1dd982429d908e"
}
201 Created
Response
{
  "id": "66418d7295e0cb6c380f02c0",
  "amount": {
    "coin": "usdt",
    "value": 1723.414
  },
  "fee": {
    "coin": "usdt",
    "value": 100.706
  },
  "wallet": "TZF9xjZXbe9kXXU6AM6fckcPc5FuhohdCX",
  "status": "pending",
  "createdAt": "2024-05-13T03:48:02.041Z"
}
400 Bad Request - Invalid wallet
Error Response
{
  "message": [
    "Address must be a valid eth, btc or trx address"
  ],
  "error": "Bad Request",
  "statusCode": 400
}
400 Bad Request - Insufficient balance
Error Response
{
  "message": "insufficient-balance",
  "error": "Bad Request",
  "statusCode": 400
}
Implementation Examples
cURL
curl -X POST https://api.grootbit.com/withdraw \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "coin": "usdt",
    "amount": 1824.12,
    "wallet": "TZF9xjZXbe9kXXU6AM6fckcPc5FuhohdCX",
    "clientId": "66417972bc1dd982429d908e"
  }'
Node.js
const response = await fetch('https://api.grootbit.com/withdraw', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`
  },
  body: JSON.stringify({
    coin: 'usdt',
    amount: 1824.12,
    wallet: 'TZF9xjZXbe9kXXU6AM6fckcPc5FuhohdCX',
    clientId: '66417972bc1dd982429d908e'
  })
});

const withdraw = await response.json();
console.log(withdraw);
Python
import requests

response = requests.post(
    'https://api.grootbit.com/withdraw',
    headers={'Authorization': f'Bearer {token}'},
    json={
        'coin': 'usdt',
        'amount': 1824.12,
        'wallet': 'TZF9xjZXbe9kXXU6AM6fckcPc5FuhohdCX',
        'clientId': '66417972bc1dd982429d908e'
    }
)

withdraw = response.json()
print(withdraw)
C#
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var content = new StringContent(
    JsonSerializer.Serialize(new {
        coin = "usdt",
        amount = 1824.12,
        wallet = "TZF9xjZXbe9kXXU6AM6fckcPc5FuhohdCX",
        clientId = "66417972bc1dd982429d908e"
    }),
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync(
    "https://api.grootbit.com/withdraw", content
);
var withdraw = await response.Content.ReadAsStringAsync();
Java
HttpClient client = HttpClient.newHttpClient();
String json = """
    {
        "coin": "usdt",
        "amount": 1824.12,
        "wallet": "TZF9xjZXbe9kXXU6AM6fckcPc5FuhohdCX",
        "clientId": "66417972bc1dd982429d908e"
    }
    """;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.grootbit.com/withdraw"))
    .header("Content-Type", "application/json")
    .header("Authorization", "Bearer " + token)
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString()
);

Transactions

Get client transaction history including deposits and withdrawals.

GET /statement/:clientId Get client statement
Bearer Token Required

Retrieve the transaction history for a specific client, filtered by date.

Path Parameters

ParameterTypeDescription
clientId REQUIRED string Client identifier

Query Parameters

ParameterTypeDescription
since string (ISO 8601) Filter transactions since this date
Example URL
GET /statement/664cd2535e9396829854370f?since=2024-05-13T12:00:00.999Z
200 OK
Response
[
  {
    "id": "664cd3fa4c2bea7aea89023b",
    "type": "withdraw",
    "createdAt": "2024-05-21T17:03:54.152Z",
    "clientId": "664cd2535e9396829854370f",
    "partnerId": "663917f2763b1bff22ec5ce9",
    "amountRequested": 1082,
    "amountReceived": 1041.78,
    "fee": 40.22,
    "coin": "trx"
  },
  {
    "id": "664cd3f9e1c4889f4476b590",
    "type": "deposit",
    "createdAt": "2024-05-21T17:03:53.971Z",
    "clientId": "664cd2535e9396829854370f",
    "partnerId": "663917f2763b1bff22ec5ce9",
    "amount": 2164,
    "coin": "trx"
  }
]
Implementation Examples
cURL
curl -X GET "https://api.grootbit.com/statement/664cd2535e9396829854370f?since=2024-05-13T12:00:00.999Z" \
  -H "Authorization: Bearer YOUR_TOKEN"
Node.js
const clientId = '664cd2535e9396829854370f';
const since = '2024-05-13T12:00:00.999Z';
const response = await fetch(
  `https://api.grootbit.com/statement/${clientId}?since=${since}`,
  {
    headers: {
      'Authorization': `Bearer ${token}`
    }
  }
);

const transactions = await response.json();
console.log(transactions);
Python
import requests

client_id = '664cd2535e9396829854370f'
since = '2024-05-13T12:00:00.999Z'

response = requests.get(
    f'https://api.grootbit.com/statement/{client_id}',
    params={'since': since},
    headers={'Authorization': f'Bearer {token}'}
)

transactions = response.json()
print(transactions)
C#
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var clientId = "664cd2535e9396829854370f";
var since = "2024-05-13T12:00:00.999Z";
var response = await client.GetAsync(
    $"https://api.grootbit.com/statement/{clientId}?since={since}"
);
var transactions = await response.Content.ReadAsStringAsync();
Java
HttpClient client = HttpClient.newHttpClient();
String clientId = "664cd2535e9396829854370f";
String since = "2024-05-13T12:00:00.999Z";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.grootbit.com/statement/"
        + clientId + "?since=" + since))
    .header("Authorization", "Bearer " + token)
    .GET()
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString()
);

Invoice

Create PIX QR codes to deposit and exchange balance into crypto.

POST /invoice Create Invoice
Bearer Token Required

Create a new invoice with a PIX QR code for depositing BRL and converting to crypto.

Request Body

ParameterTypeDescription
market REQUIRED string Trading pair (e.g. "usdt-brl")
amount REQUIRED object Object with coin and value
clientId REQUIRED string Target client identifier
Request
{
  "market": "usdt-brl",
  "amount": {
    "coin": "usdt",
    "value": 312
  },
  "clientId": "672976cea1b8912dcbf7bf4a"
}
201 Created
Response
{
  "market": "usdt-brl",
  "amountRequested": {
    "coin": "usdt",
    "value": 312
  },
  "source": {
    "coin": "brl",
    "value": 1803.8904
  },
  "target": {
    "coin": "usdt",
    "value": 312
  },
  "clientId": "672976cea1b8912dcbf7bf4a",
  "partnerId": "663917f2763b1bff22ec5ce9",
  "pix": {
    "id": "672a25a1924a2fb025378dbc",
    "pixQrCode": "00020101021226850014br.gov.bcb.pix..."
  },
  "id": "672a25a2a48b02b5fe446a91"
}
400 Bad Request - Invalid coin
Error Response
{
  "message": "invalid-coin",
  "error": "Bad Request",
  "statusCode": 400
}
Implementation Examples
cURL
curl -X POST https://api.grootbit.com/invoice \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "market": "usdt-brl",
    "amount": { "coin": "usdt", "value": 312 },
    "clientId": "672976cea1b8912dcbf7bf4a"
  }'
Node.js
const response = await fetch('https://api.grootbit.com/invoice', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`
  },
  body: JSON.stringify({
    market: 'usdt-brl',
    amount: { coin: 'usdt', value: 312 },
    clientId: '672976cea1b8912dcbf7bf4a'
  })
});

const invoice = await response.json();
console.log(invoice.pix.pixQrCode);
Python
import requests

response = requests.post(
    'https://api.grootbit.com/invoice',
    headers={'Authorization': f'Bearer {token}'},
    json={
        'market': 'usdt-brl',
        'amount': {'coin': 'usdt', 'value': 312},
        'clientId': '672976cea1b8912dcbf7bf4a'
    }
)

invoice = response.json()
print(invoice['pix']['pixQrCode'])
C#
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var content = new StringContent(
    JsonSerializer.Serialize(new {
        market = "usdt-brl",
        amount = new { coin = "usdt", value = 312 },
        clientId = "672976cea1b8912dcbf7bf4a"
    }),
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync(
    "https://api.grootbit.com/invoice", content
);
var invoice = await response.Content.ReadAsStringAsync();
Java
HttpClient client = HttpClient.newHttpClient();
String json = """
    {
        "market": "usdt-brl",
        "amount": { "coin": "usdt", "value": 312 },
        "clientId": "672976cea1b8912dcbf7bf4a"
    }
    """;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.grootbit.com/invoice"))
    .header("Content-Type", "application/json")
    .header("Authorization", "Bearer " + token)
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString()
);
GET /invoice/:invoiceId Get Invoice
Bearer Token Required

Retrieve details of an existing invoice by its ID, including status and PIX QR code.

Path Parameters

ParameterTypeDescription
invoiceId REQUIRED string The unique invoice identifier
200 OK
Response
{
  "market": "usdt-brl",
  "amountRequested": { "coin": "usdt", "value": 312 },
  "source": { "coin": "brl", "value": 1807.2912 },
  "target": { "coin": "usdt", "value": 312 },
  "clientId": "672976cea1b8912dcbf7bf4a",
  "partnerId": "663917f2763b1bff22ec5ce9",
  "pix": {
    "id": "67297898924a2fb025376b1f",
    "pixQrCode": "00020101021226850014br.gov.bcb.pix..."
  },
  "id": "67297899a48b02b5fe446a8b",
  "status": "pending"
}
404 Not Found
Error Response
{
  "message": "invoice-not-found",
  "error": "Not Found",
  "statusCode": 404
}
Implementation Examples
cURL
curl -X GET https://api.grootbit.com/invoice/67297899a48b02b5fe446a8b \
  -H "Authorization: Bearer YOUR_TOKEN"
Node.js
const invoiceId = '67297899a48b02b5fe446a8b';
const response = await fetch(
  `https://api.grootbit.com/invoice/${invoiceId}`,
  {
    headers: {
      'Authorization': `Bearer ${token}`
    }
  }
);

const invoice = await response.json();
console.log(invoice.status);
Python
import requests

invoice_id = '67297899a48b02b5fe446a8b'
response = requests.get(
    f'https://api.grootbit.com/invoice/{invoice_id}',
    headers={'Authorization': f'Bearer {token}'}
)

invoice = response.json()
print(invoice['status'])
C#
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var invoiceId = "67297899a48b02b5fe446a8b";
var response = await client.GetAsync(
    $"https://api.grootbit.com/invoice/{invoiceId}"
);
var invoice = await response.Content.ReadAsStringAsync();
Java
HttpClient client = HttpClient.newHttpClient();
String invoiceId = "67297899a48b02b5fe446a8b";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.grootbit.com/invoice/" + invoiceId))
    .header("Authorization", "Bearer " + token)
    .GET()
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString()
);
POST /quote Quote
Bearer Token Required

Get a price quote for a given market and amount without creating an invoice.

Request Body

ParameterTypeDescription
market REQUIRED string Trading pair (e.g. "usdt-brl")
amount REQUIRED object Object with coin and value
Request
{
  "market": "usdt-brl",
  "amount": {
    "coin": "usdt",
    "value": 312
  }
}
201 Created
Response
{
  "market": "usdt-brl",
  "amountRequested": {
    "coin": "usdt",
    "value": 312
  },
  "source": {
    "coin": "brl",
    "value": 1877.56
  },
  "target": {
    "coin": "usdt",
    "value": 312
  }
}
Implementation Examples
cURL
curl -X POST https://api.grootbit.com/quote \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "market": "usdt-brl",
    "amount": { "coin": "usdt", "value": 312 }
  }'
Node.js
const response = await fetch('https://api.grootbit.com/quote', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`
  },
  body: JSON.stringify({
    market: 'usdt-brl',
    amount: { coin: 'usdt', value: 312 }
  })
});

const quote = await response.json();
console.log(quote.source.value); // BRL amount needed
Python
import requests

response = requests.post(
    'https://api.grootbit.com/quote',
    headers={'Authorization': f'Bearer {token}'},
    json={
        'market': 'usdt-brl',
        'amount': {'coin': 'usdt', 'value': 312}
    }
)

quote = response.json()
print(quote['source']['value'])  # BRL amount needed
C#
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);

var content = new StringContent(
    JsonSerializer.Serialize(new {
        market = "usdt-brl",
        amount = new { coin = "usdt", value = 312 }
    }),
    Encoding.UTF8,
    "application/json"
);

var response = await client.PostAsync(
    "https://api.grootbit.com/quote", content
);
var quote = await response.Content.ReadAsStringAsync();
Java
HttpClient client = HttpClient.newHttpClient();
String json = """
    {
        "market": "usdt-brl",
        "amount": { "coin": "usdt", "value": 312 }
    }
    """;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.grootbit.com/quote"))
    .header("Content-Type", "application/json")
    .header("Authorization", "Bearer " + token)
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString()
);

Webhooks

Webhook events are sent as POST requests to the URL configured in your account. Please contact our team to configure your webhook URL.

Failsafe mechanism: If your URL returns anything other than a 2xx HTTP status code, the call is considered failed. Up to 10 attempts will be made with exponential backoff (2s, 4s, 8s, 16s...). After 10 failed attempts, contact us to retry the failed requests.
new-statement-transaction (deposit)
Payload
{
  "event": "new-statement-transaction",
  "data": {
    "id": "string",
    "type": "deposit",
    "clientId": "string",
    "coin": "btc" | "eth" | "usdt" | "trx" | "usdc",
    "amount": 42.32,
    "createdAt": "Date"
  }
}
new-statement-transaction (withdraw)
Payload
{
  "event": "new-statement-transaction",
  "data": {
    "id": "string",
    "type": "withdraw",
    "clientId": "string",
    "coin": "btc" | "eth" | "usdt" | "trx" | "usdc",
    "amountRequested": 50,
    "fee": 5,
    "amountReceived": 45,
    "createdAt": "Date"
  }
}
update-balance
Payload
{
  "event": "update-balance",
  "data": {
    "clientId": "string",
    "balance": {
      "btc": 42.32,
      "eth": 42.32,
      "usdt": 42.32,
      "trx": 42.32,
      "usdc": 42.32
    }
  }
}
new-client
Payload
{
  "event": "new-client",
  "data": {
    "id": "string",
    "document": "string",
    "partnerId": "string",
    "createdAt": "Date",
    "updatedAt": "Date"
  }
}

Need help?

Contact Grootbit's Tech Lead

+55 (61) 9 8589 1092 - Kevyn Klava - kevyn@grootbit.com