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/{{organization_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":{ //optional, default status.code = ACTIVE and description = null
      "code":"ACTIVE",
      "description":"Ready to use"
   },
   "metadata":{ //optional
      "costCenter":"BR_11101997"
   }
}

Response codes

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

Retrieve all Ledgers

GET /v1/organizations/{{organization_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

If a ledger has been deleted, the information of the ledger will be displayed, including the date when the deletion occurred in the deletedAt field.

[
   {
      "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":"cc15194a-6bc9-4ebb-b15d-43411a54ba4b",
      "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":"2024-02-10T10:11:27+0400"
   }
]

Retrieve Ledger by id

GET /v1/organizations/{{organization_id}}/ledgers/{{ledger_id}}

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

Headers

NameValue

Authorization

Bearer <token>

Response codes

If a ledger has been deleted, the information of the ledger will be displayed, including the date when the deletion occurred in the deletedAt field.

{
   "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/{{organization_id}}/ledgers/{{ledger_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

If a ledger has been deleted, the information of the ledger will be displayed, including the date when the deletion occurred in the deletedAt field.

{
  "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/{{organization_id}}/ledgers/{{ledger_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