Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A refund or authorization reversal can be submitted via the API using the /txns endpoint. You can look up additional information about the /txns endpoint in theAPI Reference.

How to submit a refund or void a payment via the API?

The process of submitting a card payment (sale) refund, an eCheck refund, and or voiding an approved transaction is virtually the same. The only difference between these three options is the type value included in the request.

...

You can enter a partial amount to be refunded (amount values are in cents USD - in the code snippet shown below a $1.00 refund is shown).

...

At a minimum, the only fields required to submit a refund/void are:

fortxn - enter the Payrix Transaction ID (TXN ID) of the original payment you wish to refund/void.

type - In the case of a card payment refund this field should be set with the value “5”.

...

To void an approved (but not captured/settled) payment, the type should be set to “4”.

...

Other optional fields (e.g. fee, first ([name)], last ([name) ] etc.) can be included in the API request, but they are not required for the refund/void to process successfully.

How to cancel an approved payment via the API?

As previously covered elsewhere, the fundamental difference between voiding and canceling a payment is that canceling a transaction simply removes the approved payment from the Merchant’s daily batch, but does not actually reverse the authorization (as voiding does).

Therefore, in API terms, voiding a payment more closely resembles a standard refund, but canceling a transaction fundamentally differs. To cancel an approved payment in the API, send a PUT request to the /txns endpoint and include the relevant Payrix Transaction ID (TXN ID) in the request string (i.e. PUT/txns/txn_ID). In the code body, simply send a request to nullify the batch associated with the approved payment.

...