Get Started

Getting Started
The API documentation is intended for developers and technical teams to seamlessly integrate Miden’s financial infrastructure solutions into their applications and business processes. It lets you integrate card issuance, business accounts, collections and disbursements, and wallet infrastructure directly into your product.n financial workflows.
The Five Solutions
- Card Issuance: Issue and manage virtual/physical cards, retail and corporate cards for your customers, vendors, employees,and partners.
- USD Business Accounts Create and manage USD accounts programmatically. It provides access to features such as USD account management, transfers, collections, beneficiaries, and webhook notifications.
- NGN Business Accounts Programmatic NGN accounts, collections, and payouts
- Collections & Disbursements Accept payments and pay out across multiple channels, currencies and countries
- Wallet as a Service (WaaS) Build and manage wallet infrastructure for your users
Quick Start
BaseUrl :
https://sandbox-api.midencards.io/miden
To access any of the resources on the BaseUrl/api/v1/, you have to pass pre-defined headers for authentication and authorization.
See Authentication process below: a. Reference b. Signature c. UniqueKey d. MidenAuthorization e. Authorization
The API is secure and only authorized clients can consume the service. There is a clientId, clientSecret and uniqueKey assigned to every client for authentication and authorization. See below required headers how to derive headers.
How to derive Headers:
Part of every payload will be authentication and authorization headers and they are:
a. Reference:
The reference is a maximum 30-character string generated by the client and has to be unique for every request. e.g. 1232222Ehsj12345663
b. Signature:
The signature is a more complex computation used for authentication. It is a combination of the Http verb, encoded url, client generated reference, client id, and client secrete. All will be hashed and encoded with base 64.
See example below:
$encodeUrl = urlencode($url); $baseStringToBeSigned = $method . "&" . $encodeUrl . "&" . $reference. "&". $clientId . "&" . $secret; $sign = Base64Encode(SHA1($baseStringToBeSigned));
For more details on how to generate signature, see here.
c. UniqueKey:
This is generated and shared as part of the client on-boarding process.
d. MidenAuthorization:
This is a combination of miden auth and base64 encoded client Id. E.g. MidenAuthorization = "MidenAuth " . Base64Encode ($clientId);
note: "MidenAuth " is a fixed string that needs to be concatenated with the Base64-encoded value of _clientId_
e. Authorization:
Authorization is the bearer token gotten from get token endpoint. This is required for all transactions. $token = token from identity get token login (get token url => https://sandbox-identityserver.midencards.io/connect/token)
Sample curl request:
curl --location --request POST 'https://sandbox-identityserver.midencards.io/connect/token
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Authorization: Basic REVGQVVMVE9SR0FOSVpBVElPTkFCRDc4OTNBMTYzMDRDRTVBNEM4RDQ2MjhDQzAwQkZCOjR6TC0hX2dLcTA1Q2VIdU8hTG4yTTk3QG4kcEAhQQ=='
--data-urlencode 'grant_type=client_credentials'
--data-urlencode 'scope=CardAPIs'
Snippet for Generating Signature in PHP
StartFragment
function nonce()
{
return substr(str_shuffle(MD5(microtime())), 0, 20);
}
function Base64Encode($value): string
{
return base64_encode($value);
}
function Base64Decode($value): bool|string
{
return base64_decode($value);
}
function SHA256($signaturecipher): bool|string
{
return hash("sha256",$signaturecipher);
}
function SHA1Here($signatureCipher): string
{
return sha1($signatureCipher, false);
}
EndFragment
$url = "full url of the request";
$encodeUrl = urlencode($url);
$reference = nonce();
$clientId = "client Id generated during application creation";
$clientSecret = "generated during application creation";
$method = "Http method of the request";
$baseStringToBeSigned = $method . "&" . $encodeUrl . "&" . $reference. "&". $clientId . "&" . $clientSecret;
$signature = Base64Encode(SHA1Here($baseStringToBeSigned));
Next Steps
- New to a specific solution? Jump to its overview in the sidebar.
- Setting up auth for the first time? Start with Access Token then Generate Signature.
On this page
- Get Started