Mono Colombia

Updates state of a ledger account

Updates state of a subaccount type ledger account.

Considerations:

  1. You couldn't modify state of the canceled ledger accounts.
  2. You couldn't modify accounts where the type is different of a subaccount
PATCH
/v1/ledger/accounts/{id}

Autorización

AutorizaciónBearer <token>

En: header

Parámetros de ruta

idstring

Account ID (Base 62 format)

Match^[A-Za-z]{2,7}_[\w-]{22}$
Example"lacc_5tgliBmzjZ6mpQPRbQjfKj"

Cuerpo de la solicitud

application/json

Attributes to update state of a ledger account

Definiciones de TypeScript

Usa el tipo request body en TypeScript.

detail?string

It provides a textual reason why the account is blocked in case of the state_reason value is other.

Example"breach of terms"
reason?string

It provides the reason why the account could be blocked. It is required when the account is transitioned to being blocked.

Value in"temporary" | "user_request" | "unused" | "fraud" | "other"
Example"unused"
statestring

State to update the account, it can be one of the following values:

  • active: it's enabled to perform operations with the account balance.
  • blocked: it's disabled by a tenant and couldn't perform any operation with the account balance.
Value in"active" | "blocked"
Example"blocked"

Cuerpo de la respuesta

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://api.sandbox.cuentamono.com/v1/ledger/accounts/lacc_5tgliBmzjZ6mpQPRbQjfKj" \  -H "Content-Type: application/json" \  -d '{    "state": "blocked"  }'
{
  "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": "404 Not Found",
  "errors": [
    {
      "error_code": "item_not_found",
      "message": "The item doesn't exist",
      "path": null,
      "url": null
    }
  ],
  "id": "log_7MkWaFqvfosB8fzHhb1Eql",
  "message": "Resource not defined"
}
{
  "code": "422 Unprocessable Content",
  "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"
}