Wednesday, 30 November 2022

Rest API to Activate and Deactivate the Integration in OIC


URL:  
https:/Host/ic/api/integration/v1/integrations/Id

Headers

Content-Type : application/json; charset=utf-8

X-HTTP-Method-Override: PATCH

Method : POST 

URL: https:/Host/ic/api/integration/v1/integrations/TestINT|01.00.0000

To deactivate a Integration.

{

    "status":"CONFIGURED"

}

To Activate a integration

{

"status":"ACTIVATED"

}

Response :

{

    "type": "integrationRs",

    "links": [],

    "status": "ACTIVATED",

    "compatible": false,

    "lockedFlag": false,

    "scheduleApplicableFlag": false,

    "scheduleDefinedFlag": false,

    "tempCopyExists": false,

    "totalEndPoints": 0,

    "stopScheduleForDeactivation": false

}

 


Query to retrieve User Roles Assigned to a user in Oracle Fusion

 SELECT pu.username,prdt.role_id,

prdt.role_name,

prd.role_common_name

FROM per_user_roles pur,

per_users pu,

per_roles_dn_tl prdt,

per_roles_dn prd

WHERE pu.user_id = pur.user_id

AND pu.username = :P_USERNAME

AND prdt.role_id = pur.role_id

AND prdt.role_id = prd.role_id

AND prdt.language = 'US'

AND pu.active_flag = 'Y'

ORDER BY pu.username, prdt.role_name

Tuesday, 7 June 2022

Query to get AP Invoice lines Tax details in Oracle Fusion

 SELECT aia.invoice_num,
       xep.name                 Legal_Entity_Name,
       psv.vendor_name          party,
       aila.line_number         Line_Ref,
       aila.line_type_lookup_code,
       gcc.segment1             Distribution_entity,
       zl.tax_amt               Tax_amount,
       zl.tax_regime_code       Tax_regime,
       zl.tax_jurisdiction_code Tax_Juridiction,
       zl.taxable_amt           TaxableAmt,
       ZE.exception_reason_code Exemption_Reason,
       ZE.tax_rate_code         Exemption_Rate,
       zrb.country_code         Country_of_taxation,
       zl.tax_line_number       Tax_Line_Ref,
       zl.tax,
       zl.tax_rate_code,
       zl.tax_rate
FROM   ap_invoices_all aia,
       poz_suppliers_v psv,
       xle_entity_profiles xep,
       ap_invoice_lines_all aila,
       gl_code_combinations gcc,
       ap_invoice_distributions_all aida,
       zx_lines zl,
       zx_status_b zsb,
       zx_exceptions ze,
       zx_regimes_b zrb
WHERE  1 = 1
       AND psv.vendor_id = aia.vendor_id
       AND aia.legal_entity_id = xep.legal_entity_id(+)
       AND aia.invoice_id = aila.invoice_id
       AND aila.invoice_id = aida.invoice_id
       AND aila.line_number = aida.invoice_line_number
       AND aia.invoice_id = zl.trx_id(+)
       AND aila.line_number = zl.trx_line_number(+)
       AND zl.application_id(+) = 200
       AND ze.tax_exception_id(+) = zl.tax_exception_id
       AND zsb.tax_status_id = zl.tax_status_id
      AND zl.tax_regime_id = zrb.tax_regime_id
       AND aida.dist_code_combination_id = gcc.code_combination_id
       AND ( aida.line_type_lookup_code = 'MISCELLANEOUS'
              OR aida.line_type_lookup_code = 'FREIGHT'
              OR aida.line_type_lookup_code = 'ITEM' )
       AND zsb.tax_status_code = 'EXEMPT' 

Thursday, 19 May 2022

Query to Get Purchase Category hierarchy In oracle Fusion

 SELECT (SELECT category_name

                 FROM   por_browse_categories_tl pbct

                 WHERE  pbct.category_id = picpl.level1_cat_id) Level_1_Name,

                (SELECT category_name

                 FROM   por_browse_categories_tl pbct

                 WHERE  pbct.category_id = picpl.level2_cat_id) Level_2_Name,

                (SELECT category_name

                 FROM   por_browse_categories_tl pbct

                 WHERE  pbct.category_id = picpl.level3_cat_id) Level_3_Name

FROM   por_item_cat_parent_levels picpl

WHERE  picpl.type = 'SOURCING'

ORDER  BY level_1_name,

          level_2_name,

          level_3_name

Wednesday, 4 May 2022

Sample payload To Create a Payables Invoice using Rest API in Oracle Fusion

Rest API : https://Host/fscmRestApi/resources/latest/invoices 

Method: Post

Sample payload 

{
    "InvoiceNumber": "Test_Rest_007",
    "InvoiceCurrency": "USD",
    "InvoiceAmount": 2112.75,
    "InvoiceDate": "2022-05-02",
    "BusinessUnit": "Business Unit",
      "InvoiceSource": "Manual invoice entry",
        "InvoiceType": "Standard",
  "PayGroup":"Refund",
    "Supplier": "Test Supplier ",
    "SupplierSite": "MAIN",
       "LiabilityDistribution": "100.00000.20501.00000.000",
    "invoiceLines": [
        {
            "LineNumber": 1,
            "LineAmount": 2112.75,
            "Description": null,
            "invoiceDistributions": [
                {
                    "DistributionLineNumber": 1,
                    "DistributionLineType": "Item",
                    "DistributionAmount": 2112.75,
                    "DistributionCombination": "100.00000.60005.00000.000"
                }
            ]
        }
    ]
}

Query to get Account Segment Description

 SELECT gl_flexfields_pkg.get_description_sql

                                     (chart_of_accounts_id,--- chart of account id

                                      1,----- Position of segment

                                      segment1 ---- Segment value

                                     )

FROM gl_code_combinations

Query to get concatenated Code combination of a code combination id

 SELECT gl_flexfields_pkg.get_concat_description

                                          (chart_of_accounts_id,

                                           code_combination_id)

            FROM gl_code_combinations

Wednesday, 6 April 2022

query to get Expense report number invoice number and payment number in Oracle Fusion

 select 
i.invoice_number,
c.check_number,
p.payment_number,
eer.expense_report_num
from
AP_INVOICES_ALL i,
AP_CHECKS_ALL c,
AP_INVOICE_PAYMENTS_ALL p,
EXM_EXPENSE_REPORTS eer
where p.invoice_id = i.invoice_id
and c.check_id = p.check_id
and i.REFERENCE_KEY1=eer.EXPENSE_REPOrt_id
and i.PRODUCT_TABLE='EXM_EXPENSE_REPORTS'

Tuesday, 5 April 2022

Rest API to create Supplier in Oracle Fusion

 Rest API:  https://HOST/fscmRestApi/resources/11.13.18.05/suppliers

Method: POST

Request Payload:

{
  "Supplier" : "Test Supplier",
  "TaxOrganizationType" : "Corporation",
  "SupplierType" : "Supplier",
  "BusinessRelationship" : "Spend Authorized",
  "DUNSNumber" : "221132556",
  "OneTimeSupplierFlag" : false,
  "TaxpayerCountry" : "United States",
  "TaxpayerId" : "98-01234567"
}

Response :

{
    "SupplierId": 300000127675805,
    "SupplierPartyId": 300000127675806,
    "Supplier": "Test Supplier",
    "SupplierNumber": "20029",
    "AlternateName": null,
    "TaxOrganizationTypeCode": "CORPORATION",
    "TaxOrganizationType": "Corporation",
    "SupplierTypeCode": "SUPPLIER_GH",
    "SupplierType": "Supplier",
    "InactiveDate": null,
    "Status": "ACTIVE",
    "BusinessRelationshipCode": "SPEND_AUTHORIZED",
    "BusinessRelationship": "Spend Authorized",
    "ParentSupplierId": null,
    "ParentSupplier": null,
    "ParentSupplierNumber": null,
    "CreationDate": "2022-04-05T17:49:39.001+00:00",
    "CreatedBy": "pinky.mukherjee@pwc.com",
    "LastUpdateDate": "2022-04-05T17:49:46.911+00:00",
    "LastUpdatedBy": "pinky.mukherjee@pwc.com",
    "CreationSourceCode": "WEB_SERVICE",
    "CreationSource": "Web Service",
    "DataFoxScore": null,
    "DataFoxScoringCriteria": null,
    "Alias": null,
    "DUNSNumber": "221132556",
    "OneTimeSupplierFlag": false,
    "RegistryId": "SUP_540989",
    "CustomerNumber": null,
    "StandardIndustryClass": null,
    "IndustryCategory": null,
    "IndustrySubcategory": null,
    "NationalInsuranceNumber": null,
    "NationalInsuranceNumberExistsFlag": false,
    "CorporateWebsite": null,
    "YearEstablished": null,
    "MissionStatement": null,
    "YearIncorporated": null,
    "ChiefExecutiveTitle": null,
    "ChiefExecutiveName": null,
    "PrincipalTitle": null,
    "PrincipalName": null,
    "FiscalYearEndMonthCode": null,
    "FiscalYearEndMonth": null,
    "CurrentFiscalYearPotentialRevenue": null,
    "PreferredFunctionalCurrencyCode": null,
    "PreferredFunctionalCurrency": null,
    "TaxRegistrationCountryCode": null,
    "TaxRegistrationCountry": null,
    "TaxRegistrationNumber": null,
    "TaxpayerCountryCode": "US",
    "TaxpayerCountry": "United States",
    "TaxpayerId": "98-01234567",
    "TaxpayerIdExistsFlag": true,
    "FederalReportableFlag": false,
    "FederalIncomeTaxTypeCode": null,
    "FederalIncomeTaxType": null,
    "StateReportableFlag": false,
    "TaxReportingName": null,
    "NameControl": null,
    "VerificationDate": null,
    "UseWithholdingTaxFlag": false,
    "WithholdingTaxGroupId": null,
    "WithholdingTaxGroup": null,
    "BusinessClassificationNotApplicableFlag": false,
    "DataFoxId": null,
    "DataFoxCompanyName": null,
    "DataFoxLegalName": null,
    "DataFoxCompanyPrimaryURL": null,
    "DataFoxNAICSCode": null,
    "DataFoxCountry": null,
    "DataFoxEIN": null,
    "DataFoxLastSyncDate": null,
    "OBNEnabledFlag": null,
    "links": [
        {
            "rel": "self",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805",
            "name": "suppliers",
            "kind": "item",
            "properties": {
                "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000007770400000007737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B0200007870000000017371007E0002000000017372001B6F7261636C652E6A626F2E646F6D61696E2E4E756C6C56616C75655899C1C58DAABEEB02000149000A6D53514C54797065496478700000000C7371007E00020000000171007E00077371007E00020000000171007E000778"
            }
        },
        {
            "rel": "canonical",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805",
            "name": "suppliers",
            "kind": "item"
        },
        {
            "rel": "lov",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/lov/CountryLookup",
            "name": "CountryLookup",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/lov/FiscalYearEndMonthLookup",
            "name": "FiscalYearEndMonthLookup",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/lov/ParentSupplierLookup",
            "name": "ParentSupplierLookup",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/lov/CurrencyLookup",
            "name": "CurrencyLookup",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/lov/BusinessRelationshipLookup",
            "name": "BusinessRelationshipLookup",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/lov/TaxOrganizationTypeLookup",
            "name": "TaxOrganizationTypeLookup",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/lov/SupplierTypeLookup",
            "name": "SupplierTypeLookup",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/lov/FederalIncomeTaxTypeLookup",
            "name": "FederalIncomeTaxTypeLookup",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/lov/WithholdingTaxGroupLookup",
            "name": "WithholdingTaxGroupLookup",
            "kind": "collection"
        },
        {
            "rel": "child",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/child/DFF",
            "name": "DFF",
            "kind": "collection"
        },
        {
            "rel": "child",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/child/addresses",
            "name": "addresses",
            "kind": "collection"
        },
        {
            "rel": "child",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/child/attachments",
            "name": "attachments",
            "kind": "collection"
        },
        {
            "rel": "child",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/child/businessClassifications",
            "name": "businessClassifications",
            "kind": "collection"
        },
        {
            "rel": "child",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/child/contacts",
            "name": "contacts",
            "kind": "collection"
        },
        {
            "rel": "child",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/child/globalDFF",
            "name": "globalDFF",
            "kind": "collection"
        },
        {
            "rel": "child",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/child/productsAndServices",
            "name": "productsAndServices",
            "kind": "collection"
        },
        {
            "rel": "child",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/child/sites",
            "name": "sites",
            "kind": "collection"
        },
        {
            "rel": "action",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/action/scores",
            "name": "scores",
            "kind": "other"
        },
        {
            "rel": "action",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/action/signals",
            "name": "signals",
            "kind": "other"
        },
        {
            "rel": "action",
            "href": "https://Host:443/fscmRestApi/resources/11.13.18.05/suppliers/300000127675805/action/submitSpendAuthorizationRequest",
            "name": "submitSpendAuthorizationRequest",
            "kind": "other"
        }
    ]
}

Rest API to Get Legal entity details

 Method: Get

Rest API: https://<Host>/fscmRestApi/resources/11.13.18.05/legalEntitiesLOV/{legal_entity}

Response :
{
    "LegalEntityId": 300000000000000,
    "Name": "Legal Entity",
    "LegalEntityIdentifier": "000",
    "EffectiveFrom": null,
    "EffectiveTo": null,
    "PartyId": 300000055721140,
    "links": [
        {
            "rel": "self",
            "href": "https://Server:443/fscmRestApi/resources/11.13.18.05/legalEntitiesLOV/300000000000000",
            "name": "legalEntitiesLOV",
            "kind": "item"
        },
        {a
            "rel": "canonical",
            "href": "https://Server:443/fscmRestApi/resources/11.13.18.05/legalEntitiesLOV/300000000000000",
            "name": "legalEntitiesLOV",
            "kind": "item"
        }
    ]
}



Rest API to Get Business unit Details

Method: Get

Rest API: https://<Host>/hcmRestApi/resources/11.13.18.05/hcmBusinessUnitsLOV/{BusinessUnitId}

Response:

{
    "BusinessUnitId": 300000000000000,
    "Name": "Business Unit",
    "Status": "BU",
    "links": [
        {
            "rel": "self",
            "href": "https://Server/hcmRestApi/resources/11.13.18.05/hcmBusinessUnitsLOV/300000000000000",
            "name": "hcmBusinessUnitsLOV",
            "kind": "item"
        },
        {
            "rel": "canonical",
            "href": "https://Server/hcmRestApi/resources/11.13.18.05/hcmBusinessUnitsLOV/300000000000000",
            "name": "hcmBusinessUnitsLOV",
            "kind": "item"
        }
    ]
}

Query to get Purchase Order and requisition in Oracle Fusion

SELECT
POH.PO_HEADER_ID,
POH.SEGMENT1  ,
PRHA.REQUISITION_NUMBER
FROM
PO_HEADERS_ALL POH,
PO_DISTRIBUTIONS_ALL PDA ,
POR_REQ_DISTRIBUTIONS_ALL PRDA ,
POR_REQUISITION_LINES_ALL PRLA ,
POR_REQUISITION_HEADERS_ALL PRHA
WHERE 1=1
AND POH.PO_HEADER_ID = PDA.PO_HEADER_ID
AND PDA.REQ_DISTRIBUTION_ID = PRDA.DISTRIBUTION_ID
AND PRDA.REQUISITION_LINE_ID = PRLA.REQUISITION_LINE_ID
AND PRLA.REQUISITION_HEADER_ID = PRHA.REQUISITION_HEADER_ID
AND PRHA.REQUISITION_NUMBER = <Requsition_number>

Wednesday, 9 March 2022

Rest API to Terminate a worker in Oracle Fusion

Method: Post

Header 

Content-Type : application/vnd.oracle.adf.action+json

Rest API: https://<Host>/hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships/{PeriodOfServiceId}

Sample Payload 

{
"actionCode": "RESIGNATION",
"terminationDate": "2022-03-01",
"reasonCode":"RESIGN_PERSONAL",
"notificationDate":"2022-03-01",
"recommendedForRehire":"ORA_NS"
}

Response

{
    "result": "true"
}

Status

200 OK

Saturday, 5 March 2022

query to get legal entity and business Unit name

SELECT

hou.name BU_NAME,

hou.SHORT_CODE ,

le.NAME Legal_ENtity,

led.NAME Ledger_Name

FROM

hr_operating_units hou,

xla_gl_ledgers led,

Xle_entity_profiles le

WHERE

hou.default_legal_context_id = le.legal_entity_id

AND led.ledger_id = hou.set_of_books_id

Friday, 4 March 2022

Wednesday, 2 February 2022

Sample REST Payload to create employee in Oracle Fusion

RESTAPI WSDL for oracle Fusion

 WSDL: https://<Hostname>/hcmRestApi/resources/11.13.18.05/emps


Sample payload to create Employee in oracle Fusion

{
    "Salutation": "MR.",
    "LegalEntityId": 3000000099999988,
    "FirstName": "FirstName",
    "MiddleName": "NA",
    "LastName": "LastName",
    "DisplayName": "FirstName LastName",
    "WorkEmail": "FirstName.LastName@test.com",
    "CitizenshipLegislationCode": "US",
    "CitizenshipStatus": "A",
    "DateOfBirth": "1990-09-09",
    "Gender": "M",
    "UserName": "USERNAME",
    "assignments": [
        {
            "AssignmentName": "TEST_Assignment_1",
            "BusinessUnitId": 300000009999,
            "ActionCode": "HIRE",
            "ActionReasonCode": "NEWHIRE",
            "AssignmentStatus": "ACTIVE",
            "WorkTaxAddressId": null,
            "ManagerType": "LINE_MANAGER"
        }
    ]
}