You can manage this using client variable. Create a client variable and set default value as a false.
After calling the API set this client variable value as True. While calling API check if client variable value is false then call API.
Reset the client variable value when user go for the another payment.
Thanks
Vinod