POST
/
api
/
v1
/
server-to-server-interface
/
refund
Refund a Transaction
curl --request POST \
  --url https://api-dev.paymentoptions.com/api/v1/api/v1/server-to-server-interface/refund \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "transactionId": "9dfd39ec-eb4a-4f8b-a526-17abf140a717",
  "amount": 1000,
  "merchant_id": "< Merchant ID >",
  "notes": "Refund amout captured/purchased"
}'
{
  "success": true,
  "status_code": 201,
  "is_live": false,
  "transaction_type": "REFUND",
  "gateway_response": {
    "version": "1",
    "type": "INFO",
    "message": "Amount successfully refunded.",
    "code": "INFO0002"
  },
  "merchant_details": {
    "legal_name": "Tink15 Factory",
    "mid": "< Merchant ID >",
    "merchant_txn_ref": "qwe"
  },
  "payment_details": {
    "amount": 1000,
    "response_code": 0,
    "auth_code": "264302",
    "currency": "JPY",
    "payment_method": "ECMC-SSL",
    "scheme": "MASTERCARD",
    "card": {
      "name": "John Doe",
      "number": "5200000000001005",
      "exp_month": "12",
      "exp_year": "24"
    },
    "additional_data": {
      "payment_data_source": {
        "type": "card"
      }
    }
  },
  "transaction_details": {
    "id": "626fa81d-9819-4947-bb9b-b0f11e00a50e",
    "ref": 74824,
    "timestamp": "2024-11-25T08:51:52.000Z",
    "merchant_txn_ref": "qwe"
  }
}

Key Points

  • The Refund API allows the merchant to reverse a transaction, sending the funds back to the customer’s payment method.

  • This API is typically used in scenarios such as order cancellations, product returns, or when a customer disputes a charge.

  • Refunds can be partial or full, depending on the amount specified in the refund request. If a partial amount is refunded, the remaining balance of the original transaction is still valid.

Flow diagram

Flow diagram image

Api Parameters

Authorizations

Authorization
string
header
required

API Key for Authorization. Format: 'Basic YOUR_API_KEY_HERE'

x-api-key
string
header
required

API Key specific to x-api-key.

Body

application/json

The request payload to refund a transaction.

The body is of type object.

Response

201 - application/json

Transaction refunded successfully

The response is of type object.