Description: Initiates a full or partial refund for a previously successful transaction.
Note: Refund cannot be initiated for failed payments. Duplicate refunds are not allowed. You can only refund up to the amount received.
https://stanzape.com/api/uat/refund/init/
Content-Type: application/json "X-Signature: " . base64_encode(hash_hmac('sha256', $json_body, $shared_secret, true))
Language | Core Logic |
---|---|
Node.js | crypto.createHmac('sha256', key).update(message).digest('base64') |
Python | base64.b64encode(hmac.new(key, msg, hashlib.sha256).digest()).decode() |
Java | Base64.getEncoder().encodeToString(mac.doFinal(message.getBytes())) |
PHP | base64_encode(hash_hmac('sha256', $message, $key, true)) |
{ "orderid": "ORD2025010112562223", "refundid": "REF1234567890", "amount": 50.00, "reason": "Customer request", "merchantdata": { "mid": "XXXXXX02", "authkey": "XXXXXXXXXXXXXXstanzakey" } }
{ "status": "STANZA001", "message": "Refund successful", "refundid": "REF1234567890", "orderid": "ORD2025010112562223", "amount": 50.00, "timestamp": "2025-07-23T22:30:00+05:30" }
{ "status": "STANZA002", "message": "Refund not allowed for failed transaction" // or other error details }
Status | Code | Meaning |
---|---|---|
✅ | STANZA001 | Refund processed successfully |
⚠️ | STANZA002 | Bad Request – Invalid or failed orderid |
🔐 | STANZA003 | Unauthorized – Invalid auth key |
💥 | STANZA004 | Server error – try again later |
Description: Check the status of a refund using the refundid
.
https://stanzape.com/api/uat/refund/status/
{ "request": { "refundid": "REF1234567890" }, "merchantdata": { "mid": "XXXXXX02", "authkey": "XXXXXXXXXXXXXXstanzakey" } }
{ "status": "STANZA001", "message": "Refund Found", "refund": { "refundid": "REF1234567890", "orderid": "ORD2025010112562223", "amount": 50.00, "status": "REFUNDED", "timestamp": "2025-07-23T22:30:00+05:30" } }
{ "status": "STANZA002", "message": "Refund ID not found" }
If you're facing issues or need integration support, Email: support@stanzape.com or connect with our team.