Topup or withdrawal a ledger account balance
Topup or withdraw a ledger account balance.
Considerations:
- This endpoint could be only used for accounts with type
subaccount. - The accounts should be
active. - The associated account holder should also be
active. - You can only make operations if the currency code of the amount is the same as the currency code of the account.
Authorization
authorization
AuthorizationBearer <token>
In: header
Path Parameters
account_idstring
Account ID (Base 62 format)
Match
^[A-Za-z]{2,6}_[\w-]{22}$Example
"lacc_5tgliBmzjZ6mpQPRbQjfKj"Header Parameters
x-idempotency-key?string
Idempotency key in UUID format
Format
uuidExample
"f30f1d0b-795f-49f5-80dc-41a7bffccfde"Request Body
application/json
Attributes to topup/withdraw an account balance
amountobject
Money schema
description?string|null
String field
Length
length <= 255Example
"Topup #23"external_idstring
Unique identifier of the update balance operation
Example
"37979c4d-9a6b-40de-b258-42e62f7ee4f1"metadata?object|null
Example
{
"id": 3,
"reference": 123
}operationstring
Operation type to perform an update balance, it can be one of the following options:
topup: Increment the account balance.withdrawal: Decrease the account balance.
Value in
"topup" | "withdrawal"reference?string|null
String field
Length
length <= 255Example
"231"Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.cert.monoban.co/v1/ledger/accounts/lacc_5tgliBmzjZ6mpQPRbQjfKj/balance" \ -H "Content-Type: application/json" \ -d '{ "amount": { "amount": 100000000, "currency": "COP" }, "external_id": "37979c4d-9a6b-40de-b258-42e62f7ee4f1", "operation": "topup" }'{
"amount": {
"amount": 100000000,
"currency": "COP"
},
"description": "Topup #23",
"external_id": "37979c4d-9a6b-40de-b258-42e62f7ee4f1",
"id": "accop_5tgliBmzjZ6mpQPRbQjfKj",
"metadata": {
"id": 3,
"reference": 123
},
"operation": "topup",
"reference": "231"
}{
"code": "400 Bad Request",
"errors": [
{
"error_code": "validation_error",
"message": "Generic changeset errors",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Malformed request"
}{
"code": "401 Unauthorized",
"errors": [
{
"error_code": "expired_token",
"message": "The token is expired, inactive, or doesn't exist.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Authorization header is missing or invalid."
}{
"code": "403 Forbidden",
"errors": [
{
"error_code": "not_authorized",
"message": "Not authorized to have access to this resource.",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Not authorized to have access to this resource"
}{
"code": "422 Unprocessable Entity",
"errors": [
{
"error_code": "missing_field",
"message": "The field is missing on the request body or parameters.",
"path": "#/path/to/field",
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Validation errors"
}