- Step by Step :Using Receipt API ->Apply On Account (Scenario 3) 
- Step by Step :Using Receipt API ->Creating cash and apply (Scenario 2) 
- Step by Step :Using Receipt API ->Create Cash Receipt (Scenario 1) 
What is senarios here
The senario which going to discuss here is "Reverse Receipt"
The senarios is very simple as cancel, you basically booked the transaction and then reverse it to make net effect zero.
Typically senarios is when Customer is ready to pay, you created Receipt and submitted a cheque in Bank and then bank inform there is issue with Cheque ,in that case you are simply reversing the transaction and notify the customer.
Which API is being used
Call this routine Ar_receipt_api_pub.Reverse to reverse.
This is applicable to reversal of both cash as well Misc.
Step to use the API
You have to perform these steps in order to get API executed
Step 1 : Identification of some mandatory and key column of API
Once you identify the key and mandatory column , you have 50% done. What is recomended for you to check the API version in irep with your EBS version.
Here is the example.
First you need to create a cash Receipt .
The other Information for Onaccount mapping are here:
Step 2 : Idetify and the mandatory column and must do pre-requsite setup for receipt.
Your Payment method , underline bank, respective accounting details must be pre-requiste step up for creating a receipt in Oracle.
The mandatory requirement is Customer master with valid bill to and a valid transaction that must be open.
The other mandatory column here is to pass the reason and code that must be from setup.
Input from these two screens are used to pass the value in the API's
Step 3: You need to initialize the apps_initialize pacakge
For this you have to follow these steps:
Run the query 1
- SELECT USER_ID FROM FND_USER
- WHERE USER_NAME='USER_NAME';
Run the query 2
- SELECT application_id FROM fnd_application
- WHERE application_short_name LIKE 'APPL_SHRT_NAME';
Run the query 3
- SELECT RESPONSIBILITY_ID
- FROM FND_RESPONSIBILITY
- WHERE APPLICATION_ID=222;
Run the query 4
Run this script  in your Toad or Sql*Plus Client , this will initialize the apps.
Alternatively you can use fnd_global.apps_initialize(1290,51118,222) before calling API.
Step 4: Run this script  in Toad or sql*plus and once the procedure executed verify the details from front end.
Assuming You have already created 500 cash Receipt in system and now you need to reverse this:
- This IS been tested AND used IN 11i10.2 . WITH little modification you can USE IN R12. Here IS api code IN <a href="http://a">text</a> file.
Final verifictaion here is two steps , you need to verify first after creating cash Receipt of 500 and then you need to reverse this.
Steps 1 : Query for Receipt Number 'HUB-TEST4'(As Example discussed above). The below screen shows the created cash receipt
Steps 2 : Once you run the API Query for Receipt Number 'HUB-TEST4'(As Example discussed above). The below screen shows the entry after reversal. You can see the details in Receipt History.