You can connect with the API by sending a POST request to the following endpoint:
https://do-calculate.com/api/calculate-trade-zakat
Request Body:
The API expects a JSON object in the request body with the following properties:
{ "merchandise": 12000, "cash": 6000, "debtsReceivable": 3500, "debtsPayable": 1700, "yearType": "hijri", "gramPriceGold": 10000, "gramPriceSilver": 0 }
The API will respond with a JSON object containing the calculated Zakat on money, the threshold, and the Zakat duty as shown in the following example:
{ "result": { "zakatDuty": "no", "moneyAmout": 19800, "threshold": 850000, "tradeZakat": 0 } }
If the request is missing any of the required properties (merchandise,cash,debtsReceivable,debtsPayable 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 '{"merchandise":12000,"cash":6000,"debtsReceivable":3500,"debtsPayable":1700,"yearType":"hijri","gramPriceGold":10000,"gramPriceSilver":0}' https://do-calculate.com/api/calculate-trade-zakat