Skip to content

Refunds from a transaction

Request

POST {{baseURL}}/v2/transactions/reversal

This endpoint refunds or returns funds.

This includes refunding to a credit card or provides an ACH credit.

This endpoint requires a merchant API token. A partner API token will result in a permissions error including possibly a 403 response.

See Also:
To list transactions, see GET /v2/transactions.
To retrieve a transaction by ID, see GET /v2/transactions/{transactionId}.
To create a new transaction, see POST /v2/transactions.

Security
Bearer
Bodyapplication/json
paymentProcessorIdstring or null, (uuid)required

Identifies the payment processor.

Defaults to merchant's default processor.

Example: 76215e54-a85b-4d42-9553-163fe393cb02

Example:"76215e54-a85b-4d42-9553-163fe393cb02"
baseAmountnumber, (double), decimal places <= 2required

Specifies the base transaction amount before adjustments.

Example: 99.99

Example:99.99
referenceIdstring or null, <= 36 charactersrequired

Specifies a reference identifier provided by the merchant.

This is included in the duplicate-check key. It allows the same card and amount combination to be charged multiple times when the reference identifiers are different.

Example: REF-EXT-12345

Example:"REF-EXT-12345"
creditDetailsobjectrequired

Specifies credit payment method details.

Either cardData or achData must be provided.

currencyCodestring or null, <= 3 characters

Identifies the transaction's currency code (in uppercase ISO 4217 currency code).

Example: USD

Default:"USD"
Value:"USD"
Example:"USD"
billingAddressobject or null

Identifies the address information.

shippingAddressobject or null

Identifies the address information.

contactInfoobject or null

Contact information.

customerIdstring or null, (uuid)

Identifies the customer to link this payment method to.

This value may be null when this payment method is an orphan owned by the merchant directly. An orphan payment method is a payment method in the merchant's vault but has no customer record associated with it.

Example: 8fa8e727-73c6-436e-b56f-6f55aabf3b1c

Example:"8fa8e727-73c6-436e-b56f-6f55aabf3b1c"

Unreferenced card reversal using raw card data. Saved payment methods are not supported for unreferenced reversals.

curl -i -X POST \
  https://sandbox.api.flute.com/v2/transactions/reversal \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "paymentProcessorId": "7538ed96-b5ec-488e-94a0-b44ef5e77833",
    "baseAmount": 100,
    "currencyCode": "USD",
    "referenceId": "ext-ref-123",
    "billingAddress": {
      "city": "New York",
      "countryCode": "US",
      "addressLine1": "123 Main Street",
      "addressLine2": "Suite 100",
      "postalCode": "10002-0001",
      "stateCode": "NY"
    },
    "shippingAddress": {
      "city": "New York",
      "countryCode": "US",
      "addressLine1": "456 Delivery Ave",
      "addressLine2": "Floor 2",
      "postalCode": "10002-0001",
      "stateCode": "NY"
    },
    "contactInfo": {
      "firstName": "Alexandro",
      "lastName": "Peppared",
      "companyName": "Peppared Street Cafe",
      "email": "peppared@example.com",
      "mobilePhoneNumber": "+14125553845",
      "hasSmsConsent": false
    },
    "creditDetails": {
      "cardData": {
        "paymentMethodDetails": {
          "cardNumber": "4111111111111111",
          "securityCode": "123",
          "expirationMonth": 12,
          "expirationYear": 2033
        }
      },
      "achData": null
    }
  }'

Responses

OK

Bodyapplication/json
itemsArray of objects or null
pageInfoobject

Indicates an object describing the pagination status.

If additional pages to review are needed, repeat the exact same search but include a new pageIndex value. Typically, this will increment the current pageIndex by one. However, any valid value may be used. Value restrictions include:

  • A value less than zero is not permitted.
  • Values equal to or greater than totalPages end successfully but will not return any items.
Response
{ "transactionId": "ca1a4988-7541-4be1-83d5-4111a50b16a3", "transactionStatus": "Approved", "processedAmount": 100, "currencyCode": "USD", "processorResponse": { "processorName": "TSYS", "responseCode": "00", "responseMessage": "Approved", "responseDefinition": "Approved and completed" } }