Skip to main content

Authentication

Introduction​

Moyasar's Platform API uses API Keys to authenticate requests.

Your platform key will be generated by Moyasar's staff and shared through a secure medium during onboarding.

Basic Auth

Authentication to the API is performed via HTTP Basic Auth.

You should send the Basic authentication scheme with the following fields:

  • Username: <your_api_key>
  • Password: <EMPTY>
Important

The password must be kept empty

HTTPS​

All API calls must be made over HTTPS; any API call made over HTTP will be rejected.

Example​

Here is an example of the List Merchants endpoint in different programming languages

require 'vendor/autoload.php'; // Make sure Guzzle is installed via Composer

use GuzzleHttp\Client;

$client = new Client();

$response = $client->get('https://apimig.moyasar.com/v1/merchants', [
'auth' => ['platform_123', ''],
]);

echo $response->getBody()->getContents();
tip

You must replace platform_123 with your API key.