Skip to main content

 

 

Coupa Success Portal

Sample cXML Invoice Backed by Contract

Coupa allows to post non-PO backed invoices against contract via cXML. The only difference in the spec from a PO-backed invoice is that Document Reference payloadID in the InvoiceDetailOrderInfo tag includes contract number instead of PO number under Master Agreement Reference. Below sample is for non Services which has quantity.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.020/InvoiceDetail.dtd">
<cXML version="1.0" payloadID="1240598937@SUBDOMAIN.coupahost.com" timestamp="2009-05-01T01:24:51-07:00">
   <Header>
      <From>
         <Credential domain="DUNS">
            <Identity>Kyle</Identity>
         </Credential>
      </From>
      <To>
         <Credential domain="DUNS">
            <Identity>Coupa</Identity>
         </Credential>
      </To>
      <Sender>
         <Credential domain="DUNS">
            <Identity>Kyle</Identity>
            <SharedSecret>Shhh</SharedSecret>
         </Credential>
         <UserAgent>Your Very Own Agent 1.23</UserAgent>
      </Sender>
   </Header>
   <Request deploymentMode="production">
      <InvoiceDetailRequest>
         <InvoiceDetailRequestHeader invoiceID="735675n3" purpose="standard" operation="new" invoiceDate="2009-05-01T11:45:51-07:00">
            <InvoiceDetailHeaderIndicator />
            <InvoiceDetailLineIndicator isAccountingInLine="yes" />
            <PaymentTerm payInNumberOfDays="30" />
         </InvoiceDetailRequestHeader>
         <InvoiceDetailOrder>
            <InvoiceDetailOrderInfo>
               <MasterAgreementReference>
                  <!-- payloadID is the Contract number -->
                  <DocumentReference payloadID="2257" />
               </MasterAgreementReference>
            </InvoiceDetailOrderInfo>
            <!-- First invoice quantity line. -->
            <InvoiceDetailItem invoiceLineNumber="1" quantity="1">
               <UnitOfMeasure>EA</UnitOfMeasure>
               <UnitPrice>
                  <Money currency="USD">365</Money>
               </UnitPrice>
               <!-- The lineNumber here is the backing PO line number, i.e. in this case, line 2 of PO #10 -->
               <InvoiceDetailItemReference lineNumber="1">
                  <!-- The Description will show up on the invoice's line description. Although it can be anything, 
                       Coupa recommends that you make this the same as the backing PO line's description. -->
                  <Description xml:lang="en">NEW 1 NINTENDO WII GAME CONSOLE + WII FIT BUNDLE +GAMES</Description>
               </InvoiceDetailItemReference>
               <!-- Shows up as "Total" on the invoice line -->
               <SubtotalAmount>
                  <Money currency="USD">365</Money>
               </SubtotalAmount>
            </InvoiceDetailItem>
         </InvoiceDetailOrder>
         <InvoiceDetailSummary>
            <!-- Should add-up and be consistent with the subtotals on the invoice lines -->
            <SubtotalAmount>
               <Money currency="USD">365</Money>
            </SubtotalAmount>
            <Tax>
               <Money currency="USD">8</Money>
               <Description xml:lang="en">total tax</Description>
               <TaxDetail purpose="tax" category="VAT" percentageRate="1" taxPointDate="2009-04-24T11:45:51-07:00">
                  <TaxableAmount>
                     <Money currency="USD">365</Money>
                  </TaxableAmount>
                  <TaxAmount>
                     <Money currency="USD">8</Money>
                  </TaxAmount>
                  <TaxLocation xml:lang="en">CA</TaxLocation>
               </TaxDetail>
            </Tax>
            <SpecialHandlingAmount>
               <Money currency="USD">5</Money>
            </SpecialHandlingAmount>
            <!-- Shipping costs -->
            <ShippingAmount>
               <Money currency="USD">30</Money>
            </ShippingAmount>
            <NetAmount>
               <Money currency="USD" />
            </NetAmount>
         </InvoiceDetailSummary>
      </InvoiceDetailRequest>
   </Request>
</cXML>

 

Below sample is for Services which does not have quantity.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.008/InvoiceDetail.dtd">
<cXML version="1.1.008" payloadID="201404091618341618340.106@coupa.com" timestamp="2014-04-09T16:18:34-07:00">
  <Header>
    <From>
      <Credential domain="NetworkID">
        <Identity>TEST</Identity>
        <SharedSecret>InvoicePROD</SharedSecret>
      </Credential>
    </From>
    <To>
      <Credential domain="NetworkID">
        <Identity>TEST</Identity>
      </Credential>
    </To>
    <Sender>
      <Credential domain="NetworkID">
        <Identity>TEST</Identity>
        <SharedSecret>InvoicePROD</SharedSecret>
      </Credential>
      <UserAgent>CatalogManager</UserAgent>
    </Sender>
  </Header>
  <Request deploymentMode="production">
    <InvoiceDetailRequest>
      <InvoiceDetailRequestHeader invoiceID="2650" invoiceDate="2014-04-04T00:00:00-07:00" operation="new" purpose="standard">
        <InvoiceDetailHeaderIndicator/>
        <InvoiceDetailLineIndicator isAccountingInLine="yes"/>
        <InvoiceDetailPaymentTerm payInNumberOfDays="030" percentageRate="000000"/>
      </InvoiceDetailRequestHeader>
      <InvoiceDetailOrder>
        <InvoiceDetailOrderInfo>
          <MasterAgreementReference>
            <!-- payloadID is the Contract number -->
            <DocumentReference payloadID="2257"/>
          </MasterAgreementReference>
        </InvoiceDetailOrderInfo>
        <InvoiceDetailServiceItem invoiceLineNumber="00001" quantity="1">
          <InvoiceDetailServiceItemReference lineNumber="00001"/>
          <SubtotalAmount>
            <Money currency="USD">501.36</Money>
          </SubtotalAmount>
          <UnitOfMeasure>HUR</UnitOfMeasure>
          <UnitPrice>
            <Money currency="USD">501.36</Money>
          </UnitPrice>
        </InvoiceDetailServiceItem>
      </InvoiceDetailOrder>
      <InvoiceDetailSummary>
        <SubtotalAmount>
          <Money currency="USD">501.36</Money>
        </SubtotalAmount>
        <Tax>
          <Money currency="USD">0</Money>
          <Description xml:lang="en">Total Tax Invoice</Description>
          <TaxDetail purpose="tax" category="sales">
            <TaxableAmount>
              <Money currency="USD">501.36</Money>
            </TaxableAmount>
            <TaxAmount>
              <Money currency="USD">0</Money>
            </TaxAmount>
          </TaxDetail>
        </Tax>
        <GrossAmount>
          <Money currency="USD">501.36</Money>
        </GrossAmount>
        <NetAmount>
          <Money currency="USD">501.36</Money>
        </NetAmount>
        <DueAmount>
          <Money currency="USD">501.36</Money>
        </DueAmount>
      </InvoiceDetailSummary>
    </InvoiceDetailRequest>
  </Request>
</cXML>

  • Was this article helpful?