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
Type | Description |
---|---|
RefundRequest\[] | The refunds process. |
RefundRequest Object
Name | Type | Req. | Description |
---|---|---|---|
transactionId | Guid | Yes | The transaction identifier. This is the identifier for the payment that was originally processed on Ozow. |
amount | Decimal | Yes | The amount that needs to be refunded. This can be less than the original transaction amount but not more. |
refundReason | String (500) | No | The reason for the refund. |
notifyUrl | String (500) | No | The URL Ozow will send a notification to once the refund has been finalised. |
hashCheck | String (150) | Yes | SHA512 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. |
isRtc | Bool | No | Whether the refund should be processed as an RTC refund. |
Response object
Name | Type | Description |
---|---|---|
refundId | Guid | The identifier for the refund that was created. No identifier is returned if there was an error creating the refunds. |
transactionId | Guid | The transaction identifier. This will correspond to one of the transaction identifiers passed through in the request. |
refundAmount | Decimal | The refund amount. |
errors | String[] | 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:
- Concatenate the RefundRequest variables (excluding HashCheck) in the order they appear in the table.
- Append your private key to the concatenated string. Your private key can be found in merchant details section of the merchant admin site.
- Convert the concatenated string to lowercase.
- 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
- 00000000-0000-0000-0000-0000000000000.01Test 1http://xgfg26qcbpbx.runscope.net
- 00000000-0000-0000-0000-0000000000000.01Test 1http://xgfg26qcbpbx.runscope.net215114531AFF7134A94C88CEEA48E
- 00000000-0000-0000-0000-0000000000000.01test 1http://xgfg26qcbpbx.runscope.net215114531aff7134a94c88ceea48e
- c588fcb20f32e28d516922d95ada0afd37f898c45376a8a6a782c0d678a0561d3d2483e879eb9d820e02b5810c9b9b7f49a2f26e07be6a23093b11c0bd3a51ef
Updated 7 months ago
What’s Next