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 WePay. The following attributes are associated with the balance model:
Properties
| Field | Type | Description |
|---|---|---|
userId | string | Unique identifier for the user. |
assets | object | An object containing assets associated with the user. |
assets.fiat | object | Fiat asset details. |
assets.fiat.balances | array | An array of fiat balances. |
assets.fiat.balances.amount | number | The amount of the fiat balance. |
assets.fiat.balances.assetCode | string | The code of the fiat asset (e.g., IDR). |
assets.fiat.lastUpdated | string | Timestamp when the fiat balance was last updated. |
assets.crypto | object | Crypto asset details. |
assets.crypto.balances | array | An array of crypto balances. |
assets.crypto.balances.amount | number | The amount of the crypto balance. |
assets.crypto.balances.assetCode | string | The code of the crypto asset (e.g., usdt-tron). |
assets.crypto.lastUpdated | string | 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://staging.wepay.to/v1/balance \
--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"
}
