Mono Colombia

Creates a ledger account

Creates a ledger account associated to a third-party account holder.

Considerations:

  1. You could previusly check the accepted currency codes in the endpoint /v1/ledger/tenant/config.
  2. The third-party account holder must be active.
POST
/v1/ledger/accounts

Authorization

authorization

AuthorizationBearer <token>

In: header

Header Parameters

x-idempotency-key?string

Idempotency key in UUID format

Formatuuid
Example"f30f1d0b-795f-49f5-80dc-41a7bffccfde"

Request Body

application/json

Attributes to create a ledger account

currency_codestring

The currency associated with the account balance.

Value in"COP" | "USD" | "MXN" | "CLP" | "BRL" | "PEN" | "EUR"
holder_idstring

Identifier of the third-party account holder.

Match^[A-Za-z]{2,6}_[\w-]{22}$
Example"acch_5tgliBmzjZ6mpQPRbQjfKj"
metadata?object|null

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.

Example{ "id": 3, "reference": 123 }
name?string|null

Name of the account, which is used to describe the account's purpose better.

Example"Main account"
program_id?string|null

Program identifier. If the value is empty, the account is associated with the tenant default program.

Match^[A-Za-z]{2,6}_[\w-]{22}$
Example"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"
}