Refund a transaction
Refunds a transaction through the gateway, records a REFUNDED transaction with a negative amount and sends a REFUND webhook.
Authentication
Section titled “Authentication”Authorization: Bearer <API token>, required.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | integer | Yes | Internal transaction ID. |
amountToRefund |
query | number | No | Amount to refund. Omit for a full refund. |
Request
Section titled “Request”# Full refundcurl "https://api.creditcore.io/api/refund/99101" \ -H "Authorization: Bearer $CREDITCORE_API_TOKEN"
# Partial refundcurl "https://api.creditcore.io/api/refund/99101?amountToRefund=4.50" \ -H "Authorization: Bearer $CREDITCORE_API_TOKEN"Response
Section titled “Response”Always 200 OK. Check success:
{ "success": true, "message": "Refund success with amount 9.99" }{ "success": false, "message": "This transaction is not refundable 99101" }| Failure message | Cause |
|---|---|
This transaction is not refundable <id> |
refundStatus isn’t REFUNDABLE (already refunded, voided…). |
Refund amount is higher than amount in transaction |
amountToRefund exceeds the original amount. |
Transaction not found with ID: <id> |
Unknown transaction. |