Replenishment of the user's advance balance

The method allows you to top up the user's advance balance (check the availability of the method in support)

Request:

Parameter

Required

Type

Description

userId

Yes

String

User ID

advancedBalanceId

Yes

String

Advanced balance ID

amount

Yes

String

The amount of replenishment. The number must contain no more than two decimal places (i.e. '5.25' is suitable, but '5.529' is not)

Replenishment of the user's advance balance

POSThttps://ocp.onchainpay.io/partner/api/top-up-advanced-balance
Header parameters
Body
userId*string

User ID

Example: "b62ffd59-158b-4daf-aeb0-cc02c710f615"
organizationId*string

Organization ID

Example: "6691face-ec14-4fd5-94a8-f6307dcb22a4"
advancedBalanceId*string

ID of the advance balance

Example: "bb837399-bb7a-4d97-9cab-4d47c1b198ba"
amount*string

The amount for which the balance is replenished

Example: "4.87"
Response
Body
success*boolean

Request success indicator

response*PartnerAdvancedBalancesSource (object)

The object of the advance balance

Request
const response = await fetch('https://ocp.onchainpay.io/partner/api/top-up-advanced-balance', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "userId": "b62ffd59-158b-4daf-aeb0-cc02c710f615",
      "organizationId": "6691face-ec14-4fd5-94a8-f6307dcb22a4",
      "advancedBalanceId": "bb837399-bb7a-4d97-9cab-4d47c1b198ba",
      "amount": "4.87"
    }),
});
const data = await response.json();
Response
{
  "success": false,
  "response": {
    "advancedBalanceId": "bb837399-bb7a-4d97-9cab-4d47c1b198ba",
    "currency": "USD",
    "blocked": false,
    "blockReason": null,
    "balance": "12",
    "availableCurrenciesForDeposit": [
      "USDT"
    ]
  }
}

Last updated