Versions Compared

Key

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

How To - Use this guide provides step-by-step instructions on how to use the API to submit a refund or void transaction using the Payrix API as a Payrix Partner.

Cancel vs Refund vs Void

A refund, cancel or void transaction request can be submitted via the API using the /txns endpoint. You can see more information in theAPI Reference guide.

...

For more info on Transaction Type see the expandable content below:

Transaction Types

Expand
titleTransaction Types Description

Transaction Type

Transaction Code

Note

Reverse Authorization

4

Credit Card Only.

Reverses a prior Auth or Sale Transaction and releases the credit hold.

Refund Transaction

5

Credit Card Only.

Refunds a prior Capture or Sale Transaction (total may be specified for a partial refund).

eCheck Refund Transaction

8

Echeck Only:

Refund Transaction for prior ECheck Sale Transaction.

Transaction Statuses

Expand
titleTransaction Statuses Description

Transaction Status

Status Code

Note

Pending

0

Approved

1

Payments can be voided or cancelled.

Failed

2

Captured

3

Payments can be refunded.

Settled

4

Payments can be refunded.

Returned

5

Payment has been successfully refunded.

...

Refund Payments via the API

Getting Started

Step 1: Check the desired refund payment’s transaction status - 3 for Captured or 4 for Settled.

...

See examples below of different payment refund use cases after setup:

Refund a Full Card Payment

Unless specified, refunds without amounts listed will be treated as a refund of the entire transaction amount.

...

Code Block
{
    "fortxn": "t1_txn_5f6276c12269b0cc77adb44",
    "type": "5"
}

Refund a Partial Card Payment

You can specify a partial amount to be refunded by using the optionaltotal parameter.

...

Code Block
{
    "fortxn": "t1_txn_5f6276c12269b0cc77adb44",
    "type": "5",
    "total": "100"
}

Refund an eCheck Payment

For eCheck refunds, you must submit the first name of the receiving/refunded customer under a first parameter.

Code Block
{
    "fortxn": "t1_txn_5f6276c12269b0cc77adb44",
    "type": "8",
    "first": "John"
    "total": "100"
}

Void Payments via the API

Getting Started

Step 1: Check the desired payment’s transaction status is:1 for Captured

...

When finished, send the request body in a POST request to the /txns endpoint.

Void a Payment

Code Block
{
    "fortxn": "t1_txn_5f1841b4b1200ea4d1af843",
    "type": "4"
}

Cancel an approved payment via the API

Getting Started

Step 1: Check the desired payment’s transaction status is:1 for Captured

...

When finished, send the request body in a PUT request to the /txns/{txn_ID} endpoint.

Cancel a Payment

Code Block
{
    "batch": null
}

...