API Basics

The Lahza API provides comprehensive access to the various features available on our dashboard, allowing you to leverage and expand their functionality within your own application. Our API follows RESTful principles and is structured around the primary resources that you'll interact with, with a few exceptions worth mentioning.

Sign up for a free Lahza account to access and test the API. Test keys will be provided for making API calls. Requests and Response

Requests and Response

  "status": [boolean],  // Only true if the details provided could be processed and no error occured while processing
  "message": [string], // Explains why status is false... Entirely informational. Please only log this but do not use for your checks
  "data": [object]    // contains actionable result of processing if present

We recommend using HTTP status codes to determine the outcome of an API call. However, we also provide additional keys to give you more information about the response.

The "status" key indicates whether the request was successful or not. If it is set to true, the request was successful. If it is set to false, there was an error.

The "message" key provides a summary of the response and its status. For example, when retrieving a list of customers, the message might say "Customers retrieved". In case of an error, the message will contain a description of the error, such as the authorization header situation mentioned earlier. This key is consistent across all requests.

The "data" key contains the actual result of the request. It can be an object or an array, depending on the type of request made. For example, retrieving a single customer will return a customer object in the data key, while retrieving a list of customers will return an array of customer objects.

The "meta" key is used to provide additional contextual information about the contents of the data key. For instance, when retrieving a list of transactions for a customer, pagination parameters can be included in the meta key to limit the result set. The meta key will contain an object with relevant attributes to provide this context.

"meta": {
  "total": 2,
  "skipped": 0,
  "perPage": 50,
  "page": 1,
  "pageCount": 1


Last updated