SELECT distinct 
    aia.invoice_id,
    aia.invoice_num,
    aia.invoice_date,
    aia.invoice_amount,
    aia.invoice_currency_code,
    aia.payment_currency_code,
    aia.gl_date,
    xah.period_name,
    aia.payment_method_code,
    xah.je_category_name,
    xev.event_id,
    xte.ENTITY_CODE
    ,xte.APPLICATION_ID
    ,xte.legal_entity_id
    ,source_id_int_1
    ,source_application_id
    ,source_id_int_2
    ,source_id_char_1
    ,gjh.status
FROM
    ap.ap_invoices_all             aia,
    xla.xla_transaction_entities   xte,
    xla.xla_events                 xev,
    xla.xla_ae_headers             xah,
    xla.xla_ae_lines               xal,
    gl_import_references           gir,
    gl_je_headers                  gjh,
    gl_je_lines                    gjl,
    gl_code_combinations           gcc
WHERE
    aia.invoice_id = xte.source_id_int_1
    AND xev.entity_id = xte.entity_id
    AND xah.entity_id = xte.entity_id
    AND xah.event_id = xev.event_id
    AND xah.ae_header_id = xal.ae_header_id
    AND xah.je_category_name = 'XX_CATEGORY_NAME'--Purchase Invoices
    AND xah.gl_transfer_status_code = 'Y'
    AND xal.gl_sl_link_id = gir.gl_sl_link_id
    AND gir.gl_sl_link_table = xal.gl_sl_link_table
    AND gjl.je_header_id = gjh.je_header_id
    AND gjh.je_header_id = gir.je_header_id
    AND gjl.je_header_id = gir.je_header_id
    AND gir.je_line_num = gjl.je_line_num
    and gjh.name='XX_JOURNAL_NAME'
    and aia.invoice_num='XX_INVOICE_NUM';
DECLARE
p_event_source_info xla_events_pub_pkg.t_event_source_info;

lv_valuation_method VARCHAR2(100) :=null;
lv_security_context xla_events_pub_pkg.t_security;
BEGIN

p_event_source_info.source_application_id := 200; --101 GL -- 602 XLE
p_event_source_info.application_id := 200; -- AR
p_event_source_info.legal_entity_id := 23273;
p_event_source_info.ledger_id := 2021;
p_event_source_info.entity_type_code := 'AP_INVOICES';
p_event_source_info.transaction_number := NULL;
p_event_source_info.source_id_int_1 := 138348; -- Customer Transaction ID;
p_event_source_info.source_id_int_2 := NULL;
p_event_source_info.source_id_int_3 := NULL;
p_event_source_info.source_id_int_4 := NULL;
p_event_source_info.source_id_char_1 := NULL;
p_event_source_info.source_id_char_2 := NULL;
p_event_source_info.source_id_char_3 := NULL;
p_event_source_info.source_id_char_4 := NULL;

xla_events_pub_pkg.delete_event
(p_event_source_info => p_event_source_info,
p_event_id => 154087, -- xla_events
p_valuation_method =>lv_valuation_method,
p_security_context => lv_security_context
);

DBMS_OUTPUT.put_line('Process completed');
commit;

exception when others then

DBMS_OUTPUT.put_line('Error:'||SQLERRM);
END;
/

** To Find Parameters used in API navigate to below page :