Minting KESC
Learn how to convert KES to KESC for your users.
Overview
Minting is the process of converting Kenyan Shillings (KES) to KESC stablecoins. Users send KES via M-Pesa, and receive KESC in their account.
Minting Flow
- User initiates a mint request in your app
- Your backend calls the Pyramid API to create a mint transaction
- User completes M-Pesa payment
- Pyramid verifies payment and mints KESC
- KESC is credited to user's account
- You receive a webhook notification
Implementation
const response = await fetch('https://api.pyramid.africa/v1/transactions/mint', {
method: 'POST',
headers: {
'X-API-Key': 'your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: 'acc_xyz789',
amount: 1000.00,
reference: 'mint_' + Date.now()
})
});
const transaction = await response.json();
console.log(transaction.id); // txn_abc123