Success and Error functions are not triggering in API call

I saw the documentation of making ajax call in Frappe :

frappe.call({
    method: "",
    type: "POST",
    args: {},
    success: function(r) {},
    error: function(r) {},
    always: function(r) {},
    btn: opts.btn,
    freeze: false,
    freeze_message: "",
    async: true,
    url: "" || frappe.request.url,
});

In this success and error function is not triggering after getting the response.

You are absolutely spot on, I don’t know exactly the reason for that, but you can try “callback” instead of using “success” or “error”, and handle them yourself.