Refund
Sometimes, a customer makes a request for their money after a successful transaction. Other times, an order cannot be fulfilled after payment has been made. In either case, you need to consider if you should Make a:
- Partial refund
- Full refund
Our RefundAPI
allows you to repay your customers in part or fully. You simply make a refund request. Refunds use your available Kashier balance—this doesn’t include any pending balance.
Create a refund
In order to make a refund, you need to make a PUT request to the Refund API, passing the Kashier Order ID and transaction ID as parameters in the URL and including the refund amount in the request body.
For partial refunds, you pass an amount field with the request body. It is not permitted for the refund amount to exceed the amount of the original transaction.
In case you are still in development phase, you will need to call our API using the following testing endpoint API point URL
Endpoint | Value |
---|---|
URL | https://test-fep.kashier.io/v3/orders/:orderId |
Method | Put |
Meanwhile, whenever you are ready for production, you should use the following production API endpoint URL instead
Endpoint | Value |
---|---|
URL | https://fep.kashier.io/v3/orders/:orderId |
Method | Put |
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
orderId | Path Parameter | Kashier Order Id | True |
Headers
Key | Description |
---|---|
Authorization | The Authorization is secretkey that is used to identify the merchant , you can obtain from kashier's dashboard, learn more about Authorization. |
Click here to shrink1curl -X 'PUT' 'https://test-api.kashier.io/orders/:orderId/'2-H 'Authorization: your_secretKey'3-H 'accept: application/json'4-H 'Content-Type: application/json'5-d '{6 "apiOperation":"REFUND",7 "reason":"any reason",8 "transaction":{9 "amount": 3,1011 }'
Body structure
Click here to shrink1{2 "apiOperation":"REFUND",3 "reason":"any reason",4 "transaction":{5 "amount": 3,67 }8}
Body description
Parameter | Description |
---|---|
amount | The amount to be refunded |
apiOperation | should be REFUND to be able to make refund request |
Response structure
Click here to expandClick here to shrink1{2 "response": {3 "status": "SUCCESS",4 "gatewayCode": "APPROVED",5 "gatewayMessage": "Payment accepted",6 "transactionResponseCode": "00",7 "transactionResponseMessage": {8 "en": "Approved",9 "ar": "تمت الموافقة"10 },11 "transactionId": "TX-69827599",12 "transactionDate": "2022-04-13T10:44:46.724Z",13 "settlementDate": "2022-04-13",14 "amount": 10,15 "currency": "EGP",16 "operation": "refund",17 "merchantIdentifier": "TESTQNBINHOUSE03",18 "payload": {19 "authorizationResponse": {20 "cardSecurityCodeError": "M",21 "commercialCard": "888",22 "commercialCardIndicator": "3",23 "financialNetworkCode": "777",24 "posData": "1025100006600",25 "posEntryMode": "812",26 "processingCode": "203000",27 "responseCode": "00",28 "stan": "199804",29 "transactionIdentifier": "123456789"30 },31 "gatewayEntryPoint": "WEB_SERVICES_API",32 "merchant": "",33 "order": {34 "amount": 14,35 "chargeback": {36 "amount": 0,37 "currency": "EGP"38 },39 "creationTime": "2022-04-13T10:39:31.655Z",40 "currency": "EGP",41 "id": "93c799ea-ae6c-485c-bf36-a385acbb8c13",42 "lastUpdatedTime": "2022-04-13T10:44:46.764Z",43 "merchantAmount": 14,44 "merchantCategoryCode": "8211",45 "merchantCurrency": "EGP",46 "reference": "6228c89970bbfb001898c9fc",47 "status": "PARTIALLY_REFUNDED",48 "totalAuthorizedAmount": 14,49 "totalCapturedAmount": 14,50 "totalDisbursedAmount": 0,51 "totalRefundedAmount": 1052 },53 "response": {54 "acquirerCode": "00",55 "cardSecurityCode": {56 "acquirerCode": "M",57 "gatewayCode": "MATCH"58 },59 "gatewayCode": "APPROVED"60 },61 "result": "SUCCESS",62 "sourceOfFunds": {63 "provided": {64 "card": {65 "brand": "",66 "expiry": {67 "month": "6",68 "year": "22"69 },70 "fundingMethod": "CREDIT",71 "number": "512345******2346",72 "scheme": "MASTERCARD",73 "storedOnFile": "NOT_STORED"74 }75 },76 "type": "CARD"77 },78 "timeOfLastUpdate": "2022-04-13T10:44:46.764Z",79 "timeOfRecord": "2022-04-13T10:44:46.724Z",80 "transaction": {81 "acquirer": {82 "batch": 20220413,83 "date": "0413",84 "id": "QNBAAIH_S2I",85 "merchantId": "000000079447918",86 "settlementDate": "2022-04-13",87 "timeZone": "+0200",88 "transactionId": "123456789"89 },90 "amount": 10,91 "currency": "EGP",92 "id": "TX-69827599",93 "receipt": "210310200874",94 "source": "INTERNET",95 "stan": "200874",96 "terminal": "80000145",97 "type": "REFUND"98 },99 "version": "62"100 },101 "cardOrderId": "93c799ea-ae6c-485c-bf36-a385acbb8c13",102 "creationDate": "2022-04-13T10:44:46.724Z",103 "orderReference": "TEST-ORD-37089"104 },105 "messages": {106 "en": "Congratulations! Your refund was successful",107 "ar": "تهانينا! تمت معاملة استرداد الأموال بنجاح"108 },109 "status": "SUCCESS"110}
Refund status
Status | Description |
---|---|
SUCCESS | Refund has successfully been processed by the processor. |
FAILURE | Refund cannot be processed. Your account is credited with refund amount. |
PENDING | Refund initiated, waiting for response from the processor |
The refund amount must not be more than the original transaction amount.