Skip to content

Reverses a transaction

Request

POST {{baseURL}}/pay-api/v1/transactions/return

This endpoint refunds or returns funds from an original transaction identifier.

This creates a refund transaction that is linked to a specific previous transaction.

See Also:
To create a transaction, see POST /pay-api/v1/transactions/sale.
To void a transaction, see POST /pay-api/v1/transactions/void.
To credit from a transaction without a reference, see POST /pay-api/v1/transactions/return/no-reference.
To retrieve a transaction by ID, see GET /pay-api/v1/transactions/{transactionId}.

Security
Bearer
Bodyapplication/json
cardDataSourceinteger, (int32)required

Specifies the card data source.

Valid values are:

ValueNameDescription
1InternetVirtual Terminal, ISV API
2SwipeTrack1, Track2
3NFCEMV Tags, Track2
4EMVEMV Tags
5EMVContactlessEMV Tags
6FallbackSwipeTrack 2
7ManualCard present keyed transaction

Example: 2

Example:2
transactionIdstring, (uuid)required

Specifies the transaction identifier.

Example: 94c59697-3db4-4ef7-84f7-b1cc14f21d93

Example:"94c59697-3db4-4ef7-84f7-b1cc14f21d93"
track1string or null

The card data from track 1 of the magnetic stripe.

track2string or null

Information stored on the magnetic stripe of a credit or debit card, including the card number, expiration date, and cardholder's name.

emvTagsArray of strings or null

Each tag corresponds to a particular piece of data stored on the card.

emvPaymentAppVersionstring or null

The version number of the payment application in use.

pinstring or null

Specifies the encrypted PIN for the terminal.

pinKsnstring or null

Specifies the KSN for DUKPT PIN encryption.

Required only if the PIN is encrypted using DUKPT.

amountnumber or null, (double)

Amount

Refunds the full amount of a settled credit card sale.

amount is null, so the full original amount is refunded.

No card data is needed for a credit card refund.

POST /pay-api/v1/transactions/return HTTP/1.1
Host: sandbox.api.flute.com
Authorization: Bearer <YOUR_JWT_HERE>
Accept: application/json
Content-Type: application/json

{
  "transactionId": "8a4f1c27-6d93-4e05-b2a8-1f7c3e9d5b60",
  "cardDataSource": 1
}

Responses

OK

Bodyapplication/json
transactionIdstring, (uuid)

Indicates the transaction identifier.

Example: c7c15dd0-03e7-4e55-917c-54bedafba5e7

Example:"c7c15dd0-03e7-4e55-917c-54bedafba5e7"
transactionDateTimestring, (date-time)

Indicates the date and time (in ISO 8601 UTC or timezone offset format) of the transaction.

Examples: 2026-08-24T08:45:22Z

Example:"2026-08-24T08:45:22Z"
typeIdinteger, (int32)

Type id of transaction.

typestring or null

Type name of transaction

statusIdinteger, (int32)

Status id of transaction.

statusstring or null

Status name of transaction

detailsobject

Indicates additional processor-level response details for the transaction.

transactionReceiptobject or null


Indicates an object describing the transaction receipt. The transaction receipt will be null or empty before the transaction is completed. After the completed transaction, it will be filled out.

Response

The full $64.99 is refunded.

The refund is a new transaction with type Refund.

{ "transactionId": "a9d3e6f2-1b48-4c75-8e09-5f2c7b1d4a36", "transactionDateTime": "2026-10-21T09:15:44.6120387Z", "typeId": 5, "type": "Refund", "statusId": 2, "status": "Captured", "details": { "hostResponseCode": "00", "hostResponseMessage": "APPROVAL", "hostResponseDefinition": "Approved and completed", "code": "Approve", "message": "Success", "processorResponseCode": "00", "authCode": "R64990", "maskedPan": "411111******1111" }, "transactionReceipt": { "transactionId": "a9d3e6f2-1b48-4c75-8e09-5f2c7b1d4a36", "transactionDateTime": "2026-10-21T09:15:44.6120387Z", "amount": { "baseAmount": 64.99, "percentageOffAmount": 0, "percentageOffRate": 0, "cashDiscountAmount": 0, "cashDiscountRate": 0, "surchargeAmount": 0, "surchargeRate": 0, "tipAmount": 0, "tipRate": 0, "totalAmount": 64.99 }, "currencyId": 1, "currency": "USD", "processorId": "64aa4643-2c62-45fa-9554-3a69833114e9", "processor": "Primary card processor", "operationTypeId": 1, "operationType": "PayNow", "paymentMethodTypeId": 1, "paymentMethodType": "Card", "transactionTypeId": 5, "transactionType": "Refund", "customerId": null, "customerPan": "411111******1111", "cardTokenType": 1, "statusId": 2, "status": "Captured", "merchantName": "Peppared Street Cafe", "merchantAddress": "7429 Desert Mirage Lane, Suite 7, Phoenix, AZ 85099", "merchantPhoneNumber": "+14155558787", "merchantEmailAddress": "billing@pepparedstreetcafe.example.com", "merchantWebsite": "https://pepparedstreetcafe.example.com", "authCode": "R64990", "source": { "typeId": 2, "type": "ApiToken", "id": "3c1f7a92-5d4e-4b8a-9f06-2e7d1b4c8a53", "name": "Store checkout API" }, "cardholderAuthenticationMethodId": 0, "cardholderAuthenticationMethod": "NotAuthenticated", "cvmResultMsg": null, "cardDataSourceId": 1, "cardDataSource": "Internet", "responseCode": "00", "responseDescription": "Approved and completed", "cardProcessingDetails": { "authCode": "R64990", "mid": "887000003193", "tid": "75021674", "cardCreditDebitTypeId": 1, "cardCreditDebitType": "Credit", "processCreditDebitTypeId": 1, "processCreditDebitType": "Credit", "rrn": "629322501148", "cardTypeId": 1, "cardType": "Visa" }, "achProcessingDetails": null, "availableOperations": [ { "typeId": 4, "type": "Void", "availableAmount": 64.99, "suggestedTips": null } ], "avsResponse": null, "emvTags": null, "orderNumber": "ORD-20261020-2001" } }