You can connect with the API by sending a POST request to the following endpoint:
https://do-calculate.com/api/calculate-gold-zakat
Request Body:
The API expects a JSON object in the request body with the following properties:
{ "goldWeights": [ 44, 0, 11, 70, 50 ], "goldKarats": [ 18, 21, 22, 22, 0 ], "gramPriceGold": 0, "yearType": "hijri" }
The API will respond with a JSON object containing the calculated Zakat on gold, the threshold, and the Zakat duty as shown in the following example:
{ "result": { "totalPureGoldWeight": 107.24999999999999, "goldZakatDuty": "yes", "moneyZakatAmount": 0, "goldZakatAmount": 2.6812499999999995, "goldWeightThreshold": 85 } }
If the request is missing any of the required properties (goldWeights, goldKarats, gramPriceGold, 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 '{"goldWeights":[44,0,11,70,50],"goldKarats":[18,21,22,22,0],"gramPriceGold":0,"yearType":"hijri"}' https://do-calculate.com/api/calculate-gold-zakat