keyAuthentication

This gives details on how Authentication is to be handled when connecting to the Merpi API.

Before you begin to make API calls, you need your API Key, and that is gotten from the dashboard. To get your API key, log in to your dashboardarrow-up-right, on the Menu on the left, click on Settings, you’ll see your Profile Information amidst other tabs. Navigate to the tab that says ‘API Keys’. Check what environment you are in whether Live or Staging and copy the appropriate key.

After copying your key, whenever you attempt to make a request, make sure to attach it to the header like this:

curl {{merpi_api_url}}/api/v1/experience/buy/ticket

-H "X-API-KEY: sk_test_DEFAULT"

-H "TransactionMedium: POS || Mobile || Web"

-H "Content-Type: application/json"

-H "Accept: /"

Please, include the transaction medium through which you are hitting MERPI endpoints. If you are hitting from a mobile device, you are to send 'Mobile' as the TransactionMedium in your Header. Same for 'POS' if you are hitting MERPI endpoints from your POS and send 'Web' from your website.

In the coming sections, we are going to see the API Reference divided into 3 major sections:

Each will have their detailed description of the endpoints associated with them. For example, under Bus ticketing, we’ll see the endpoint that fetches the list of available routes(Lagos->Abuja), the query parameters that can be used to filter endpoint and get much accurate information about the routes, the response body structure and a description of what each field in the response body represents amidst a lot of other information about the endpoint.

Last updated