You can connect with the API by sending a POST request to the following endpoint:
https://do-calculate.com/api/calculate-fruits-zakat
Request Body:
The API expects a JSON object in the request body with the following properties:
{ "weight": 50, "pricePerKg": 10, "wateringMethod": "full-cost" }
The API will respond with a JSON object containing the calculated Zakat on silver, the threshold, and the Zakat duty as shown in the following example:
{ "result": { "fruitsZakatAmount": 2.5, "moneyZakatAmount": 125, "threshold": 635 } }
If the request is missing any of the required properties (weight, pricePerKg, or wateringMethod), the API will respond with a 400 Bad Request status code and an error message.
If the weight or height is negative, the API will also respond with a 400 Bad Request status code and an error message.
curl -X POST -H "Content-Type: application/json" -d '{"weight":50,"pricePerKg":10,"wateringMethod":"full-cost"}' https://do-calculate.com/api/calculate-fruits-zakat