Initialize Transaction
Create a new charge and receive a hosted checkout URL.
POST
/api/v1/transaction/initializeRequires Authorization: Bearer sk_live_…
Body parameters
| Parameter | Type | Description |
|---|---|---|
amountrequired | number | Charge amount in GHS. Min 0.01, max 100,000. |
email | string | Customer email (optional but recommended). |
customer_name | string | Customer’s MoMo registered name (recommended when available). |
callback_url | string | HTTPS URL to redirect the browser after successful payment. |
description | string | Shown on checkout / stored on the transaction. |
metadata | object | Arbitrary JSON you get back on verify and webhooks (e.g. your order id). |
Sample request
curl -X POST https://waaguan.com/api/v1/transaction/initialize \
-H "Authorization: Bearer sk_live_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 50,
"email": "customer@email.com",
"customer_name": "AMA MENSAH",
"callback_url": "https://yoursite.com/payment/callback",
"description": "Order #1001",
"metadata": { "order_id": "1001" }
}'Sample response
{
"status": true,
"message": "Authorization URL created",
"data": {
"authorization_url": "https://waaguan.com/pay/wa-6281126272",
"access_code": "AbCdEfGhIjKlMnOp",
"reference": "wa-6281126272",
"amount": 50,
"currency": "GHS",
"momo_number": "024XXXXXXXX",
"momo_network": "MTN"
}
}Response fields
| Parameter | Type | Description |
|---|---|---|
authorization_url | string | Hosted checkout URL — redirect the customer here. |
access_code | string | Used for short links at /c/{access_code}. |
reference | string | Unique wa-########## reference for verify & webhooks. |
amount | number | Amount charged. |
currency | string | Typically GHS. |
momo_number | string | MoMo number shown on checkout. |
momo_network | string | e.g. MTN. |