LogoLogo
  • Transaction API
    • Overview
    • Authentication
    • Payment Methods
    • Integrations
      • POS (In-Store)
      • E-commerce
    • Payment Flows
      • Create a transaction
        • Examples for POS (In-Store)
          • Basic Payment Request
          • Payment request with products
          • Payment request with callback
          • Payment request with POS Data
          • SMS Payment Request
          • Email Payment Request
          • Payment request with invoice
          • Payment request with receipt generated by SensePass
          • Payment request with receipt generated by the POS
        • Examples for e-commerce
          • Basic Payment Request
          • iFrame Example
          • Payment request with products
          • Payment request with callback
          • Payment request with website custom data
          • SMS Payment Request
          • Email Payment Request
          • Payment request with invoice
          • Payment request with receipt generated by SensePass
          • Payment request with receipt generated by the e-commerce platform
      • Transaction status
      • Authorization
      • Tokenization
      • Subscription
        • Fetch a subscription
        • Update a subscription
        • Subscription callbacks
      • Cancel a pending transaction
      • Refund a transaction
      • Pay by Credit Card
      • Credit by Credit Card
      • Payment Commit
      • Update a Transaction
    • Other Flows
      • Tags Pairing
      • Receipts
      • Customer Input
      • Token Migration
      • Create Dynamic QR
    • Terminal Agent
      • Installation
      • Pairing
      • Usage
        • Synchronous Payment
        • Real-time product information update
        • Get Last Transaction Status
        • Get Device ID
    • Settlement
    • API Notifications
      • Socket.IO Websockets
      • Callback/Webhook
      • Post Message
    • Flow Charts
      • Payment Flow
      • Transaction Status Flow
    • SDK & iFrames
      • JavaScript UI SDK
        • API
        • Commit Transaction
        • Custom SDK Style
        • Simulator
        • Manual Capture (deprecated)
      • E-commerce iFrame
      • POS iFrame
      • Credit Card iFrame
    • Models
      • Receipts Model
      • Metadata Model
      • SDK Theme Config Model
      • SDK Credit Card Field Model
      • Invoice Model
      • Product Model
      • Payment Details Model
      • Receipt Notifications Model
      • Payment Commit Model
      • Confirmation Model
      • Settlement Model
      • Subscription Model
      • Transaction Page Model
      • Transaction Model
      • Customer Input Model
      • Settlement Report Model
      • Customer Shipping/Billing Details Model
      • Additional Data Model
    • SOAP and XML
      • SOAP
      • XML
    • Testing
    • Postman
  • Partner API
    • Models
      • Onboarding Model
      • Onboarding Configuration Pages
      • Onboarding Status Model
    • SDK & iFrames
      • Onboarding iFrame
    • Flows
      • Create onboarding
      • Get Onboarding Configuration Page
      • Onboarding status
Powered by GitBook
On this page
  • API Interface
  • Refund approved transaction object
  • Example of Successful Refund
  • Example of Unsuccessful Refund
  • Refund Request Examples
  • Flow Chart
  • Transaction Status Flow

Was this helpful?

Export as PDF
  1. Transaction API
  2. Payment Flows

Refund a transaction

Last updated 4 months ago

Was this helpful?

API to refund payments of approved transaction or partial refund transaction with available balance to refund.

This endpoint automaticlly detects if void or refund operation is required.

API Interface

Refund approved transaction object

POST https://api.sensepass.com/api/transactions/refund

Request Body

Name
Type
Description

transactionNumber*

string

The Transaction Number To Be Refunded - Required

isPartial

boolean

true for partial refund transaction, requires "refundAmount" field for partial amount

refundAmount

number

The refund amount - for partial refund only, see "isPartial" flag

Authentication Request Body fields

errorCode = 0 indicating successful refund operation.

On error see "errorMessage" field which describes the error cause.

{
  "errorMessage": null,
  "errorCode": 0,
  "refundConfirmation": "063-LlgKAzfRL",
  "approvedBy": "PayPal",
  "refundBy": "PayPal",
  "dateApproval": "2019-12-19T09:47:59.105Z",
  "result": "Approved",
  "providerId": "z+n1opZ+RFn50fstklvWoOsovKIY5AUfsrVdGsO653c=",
  "transaction": {
    "TransactionNumber": "14a4334a32c852aeb0cfae52cbff1314649da7f175a8e140b35c147c",
    "date": "2019-12-19T09:47:59.105Z",
    "amount": 1234.56,
    "currency": "USD",
    "status": 0,
    "businessId": 144
  }
}
{
    // Response
}
{
    // Response
}

Example of Successful Refund

{
  "errorMessage": null,
  "errorCode": 0,
  "refundConfirmation": "063-LlgKAzfRL",
  "approvedBy": "PayPal",
  "refundBy": "PayPal",
  "dateApproval": "2019-12-19T09:47:59.105Z",
  "result": "Approved",
  "providerId": "z+n1opZ+RFn50fstklvWoOsovKIY5AUfsrVdGsO653c=",
  "transaction": {
    "TransactionNumber": "14a4334a32c852aeb0cfae52cbff1314649da7f175a8e140b35c147c",
    "date": "2019-12-19T09:47:59.105Z",
    "amount": 1234.56,
    "currency": "USD",
    "status": 0,
    "businessId": 144
  }
}

Example of Unsuccessful Refund

{
    "errorMessage": "refund operation declined by Processor",
    "errorCode": 22,
    "transaction": null,
    "refundConfirmation": null,
    "dateApproval": null,
    "result": "Declined",
    "providerId": null,
    "approvedBy": null,
    "refundBy": null,
    "amount": null
}

Refund Request Examples

Basic request example to refund a new transaction using Device ID:

{
  "transactionNumber": "14a4334a32c852aeb0cfae52cbff1314649da7f175a8e140b35c147c",
  "deviceId": "2ooeww5ufzg3nkuf8a10gu5n695yolixlbgb042o03to9bxfkr7t815i5epu8o58jv1rznif3o1tr6xsb1rm"
}

Basic request example to refund a new transaction using Location API Key or Merchant API key:

{
  "transactionNumber": "14a4334a32c852aeb0cfae52cbff1314649da7f175a8e140b35c147c",
  "apiKey": "2ooeww5ufzg3nkuf8a10gu5n695yolixlbgb042o038o58jv1rznif3o1tr6xsb1rm"
}

Flow Chart

Transaction Status Flow

See here our Authentication page
See our payment flow chart here
See our transaction status flow here