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 look up additional information about the /txns endpoint see more information in theAPI Reference guide.
Cancel | Void | Refund |
---|---|---|
Removes the approved payment from the Merchant’s daily batch, but does not reverse the authorization. | Removes the approved payment from the Merchant’s daily batch AND reverses the authorization. | Refunds a prior Capture or Sale Transaction, total may be specified for a partial refund. |
Transaction Type: | Transaction Type: | Transaction Type: |
Transaction Status Code: | Transaction Status Code: | Transaction Status Code: |
Must be done before batching. | Must be done before batching. | May be done anytime. |
Info |
---|
About Refund Timeframes All transactions may be voided before they are batched. If the transaction has already been batched (frequency dependent on Referrer configuration), it will required a refund.
|
Submitting a Refund or Void a Payment via the API
The process of submitting a card payment (sale) refund, an eCheck refund, or voiding an approved transaction is virtually the same. The only difference between these three options is the type value included in the request.
A refund can be issued when the transaction status is “3” (captured) or “4” (settled), but payments with these statuses cannot be voided or canceled. A payment can only be voided or canceled if the transaction status is “1” (approved).
All API transaction statuses:
...
Refund a Card Payment via the API
...
|
For more info on Transaction Type see the expandable content below:
Transaction Types
Expand | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
Transaction Statuses
Expand | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||
|
...
Refund Payments via the API
Getting Started
Step 1: Check the desired refund payment’s transaction status - 3
for Captured or 4
for Settled.
Step 2: Enter required parameters to the request body
fortxn
-The Payrix Transaction ID (TXN ID) of the original payment to refundedtype
-5
= Card Payments or8
= eChecks (ACH).
When finished, send the request body in a POST
request to the /txns
endpoint and including the Transaction ID of the payment that is being refunded/voided. By default, if no amount is set when submitting a refund/void via the API it will be a full refund for the entire amount of the original transaction (excluding .
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.
Note: Full refunds exclude any funds that have been previously partially refunded).
|
Refund a Partial Card Payment
You can enter specify a partial amount to be refunded (amount values by using the optionaltotal
parameter.
Values are in cents USD - in the code snippet below a .
Example: $1.00
...
=
100
, $100 =10000
, etc.
|
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.
...
...
Refund an eCheck Payment
...
For eCheck refunds, the type field should be set to “8”. Additionally, you must submit the customer’s (whom you are sending the eCheck refund to) first namefirst name of the receiving/refunded customer under a first
parameter.
|
...
Void
...
Payments via the API
...
To void an approved (but not captured/settled) payment, the type should be set to “4”.
Getting Started
Step 1: Check the desired payment’s transaction status is:1
for Captured
Step 2: Enter required parameters to the request body:
fortxn
-The Payrix Transaction ID (TXN ID)of the original payment to voided.type
-4
= Card Payments.
When finished, send the request body in a POST
request to the /txns
endpoint.
Void a Payment
|
...
Cancel an approved payment via the API
Info |
---|
cancel payment vs. void payment:
|
...
Getting Started
Step 1: Check the desired payment’s transaction status is:1
for Captured
Step 2: Enter required parameters to the request body:
batch
-null
Step 3: Add the following path parameter:
{txn_ID}
- The Payrix Transaction ID (TXN ID) of the original payment to cancelled.
When finished, send the request body in 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.}
endpoint.
Cancel a Payment
|
...