creating Payable Invoice using Rest Service

                               Creating a Ap invoice Using Rest API

First login into fusion instance 

Username : fin_impl

password : ...........

Navigate to invoice page

Invoice creation in front end (UI)

Navigation: click on navigator -->payables-->invoices-->then click on task bar 

then click on  Create invoice

The below page will open 



give the all mandatory fields to create an invoice

BU,Inv No, Supplier, amount

then create an invoice lines to the invoice 

This same process we need to do in rest service

Create an AP invoice using Rest API

Then open postman give the Request Url for creating a payable invoice

Request Url: https://fa-esll-saasfademo1.ds-fa.oraclepdemos.com/fscmRestApi/resources/11.13.18.05/invoices

Use Post method to creating an invoice 

Paste the request url 

then click on Body 

and then select Raw ,then select JSON

paste the JSON request payload

Request Payload:

-------------------------

Then give the Request payload:

{
    "InvoiceNumber""a2cf_inv1",
    "InvoiceCurrency""USD",
    "InvoiceAmount"2212.75,
    "InvoiceDate""2023-04-08",
    "BusinessUnit""US1 Business Unit",
    "Supplier""ABC Consulting",
    "SupplierSite""ABC US1",
    "Description""A2cf traings",
   
    "invoiceLines": [{
        "LineNumber"1,
        "LineAmount"2112.75,
   
        "invoiceDistributions": [{
            "DistributionLineNumber"1,
            "DistributionLineType""Item",
            "DistributionAmount"2112.75,
            "DistributionCombination""101.10.65110.110.000.000"
   
        }]
        },
        {
            "LineNumber"2,
            "LineType""Freight",
            "LineAmount"100,
            "ProrateAcrossAllItemsFlag"true
        }]
   
}

In this JSON payload we are creating two lines to invoice



Here we are using Invoicenumber : a2cf_inv1

mandatory fields to create invoice

"InvoiceNumber""a2cf_inv1",
    "InvoiceCurrency""USD",
    "InvoiceAmount"2212.75,
    "InvoiceDate""2023-04-08",
    "BusinessUnit""US1 Business Unit",
    "Supplier""ABC Consulting",
    "SupplierSite""ABC US1",
    "Description"A2cf traings


Then give the Basic Authentication

Username: fin_impl

password: ............



Then Run the payload (click on Send Button)

Then in front end Either invoice created or not

and also check in back end tables

Front end checking

Navigation: click on navigator -->payables-->invoices-->then click on task bar 

then click on  Manage invoice

Give the invoice number what i created in rest api

Invoice number : a2cf_inv1

Then click on search

Here we can see the Invoice got create

if you want to see line details click on invoice number then we can see line information

then check in base tables

select * from Ap_invoices_all where invoice_num ='a2cf_inv1'

go to analytics create a new data model  then create a data set and then paste it and test the results



We are getting data from back end tables as well

If you want line  data too add another table ap_invoice_lines_all

and then give the join to two tables with invoice_id 


No comments: