Skip to main content
GET
/
payments
/
all
cURL
curl --request GET \
  --url https://api.clickpesa.com/third-parties/payments/all \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.clickpesa.com/third-parties/payments/all"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.clickpesa.com/third-parties/payments/all', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.clickpesa.com/third-parties/payments/all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.clickpesa.com/third-parties/payments/all"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.clickpesa.com/third-parties/payments/all")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.clickpesa.com/third-parties/payments/all")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "id": "<string>",
      "exchanged": true,
      "exchange": {
        "sourceCurrency": "USD",
        "targetCurrency": "TZS",
        "sourceAmount": 1000,
        "rate": 2500
      },
      "paymentReference": "<string>",
      "paymentPhoneNumber": "255712345678",
      "orderReference": "<string>",
      "collectedAmount": 123,
      "collectedCurrency": "<string>",
      "message": "<string>",
      "updatedAt": "2023-11-07T05:31:56Z",
      "createdAt": "2023-11-07T05:31:56Z",
      "customer": {
        "customerName": "<string>",
        "customerPhoneNumber": "<string>",
        "customerEmail": "jsmith@example.com"
      }
    }
  ],
  "totalCount": 123
}
{
"message": "<string>"
}
{
"message": "Unauthorized"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

startDate
string<date>

Start date for filtering payments . Accepted formats : YYYY-MM-DD or DD-MM-YYYY

endDate
string<date>

End date for filtering payments . Accepted formats : YYYY-MM-DD or DD-MM-YYYY

status
enum<string>

Payment status filter

Available options:
SUCCESS,
SETTLED,
PROCESSING,
PENDING,
FAILED
collectedCurrency
string

Currency filter (e.g., TZS, USD)

channel
string

Payment channel filter

orderReference
string

Order reference filter

clientId
string

Client ID filter

sortBy
string

Field to sort by (default: createdAt). All response fields are sortable including customer fields

orderBy
enum<string>
default:DESC

Sort order (default: DESC)

Available options:
ASC,
DESC
skip
integer
default:0

Number of records to skip for pagination

Required range: x >= 0
limit
integer
default:20

Number of records to return

Required range: x >= 1

Response

Query all payments response

data
object[]

Array of payment records

totalCount
integer

Total number of payments matching the query criteria