Payment modificationsPayment modifications

Refund a payment

post/api2.php?action=refund

Refunds 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=refund

Authorization

ApiTokenAuth
headerapi_token<token>

API token issued by Datman.

Request Parameters

Request Body

application/json
  1. 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*number

The amount to refund, in major units (e.g. 10.50).

Range0.01 <= value
reason?string

Why the payment is refunded.

requested_by?string

Who 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

Response Body

The refund result (outcome is success), or why it failed (outcome is failed).

application/json
  1. response
outcome*string
message?string

Present 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.