• France
status page
Demo shops
assistance
FAQContact support
Search
Categories
Tags
docs.
France
Spain
Europe (English)
India
Homepage
Use cases
Create a payment
Create an installment payment
Create a multi-card (split) payment
Create a payment by Alias (Token)
Create a payment link
Create a recurring payment
Manage subscriptions
Manage your transactions (refund, cancel...)
Analyze your reports
API docs
Embedded Form
REST API
Hosted payment
Mobile payment
File exchange
SDD mandates by REST API
Snippets
Payment methods
Plugins
Marketplace
Guides
Merchant Back Office
Back Office Expert
Functional guides

Authentication phase

Each call requires an authentication based on the HTTP Basic Authentication method.

This method uses the Authorization HTTP header consisting of the word Basic followed by a string encoded in base64 containing a username and a password separated by a colon (:).

  • The username is the shop identifier, for example: 28478261
  • The password is defined in the Merchant Back Office: for example testpassword_HDBz5YpANEajG4DwYSmkQDNM9lzGiuvrhY9f6G9HEm5do.

The username and password are available in the Merchant Back Office, Settings > Shop menu, REST API keys tab.

PARAMETER Description
User Username for building the header Authorization string.
Test password Password allowing to build the Authorization header string for test transactions (with test cards).
Production password Password allowing to build the Authorization header string for production transactions (with real cards).

How to build the “Authorization” HTTP header

  1. Create a string presented asusername:password
    69876357:testpassword_DEMOPRIVATEKEY23G4475zXZQ2UA5x7M
  2. Encode the obtained chain in base64
    Njk4NzYzNTc6dGVzdHBhc3N3b3JkX0RFTU9QUklWQVRFS0VZMjNHNDQ3NXpYWlEyVUE1eDdN
  3. Add the “Authorization” header to your request containing the word “Basic” followed by the string encoded in base64:
    Authorization: Basic Njk4NzYzNTc6dGVzdHBhc3N3b3JkX0RFTU9QUklWQVRFS0VZMjNHNDQ3NXpYWlEyVUE1eDdN

In PHP, the Authorization header will be calculated as follows:

$header = "Authorization: Basic " . base64_encode($username . ':' . $password);

The full HTTP request will look like this:

/en-EN/rest/V4.0/api/kb/authentication.html
https://github.com/lyra/rest-php-examples/blob/master/www/SDKTest.php#L16-L26
https://api.lyra.com/api-payment/V4/Charge/SDKTest
{
    "value": "my testing value"
}

Useful links

For more details on implementation in different languages, see the following Gitub gists.

Jobs
Legal
GDPR
25.18-1.11