Tuesday, 27 July 2021

Assign ExternalBankAccount to the Supplier Site

 Scope:

     In this post, we see how to assign an external bank account to the supplier site. Prerequisite for this external bank account already created. Please see here to know how to create an external bank account https://oraclejourney2cloud.blogspot.com/2021/07/create-external-bank-account-in-oracle.html  

Requirement:

 We need to assign the already created external bank account to the supplier site level

How to: 

In this example, we have taken an existing external bank account that was created for the supplier level. 

Note: there is no option to create an external bank account at the site level directly. First, it has to be created at the supplier (create +owner) and after that at the site is assigned with Instrument API.

A. Using bellow queries to identify data for Instrument assignment Rest API.

1. Identify the Payee ID (supplier ID)

select * from hz_parties where party_name = ‘Dummy supplier';

Payee_id = 12444

2. Identify the Supplier site ID

Select * from hz_party_sites where  party_id = '12444' and party_site_name = ‘Dummy site name’;

Payee_site_id = 172725

3. Identify the External bank account ID

select * from iby_ext_bank_accounts where bank_account_name = ‘Dummy bank account';

Ext_bank_account_id = 1

4. Identify the external payee id for this supplier site

select * from IBY_EXTERNAL_PAYEES_ALL where Payee_party_id = 12444 and party_site_id = '172725';

Ext_payee_id = 300100027626399

B. Rest Api Instrument assignment

Api: https://<hostname>//fscmRestApi/resources/11.13.18.05/instrumentAssignments

Payload Used:

    "PaymentPartyId": 300100027626399,

    "PaymentInstrumentId": 1,

    "PaymentFlow": "DISBURSEMENTS",

    "PaymentInstrumentType": "BANKACCOUNT",

    "Intent": "Supplier",

    "StartDate": "2020-10-29"

}

Where 

PaymentPartyId = Ext_payee_id for supplier site.

PaymentInstrumentId = External bank account ID.

Response:

{

    "PaymentInstrumentAssignmentId": 300100234993900,

    "PaymentPartyId": 300100027626399,

    "PaymentInstrumentId": 1,

    "PaymentFlow": "DISBURSEMENTS",

    "PaymentInstrumentType": "BANKACCOUNT",

    "PrimaryIndicator": "Y",

    "StartDate": "2020-10-29",

    "EndDate": "4712-12-31",

    "MaskedBankAccountNumber": "XXXX4147",

    "MaskedCreditCardNumber": null,

    "VendorId": null,

    "PersonId": null,

    "Intent": "Supplier",

}

No comments:

Post a Comment