Refund a payment
/api2.php?action=refundRefunds all or part of a payment, identified by your order_id and the merchant_id. The refund can't be more than what's left to refund on the payment. If the payment was only authorised (a pre-auth), it is captured in full first and then refunded.
Errors are returned with HTTP 200. Check outcome in the body: it is success or failed, and message explains a failure. This includes an invalid or missing api_token.
Endpoint destination URL
https://sandbox-payments.datmanpay.com/api2.php?action=refundApiTokenAuthapi_token<token>API token issued by Datman.
Request Parameters
application/json- body
merchant_id*|The merchant that took the payment.
order_id*|Your own order reference for the payment, as you sent it when paying.
amount*numberThe amount to refund, in major units (e.g. 10.50).
0.01 <= valuereason?stringWhy the payment is refunded.
requested_by?stringWho asked for the refund, for your records.
refund_split_fee?array<>How much to take back from each merchant that received part of the payment.
Response parameters & Errors
The refund result (outcome is success), or why it failed (outcome is failed).
application/json- response
outcome*stringmessage?stringPresent for an uncaptured pre-auth, which is captured first and then refunded.
destination?The amount refunded to each destination, as strings.
transaction_methods?The payment method of the original payment (ECOM, GPAY, APPLEPAY or WALLET) and its original total, as strings.

