You can connect with the API by sending a POST request to the following endpoint:
https://do-calculate.com/api/calculate-animals-zakat
Request Body:
The API expects a JSON object in the request body with the following properties:
{ "camelCount": 0, "cowCount": 311, "sheepCount": 23 }
The API will respond with a JSON object containing the calculated Zakat details for each animal type:
{ "result": { "sheep": { "zakatDuty": "no", "zakatAmount_1": 0, "description_en_1": "", "description_ar_1": "" }, "cow": { "zakatDuty": "yes", "zakatAmount_1": 10, "description_en_1": "One-year-old (Male or Female)", "description_ar_1": "تبيع ( ذكر أو أنثى - عمره عام)", "operator": "or", "zakatAmount_2": 7, "description_en_2": "Two-year-old (Female)", "description_ar_2": "مسنة (عمرها عامين)" }, "camel": { "zakatDuty": "no" } } }
If the request is missing any of the required properties (camelCount, cowCount, or sheepCount), 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 '{"camelCount":0,"cowCount":311,"sheepCount":23}' https://do-calculate.com/api/calculate-animals-zakat