API documentation for MoBit's cryptocurrency exchange platform
API Documentation
Request Headers
All API requests must include the following header for authentication and proper content handling. Contact support to get approved for an API key.
Required Headers
| Header | Value | Description |
|---|---|---|
X-Mobit-Api-Key |
{api_key} |
Your API key |
Example Request
curl -X POST "https://mobit.exchange/api/v1/exchange" \
-H "X-Mobit-Api-Key: c31a9cdc-7178-43ff-b043-f12fbd2097f4" \
-d '{"from_currency": "bitcoin", "to_currency": "ethereum", "rate_type": "dynamic",
"to_address": "0x1234567890abcdef1234567890abcdef12345678"}'
Passing Parameters
Parameters are expected to be passed as query parameters in the case of GET requests and as body parameters for POST requests.
Query Parameters
Appended to the URL after a ? symbol.
GET /api/v1/calculate?from_currency=bitcoin&to_currency=ethereum&receive_amount=100.000
Body Parameters
Used for initiating exchanges and refunds. Sent as JSON in the request body for POST requests. See example request in the HEADERS section.
/api/v1/exchange
Initiates an exchange request with the specified parameters.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
rate_type |
string | Yes | Rate Type for the exchange (e.g., "flat", "dynamic") |
from_currency |
string | Yes | The currency to convert from (e.g., "tether", "bitcoin", "ethereum", "monero" "usd-coin", "dai") |
to_currency |
string | Yes | The currency to convert to (e.g., "tether", "bitcoin", "ethereum", "monero" "usd-coin", "dai") |
to_address |
string | Yes | The address to send the exchanged funds to |
refund_address |
string | No | The address to recieve a refund to |
Response
{
"result":
{
"order_id": "012345678901234567890",
"recieving_address": "0x1234567890abcdef1234567890abcdef12345678",
"min_amount": "100.000",
"time_created": "2024-01-01T00:00:00Z"
},
"error": null
}
/api/v1/status
Retrieves the status of an order along with relavant data.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
order_id |
string | Yes | The unique identifier of the order |
Response (receiving, sending, refunding)
{
"result":
{
"status": "receiving | sending | refunding",
"txid": "0x1234567890abcdef1234567890abcdef12345678"
"confirmations": "0",
"confirmations_required": "10",
"to_currency": "tether | bitcoin | ethereum | monero | usd-coin | dai",
"from_currency": "tether | bitcoin | ethereum | monero | usd-coin | dai",
"amount_received | amount_sent": "100.000",
},
"error": null
}
Response (queued)
{
"result":
{
"status": "queued",
"position": "1 | 2 | 3 | ...",
},
"error": null
}
Response (complete, refunded)
{
"result":
{
"status": "complete | refunded",
"txid": "0x1234567890abcdef1234567890abcdef12345678",
"to_currency": "tether | bitcoin | ethereum | monero | usd-coin | dai",
"from_currency": "tether | bitcoin | ethereum | monero | usd-coin | dai",
"amount_sent": "100.000",
},
"error": null
}
Response (failed)
{
"result":
{
"status": "failed",
"error": "tx-size | timed-out",
"error_msg": "Your order...",
},
"error": null
}
/api/v1/refund
Initiates a refund request for an existing order.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
order_id |
string | Yes | Unique identifier for the order to be refunded |
to_address |
string | Yes | You must provide the previously provided to_address for verification |
refund_address |
string | No | Refund address only required if not previously provided |
Response
{
"result":
{
"success": "true",
},
"error": null
}
/api/v1/estimate
Calculates the amount for you to send or the amount you would receive for an order based on currencies and rate type. Rate type is required when providing send_amount, otherwise it will be flat when providing receive_amount.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
from_currency |
string | Yes | The currency you are sending |
to_currency |
string | Yes | The currency you would like to receive |
receive_amount | send_amount |
string | Yes | The amount you would like to receive or send |
rate_type |
string | No | The rate type for the estimate (e.g., "flat", "dynamic") |
Response
{
"result":
{
"send_amount | receive_amount": "100.000",
},
"error": null
}
Error Handling
The API uses conventional HTTP response codes to indicate the success or failure of requests. Codes in the 2xx range indicate success, codes in the 4xx range indicate client errors, and codes in the 5xx range indicate server errors. If you're experiencing issues not covered here, contact our support team.
HTTP Status Codes
| Status | Name | Description |
|---|---|---|
400 |
Bad Request | The request was malformed or missing required parameters |
401 |
Unauthorized | No valid API key was provided |
404 |
Not Found | The requested resource doesn't exist |
405 |
Method Not Allowed | The HTTP method is not supported for this endpoint |
500 |
Internal Server Error | Something went wrong on our end |
Error Response Format
{
"result": null,
"error": "tx-size",
"error_msg": "Transaction size is too small, contact us within 15 days to retrieve your funds."
}