Integrate HPAY payments services into your app
Endpoint : POST /getToken/
Request JSON :
Content-Type: application/json
{
"api_key":"YOUR_API_KEY",
"api_public_key":"YOUR_PUBLIC_KEY",
"api_secret_key":"YOUR_SECRET_KEY",
"mode":"TEST or PROD"
}
Response JSON :
{
"success": true,
"message": "Token generated",
"token": "RmtVMVV6clh5NURDWnRJUjdHQ2hIZHRO",
"livetime": "15mn",
"time_generated": 1758382955,
"error_code": 0,
"company": "WestSofts INC",
"mode": "TEST",
"balance": {
"currency": "CAD",
"main_balance": 50,
"profit_balance": 100
}
}
Endpoint : POST /payment/
Request JSON :
Content-Type: application/json
Description :
The purchase currency is the one linked to your account when the Token is generated. You must specify your own notify_url, success_url, cancel_url
{
"api_key":"91265Y.190DE10.967ZAA",
"public_key":"pkey.006JhgTHSd23f5.SDjd.Sze12Zds.hdesK1",
"mode":"TEST",
"amount": 14900,
"product_name": "Achat de sac pour enfant",
"description": "Sac d'école pour enfant de 4 à 10 ans",
"notify_url": "https://hpay.cash/third/notify/",
"success_url": "https://hpay.cash/third/success/",
"cancel_url": "https://hpay.cash/third/cancel/",
"token":"QzArdC84YXg0TlVycjhiT2RkVVhBVU"
}
Response JSON :
{
"success": true,
"message": "Payment URL generated",
"amount": "100",
"fees": 0.5,
"currency": "CAD",
"transaction_id": "AabBzZ190002AZ",
"mode": "TEST",
"company": "WestSofts INC SARL",
"checkout_url": "https://checkout.hpay.cash?ref=AabBzZ190002AZ"
}
Endpoint : POST /getPaymentHistory/
Request JSON :
Content-Type: application/json
{
"api_key":"32HDS6D.DEQ78U.DESS8",
"public_key":"pkey.8763DHheHDe.SDjd.76720.DZDk09",
"mode":"TEST",
"statut":"UNPAID or PAID",
"date_from":"yyyy-mm-dd",
"date_to":"yyyy-mm-dd",
"fetch_limit":"0,50",
"transaction_id":"",
"token":"QzArdC84YXg0TlVycjhiT2RkVVhBVUMwQnQ4VktNKzBEVk"
}
Response JSON :
{
"success": true,
"message": "Data Fetched",
"error_code": 0,
"history": [
{
"transaction_id": "ceXefesOpl",
"amount": "7000.00",
"fees": "700.00",
"profit": 6300,
"currency": "XOF",
"mode": "TEST",
"status": "UNPAID",
"product": "Amazon Achat de carte cadeau",
"description": "Achat en ligne de Chèques-cadeaux et cartes cadeaux dans un vaste choix sur la boutique Boutique chèques-cadeaux.",
"payment_link": "https://checkout.hpay.cash/?ref=ceXefesOpl",
"date_generated": "2025-11-08 14:42:34"
}
]
}
Endpoint : POST /getCollectBalance/
Request JSON :
Content-Type: application/json
{
"api_key":"F956789.8578PTKLGF",
"api_public_key":"YOUR_PUBLIC_KEY",
"token":"YOUR_GENERATED_TOKEN"
}
Response JSON :
{
"success": true,
"message": "Data Fetched",
"error_code": 0,
"entreprise_name": "WestSofts INC SARL",
"entreprise_contact": "00000000",
"entreprise_currency": "XOF",
"main_balance": "0",
"profit_balance": "0"
}