Step 2: Submit refunds

Parameters

You will pass all refunds you want to be processed in this request.

Url: /secure/refunds/submit

Method: POST

Headers: See common headers

URL Params: N/A

Data Params

TypeDescription
RefundRequest\[]The refunds process.

RefundRequest Object

NameTypeReq.Description
transactionIdGuidYesThe transaction identifier. This is the identifier for the payment that was originally processed on Ozow.
amountDecimalYesThe amount that needs to be refunded. This can be less than the original transaction amount but not more.
refundReasonString (500)NoThe reason for the refund.
notifyUrlString (500)NoThe URL Ozow will send a notification to once the refund has been finalised.
hashCheckString (150)YesSHA512 hash used to ensure that certain fields in the message have not been altered after the hash was generated. Check the generate hash section below for more details on how to generate the hash.
isRtcBoolNoWhether the refund should be processed as an RTC refund.

Response object

NameTypeDescription
refundIdGuidThe identifier for the refund that was created. No identifier is returned if there was an error creating the refunds.
transactionIdGuidThe transaction identifier. This will correspond to one of the transaction identifiers passed through in the request.
refundAmountDecimalThe refund amount.
errorsString[]Validation errors for the specific refund.

Request example

POST https://api.ozow.com/secure/refunds/submit HTTP/1.1
Authorization: Bearer J4lnLIZtJSc0Rf...Zunskttzl3MdGEMIDArZ4Yp6QTw6_Z4uDkAJN8Y
Accept: application/json
Content-Type: application/json
[
   {
      "TransactionId":"00000000-0000-0000-0000-000000000000",
      "Amount":0.01,
      "RefundReason":"Test 1",
      "NotifyUrl":"http://xgfg26qcbpbx.runscope.net",
      "HashCheck":"c588fcb20f32e28d516922d95ada0afd37f...c9b9b7f49a2f26e07be6a23093b11c0bd3a51ef"
   },
   {
      "TransactionId":"00000000-0000-0000-0000-000000000000",
      "Amount":0.01,
      "RefundReason":"Test 2",
      "NotifyUrl":"http://xgfg26qcbpbx.runscope.net",
      "HashCheck":"a5bd6db5ce674a5f50b355d7956f2d32ef...fc6c86c1ad66ddeb08cf1930cf7c420432a46725"
   },
   {
      "TransactionId":"00000000-0000-0000-0000-000000000000",
      "Amount":1,
      "RefundReason":"Test 3",
      "NotifyUrl":"http://xgfg26qcbpbx.runscope.net",
      "HashCheck":"d38197fe6b1856035859d8a1428b5477...848c95479e6e9a8ce1063b04785463b70ab79329c6",
      "isRtc": true
   }
]

Response example

[
   {
      "refundId":"00000000-0000-0000-0000-000000000000",
      "transactionId":"00000000-0000-0000-0000-000000000000",
      "refundAmount":0.01,
      "errors":null
   },
   {
      "refundId":"00000000-0000-0000-0000-000000000000",
      "transactionId":"00000000-0000-0000-0000-000000000000",
      "refundAmount":0.01,
      "errors":null
   },
   {
      "refundId":null,
      "transactionId":"00000000-0000-0000-0000-000000000000",
      "refundAmount":1.0,
      "errors":[
         "Hash check invalid"
      ]
   }
]

Generate request hash check

Follow these steps to generate the hash check:

  1. Concatenate the RefundRequest variables (excluding HashCheck) in the order they appear in the table.
  2. Append your private key to the concatenated string. Your private key can be found in merchant details section of the merchant admin site.
  3. Convert the concatenated string to lowercase.
  4. Generate a SHA512 hash of the lowercase concatenated string.

Hash example

Here is an example of how a hash would be generated using the steps above and the values below.

TransactionId: 00000000-0000-0000-0000-000000000000

Amount: 0.01

RefundReason: Test 1

NotifyUrl: http://xgfg26qcbpbx.runscope.net