Request cURL PHP Node.js Python
curl -X POST "https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3/pay" \
-H "Authorization: Bearer $MORZEPAY_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: cash-nile-0001" \
-d '{
"paid_out_of_band": true,
"note": "Cash at the shop",
"email_receipt": true
}'$ch = curl_init('https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3/pay');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('MORZEPAY_KEY'),
'Content-Type: application/json',
'Idempotency-Key: cash-nile-0001',
],
CURLOPT_POSTFIELDS => json_encode([
'paid_out_of_band' => true,
'note' => 'Cash at the shop',
'email_receipt' => true,
]),
]);
$response = json_decode(curl_exec($ch), true);const res = await fetch('https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3/pay', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MORZEPAY_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'cash-nile-0001',
},
body: JSON.stringify({
paid_out_of_band: true,
note: 'Cash at the shop',
email_receipt: true,
}),
});
const response = await res.json();import os, requests
res = requests.post(
'https://morzepay.com/v1/invoices/inv_UfwyBh1W4Jfa6iG2u2AVT3/pay',
headers={'Authorization': f"Bearer {os.environ['MORZEPAY_KEY']}", 'Idempotency-Key': 'cash-nile-0001'},
json={
'paid_out_of_band': True,
'note': 'Cash at the shop',
'email_receipt': True,
},
)
response = res.json(){
"success": true,
"data": {
"id": "inv_UfwyBh1W4Jfa6iG2u2AVT3",
"object": "invoice",
"livemode": true,
"number": "NILE-0001",
"status": "paid",
"past_due": false,
"wallet_id": "wal_8fK2mQx7RtP4nVb9LcHs2w",
"currency": "UGX",
"customer": {
"name": "Sarah Namuli",
"email": "[email protected] ",
"phone": "+256772418905",
"address": null
},
"lines": [
{
"description": "Website design (5 pages)",
"quantity": 1,
"unit_amount": "450000.00",
"amount": "450000.00"
},
{
"description": "Hosting, 12 months",
"quantity": 2,
"unit_amount": "75000.00",
"amount": "150000.00"
}
],
"subtotal": "600000.00",
"tax_percent": 18,
"tax": "108000.00",
"total": "708000.00",
"amount_paid": "708000.00",
"amount_due": "0.00",
"fee_bearer": "wallet",
"due_date": "2026-10-18",
"memo": null,
"footer": null,
"reference": "order-1001",
"metadata": null,
"hosted_invoice_url": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715",
"invoice_pdf": "https://morzepay.com/i/3f31d270b9829c826d28f0a4e68d7715/pdf",
"receipt_id": "rcpt_WDL1pxuSr3cCcrFL1im2Th",
"receipt_url": "https://morzepay.com/r/5c0e0f50a1b2c3d4e5f60718293a4b5c",
"transaction_id": null,
"paid_out_of_band": true,
"created_at": "2026-10-04T10:00:12+03:00",
"finalized_at": "2026-10-04T10:00:12+03:00",
"sent_at": "2026-10-04T10:00:13+03:00",
"paid_at": "2026-10-06T11:24:05+03:00",
"voided_at": null,
"payments": []
}
}