Skip to main content

Validate Product

This API endpoint validates a product. Product validation is required before every product purchase.

HTTP Request

POST
https://payments.relworx.com/api/products/validate

Arguments

ParameterTypeRequiredDescription
account_nostringYesBusiness account number. This is generated for you when you create a business account.
referencestringYesA unique generated string to identify your request. A minimum of 8 and maximum of 36 characters is allowed.
msisdnstringYesProduct receiver account number. i.e Yaka / National water meter number.
amountdecimalYesProduct purchase amount / price.
product_codestringYesCode for product.
contact_phonestringYesContact phone number for on which SMS is sent after product purchase.
location_idstringNoParameter is required for validating product code NATIONAL_WATER. Get this value from the choice-list of product with code NATIONAL_WATER.

Sample request for product validation.

Make sure to replace <--Your API Key--> with your generated API Key.

curl "https://payments.relworx.com/api/products/validate" \
-X POST \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.relworx.v2" \
-H "Authorization: Bearer <--Your API Key-->" \
-d '{
"account_no": "RELJH012BV45P",
"reference": "52750b30ffbc7de3b36",
"msisdn": "0701454887",
"amount": 1000,
"product_code": "MTN_UG_AIRTIME",
"contact_phone": "0701454832",
}'

Response Parameters

ParameterDescription
customer_nameName of customer to receive product if available.
validation_referenceA unique reference that identifies a validation. This is required when purchasing product.

Sample response.

{
"success": true,
"customer_name": "",
"validation_reference": "416b358df57e82a6"
}