Creates a ledger account
Creates a ledger account associated to a third-party account holder.
Considerations:
- You could previusly check the accepted currency codes in the endpoint
/v1/ledger/tenant/config. - The third-party account holder must be
active.
Authorization
authorization
In: header
Header Parameters
Idempotency key in UUID format
uuid"f30f1d0b-795f-49f5-80dc-41a7bffccfde"Request Body
application/json
Attributes to create a ledger account
The currency associated with the account balance.
"COP" | "USD" | "MXN" | "CLP" | "BRL" | "PEN" | "EUR"Identifier of the third-party account holder.
^[A-Za-z]{2,6}_[\w-]{22}$"acch_5tgliBmzjZ6mpQPRbQjfKj"A tenant-managed flat map for providing additional data about the account. The values are stored and displayed as strings, and the provided information will be returned as-is in the account details.
{
"id": 3,
"reference": 123
}Name of the account, which is used to describe the account's purpose better.
"Main account"Program identifier. If the value is empty, the account is associated with the tenant default program.
^[A-Za-z]{2,6}_[\w-]{22}$"pro_5tgliBmzjZ6mpQPRbQjfKj"Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.cert.monoban.co/v1/ledger/accounts" \ -H "Content-Type: application/json" \ -d '{ "currency_code": "COP", "holder_id": "acch_5tgliBmzjZ6mpQPRbQjfKj" }'{
"currency_code": "COP",
"holder_id": "acch_5tgliBmzjZ6mpQPRbQjfKj",
"id": "lacc_5tgliBmzjZ6mpQPRbQjfKj",
"inserted_at": "2022-01-01T01:00:00Z",
"metadata": {
"id": 3,
"reference": 123
},
"name": "Main account",
"program_id": "pro_5tgliBmzjZ6mpQPRbQjfKj",
"provider": "mono_ledger",
"state": "active",
"state_reason": "temporary",
"state_reason_detail": "string",
"type": "subaccount",
"updated_at": "2022-01-01T01:00:00Z"
}{
"currency_code": "COP",
"holder_id": "acch_5tgliBmzjZ6mpQPRbQjfKj",
"id": "lacc_5tgliBmzjZ6mpQPRbQjfKj",
"inserted_at": "2022-01-01T01:00:00Z",
"metadata": {
"id": 3,
"reference": 123
},
"name": "Main account",
"program_id": "pro_5tgliBmzjZ6mpQPRbQjfKj",
"provider": "mono_ledger",
"state": "active",
"state_reason": "temporary",
"state_reason_detail": "string",
"type": "subaccount",
"updated_at": "2022-01-01T01:00:00Z"
}{
"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"
}