How you refund a split funded transaction depends on whether you want to do a full refund or a partial refund.

Full refunds

Full refunds of a split transaction work the same as refunds for a transaction without splits. Payabli returns the total of the transaction, less any pass-through fees, to the payor, reversing the original transaction’s split instructions. For example, a $103 transaction had a $100 total, plus a $3 pass-through fee. Payabli returns $100 to the payor, removing the funds from the same accounts the funds were originally split into.

To run a full refund, see the refund guide for help.

A request to this endpoint refunds the transaction based on the original transaction’s split instructions.

Partial refunds

Payabli accepts partial refunds when the original transaction was split only if the refund request includes split instructions. You must specify how much to return to the customer, and from whom.

Partial refund considerations

  • You can only make refunds from the accounts and entrypoints used in the original request.
  • You don’t have to include every account on the original transaction in a partial refund request.
  • An account can’t refund more than it received in the original transaction. For example, if Account A received $35 in the original transaction, you will get an error if you try to refund more than $35 from Account A.
  • The split amounts are validated for partial refunds. They can’t total more than the original transaction, or the refund request fails.

Build the request

See the API reference for this endpoint.

First, choose an endpoint. If you’re testing, use the Sandbox endpoint..

Authenticate

Authenticate by sending your API token in the request header with the key requestToken:
--header 'requestToken: API TOKEN'

Path parameter

The Refund endpoint has a required path parameter, transId, which is the referenceId for the transaction.

transId
string
required

The referenceId identifying the transaction (PaymentId). You can find this in the success response for the payment you want to refund.

Body parameter

The body parameter is required.

body
string
required

Example request

This example refunds the transaction with a referenceId of 10-3ffa27df-b171-44e0-b251-e95fbfc7a723 for the total amount of the $100 transaction.

Full refund with split

  curl --request GET \
      --url https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723 \
      --header 'accept: application/json'
      --header 'requestToken: <insert API token>'
      --data '
  {
    "source": "api",
    "orderDescription": "Materials deposit",
    "amount": 100,
    "refundDetails": {
      
      "splitRefunding": [
        {
          "originationEntryPoint": "7f1a381696",
          "accountId": "187-342",
          "description": "Refunding undelivered materials",
          "amount": 60
        },
        {
          "originationEntryPoint": "7f1a381696",
          "accountId": "187-343",
          "description": "Refunding deposit for undelivered materials",
          "amount": 40
        }
      ]
    }
  }'

This example refunds a partial amount of $70 (out of $100) of the transaction with a referenceId of 10-3ffa27df-b171-44e0-b251-e95fbfc7a723.

Partial refund with split
  curl --request GET \
      --url https://api-sandbox.payabli.com/api/MoneyIn/refund/10-3ffa27df-b171-44e0-b251-e95fbfc7a723 \
      --header 'accept: application/json'
      --header 'requestToken: <insert API token>'
      --data '
  {
    "source": "api",
    "orderDescription": "Materials deposit",
    "amount": 70,
    "refundDetails": {
      
      "splitRefunding": [
        {
          "originationEntryPoint": "7f1a381696",
          "accountId": "187-342",
          "description": "Refunding undelivered materials",
          "amount": 40
        },
        {
          "originationEntryPoint": "7f1a381696",
          "accountId": "187-343",
          "description": "Refunding deposit for undelivered materials",
          "amount": 30
        }
      ]
    }
  }'

Example response

A successful refund returns a 200 status with a JSON body.

Success refund response

{
    "responseText": "Success",
    "isSuccess": true,
    "responseData": {
        "authCode": "A0000",
        "referenceId": "10-3ffa27df-b171-44e0-b251-e95fbfc7a723",
        "resultCode": 1,
        "resultText": "CAPTURED",
        "avsResponseText": null,
        "cvvResponseText": null,
        "customerId": null,
        "methodReferenceId": null
    },
    "pageidentifier": null
}