HarborPay Documentation

Accept and process cards, wallets, and Local Payment Methods in a single, modern integration. Store customer and payment information to reduce friction at checkout.

You will need an account on HarborPay to accept payments if you don't already have one. Create one here, and get your clientId and clientKey from the preferences screen.

Customisable

Build a payment form with the right level of customization for your needs.

Security

Securely store customer information – including payment method information.

Plugins/Libraries

Implement out of our collection, what's suitable for your setup.

Callbacks

Set up and receive callbacks for every payment processed!

Authentication

Authentication requires the following headers;

The PASSWORD is a base64 encoding of your clientId + clientKey.

                                    
                                        "Authorization: Bearer PASSWORD",
                                        "Content-Type: application/json",
                                    
                                

Accepting Payments

Payments can be accepted via two main methods.

Popup

This allows you to implement HarborPay's payment collection in very simple steps.

Note
No authentication is required when using the Popup method.
                                                    
                                                        // Add harbor pay to your DOM
														<script src="https://app.myharborpay.com/cdn/harborpay.js">

														// Initialise HarborPay with your client details

														harborPay.initialize({
															client_id: '1',
															client_key: '456789iokjhgty5643',
															amount: 1.0, //this can be omitted and passed to harborPay.begin();
															currency: 'GHS',
														});

														// Attach the invocation (harborPay.begin();) to your target button
														<button onclick="harborPay.begin()">Submit</button>
                                                    
                                                
                                                 
Tap the button below to test with a payment of GH1
REST

This allows you to call the REST APIs directly.

                                                
                                                    curl -d '{"client_id":"1234", "client_reference":"fer3536ty","customer_number":"02000000000", "email":"customer@hpay.com", "currency":"GHS", "amount":"5.0", "transaction_type":"momo", "transaction_platform":"MTN"}'
                                                    -H 'Content-Type: application/json' -H 'Authorization: Bearer PASSWORD'
                                                    https://app.myharborpay.com/accept
                                                
                                            
                                                
                                                        $url = "https://app.myharborpay.com/accept";

                                                        //JSON encode the payload
                                                        $payload = json_encode([
                                                            'client_id' => '1234',
                                                            'client_reference' => 'fer3536ty',
                                                            'customer_number' => '02000000000',
                                                            'email' => "customer@hpay.com",
                                                            'currency' => 'GHS',
                                                            'amount' => '5.0',
                                                            'transaction_type' => 'momo'
                                                            'transaction_platform' => 'MTN'
                                                        ]);

                                                        $curl = curl_init();
                                                        curl_setopt($curl, CURLOPT_URL, $url);
                                                        curl_setopt($curl, CURLOPT_POST, 1);
                                                        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                                                        curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);
                                                        curl_setopt($curl, CURLOPT_HTTPHEADER, [
                                                            "Authorization: Bearer PASSWORD",
                                                            "Content-Type: application/json",
                                                        ]);

                                                        $result = curl_exec($curl);
                                                        echo $result;
                                                
                                            
                                                
                                                    import requests
                                                    from requests.structures import CaseInsensitiveDict

                                                    url = "https://app.myharborpay.com/accept"

                                                    headers = CaseInsensitiveDict()
                                                    headers["Content-Type"] = "application/json"
                                                    headers["Authorization"] = "Bearer PASSWORD"

                                                    data = '{"client_id":"1234", "client_reference":"fer3536ty","customer_number":"02000000000", "email":"customer@hpay.com", "currency":"GHS", "amount":"5.0", "transaction_type":"momo", "transaction_platform":"MTN"}'
                                                    resp = requests.post(url, headers=headers, data=data)
                                                    print(resp.status_code)
                                                
                                            

Sending Money

This allows you to send money to multiple mobile money users at a go.

                                                
                                                    curl -d '{"client_id": "1234", "currency": "GHS", "recipients": [{"client_reference":"ertfgdre567u","amount":1.0,"customer_number":"2330000000","customer_name":"Jane Doe"},{"client_reference":"gftr5467tyui3","amount":2.0,"customer_number":"2330000001","customer_name":"John Doe"}]}'
                                                    -H 'Content-Type: application/json' -H 'Authorization: Bearer PASSWORD'
                                                    https://app.myharborpay.com/send_money
                                                
                                            
                                                
                                                        $url = "https://app.myharborpay.com/send_money";

                                                        //JSON encode the payload
                                                        $payload = json_encode([
                                                            'client_id' => '1234',
                                                            'currency' => 'GHS',
                                                            'client_reference' => 'fer3536ty',
                                                            'recipients' => [
                                                                [
                                                                    'client_reference' => 'ertfgdre567u',
                                                                    'amount' => 1.0',
                                                                    'customer_number' => '2330000000',
                                                                    'customer_name' => 'Jane Doe'
                                                                ],
                                                                [
                                                                    'client_reference' => 'gftr5467tyui3',
                                                                    'amount' => 2.0',
                                                                    'customer_number' => '2330000001',
                                                                    'customer_name' => 'John Doe'
                                                                ],
                                                            ]
                                                        ]);

                                                        $curl = curl_init();
                                                        curl_setopt($curl, CURLOPT_URL, $url);
                                                        curl_setopt($curl, CURLOPT_POST, 1);
                                                        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                                                        curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);
                                                        curl_setopt($curl, CURLOPT_HTTPHEADER, [
                                                            "Authorization: Bearer PASSWORD",
                                                            "Content-Type: application/json",
                                                        ]);

                                                        $result = curl_exec($curl);
                                                        echo $result;
                                                
                                            
                                                
                                                    import requests
                                                    from requests.structures import CaseInsensitiveDict

                                                    url = "https://app.myharborpay.com/send_money"

                                                    headers = CaseInsensitiveDict()
                                                    headers["Content-Type"] = "application/json"
                                                    headers["Authorization"] = "Bearer PASSWORD"

                                                    data = '{"client_id": "1234", "currency": "GHS", "recipients": [{"client_reference":"ertfgdre567u","amount":1.0,"customer_number":"2330000000","customer_name":"Jane Doe"},{"client_reference":"gftr5467tyui3","amount":2.0,"customer_number":"2330000001","customer_name":"John Doe"}]}'
                                                    resp = requests.post(url, headers=headers, data=data)
                                                    print(resp.status_code)
                                                
                                            

Withdrawing Money

This allows you to withdraw money from your HarborPay wallet to a mobile money account.

                                                
                                                    curl -d '{"client_id": "1234", "amount": 1.0, "currency": "GHS", "account_platform": "MTN", "account_number": "2330000000", "account_name": "Jane Doe"}'
                                                    -H 'Content-Type: application/json' -H 'Authorization: Bearer PASSWORD'
                                                    https://app.myharborpay.com/withdraw
                                                
                                            
                                                
                                                        $url = "https://app.myharborpay.com/withdraw";

                                                        //JSON encode the payload
                                                        $payload = json_encode([
                                                            'client_id' => '1234',
                                                            'currency' => 'GHS',
                                                            'amount' => 1.0',
                                                            'account_platform' => 'MTN',
                                                            'account_number' => '2330000000,
                                                            'account_name', 'Jane Doe'
                                                        ]);

                                                        $curl = curl_init();
                                                        curl_setopt($curl, CURLOPT_URL, $url);
                                                        curl_setopt($curl, CURLOPT_POST, 1);
                                                        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                                                        curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);
                                                        curl_setopt($curl, CURLOPT_HTTPHEADER, [
                                                            "Authorization: Bearer PASSWORD",
                                                            "Content-Type: application/json",
                                                        ]);

                                                        $result = curl_exec($curl);
                                                        echo $result;
                                                
                                            
                                                
                                                    import requests
                                                    from requests.structures import CaseInsensitiveDict

                                                    url = "https://app.myharborpay.com/withdraw"

                                                    headers = CaseInsensitiveDict()
                                                    headers["Content-Type"] = "application/json"
                                                    headers["Authorization"] = "Bearer PASSWORD"

                                                    data = '{"client_id": "1234", "amount": 1.0, "currency": "GHS", "account_platform": "MTN", "account_number": "2330000000", "account_name": "Jane Doe"}'
                                                    resp = requests.post(url, headers=headers, data=data)
                                                    print(resp.status_code)
                                                
                                            

Plugins / Libraries

Our plugins allow easy implementations of all our currently available features

Processing Payments

Accept money from different sources into your HarborPay wallet.

Sending Money

Send money to individuals or multiple clients at a go!

Withdraw Money

Withdraw money from your HarborPay wallet to a mobile money account.

We're adding more plugins soon.

Flutter Library

See sample implementation above. You can visit the official plugin page.

Wordpress Plugin

Coming Soon.

NodeJS Library

Coming Soon.

Webhooks

When you receive a payment, or a withdrawal request gets processed, you receive a callback, i.e if you've set your callback URL in preferences.

Format:
                                        
                                            {
                                                "client_reference": "23435fer33",
                                                "success": true,
                                                "payment_status": "Completed",
                                                "completed_at": "2021-12-01 00:58",
                                            }