Create Customer Account API

TCA Create Customer Account API

Name of the API : CREATE CUSTOMER ACCOUNT API
Base Tables Affected : HZ_CUST_ACCOUNTS, HZ_CUSTOMER_PROFILES
PL/SQL Procedure used : CREATE_CUST_ACCOUNT
Package Used : HZ_CUST_ACCOUNT_V2PUB

Mandatory Parameters :
Parameter Name Parameter Type Data Type
p_init_msg_list         IN  VARCHAR2:= FND_API.G_FALSE
p_cust_account_rec      IN  CUST_ACCOUNT_REC_TYPE
p_person_rec            IN  HZ_PARTY_V2PUB.PERSON_REC_TYPE
p_customer_profile_rec  IN  HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE
p_create_profile_amt    IN  VARCHAR2:= FND_API. G_TRUE
x_cust_account_id       OUT NUMBER
x_account_number        OUT VARCHAR2
x_party_id              OUT NUMBER
x_party_number          OUT VARCHAR2
x_profile_id            OUT NUMBER
x_return_status         OUT VARCHAR2
x_msg_count             OUT NUMBER
x_msg_data              OUT VARCHAR2

Procedure:

Note: p_create_profile_amt indicates whether to create profile amounts for the customer profile being created. If value equals to FND_API.G_TRUE, profile amounts will be created by copying over the profile amounts for the profile class on which this customer profile is based.

General Tips for Running the Create Customer Account API (Person):

a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN createperson.sql)
b) Enter the Values for the Parameters Account Name, First Name and Last Name from the SQL prompt.
c) Set the organization id before running the script as :
EXEC fnd_client_info.set_org_context(‘<orgid>’); for 11i
OR For R12
EXEC mo_global.init (‘AR’);
EXEC mo_global.set_org_context(<org_id>, NULL, ‘AR’);
EXEC fnd_global.set_nls_context(‘AMERICAN’);
EXEC mo_global.set_policy_context(‘S’, <org_id>);

Example For Running a Create Customer Account API (Person) For an Existing Party:

 Sample Output of the Create Customer Account Script (Person):

x_return_status = S
x_msg_count = 0
Party Id = 550707
Party Number = 60490
Profile Id =
x_msg_data =

Script To Verify whether Create Customer Account API (Person) is successful:

 Example For Running a Create Customer Account API (Person) For a New Party:

 Result:

x_return_status = S
x_msg_count = 0
Party Id = 554754
Party Number = 60594
Profile Id = 559833
x_msg_data =

Script To Verify whether Create Customer Account API (Person) is successful:

 

 

 

Related posts:

Leave a Reply