Introduction
Learn how to integrate Dotapay's APIs into your apps.
API basics
Before you begin! You should create a free Dotapay account that you can test the API against. We will provide you with test keys that you can use to make API calls.
The Dotapay API lets you programmatically collect payments, manage transactions, and perform other operations that you can also do from your Dotapay Dashboard. It's a RESTful, JSON-based API that uses standard HTTP methods and requires authentication for most requests.
All requests must be made over HTTPS. Unencrypted HTTP requests aren't supported.
BASE URL
The base URL for all API requests is:
https://api.backend.dotapay.ngThis works for both test and live environments. Your API keys determine which environment you're using.
Environments and API Keys
Dotapay provides both test and live environments, each with their own set of API keys. Use your test keys for development and testing, and your live keys for production.
For more details on obtaining and managing your API keys, see the Authentication section.
HTTP methods
The Dotapay API follows standard HTTP semantics.
POST
String
Creates a new resource on the server.
GET
String
Retrieves a representation of a resource.
PUT
String
Updates an existing resource or creates it if it doesn't exist.
DELETE
String
Deletes a specified resource.
Making requests
All requests to the Dotapay API are made to the base URL and must include your Private key in the Authorization header.
Authorization headers should be in the following format: DPPRIVATEKEY: PRIVATE_KEY.
The API Reference lists examples of requests for each endpoint. You can copy and paste these examples into your own code or run them from the command line using cURL. You can also explore the API using Postman and the Dotapay Postman Collection.
Requests and responses
Both request body data and response data are formatted as JSON. Content type for responses is always application/json. Generally, all responses are in the following format:
Keys
status Boolean
This lets you know if your request was succesful or not. We recommend that you use this in combination with HTTP status codes to determine the result of an API call.
message
String
This is a summary of the response and its status. For instance when trying to retrieve a list of customers, message might read “Customers retrieved”. In the event of an error, the message key will contain a description of the error as with the authorization header situation above. This is the only key that is universal across requests.
data
Object
This contain the results of your request. It can either be an object, or an array depending on the request made. For instance, a request to retrieve a single customer will return a customer object in the data key, while the key would be an array of customers if a list is requested instead.
Last updated