Introduction
Learn how to integrate our APIs into your application.
Before you start, you need to create a free Mavapay account and get your test API keys to start building with the Mavapay API. All monies transacted in the sandbox environment are not real and are for testing purposes only.
About the API
The Mavapay API is a set of RESTful APIs that allow you to interact with our platform. We provide APIs for payments, transfers, and more. You can use our APIs to build amazing payment experiences for your customers. We follow the OpenAPI specification for our API documentation.
Our base URL for the sandbox/staging API is https://staging.api.mavapay.co/api/v1
while the base URL for the live API is https://api.mavapay.co/api/v1
.
HTTP Methods
Our API endpoints support the following HTTP methods:
GET
: Retrieve data from the server.POST
: Send data to the server.PUT
: Update data on the server.DELETE
: Remove data from the server.
Status Codes
Our API uses standard HTTP status codes to indicate the success or failure of an API request. Here are some common status codes you might encounter:
200 OK
: The request was successful.201 Created
: The resource was created successfully.400 Bad Request
: The request was invalid.401 Unauthorized
: The request was not authorized.404 Not Found
: The resource was not found.500 Internal Server Error
: An error occurred on the server.
Sample requests
We provide sample requests for each API endpoint in our documentation. You can use these samples to understand how to interact with our APIs.
Requests and Responses
All requests to our API must include a valid API key in the Authorization
header. Responses from our API are in JSON format. Content-Type should be set to application/json
.
The response body will contain the data you requested or an error message if the request was unsuccessful. Here is an example of a successful response:
keys
status
: The status of the request (success
orerror
).message
: A message describing the status of the request.data
: The data returned by the API. Always an object or an array.
Supported Currencies
Mavapay makes use of the ISO 4217 format for currency codes. When sending currency codes in requests, please use the appropriate ISO 4217 code for the currency you are working with.
When sending amounts, please ensure that the amount is in the smallest unit of the currency. For example, if you are sending 100 NGN, you should send 10000
as the amount (100 * 100)
.
Here are the list of currencies our API supports (we’re constantly adding more currencies):