how to add Prepayment to Customer in Peachtree with help of API

SOLVED

hi, 

from last few days i am searching on how to add prepayment to customers in Peachtree,

I need to replicate below mentioned functionality of Sage 50 in my app using API

- Receive Money ~> Receive Money from Customer

- select customer

- check the prepayment checkbox.

- save the payment

it will generate an invoice in negative amount, and when we try to view that invoice system says "This is a beginning balance or a prepayment you can not view it."

I want to do the same thing in my application using Sage API.

Right now i can do the same thing by using PeachwServer.dll by passing perpayment as TRUE and invoice amount in negative, but I want to achieve this functionality while using API 

Please let me know how i can do the same thing by using Peachtree API

Thanks