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 with predictable resource-oriented URLs, JSON-encoded 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

// 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
  });

Last updated