Ecommerce

Refund a transaction

Allows you to refund all or part of a previous credit card, debit card, or echeck transaction using the Nexio Payment ID. In order to refund a transaction, it must have already settled.

The entire process for refunding a transaction is as follows:

  1. Run a transaction using the Run card transaction or Run echeck transaction endpoint.
  2. Retrieve the id from the response. This is the Nexio Payment ID.
  3. Use the dashboard from the gateway connection that processed the transaction to manually settle the transaction if that is possible (or wait for the transaction to settle). Note that you can use the Nexio mock gateway and the paymentOptionTag of nexioAuto to immediately make a transaction settle.
  4. Include the payment id in the body of your request for this endpoint, along with an amount that is less than or equal to the original transaction amount. Note that some gateway connections allow multiple refunds per transaction. In this situation, you should ensure that the total of all refunds does not exceed the amount charged in the original transaction.

If you do not know the paymentId or the maximum amount to refund, you can get an array of possible transactions that have settled with the View transactions endpoint and at least the following query filters:<br/>transactionStatus=20<br/>plugin=

<!-- theme: warning -->

⚠️ Try It

To use the Try It feature for this endpoint, you can use the credentials for your Sandbox API user.<br/><br/>You can also use the following test account. Copy the value and paste it into the appropriate space in the Try It section to the right. username: docs@nexiopay.com password: JZdzoXpdDeH6VA<br/><br/>Include the ID and a refund amount, as indicated above. You may also include a description of why you are issuing the refund.

<div style="display:none;">

Request parameters

  • id
  • data
  • data.amount
  • refundReason

Response parameters

  • id
  • merchantId
  • transactionDate
  • authCode
  • transactionStatus
  • transactionType
  • currency
  • amount
  • message
  • data
  • data.currency
  • data.settlementCurrency
  • data.amount
  • gatewayResponse
  • gatewayResponse.gatewayName
  • gatewayResponse.refNumber
  • recurringData
  • recurringData.recurringId
  • recurringData.recurringIdType
</div>
post/pay/v3/refund

Request body

idstring required

The Nexio Payment ID. To refund a transaction through this endpoint it must have been captured through the Nexio Payment API. The transaction must also have already settled.

refundReasonstring

Specifies information about why the refund is being issued.

The gateway or connection may not use or return this value.

Example request

{
  "id": "eyJuYW1lIjoWJlciI6IjMxCJtZXJjaGFudElkIjoiMoiVVNEIn0=",
  "data": {
    "amount": 5.95
  },
  "refundReason": "This is the reason for the refund."
}

Response

Success

idId — unresolved $ref
merchantIdMerchantId — unresolved $ref
authCodeAuthCode — unresolved $ref
transactionTypestring

The transaction type. If the refund was successful, this value will be refund.

transactionDateTransactionDate — unresolved $ref
transactionStatusstring
messageMessage — unresolved $ref
refundReasonstring

Indicates the information specified when submitting the refund request. This parameter is only returned when included in the refund request, and only when returned by the gateway or connection.

amountnumber

The amount that was refunded, expressed as a negative number.

currencyCurrency — unresolved $ref
gatewayResponseGatewayResponse — unresolved $ref
random-nnnnnnnRandomNnnn — unresolved $ref

Changes

No recorded changes to this endpoint across all 1 revision of this API.