Ledgers API

Use the Ledgers API to manage the Ledgers that are part of the Organization.

Refer to Ledgers API in the Requests and Responses page for more information about the parameters.

Create a Ledger

POST /v1/organizations/{{id}}/ledgers

Use this endpoint to create a Ledger.

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Request body
{
  "name": "The Neobank Brazil",
  "status": {
    "code": "ACTIVE", 
    "description": "Ready to use"
  },
  "metadata": {
    "costCenter": "BR_11101997"
  }
}

Response codes

{
  "id": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
  "organizationId": "cc15194a-6bc9-4ebb-b15d-43411a54ba4b",
  "name": "The Neobank Brazil",
  "metadata": {
    "costCenter": "BR_11101997"
  },
  "status": {
    "code": "ACTIVE",
    "description": "Ready to use"
  },
  "createdAt": "2024-02-08T16:59:31+0300",
  "updatedAt": "2024-02-08T16:59:31+0300",
  "deletedAt": null
}

Retrieve all Ledgers

GET /v1/organizations/{{id}}/ledgers

Use this endpoint to retrieve the information of all Ledgers that the user has access to.

Headers

NameValue

Authorization

Bearer <token>

Response codes

[
    {
        "id": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
        "organizationId": "cc15194a-6bc9-4ebb-b15d-43411a54ba4b",
        "name": "The Neobank Brazil",
        "metadata": {
            "costCenter": "BR_11101997"
        },
        "status": {
          "code": "ACTIVE",
          "description": null
        },
        "createdAt": "2024-02-08T16:59:31+0300",
        "updatedAt": "2024-02-08T16:59:31+0300",
        "deletedAt": null
    },
    {
        "id": "0df8d87f-f26e-451c-b650-f8af7af947dc",
        "organizationId": "cc15194a-6bc9-4ebb-b15d-43411a54ba4b",
        "name": "The Neobank US",
        "metadata": {
            "officeAddress": "123 Broadway",
            "generalManager": "Larry Fink"
        },
        "status": {
          "code": "ACTIVE",
          "description": null
        },
        "createdAt": "2024-02-09T06:49:31+0300",
        "updatedAt": "2024-02-09T06:49:31+0300",
        "deletedAt": null
    },
    {
        "id": "048bbdd0-1de6-4e36-a91b-a87b000778d9",
        "organizationId": "54c59721-8e31-4453-9a22-19d9376768bb",
        "name": "Just another ledger",
        "metadata": null,
        "status": {
          "code": "INACTIVE",
          "description": "Deactivated"
        },
        "createdAt": "2024-02-09T06:49:31+0300",
        "updatedAt": "2024-02-09T06:49:31+0300",
        "deletedAt": null
    }
]

Retrieve Ledger by id

GET /v1/organizations/{{id}}/ledgers/{{id}}

Use this endpoint to retrieve the information of a specific Ledger using the identifier (id).

Headers

NameValue

Authorization

Bearer <token>

Response codes

{
  "id": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
  "organizationId": "cc15194a-6bc9-4ebb-b15d-43411a54ba4b",
  "name": "The Neobank Brazil",
  "metadata": {
    "costCenter": "BR_11101997"
  },
  "status": {
    "code": "ACTIVE",
    "description": null
  },
  "createdAt": "2024-02-08T16:59:31+0300",
  "updatedAt": "2024-02-08T16:59:31+0300",
  "deletedAt": null
}

Update a Ledger

PATCH /v1/organizations/{{id}}/ledgers/{{id}}

Use this endpoint to edit and update the information of a specific Ledger. When you update a Ledger, the following fields can be edited:

  • name

  • status

  • metadata

When updating the "metadata" object, all previous key-value pairs must be included in the update, or they will be removed. Check the Metadata section for more information.

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Request body
{
  "name": "The Neobank Brazil",
  "status": {
    "code": "New code",
    "description": "New description"
  },
  "metadata": {
    "costCenter": "BR_11101997"
  }
}

Response codes

{
  "id": "77b0fb8b-1bd9-4810-9c6d-7e80064fab0c",
  "organizationId": "cc15194a-6bc9-4ebb-b15d-43411a54ba4b",
  "name": "The Neobank Brazil",
  "metadata": {
    "costCenter": "BR_11101997"
  },
  "status": {
    "code": "New code",
    "description": "New description"
  },
  "createdAt": "2024-02-08T16:59:31+0300",
  "updatedAt": "2024-02-08T16:59:31+0300",
  "deletedAt": null
}

Delete a Ledger

DELETE /v1/organizations/{{id}}/ledgers/{{id}}

Use this endpoint to deactivate a Ledger that is in the homologation process (HML).

Only Lerian's internal team can deactivate Ledgers in production (PROD).

Headers

NameValue

Authorization

Bearer <token>

Response codes

Last updated