# Introduction

**The Vahlid Developer API allows developers to incorporate safe, scam-free payments into their platforms.**

Using the Vahlid API, you can carry out the following:

* Create safe transactions between you and your buyers.
* Monitor transactions and provide immediate value to your customers based on the events that occur on each transaction - success, failure and raised disputes.

This API Reference is organized around these core business workflows, with comprehensive guides to help you start working with the Vahlid API as quickly as possible.

Our APIs follow the general patterns of [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) with predictable resource-oriented URLs, [JSON-encoded](https://www.json.org/json-en.html) request bodies and responses, as well as standard HTTP response codes, authentication, and verbs.

## Overview

#### Getting Started

To begin integrating with our APIs, you will need a Vahlid account. Please go ahead and create a free account if you haven't done so already. If you do have an account, let’s jump right in!

#### Authentication

Vahlid authenticates your API requests using your account’s API keys - test or live. If your calls to our API do not contain valid keys - (pun intended :)), the Vahlid API will throw unauthorized errors.

Your **API Key** should be kept confidential and only stored on your own servers. Your account’s secret API key can perform any API request to Vahlid's API without restriction.

**Obtaining your API Keys**

Your **API Keys** are generated on request on your user dashboard at **vahlid.com.** A Vahlid APIKey starts with **VHL.**

#### How to set the API Keys

After obtaining your API keys, which are both live and test keys, pass your API key as a bearer token for every API call you make to the Vahlid server. This means passing an `Authorization` header with `"Bearer: YOUR_API_KEY"` value.

Below is an example using Nodejs

```javascript
// Using fetch
fetch(`https://api.vahlid.com/v2/transactions/`, {
  headers: {
    "Authorization": `Bearer ${VAHLID_API_KEY}`
  }
})
  .then(response => {
    // Handle the response
  })
  .catch(error => {
    // Handle the error
  });

// Using axios
axios.get(`https://api.vahlid.com/v2/transactions/`, {
  headers: {
    "Authorization": `Bearer ${VAHLID_API_KEY}`
  }
})
  .then(response => {
    // Handle the response
  })
  .catch(error => {
    // Handle the error
  });

```


---

# 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://vahlid.gitbook.io/vahlid-developer-api/master.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.
