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

FieldTypeDescription
userIdstring

Unique identifier for the user.

assetsobject

An object containing assets associated with the user.

assets.fiatobject

Fiat asset details.

assets.fiat.balancesarray

An array of fiat balances.

assets.fiat.balances.amountnumber

The amount of the fiat balance.

assets.fiat.balances.assetCodestring

The code of the fiat asset (e.g., IDR).

assets.fiat.lastUpdatedstring

Timestamp when the fiat balance was last updated.

assets.cryptoobject

Crypto asset details.

assets.crypto.balancesarray

An array of crypto balances.

assets.crypto.balances.amountnumber

The amount of the crypto balance.

assets.crypto.balances.assetCodestring

The code of the crypto asset (e.g., usdt-tron).

assets.crypto.lastUpdatedstring

Timestamp when the crypto balance was last updated.


GET/v1/balance

Get Balance

This endpoint retrieves the balance information.

Request

GET
/v1/deposit/fiat
curl --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"
}

Did this page help you ship?