Language

1: Sign in to the Kopo Kopo Web Application

The recipient reference is listed together with the rest of the details found on a pay recipients record.

Step 1A. Click on the ‘Pay’ Navigation Menu

Two available options appear below, labelled ‘Overview’ and ‘Pay Recipients’. Upon clicking on the ‘Pay Recipients’ menu option, 4 category menus subsequently appear.

Pay Recipients Side Nav Menu

Step 1B. View a single PAY Recipient Record

After selecting any of the 4 categories, a list of available pay recipient records you have created is displayed. Viewing an individual record shows its destination reference.

Pay Recipients Record

2: Use K2Connect API

If a pay recipient request was made through the API, a location URL is returned in the response header, which can be used to query details of the respective pay recipient request.

Step 2A. Obtain an application access token

Your application will exchange its client_id, client_secret, and grant_type=client_credentials for an application access token. An application access token can then be used to make calls to the API on behalf of your application.

Step 2B. Query the PAY recipient

Using the location URL from the header, you can perform a query request.

GET https://sandbox.kopokopo.com/api/v1/pay_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747
Content-Type: application/json
Accept: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q

HTTP/1.1 200 Success
{
    "data": {
        "id": "c7f300c0-f1ef-4151-9bbe-005005aa3747",
        "type": "pay_recipient",
        "attributes": {
            "recipient_type": "Mobile Wallet",
            "status": "Approved",
            "first_name": "John",
            "last_name": "Doe",
            "phone_number": "+254999999999",
            "network": "Safaricom",
            "email": "johndoe@nomail.net",
            "recipient_reference": "4cab4ebf-8341-4ec1-844e-c954b4740bf5"
        }
    }
}

# Using k2-connect - https://github.com/kopokopo/k2-connect-ruby(Recommended)
payment_url = 'https://sandbox.kopokopo.com/api/v1/payments/d76265cd-0951-e511-80da-0aa34a9b2388'

# Using K2Connect - https://github.com/kopokopo/k2-connect-ruby (Recommended)
k2_pay = K2Pay.new('your_access_token')
k2_pay.query_resource(payment_url
//  Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
var PayService = K2.PayService
var payUrl = 'https://sandbox.kopokopo.com/api/v1/pay_recipients/d76265cd-0951-e511-80da-0aa34a9b2388'

PayService
  .getStatus({accessToken: 'myRand0mAcc3ssT0k3n', location: payUrl)
  .then(response => {
    console.log(response)
  })
  .catch(error => {
    console.log(error)
  })

create_pay_location_url = 'https://sandbox.kopokopo.com/api/v1/payments/d76265cd-0951-e511-80da-0aa34a9b2388'

k2connect.initialize(CLIENT_ID, CLIENT_SECRET, BASE_URL)
pay_service = k2connect.Pay


# Using K2Connect - https://github.com/kopokopo/k2-connect-python (Recommended)
pay_request_query = pay_service.pay_transaction_status(ACCESS_TOKEN, create_pay_location_url)

<?
//  Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-php (Recommended)
$payService = $K2->PayService();

$options = [
  'location' => 'https://sandbox.kopokopo.com/api/v1/pay_recipients/d76265cd-0951-e511-80da-0aa34a9b2388',
  'accessToken' => 'myRand0mAcc3ssT0k3n',
];
$response = $payService->getStatus($options);

echo $response;
//Get Java sample