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_balance_derived": "0.00",
"account_type": "Personal"
},
{
"client": {
"display_name": "Jane Doe"
},
"account_number": "1245",
"currency_code": "KES",
"description": "Jane Account",
"account_balance_derived": "11.00",
"account_type": "Personal"
}
]
},
"total_accounts_balance": "2352.2"
}

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
merchantCodeStringUnique code assigned to the merchant"2**2"
accountNumberStringMasked account number of the merchant"254702****0"
countryCodeStringCountry code of the merchant's location"254"
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"
},
"CustomerWallets": [
{
"account_number": "12980",
"client": {
"display_name": "John Doe"
},
"currency_code": "KES",
"description": "John Doe",
"account_balance_derived": "11.00"
}
],
"merchantCode": "2**2"
}
}

Update customer details

In cases where the beneficiary is rejected during account verification, Beneficiary is able to amend their KYC details.

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

Request Parameters

FieldTypeDescriptionExample
merchantCodeStringA unique number assigned to an organization/merchant registered with ViewTech, through which payment is received (can be Paybill or Till number)4****6
accountNumberStringA unique number assigned to the customer. This is returned during personal account onboarding as account number.12345
firstNameStringThe first name of the customer as it appears on the identity card or passport“John”
middleNameStringThe middle name of the customer as it appears on their identity card/Passort(Optional)“K”
lastNameStringThe last name of the customer as it appears on their identity card“Doe”
emailStringEmail of the customer (Optional)“Doe”
documentTypeStringThis is the type of identifying documentation for the customer1.ID card
2.Passport
3. Alien ID
documentNumberStringThis is the number on the identification document type2****4
callbackUrlURL stringThis is the link where sasapay will send the data about beneficiary status during onboarding process.This data can be used by the mechant to update beneficiary status on merchant system.https://example.com/callbackurl/
Request sample
Headers
Key: Authorization
Value: Bearer cFJZcjZ6anEwaThM6UmYyMkJmWm9nMHFRR2xWOQ==
Body:
{
"merchantCode": "600980",
"accountNumber": "12345",
"firstName": "John",
"middleName": "",
"lastName": "Doe",
"documentNumber": "1234328",
"documentType": "1",
"email": "johndoe@gmail.com",
"callbackUrl": "https://example.com/callbackurl"
}

Response Parameters

FieldTypeDescriptionExample
statusbooleanIndicates the status of the operation.true
statusCodeStringThis 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 description of the response status sent when a request is received.Success.Kindly upload KYC for re-verification.
Sample Response
{
"status": true,
"responseCode": "0",
"message": "Success.Kindly upload KYC for re-verification."
}