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.
Endpoint: https://sandbox.sasapay.app/api/v2/waas/customers/?merchant_code=2***8
Query Parameters
Field | Type | Description | Example |
---|---|---|---|
merchan_code=2***8 | Query Parameter | The merchantCode query parameter set to retirev you beneficiaries | MerchantCode=2****8 |
Sample Request
Headers
Key: Authorization
Value: Bearer Q1k2RW5SOGlsYUZnRzNGMQUlDS3VrTFhVV0xScFVHYQ==
Response Parameters
Field | Type | Description | Example |
---|---|---|---|
status | Boolean | This status shows whether the list of customers was retrieved successfully or not | true or false |
message | String | A detailed description of the status | "Customer retrieved successfully" |
Result | Array | An array of all the customers of the merchant. | “Result” :[] |
customer | object | An object of the attributes of a customer | "customer": {"display_name": "John K. Doe", "mobile_number": "07***8" } |
customer_account_number | Numeric | This 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_name | String | The full name of the customer | “John Doe” |
mobile_number | Numeric | This is the mobile number identifying a merchant’s customer as provided during registration. | 07***8 |
customer_balance | Numeric | The 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.
Endpoint: https://sandbox.sasapay.app/api/v2/waas/customer-details/
Request Parameters
Field | Type | Description | Example |
---|---|---|---|
accountNumber | String | The 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
Field | Type | Description | Example |
---|---|---|---|
statusCode | Numeric | This 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 |
message | String | A detailed description of the status | "Customer retrieved successfully" |
Result | JSON object | An 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"
}
}