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

  1. User initiates a mint request in your app
  2. Your backend calls the Pyramid API to create a mint transaction
  3. User completes M-Pesa payment
  4. Pyramid verifies payment and mints KESC
  5. KESC is credited to user's account
  6. 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