### Get Available Banks Example Source: https://hub.ozow.com/docs/payouts-api/te1u21qvzznh8-step-2-submit-payout-request This example demonstrates how to retrieve a list of available banks for payout processing using the GetAvailableBanks endpoint. ```APIDOC ## GET /getavailablebanks ### Description Retrieves a list of available banks for payout processing. ### Method GET ### Endpoint /getavailablebanks ### Parameters #### Query Parameters - **SiteCode** (string) - Required - The site code for authentication. #### Headers - **ApiKey** (string) - Required - Your API key for authentication. - **SiteCode** (string) - Required - The site code for authentication. - **Accept** (string) - Required - Specifies the acceptable response format, typically 'application/json'. - **Content-Type** (string) - Required - Specifies the content type of the request body, typically 'application/x-www-form-urlencoded'. ### Request Example ```csharp using RestSharp; const string apiKey = "[YOUR API KEY]"; const string siteCode = "[YOUR SITE CODE]"; const string baseUrl = "{baseUrl}/getavailablebanks"; var client = new RestClient(baseUrl); client.Options.MaxTimeout = -1; var request = new RestRequest(baseUrl, Method.Get); request.AddHeader("ApiKey", apiKey); request.AddHeader("SiteCode", siteCode); request.AddHeader("Accept", "application/json"); request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); request.AddParameter("SiteCode", siteCode); var response = await client.ExecuteAsync(request); Console.WriteLine(response.Content); ``` ### Response #### Success Response (200) - **body** (object) - Contains a list of available banks. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Complete Example with jQuery Source: https://hub.ozow.com/docs/payin-api/14a245c14d301-ozow-secure-payments-modal-checkout-integration-guide A full example demonstrating the integration using jQuery for event handling. ```html ``` -------------------------------- ### Get Available Banks Example (C#) Source: https://hub.ozow.com/docs/payouts-api/te1u21qvzznh8-step-2-submit-payout-request This C# example demonstrates how to retrieve a list of available banks for payouts using the RestSharp library. Ensure you have your API key and site code. ```csharp using RestSharp; const string apiKey = "[YOUR API KEY]"; const string siteCode = "[YOUR SITE CODE]"; const string baseUrl = "{baseUrl}/getavailablebanks"; var client = new RestClient(baseUrl); client.Options.MaxTimeout = -1; var request = new RestRequest(baseUrl, Method.Get); request.AddHeader("ApiKey", apiKey); request.AddHeader("SiteCode", siteCode); request.AddHeader("Accept", "application/json"); request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); request.AddParameter("SiteCode", siteCode); var response = await client.ExecuteAsync(request); Console.WriteLine(response.Content); ``` -------------------------------- ### Get Refund Response Example Source: https://hub.ozow.com/docs/payin-api/k9dhvphs2vc19-get-refund This is an example of a successful response when querying a refund. It includes all relevant details about the refund transaction. ```json { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "createdDate": "2019-08-24T14:15:22Z", "createdDateUtc": "2019-08-24T14:15:22Z", "merchantCode": "string", "siteCode": "string", "siteName": "string", "bankToName": "string", "currencyCode": "str", "amount": 15.2, "statementReference": "string", "status": 1, "toAccount": "string", "paymentDate": "2019-08-24T14:15:22Z", "transactionReference": "string", "customer": "string", "lastEvent": "string", "refundCompletedDate": "2019-08-24T14:15:22Z", "createdBy": "string", "isRtc": true } ``` -------------------------------- ### Quick jQuery Example for Ozow Integration Source: https://hub.ozow.com/docs/payin-api/c1c62920f850d-ozow-secure-payments-embedded-i-frame-integration-guide A complete example demonstrating Ozow iFrame integration using jQuery for event handling. ```html
Pay with Ozow ``` -------------------------------- ### Get Available Banks Response Example Source: https://hub.ozow.com/docs/payouts-api/ryoscp8qe7d7x-get-available-banks This is an example of the JSON response when successfully retrieving the list of available banks. Each bank object contains a unique bankGroupId, bankGroupName, and universalBranchCode. ```json [ { "bankGroupId": "7af901fc-2759-429c-88ae-9e40e67c76ce", "bankGroupName": "string", "universalBranchCode": "string" } ] ``` -------------------------------- ### Submit Refunds Request Example Source: https://hub.ozow.com/docs/payin-api/p7jv98av3x7cw-step-2-submit-refunds This example demonstrates the structure of a POST request to submit multiple refunds. Ensure the HashCheck is correctly generated for each refund item. ```http 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 } ] ``` -------------------------------- ### Payout Availability Response Example Source: https://hub.ozow.com/docs/payouts-api/9cxd6nhanillx-get-payout-availability This is an example of a successful response from the Get Payout Availability API. It details an available payout time slot, including its type, schedule, and interval. ```json [ { "siteCode": "string", "dayType": -2147483648, "fromTime": "2019-08-24T14:15:22Z", "toTime": "2019-08-24T14:15:22Z", "isRtc": true, "availabilityType": -2147483648, "batchScheduleType": -2147483648, "batchScheduleTime": "2019-08-24T14:15:22Z", "batchIntervalMinute": -2147483648 } ] ``` -------------------------------- ### Refund Response Example Source: https://hub.ozow.com/docs/payin-api/ih1sjk5pxzjhl-get-refunds This is an example of a successful response when retrieving refunds. It returns an array of refund objects, each containing detailed information. ```json [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "createdDate": "2019-08-24T14:15:22Z", "createdDateUtc": "2019-08-24T14:15:22Z", "merchantCode": "string", "siteCode": "string", "siteName": "string", "bankToName": "string", "currencyCode": "str", "amount": 15.2, "statementReference": "string", "status": 1, "toAccount": "string", "paymentDate": "2019-08-24T14:15:22Z", "transactionReference": "string", "customer": "string", "lastEvent": "string", "refundCompletedDate": "2019-08-24T14:15:22Z", "createdBy": "string", "isRtc": true } ] ``` -------------------------------- ### RefundList Response Example Source: https://hub.ozow.com/docs/one-api/q6c4s4b6xu3ev-refund-list This example demonstrates the structure of a typical response when listing refunds. It includes pagination links, a list of refund objects, and meta information for pagination. ```json { "links": { "self": "http://example.com", "first": "http://example.com", "last": "http://example.com", "prev": "http://example.com", "next": "http://example.com" }, "results": [ { "links": {}, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc", "amount": {}, "requested": "2019-08-24T14:15:22Z", "completed": "2019-08-24T14:15:22Z", "status": "pending", "reason": "string", "paidTo": {}, "realTimePayment": false } ], "meta": { "totalPages": 0, "totalItems": 0 } } ``` -------------------------------- ### Submit Refunds Response Example Source: https://hub.ozow.com/docs/payin-api/p7jv98av3x7cw-step-2-submit-refunds This example shows the expected response structure after submitting a refund request. It includes refund IDs, transaction IDs, amounts, and any errors encountered. ```json [ { "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" ] } ] ``` -------------------------------- ### Submit Refund Request Body Example Source: https://hub.ozow.com/docs/payin-api/jwa9556q4ftb9-submit-refund This is an example of the JSON body structure for submitting a refund request. Ensure all required fields are correctly populated. ```json [ { "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc", "amount": 20.44, "refundReason": "string", "notifyUrl": "http://example.com", "hashCheck": "string", "isRtc": false } ] ``` -------------------------------- ### Payout Request Response Example Source: https://hub.ozow.com/docs/payouts-api/te1u21qvzznh8-step-2-submit-payout-request This is an example of a successful response when submitting a payout request. It includes the payout ID and its current status. ```json { "payoutId": "00000000-0000-0000-0000-000000000000", "payoutStatus": { "status": 1, "subStatus": 201, "errorMessage": "" } } ``` -------------------------------- ### Generate Hash Check Example Source: https://hub.ozow.com/docs/payin-api/p7jv98av3x7cw-step-2-submit-refunds This example illustrates the process of generating the SHA512 hash required for refund requests. It involves concatenating specific fields, appending a private key, converting to lowercase, and then hashing. ```text 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. ``` ```text TransactionId: 00000000-0000-0000-0000-000000000000 Amount: 0.01 RefundReason: Test 1 NotifyUrl: http://xgfg26qcbpbx.runscope.net ``` ```text 1. 00000000-0000-0000-0000-0000000000000.01Test 1http://xgfg26qcbpbx.runscope.net 2. 00000000-0000-0000-0000-0000000000000.01Test 1http://xgfg26qcbpbx.runscope.net215114531AFF7134A94C88CEEA48E 3. 00000000-0000-0000-0000-0000000000000.01test 1http://xgfg26qcbpbx.runscope.net215114531aff7134a94c88ceea48e 4. c588fcb20f32e28d516922d95ada0afd37f898c45376a8a6a782c0d678a0561d3d2483e879eb9d820e02b5810c9b9b7f49a2f26e07be6a23093b11c0bd3a51ef ``` -------------------------------- ### Transaction Object Example Source: https://hub.ozow.com/docs/payin-api/g5jyiuwk49vfv-transaction This JSON object demonstrates the structure and possible values for a transaction in the Ozow system. It includes all fields with example data. ```json { "transactionId": "string", "merchantCode": "string", "siteCode": "string", "transactionReference": "string", "currencyCode": "str", "amount": -1.7976931348623157e+308, "status": "Complete", "statusMessage": "string", "createdDate": "2024-01-02 14:22", "paymentDate": "2024-01-02 14:25", "subStatus": "string", "bankName": "string", "maskedAccountNumber": "1234*****8765", "smartIndicators": "HIGH_VALUE|FIRST_OZOW" } ``` -------------------------------- ### Submit Refund API Response Example Source: https://hub.ozow.com/docs/payin-api/jwa9556q4ftb9-submit-refund This is an example of a successful response when submitting a refund. It includes the refund ID, transaction ID, refund amount, and any potential errors. ```json { "refundId": "3324897f-393a-4bf6-b3af-0b999cbc2521", "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc", "refundAmount": "string", "errors": [ "string" ] } ``` -------------------------------- ### Get Payout Request (cURL) Source: https://hub.ozow.com/docs/payouts-api/h5bq6fvcxexrw-get-payout Use this cURL command to make a GET request to the staging environment to retrieve payout details. Ensure you replace '123' with your actual API key and provide the correct SiteCode. ```curl curl --request GET \ --url https://stagingpayoutsapi.ozow.com/v1/getpayout \ --header 'ApiKey: 123' \ --header 'SiteCode: ' ``` -------------------------------- ### Get Banking Details Request (cURL) Source: https://hub.ozow.com/docs/payin-api/ojgcydk71cb3q-get-banking-details Use this cURL command to make a GET request to the staging API to retrieve banking details. Ensure you replace `{bankreferenceid}` with the actual reference ID and provide your API Key. ```shell curl --request GET \ --url https://stagingapi.ozow.com/secure/banktransfer/bankingdetails/{bankreferenceid} \ --header 'Accept: application/json' \ --header 'ApiKey: 123' ``` -------------------------------- ### Get Test Configuration Source: https://hub.ozow.com/docs/payouts-api/u9mys734unls3-payouts-api Retrieves the current test configuration settings. ```APIDOC ## GET /v1/payouts/test/configuration ### Description Retrieves the current test configuration settings. ### Method GET ### Endpoint /v1/payouts/test/configuration ### Parameters #### Query Parameters - **ApiKey** (string) - Required - API Key for authentication. ### Response #### Success Response (200) - **testMode** (boolean) - Indicates if test mode is enabled. - **mockBankAccountId** (string) - The mock bank account ID for testing. ### Response Example ```json { "testMode": true, "mockBankAccountId": "mock_12345" } ``` ``` -------------------------------- ### Install the Ozow SDK Source: https://hub.ozow.com/docs/payin-api/14a245c14d301-ozow-secure-payments-modal-checkout-integration-guide Include the Ozow integration script in your HTML to use the SDK. ```html ``` -------------------------------- ### Instantiate the Ozow SDK Source: https://hub.ozow.com/docs/payin-api/c1c62920f850d-ozow-secure-payments-embedded-i-frame-integration-guide Initialize the Ozow SDK to make its methods available for use. ```javascript const ozow = new Ozow(); // Makes SDK methods available ``` -------------------------------- ### Transaction Report Response Example Source: https://hub.ozow.com/docs/payin-api/zqhvxxm7erwo0-get-transaction-report This is an example of the JSON response structure for the Get Transaction Report API. It details the fields included for each transaction, such as ID, status, amount, and customer information. ```json [ { "id": "33857766-f29a-4a3a-a37e-66db3c42e439", "createdDateUtc": "string", "siteCode": "string", "siteName": "string", "bankFromName": "string", "bankToName": "string", "amount": -1.7976931348623157e+308, "status": "Complete", "toAccount": "string", "toReference": "string", "paymentDate": "2019-08-24", "paymentDateUtc": "2019-08-24", "transactionReference": "string", "customer": "string", "optional1": "string", "optional2": "string", "optional3": "string", "optional4": "string", "optional5": "string", "lastEvent": "string", "lastEventStatus": "string" } ] ``` -------------------------------- ### Instantiate the Ozow SDK Source: https://hub.ozow.com/docs/payin-api/14a245c14d301-ozow-secure-payments-modal-checkout-integration-guide Create an instance of the Ozow SDK to access its methods. ```javascript const ozow = new Ozow(); // Exposes SDK methods ``` -------------------------------- ### API Key Authentication Example Source: https://hub.ozow.com/docs/payouts-api/u9mys734unls3-payouts-api Include the API key in a header parameter called `ApiKey` for authentication. ```text ApiKey: 123 ``` -------------------------------- ### Launch Ozow Payment Modal Source: https://hub.ozow.com/docs/payin-api/14a245c14d301-ozow-secure-payments-modal-checkout-integration-guide Initiate the Ozow payment modal by calling `createPaymentModal` with the payment URL and POST data. Ensure your trigger element has an ID. ```javascript const paymentUrl = 'https://pay.ozow.com/'; const postData = { // 🔑 Required Ozow POST variables // SiteCode : 'ABC-123', // Amount : 750.00, // Currency : 'ZAR', // SuccessUrl / CancelUrl / ErrorUrl, etc. }; document.getElementById('payUsingOzow').onclick = () => { ozow.createPaymentModal(paymentUrl, postData); }; ``` -------------------------------- ### Obtain Access Token (cURL) Source: https://hub.ozow.com/docs/one-api/yu4y4luah3arn-quickstart-payments Use this cURL command to POST to the /token endpoint with your client credentials to obtain an access token. Ensure you replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with your actual credentials. ```bash curl -X POST "https://one.ozow.com/v1/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "client_id=YOUR_CLIENT_ID" \ -d "client_secret=YOUR_CLIENT_SECRET" \ -d "scope=payment" \ -d "grant_type=client_credentials" ``` -------------------------------- ### Transaction Notification Response Example Source: https://hub.ozow.com/docs/payin-api/rgpiavi5p7g67-transaction-notification-response This JSON object represents the structure of the response sent to the merchant's webhook. It includes all required and optional fields, along with example values for clarity. ```json { "SiteCode": "string", "TransactionId": "33857766-f29a-4a3a-a37e-66db3c42e439", "TransactionReference": "string", "Amount": -1.7976931348623157e+308, "Status": "Complete", "Optional1": "string", "Optional2": "string", "Optional3": "string", "Optional4": "string", "Optional5": "string", "CurrencyCode": "ZAR", "Hash": "string", "SubStatus": "CustomerAccountError", "MaskedAccountNumber": "1234*****8765", "BankName": "string", "SmartIndicators": "HIGH_VALUE|FIRST_OZOW" } ``` -------------------------------- ### Get Transaction by Reference (cURL) Source: https://hub.ozow.com/docs/payin-api/asxm18hxs1o91-get-transaction-by-reference Use this cURL command to make a GET request to the Ozow API to retrieve transaction details by its reference. Ensure you replace '123' with your actual ApiKey. ```curl curl --request GET \ --url https://stagingapi.ozow.com/GetTransactionByReference \ --header 'Accept: application/json' \ --header 'ApiKey: 123' ``` -------------------------------- ### Get Payout Availability Request (cURL) Source: https://hub.ozow.com/docs/payouts-api/9cxd6nhanillx-get-payout-availability Use this cURL command to make a GET request to the Payout Availability API. Ensure you replace '123' with your actual API Key and provide the correct SiteCode. ```curl curl --request GET \ --url https://stagingpayoutsapi.ozow.com/v1/getpayoutavailability \ --header 'Accept: application/json' \ --header 'ApiKey: 123' \ --header 'SiteCode: ' ``` -------------------------------- ### Create Static Reference API Request (cURL) Source: https://hub.ozow.com/docs/payin-api/jwwptkxi68us1-create-static-reference Example of how to send a POST request to the Ozow API to create a static reference using cURL. Includes necessary headers and the request body. ```shell curl --request POST \ --url https://stagingapi.ozow.com/secure/banktransfer/multiple \ --header 'Accept: application/json' \ --header 'ApiKey: 123' \ --header 'Content-Type: application/json' \ --data '{ \ "siteCode": "string", \ "countryCode": "ZA", \ "currencyCode": "ZAR", \ "amount": 150.2, \ "transactionReference": "string", \ "bankReference": "string", \ "optional1": "string", \ "optional2": "string", \ "optional3": "string", \ "optional4": "string", \ "optional5": "string", \ "customer": "string", \ "cancelUrl": "http://example.com", \ "successUrl": "http://example.com", \ "notifyUrl": "http://example.com", \ "bankId": "30a36e6b-4ce6-409a-8471-fa29e9999b3a", \ "expiryDateUtc": "2015-08-11 16:02", \ "customerCell": "0794567855", \ "hashCheck": "string" \ }' ``` -------------------------------- ### TransactionModel Example Source: https://hub.ozow.com/docs/payin-api/m48pkjfzecyuh-transaction-model This JSON object demonstrates the structure and typical values for a TransactionModel. It includes fields for transaction ID, dates, site details, amounts, status, account information, references, customer data, and optional fields. ```json { "id": "33857766-f29a-4a3a-a37e-66db3c42e439", "createdDateUtc": "string", "siteCode": "string", "siteName": "string", "bankFromName": "string", "bankToName": "string", "amount": -1.7976931348623157e+308, "status": "Complete", "toAccount": "string", "toReference": "string", "paymentDate": "2019-08-24", "paymentDateUtc": "2019-08-24", "transactionReference": "string", "customer": "string", "optional1": "string", "optional2": "string", "optional3": "string", "optional4": "string", "optional5": "string", "lastEvent": "string", "lastEventStatus": "string" } ``` -------------------------------- ### Sample Response with Links Source: https://hub.ozow.com/docs/one-api/fbc01bdf1acdd-responses Illustrates a typical response object that includes a 'links' object, conforming to JSON:API standards. The 'links' object contains URIs for the current resource and related operations. ```json { "links": { "self": "https://one.ozow.com/v1/payments/497f6eca-6276-4993-bfeb-53cbbbba6f08", "refunds": "https://one.ozow.com/v1/payments/497f6eca-6276-4993-bfeb-53cbbbba6f08/refunds" // ... }, "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", // ... } ``` -------------------------------- ### Launch Ozow Payment iFrame Source: https://hub.ozow.com/docs/payin-api/c1c62920f850d-ozow-secure-payments-embedded-i-frame-integration-guide Initiate the Ozow payment process by creating a payment frame within a specified container. ```javascript const paymentUrl = 'https://pay.ozow.com/'; const postData = { // 🔑 Required Ozow POST variables… // SiteCode : 'ABC-123', // Amount : 250.00, // Currency : 'ZAR', // SuccessUrl / CancelUrl / ErrorUrl, etc. }; document.getElementById('payUsingOzow').onclick = () => { ozow.createPaymentFrame('paymentContainer', paymentUrl, postData); }; ``` -------------------------------- ### Get Refunds by Transaction ID (cURL) Source: https://hub.ozow.com/docs/payin-api/gvw21dutpkuvj-get-refunds-by-transaction-id Use this cURL command to make a GET request to the Ozow API to retrieve refunds associated with a specific transaction ID. Ensure you replace the placeholder with your actual authorization token. ```curl curl --request GET \ --url https://stagingapi.ozow.com/secure/refunds/getrefundsbytransactionid \ --header 'Accept: application/json, application/xml' \ --header 'Authorization: ' ``` -------------------------------- ### Get Transaction Report Request (cURL) Source: https://hub.ozow.com/docs/payin-api/zqhvxxm7erwo0-get-transaction-report Use this cURL command to make a GET request to the Ozow API to retrieve transaction reports. Ensure you replace '123' with your actual API key and adjust the URL if using a different environment. ```curl --request GET \ --url https://stagingapi.ozow.com/GetTransactionReport \ --header 'Accept: application/json, application/xml' \ --header 'ApiKey: 123' ``` -------------------------------- ### Payouts API Overview Source: https://hub.ozow.com/docs/payouts-api/p91zsgmrgnnm2-payouts-integration This section provides an overview of the payouts integration process using the Ozow API. It outlines the key steps involved in setting up and executing automated payouts. ```APIDOC ## Payouts Integration Overview Integrating Ozow as an automated payout provider via a RESTful API involves the following sequence of steps: * **Step 1**: Check the payout availability for the destination bank, including the realtime clearing (RTC) feature (optional, but recommended for a better client experience). * **Step 2**: Submit a payout request via Ozow API. * **Step 3**: Ozow requires each merchant to build a web-hook API end-point which will be triggered in order to verify each payout request. * **Step 4**: Check payout status using Ozow's API (optional but recommended). ```