Skip to main content

Merchant customers

Retrieve the List of all your customers

As a merchant, you can retrieve the list of your beneficiaries by making a get request to the following endpoint and passing in the MerchantCode as a query parameter.

Alt test Endpoint: https://sandbox.sasapay.app/api/v2/waas/customers/?merchant_code=2***8

Query Parameters

FieldTypeDescriptionExample
merchan_code=2***8Query ParameterThe merchantCode query parameter set to retirev you beneficiariesMerchantCode=2****8
Sample Request
Headers
Key: Authorization
Value: Bearer Q1k2RW5SOGlsYUZnRzNGMQUlDS3VrTFhVV0xScFVHYQ==

Response Parameters

FieldTypeDescriptionExample
statusBooleanThis status shows whether the list of customers was retrieved successfully or nottrue or false
messageStringA detailed description of the status"Customer retrieved successfully"
ResultArrayAn array of all the customers of the merchant.“Result” :[]
customerobjectAn object of the attributes of a customer"customer": {"display_name": "John K. Doe", "mobile_number": "07***8" }
customer_account_numberNumericThis is a unique number identifying your customer in the system. It is composed of the merchant code and customer id on the system.4*6-3
display_nameStringThe full name of the customer“John Doe”
mobile_numberNumericThis is the mobile number identifying a merchant’s customer as provided during registration.07***8
customer_balanceNumericThe total amount of money that a specific customer has on their wallet.72.00
Response Sample
 {
"status": true,
"responseCode": "0",
"message": "Customers",
"links": {
"next": null,
"previous": null
},
"count": 7,
"pages": 1,
"results": {
"customers": [
{
"client": {
"display_name": "John Doe"
},
"account_number": "1234",
"currency_code": "KES",
"description": "John Account",
"account_type": "Personal"
},
{
"client": {
"display_name": "Jane Doe"
},
"account_number": "1245",
"currency_code": "KES",
"description": "Jane Account",
"account_type": "Personal"
}
]
}
}

Customer details

You can retrieve the details of an individual beneficiary by appending CustomerAccountNumber in the request as a query parameter.

Alt test Endpoint: https://sandbox.sasapay.app/api/v2/waas/customer-details/

Request Parameters

FieldTypeDescriptionExample
accountNumberStringThe account number of the customer as registered on your system.2****8-13
Request Sample
Headers
Key: Authorization
Value: Bearer Q1k2RW5SOGlsYUZnRzNGMk1DNIyZWs6QUlDS3VrTFhVV0xScFVHYQ==

Body:
{
"merchantCode": "2**2",
"accountNumber": "254702****0",
"countryCode": "254"
}

Response Parameters

FieldTypeDescriptionExample
statusCodeNumericThis is a numeric status code that indicates the status of the response. 0 means success and any other code means an error occurred or the request failed.Please refer to the response codes table above.0
messageStringA detailed description of the status"Customer retrieved successfully"
ResultJSON objectAn object of all the customers of the merchant.“Result” :[]
Response Sample
{
"status": true,
"responseCode": "0",
"message": "Client profile",
"data": {
"profile": {
"display_name": "John Doe",
"mobile_number": "254702*****0",
"account_status": "ACTIVE"
},
"merchantCode": "2**2"
}
}