Balance
This guide provides essential information for developers to get balance.
The balance model
The balance model is the data structure that represents a balance in Rampable. The following attributes are associated with the balance model:
Properties
- Name
userId
- Type
- string
- Description
Unique identifier for the user.
- Name
assets
- Type
- object
- Description
An object containing assets associated with the user.
- Name
assets.fiat
- Type
- object
- Description
Fiat asset details.
- Name
assets.fiat.balances
- Type
- array
- Description
An array of fiat balances.
- Name
assets.fiat.balances.amount
- Type
- number
- Description
The amount of the fiat balance.
- Name
assets.fiat.balances.assetCode
- Type
- string
- Description
The code of the fiat asset (e.g., IDR).
- Name
assets.fiat.lastUpdated
- Type
- string
- Description
Timestamp when the fiat balance was last updated.
- Name
assets.crypto
- Type
- object
- Description
Crypto asset details.
- Name
assets.crypto.balances
- Type
- array
- Description
An array of crypto balances.
- Name
assets.crypto.balances.amount
- Type
- number
- Description
The amount of the crypto balance.
- Name
assets.crypto.balances.assetCode
- Type
- string
- Description
The code of the crypto asset (e.g., usdt-tron).
- Name
assets.crypto.lastUpdated
- Type
- string
- Description
Timestamp when the crypto balance was last updated.
GET/v1/balance
Get Balance
This endpoint retrieves the balance information.
Request
GET
/v1/deposit/fiatcurl --location \
https://sandbox.rampable.co/v1/balance \
--header 'x-client-secret: ••••••' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••'
Response
{
"userId": "6719f68dd07aef516b9158ba",
"assets": {
"fiat": {
"balances": [
{
"amount": 1000000,
"assetCode": "IDR"
}
],
"lastUpdated": "2024-10-30T12:05:44.650Z"
},
"crypto": {
"balances": [
{
"amount": 100,
"assetCode": "usdt-tron"
}
],
"lastUpdated": "2024-10-30T12:05:44.650Z"
}
}
}
HTTP Status 400 Example
Error Response
{
"statusCode": 400,
"error": "Not Found",
"message": "Payment method not found"
}