You can connect with the API by sending a POST request to the following endpoint:
https://do-calculate.com/api/calculate-silver-zakat
Request Body:
The API expects a JSON object in the request body with the following properties:
{ "silverWeight": 670, "gramPriceSilver": 13000, "yearType": "gregorian" }
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": { "silverZakatAmount": 224456.7, "silverZakatDuty": "Yes", "silverWeightThreshold": 595, "moneyZakatAmount": 5784.25 } }
If the request is missing any of the required properties (silverWeight, gramPriceSilver, or yearType), 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 '{"silverWeight":670,"gramPriceSilver":13000,"yearType":"gregorian"}' https://do-calculate.com/api/calculate-silver-zakat