No businesses yet
Add your first business to generate API keys and a merchant wallet address for accepting AJE payments.
🔑 API Keys & Merchant Address
Keys are auto-generated when you create a business. Use them in your integration:
- Public Key (
pk_live_…) — include in your frontend to identify your business in the AjePay checkout widget. - Secret Key (
sk_live_…) — use server-side only to create invoices. Never expose in frontend code. - Merchant Address — the AJE wallet address where all customer payments arrive on-chain. Customers send AJE here.
🚰 Developer Faucet
Mint 100 AJE to your merchant wallet to test payment flows locally.
| Date & Time | From Address | Amount | Type | Status |
|---|---|---|---|---|
| Select a business to view transactions. | ||||
Business Profile
This information represents your business to customers during checkout.
API Keys
Use these keys to authenticate your integration with AjePay.
- Keys are automatically generated when you create a business on AjePay — no manual setup needed.
- Your Public Key goes in your frontend HTML/JS code and the AjePay widget script tag.
- Your Secret Key goes in your backend server only (PHP, Node.js, Python). It authorises invoice creation.
- Your Merchant Address is the on-chain AJE wallet address customers send payments to.
- To get keys for a different project, simply add another business from the sidebar.
Webhook Endpoint
AjePay sends a POST request to your endpoint when a payment is confirmed on-chain. Use this to grant access, activate subscriptions, or update your database.
Webhook Secret
Use this to verify that webhook calls originate from AjePay. Compare it with the x-ajepay-signature header on incoming requests.
Events
Choose which events trigger a webhook notification.
Bank Payout Account
Link your Nigerian bank account to withdraw AJE earnings to NGN. Withdrawals are processed as bank transfers.
AJE Merchant Wallet
Your AjeChain wallet address where all customer payments are received. This is a non-custodial wallet — AjePay never holds your funds.
Your private key was shown once during registration via the recovery phrase (12 words). To import your wallet into any AjeChain-compatible app, use that phrase. AjePay does not store your private key in a recoverable form.
AjePay uses the AjeChain ledger for settlement. The flow is:
- 1. Your server creates an invoice (using your Secret Key) → gets an
invoiceId. - 2. You launch the AjePay checkout modal in the customer's browser with the
invoiceId. - 3. The modal shows your Merchant Address and the amount. The customer transfers AJE from their wallet to your address.
- 4. AjePay polls the AjeChain ledger, detects the transaction, and fires your webhook.
- 5. Your server receives the webhook → grants the customer access.
Step 1 — Store your credentials
<?php
// config.php — keep this file server-side only
define('AJEPAY_SECRET', 'sk_live_YOUR_SECRET_KEY');
define('AJEPAY_GATEWAY', 'http://localhost:3005'); // your AjePay gateway URL
define('MERCHANT_ADDRESS','AJE_YOUR_MERCHANT_ADDRESS');
?>
Step 2 — Create an invoice (server-side)
Call the AjePay gateway from your backend. Never call it from JavaScript in the browser with your secret key.
<?php
require 'config.php';
function createInvoice(string $userId, string $amount, string $item): array {
$ch = curl_init(AJEPAY_GATEWAY . '/gateway/invoice/create');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'merchantAddress' => MERCHANT_ADDRESS,
'amount' => $amount,
'item' => $item,
]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'x-ajepay-key: ' . AJEPAY_SECRET,
],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
return $data; // contains invoiceId, amount, merchantAddress
}
// Usage in your checkout route:
$invoice = createInvoice($_SESSION['user_id'], '5.00', 'Premium Subscription');
echo json_encode(['invoiceId' => $invoice['invoiceId']]);
?>
Step 3 — Show the checkout modal (frontend)
Add the AjePay widget to any HTML page. Pass the invoiceId from Step 2.
<!-- Add widget script to your page -->
<script src="http://localhost:3005/ajepay-widget.js"></script>
<!-- Trigger checkout -->
<button onclick="AjePay.openCheckout('{{ $invoiceId }}')">
Pay with AJE ⚡
</button>
Step 4 — Receive the webhook
When the customer sends AJE to your merchant address, AjePay confirms it on-chain and calls your webhook URL.
<?php
// webhook.php
$raw = file_get_contents('php://input');
$payload = json_decode($raw, true);
if ($payload['event'] === 'payment.confirmed') {
$invoice = $payload['invoice'];
$userId = $invoice['userId'];
$amount = $invoice['amount']; // AJE amount received
// Grant access in your database
grantUserAccess($userId);
http_response_code(200);
echo 'OK';
}
function grantUserAccess(string $userId): void {
// e.g. UPDATE users SET is_premium = 1 WHERE id = ?
}
?>