Skip to main content

Payment Refund

  • Endpoint: /pws/payment/refund
  • HTTP Method: POST
  • Request Content-Type: application/json
  • Response Content-Type: application/json
  • Authorization: Valid AccessToken is required. (See: 2. Authentication – Obtaining AccessToken)

Description

This service allows a previously made payment on the Netahsilat portal to be fully or partially refunded.

Refunds can only be made via referenceCode.

  • Full Refund: The entire transaction amount is refunded.
  • Partial Refund: Only a specific portion of the transaction amount is refunded.

The refund result is returned as successful or failed depending on the bank authorization status.

Header Information

Header NameRequiredDescription
AuthorizationYesValid token in Bearer {AccessToken} format.
Content-TypeNoapplication/json

Request Body

Field NameTypeRequiredDescription
referenceCodestringYesReference code of the transaction to be refunded
refundAmountdecimalNoAmount to be refunded. If not sent, a full refund is made
reasonstringNoReason for refund (e.g., "Product return", "User request", "Incorrect transaction")
{  
"amount": 1500.500,
"referenceCode": "NTH2P00000002224",
"reason": "Product return"
}
{  
"message": null,
"statusCode": 200,
"exceptions": null,
"data": {
"lastAmount": 0.000,
"transactionStatusId": 1,
"errorCode": null,
"errorMessage": null,
"isSuccess": true
},
"oldData": null,
"errors": null
}

Example cURL

curl --location 'https://pgw.netahsilatdemo.com/pws/payment/refund' \  
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJwd3N2MS5hcGkiLCJlcnB2MS5hcGkiLCJjYXR2MS5hcGkiLCJ2ZW5kb3J2MS5hcGkiXSwiYWN0b3J0Ijoic2VydmljZSIsInJvbGUiOiJzZXJ2aWNlIiwiVW5pcXVlIjoiOGE2NjQxZGYtMGU4Ny00OWVkLWEyOTgtNjNjN2M3Y2JjNTk1IiwiVGVuYW50SWQiOiI2NzA2ODNjMS0yZmUwLTQ4NDYtODdiMi02Y2JhOWI3OTNhYjIiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL2V4cGlyYXRpb24iOiI2Mzg5NzA3MjQxNDMzMzI2OTUiLCJuYmYiOjE3NjEzMDI4MTQsImV4cCI6MTc2MTQ3NTYxNCwiaWF0IjoxNzYxMzAyODE0LCJpc3MiOiJzc28uYXBpIiwiYXVkIjoiZWNvenVtLnNzbyJ9.IbmVm9oVxUvDXhzYnCncNMYPBFqqJTXFQLkFYfhSbUA' \
--data '{
"amount": 1498.500,
"referenceCode": "NTH2P00000002224",
"reason": "test refund"
}'

Notes & Best Practices

  • Refunds can only be made via referenceCode.

  • Refund requests cannot be created for incomplete or failed transactions.

  • In partial refunds, refundAmount cannot exceed the transaction amount.

  • Multiple partial refunds can be made for the same transaction; the total refunded amount must not exceed the transaction amount.

  • Due to bank authorization rules, refunds may not be possible for transactions exceeding a certain age.

  • After a successful refund, the remaining amount is shown in the system under the lastAmount field.

  • The AccessToken must belong to the user or agent authorized to perform the refund.