Skip to Main Content



For appeals, questions and feedback, please email

Error while calling rest api from utl_http from oracle database.

We have a requirement to create Debit memo in Payables in fusion cloud application hence we are using the API '/fscmRestApi/resources/' from an Oracle database custom procedure we are using utl_http to pass the json payload, but we are getting error message as 'You must provide a valid value for the Distribution Combination attribute. (AP-810667)'
utl_http.set_header(lv_http_req, 'content-length', lengthb(p_rest_payload));
utl_http.write_raw(lv_http_req, utl_raw.cast_to_raw(p_rest_payload));

where p_rest_payload is the payload,
"InvoiceNumber": "Debit_memo_45",
"InvoiceCurrency": "USD",
"InvoiceAmount": "-10",
"InvoiceDate": "2023-12-05",
"BusinessUnit": "US BU",
"Supplier": "Test Supplier",
"SupplierSite": "TEST1",
"Description": "DM 45",
"InvoiceType": "Debit memo",
"invoiceLines": [{
"LineNumber": 1,
"LineAmount": "-10",
"Description": "DM 45 line",
"DistributionCombination": "0009-0000-9999-9999-10000-99999-0000-9999999"

But when we tested this payload through postman, the debit memo got created successfully without any issue with the help of same api,
Also, if we don't pass the DistributionCombination in from database call, then the Debit memo is getting created, so it means utl_https function has some issue while passing DistributionCombination, could you please assist us in debugging the issue with utl_https function.

Post Details
Added on Jan 11 2024