# Errors

Lahza's API follows a RESTful architecture and utilizes conventional HTTP response codes to communicate the outcome of requests, indicating success or failure.

\
Outlined below are some frequently encountered errors along with their possible causes:

#### The authorization code provided either does not exist or has been deactivated.

1. All authorizations remain inactive until a transaction successfully occurs on the card. If you attempt to charge an inactive authorization, you will receive this message.
2. It is important to note that you can only charge an authorization for the customer who originally saved it. If an authorization is paired with the incorrect email, you may encounter this error message.

#### This authorization is not reusable

To utilize our charge authorization endpoint, only authorizations marked as reusable can be used. Prior to attempting a charge, please ensure that the authorization object has confirmed reusability. This step will help you avoid encountering this message.

#### &#x20;Duplicate Transaction Reference

Each transaction within your integration on a specific domain must possess a unique reference. If you try to initiate a new transaction using a reference that has already been utilized, you will receive this message.

#### HTTP Codes

| 200, 201                | Request was successful and intended action was carried out. Note that we will always send a 200 if a charge or verify request was made. Do check the data object to know how the charge went (i.e. successful or failed). |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400                     | A validation or client side error occurred and the request was not fulfilled.                                                                                                                                             |
| 401                     | The request was not authorized. This can be triggered by passing an invalid secret key in the authorization header or the lack of one                                                                                     |
| 404                     | Request could not be fulfilled as the request resource does not exist.                                                                                                                                                    |
| 500, 501, 502, 503, 504 | Request could not be fulfilled due to an error on Lahza's end. This shouldn't happen so please report as soon as you encounter any instance of this.                                                                      |

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.lahza.io/errors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
