Error in creating payment entry through api

,

Cannot Pay to Customer without any negative outstanding invoice

Can you share what you have tried doing so far?

Maybe you can make an Advance entry (via Journal Entry?)

it worked , thank you

how it work ?
thank you in advance