cXML-1-2-007-InvoiceDetailRequest-In
The data mapping and sample payload for cXML-1-2-007-InvoiceDetailRequest-In message definition are outlined in this section.
Data Mapping
You can access the XSD file by exporting the message transformation package for additional information. Mapping an invoice header creates one row in InvoiceInterfaceHeader and zero or more rows in InvoiceInterfaceLine as outlined in this table.
Invoice Header Mapping
Interface |
Payload and Processing Rules |
Value Provided in the XSL File |
---|---|---|
InvoiceInterfaceHeader One row in InvoiceInterfaceHeader gets created for every invoice |
N/A |
N/A |
Source |
N/A |
B2B XML INVOICE |
VendorId |
Derived from the Purchase Order |
N/A |
VendorSiteId |
Derived from the Purchase Order |
N/A |
Description |
/InvoiceDetailRequest/InvoiceDetailRequestHeader/Comments |
N/A |
InvoiceAmount |
InvoiceDetailRequest/InvoiceDetailSummary/DueAmount/Money if present in the payload, otherwise map /InvoiceDetailRequest/InvoiceDetailSummary/NetAmount/Money |
N/A |
InvoiceCurrencyCode There's a predefined DVM in use for this field. |
/InvoiceDetailRequest/InvoiceDetailSummary/DueAmount/Money/@currency If present in the payload, otherwise map. InvoiceDetailRequest/InvoiceDetailSummary/NetAmount/Money/@currency |
N/A |
InvoiceDate |
/InvoiceDetailRequest/InvoiceDetailRequestHeader/@invoiceDate |
N/A |
InvoiceNumber |
/InvoiceDetailRequest/InvoiceDetailRequestHeader/@invoiceID |
N/A |
InvoiceTypeLookupCode |
Note: This value is set in the XSL, if the InvoiceAmount is negative then the "InvoiceTypeLookupCode" is set to CREDIT otherwise it's set to STANDARD. |
STANDARD or CREDIT |
LegalEntityId |
Derived from the Purchase Order |
N/A |
ShipToLocation |
/InvoiceDetailRequest/InvoiceDetailRequestHeader/Extrinsic[@name='SHIPTOPARTNRIDX'] |
N/A |
B2BProgramName |
N/A |
AP_INV_B2B_SOA |
InvoiceInterfaceLine |
N/A |
N/A |
InvoiceInterfaceLine with LineTypeLookupCode=FREIGHT |
One InvoiceInterfaceLine with LineTypeLookupCode=FREIGHT is created for an invoice, if the /InvoiceDetailRequest/InvoiceDetailSummary/ShippingAmount is present. |
N/A |
Amount |
/InvoiceDetailRequest/InvoiceDetailSummary/ShippingAmount/Money |
N/A |
InvoiceInterfaceLine with LineTypeLookupCode=MISCELLANEOUS |
One InvoiceInterfaceLine with LineTypeLookupCode=MISCELLANEOUS is created for an invoice, if the /InvoiceDetailRequest/InvoiceDetailSummary/SpecialHandlingAmount is present. |
MISCELLANEOUS |
Amount |
/InvoiceDetailRequest/InvoiceDetailSummary/SpecialHandlingAmount/Money |
N/A |
InvoiceInterfaceLine with LineTypeLookupCode=TAX |
One InvoiceInterfaceLine with LineTypeLookupCode=TAX is created for each TaxDetail, if tax isn't specified at the line level, which can result in multiple InvoiceInterfaceLines being created, one for each InvoiceDetailRequest/InvoiceDetailSummary/Tax/TaxDetail element. |
TAX |
Amount |
/InvoiceDetailRequest/InvoiceDetailSummary/Tax/TaxDetail/TaxAmount/Money |
N/A |
InvoiceInterfaceLine with LineTypeLookupCode=TAX |
One InvoiceInterfaceLine with LineTypeLookupCode=TAX is created for an invoice if tax isn't specified at line level and TaxDetail isn't specified at header level, that's if /InvoiceDetailRequest/InvoiceDetailSummary/Tax/Amount/Money has a value. |
TAX |
Amount |
InvoiceDetailRequest/InvoiceDetailSummary/Tax/Money |
N/A |
Invoice Line Mapping
Invoice Line mapping creates many rows in InvoiceInterfaceLine, one for the item, and zero or more rows for each tax, freight and charge element present in the XML file.
An Invoice Line is represented either by InvoiceDetailRequest/InvoiceDetailOrder OR InvoiceDetailRequest/InvoiceDetailHeaderOrder.
InvoiceDetailOrder Mapping
InvoiceInterfaceLine |
Payload and Processing Rules |
Value Provided in the XSL File |
---|---|---|
InvoiceInterfaceLine where LineTypeLookupCode = ITEM |
N/A |
ITEM |
Amount |
/InvoiceDetailRequest/InvoiceDetailOrder/InvoiceDetailItem/NetAmount/Money If present in the payload, otherwise map. /InvoiceDetailRequest/InvoiceDetailOrder/InvoiceDetailItem/SubtotalAmount/Money |
N/A |
LineGroupNumber |
The LineGroupNumber is derived from the array position of the InvoiceDetailItem element and the parent InvoiceDetailOrder element. LineGroupNumber for invoice lines with InvoiceDetailOrder element: In the cXML message, an invoice can have many InvoiceDetailOrders, and each InvoiceDetailOrder can have many InvoiceDetailItem elements. elements - for example if there are two InvoiceDetailOrder elements, each containing two InvoiceDetailItem, then there will be four InvoiceInterfaceLines created, with LineGroupNumber 1,2,3 and 4 respectively. |
1.n |
PONumber |
/InvoiceDetailRequest/InvoiceDetailOrder/InvoiceDetailOrderInfo/OrderIDInfo/@orderID If present in the payload, otherwise map. /InvoiceDetailRequest/InvoiceDetailOrder/InvoiceDetailOrderInfo/OrderReference/@orderID |
N/A |
POLineNumber |
/InvoiceDetailRequest/InvoiceDetailOrder/InvoiceDetailItem/InvoiceDetailItemReference/@lineNumber |
N/A |
POShipmentNumber |
/InvoiceDetailRequest/InvoiceDetailOrder/InvoiceDetailItem/Extrinsic[@name='SCHLINENUM'] |
N/A |
InvoicedQuantity |
/InvoiceDetailRequest/InvoiceDetailOrder/InvoiceDetailItem/@quantity |
N/A |
UnitOfMeasLookupCode There's a predefined DVM in use for this field. |
/InvoiceDetailRequest/InvoiceDetailOrder/InvoiceDetailItem/UnitOfMeasure |
N/A |
LineLookupCode |
N/A |
TAX |
Amount |
/InvoiceDetailRequest/InvoiceDetailOrder/InvoiceDetailOrderSummary/Tax/Money This is mapped only if TaxDetail isn't specified on the line. The same mapping applies if InvoiceDetailOrder is in the payload. |
N/A |
LineGroupNumber |
The Line Group Number from the parent InvoiceDetailItem is assigned for all TaxDetail rows of an InvoiceDetailItem LineGroupNumber for invoice lines with InvoiceDetailOrder element: In the cXML message, an invoice can have many InvoiceDetailOrders, and each InvoiceDetailOrder can have many InvoiceDetailItem elements. elements - for example if there are two InvoiceDetailOrder elements, each containing two InvoiceDetailItem, then there will be four InvoiceInterfaceLines created, with LineGroupNumber 1,2,3 and 4 respectively. |
N/A |
LineLookupCode |
N/A |
TAX |
Amount |
/InvoiceDetailRequest/InvoiceDetailOrder/InvoiceDetailOrderSummary/Tax/TaxDetail/ TaxAmount/Money There may be many of these lines for an InvoiceDetailOrder. |
N/A |
LineGroupNumber |
The Line Group Number from the parent InvoiceDetailItem is assigned for all TaxDetail rows of an InvoiceDetailItem LineGroupNumber for invoice lines with InvoiceDetailOrder element: In the cXML message, an invoice can have many InvoiceDetailOrders, and each InvoiceDetailOrder can have many InvoiceDetailItem elements. elements - for example if there are two InvoiceDetailOrder elements, each containing two InvoiceDetailItem, then there will be four InvoiceInterfaceLines created, with LineGroupNumber 1,2,3 and 4 respectively. |
N/A |
InvoiceDetailHeaderOrder Mapping
An Invoice Line is represented by InvoiceDetailRequest/InvoiceDetailHeaderOrder if InvoiceDetailRequest/InvoiceDetailOrder isn't present.
InvoiceInterfaceLine |
|
Value in the XSL File |
---|---|---|
InvoiceInterfaceLine where LineTypeLookupCode =ITEM |
N/A |
ITEM |
Amount |
/InvoiceDetailRequest/InvoiceDetailHeaderOrder/InvoiceDetailOrderSummary/NetAmount/Money If present in the payload, otherwise map. /InvoiceDetailRequest/InvoiceDetailHeaderOrder/InvoiceDetailOrderSummary/SubtotalAmount/Money |
N/A |
LineGroupNumber |
The LineGroupNumber is populated based on the array position of the InvoiceDetailHeaderOrder element. LineGroupNumber for invoice lines with InvoiceDetailOrder element: In the cXML message, an invoice can have many InvoiceDetailOrders, and each InvoiceDetailOrder can have many InvoiceDetailItem elements. elements - for example if there are two InvoiceDetailOrder elements, each containing two InvoiceDetailItem, then there will be four InvoiceInterfaceLines created, with LineGroupNumber 1,2,3 and 4 respectively. |
1.n |
PONumber |
/InvoiceDetailRequest/InvoiceDetailHeaderOrder/InvoiceDetailOrderInfo/OrderIDInfo/@orderID If present in the payload, otherwise map. /InvoiceDetailRequest/InvoiceDetailHeaderOrder/InvoiceDetailOrderInfo/OrderReference/@orderID |
N/A |
InvoiceInterfaceLine where LineTypeLookupCode = TAX |
N/A |
TAX |
Amount |
/InvoiceDetailRequest/InvoiceDetailHeaderOrder/InvoiceDetailOrderSummary/Tax/Money This is mapped only if TaxDetail isn't specified on the line. The same mapping applies if InvoiceDetailHeaderOrder is in the payload. |
N/A |
LineGroupNumber |
The Line Group Number from the parent InvoiceDetaillHeaderOrder is assigned for all TaxDetail rows of an InvoiceDetailHeaderOrder. LineGroupNumber for invoice lines with InvoiceDetailOrder element: In the cXML message, an invoice can have many InvoiceDetailOrders, and each InvoiceDetailOrder can have many InvoiceDetailItem elements. elements - for example if there are two InvoiceDetailOrder elements, each containing two InvoiceDetailItem, then there will be four InvoiceInterfaceLines created, with LineGroupNumber 1,2,3 and 4 respectively. |
N/A |
InvoiceInterfaceLine where LineTypeLookupCode = TAX |
N/A |
TAX |
Amount |
/InvoiceDetailRequest/InvoiceDetailHeaderOrder/InvoiceDetailOrderSummary/Tax/TaxDetail/ TaxAmount/Money There may be many of these lines created for an InvoiceDetailHeaderOrder. |
N/A |
LineGroupNumber |
The Line Group Number from the parent InvoiceDetaillHeaderOrder is assigned for all TaxDetail rows of an InvoiceDetailHeaderOrder. LineGroupNumber for invoice lines with InvoiceDetailOrder element: In the cXML message, an invoice can have many InvoiceDetailOrders, and each InvoiceDetailOrder can have many InvoiceDetailItem elements. elements - for example if there are two InvoiceDetailOrder elements, each containing two InvoiceDetailItem, then there will be four InvoiceInterfaceLines created, with LineGroupNumber 1,2,3 and 4 respectively. |
N/A |
InvoiceInterfaceLine where LineTypeLookupCode = TAX |
N/A |
TAX |
Amount |
/InvoiceDetailRequest/InvoiceDetailHeaderOrder/InvoiceDetailOrderSummary/Tax/TaxDetail/ TaxAmount/Money There may be many of these lines created for an InvoiceDetailHeaderOrder. |
N/A |
LineGroupNumber |
The Line Group Number from the parent InvoiceDetaillHeaderOrder is assigned for all TaxDetail rows of an InvoiceDetailHeaderOrder LineGroupNumber for invoice lines with InvoiceDetailOrder element: In the cXML message, an invoice can have many InvoiceDetailOrders, and each InvoiceDetailOrder can have many InvoiceDetailItem elements. elements - for example if there are two InvoiceDetailOrder elements, each containing two InvoiceDetailItem, then there will be four InvoiceInterfaceLines created, with LineGroupNumber 1,2,3 and 4 respectively. |
N/A |
Sample Payload
Here's a sample payload:
<cXML xmlns:xml="http://www.w3.org/XML/1998/namespace" timestamp="2004-01-31T16:23:01-07:00" payloadID="1233444-2004@OSN.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<From>
<Credential domain="DUNS">
<Identity>11111111</Identity>
</Credential>
</From>
<To>
<Credential domain="DUNS">
<Identity>222222222</Identity>
</Credential>
</To>
<Sender>
<Credential domain="OracleSN">
<Identity>SellerIdentity</Identity>
<SharedSecret>welcome</SharedSecret>
</Credential>
<UserAgent>Oracle Supplier Network</UserAgent>
</Sender>
</Header>
<Request>
<InvoiceDetailRequest>
<InvoiceDetailRequestHeader invoiceID="Invoice-1234" purpose="creditMemo" invoiceDate="2020-09-21T01:00:00Z">
<InvoiceDetailHeaderIndicator />
<InvoiceDetailLineIndicator />
<InvoicePartner>
<Contact role="ShipTo" addressID="">
<Name xml:lang="en-US">Bill To Contact Name</Name>
<PostalAddress>
<Street>831 Cape Town Place Street</Street>
<City>San Jose City</City>
<State>CA State</State>
<PostalCode>95133</PostalCode>
<Country isoCountryCode="US">Bill United States Country</Country>
</PostalAddress>
</Contact>
</InvoicePartner>
<InvoicePartner>
<Contact role="remitTo">
<Name xml:lang="en-us">VendorSiteName</Name>
</Contact>
</InvoicePartner>
<InvoicePartner>
<Contact role="billTo">
<Name xml:lang="en-us">VendorSiteName</Name>
</Contact>
</InvoicePartner>
<Comments xml:lang="en-US">Header Comments</Comments>
<Extrinsic name="SHIPTOPARTNRIDX">ShipToLocation</Extrinsic>
</InvoiceDetailRequestHeader>
<InvoiceDetailOrder>
<InvoiceDetailOrderInfo>
<OrderReference orderID="1005037">
<DocumentReference payloadID="" />
</OrderReference>
<MasterAgreementReference>
<DocumentReference payloadID="" />
</MasterAgreementReference>
<OrderIDInfo orderID="1005041">
<!-- If OrderIDInfo element is here, we map its value. If not, we map OrderReference/@orderID. If both are there, this takes precedence-->
</OrderIDInfo>
</InvoiceDetailOrderInfo>
<InvoiceDetailItem invoiceLineNumber="1" quantity="500">
<UnitOfMeasure>Each</UnitOfMeasure>
<UnitPrice>
<Money currency="USD">56.00</Money>
</UnitPrice>
<InvoiceDetailItemReference lineNumber="1">
<ItemID>
<SupplierPartID>RCV-100</SupplierPartID>
</ItemID>
</InvoiceDetailItemReference>
<SubtotalAmount>
<Money currency="USD">456.00</Money>
</SubtotalAmount>
<Tax>
<!-- If this block -InvoiceDetailItem/Tax- is present, we don't map InvoiceDetailSummary/Tax>-->
<Money currency="USD">542</Money>
<TaxDetail category="">
<!-- If TaxDetail is here, we map taxAmount/Money from there. If not, map Tax/Money. If both are there, this takes precedence-->
<TaxAmount>
<Money currency="USD">2</Money>
</TaxAmount>
</TaxDetail>
<!-- added 2nd TaxDetail block to payload -->
<!--<TaxDetail category="">
<TaxAmount>
<Money currency="USD">3</Money>
</TaxAmount>
</TaxDetail> -->
</Tax>
<NetAmount>
<!-- If this block is here, we map NetAmount/Money. If not, map SubtotalAmount/Money. If both are there, this takes precedence-->
<Money currency="USD">123.00</Money>
</NetAmount>
<Extrinsic name="SCHLINENUM">1</Extrinsic>
</InvoiceDetailItem>
</InvoiceDetailOrder>
<InvoiceDetailSummary>
<SubtotalAmount>
<Money currency="Each">123.00</Money>
</SubtotalAmount>
<Tax>
<Money currency="USD">542</Money>
<Description xml:lang="en">total tax</Description>
<TaxDetail category="">
<!-- If TaxDetail is here, we map taxAmount/Money from there. If not, map Tax/Money. If both are there, this takes precedence-->
<TaxAmount>
<Money currency="USD">215</Money>
</TaxAmount>
</TaxDetail>
<!-- added 2nd TaxDetail block to payload -->
<!-- <TaxDetail category="">
<TaxAmount>
<Money currency="XYZ">152</Money>
</TaxAmount>
</TaxDetail>-->
</Tax>
<SpecialHandlingAmount>
<Money currency="USD">654</Money>
</SpecialHandlingAmount>
<ShippingAmount>
<Money currency="USD">321</Money>
</ShippingAmount>
<NetAmount>
<Money currency="CAD">-24.39</Money>
</NetAmount>
<DueAmount>
<Money currency="USD">435.00</Money>
<!-- If this has a value, we map that. If not, map NetAmount/Money. If both are there, this takes precedence-->
</DueAmount>
</InvoiceDetailSummary>
</InvoiceDetailRequest>
</Request>
</cXML>