• Last edited on: 15 March 2018

Sample cXML Unbacked Invoice

Use this sample unbacked cXML invoice to test your Coupa integration.

Coupa allows to post supplier invoice via cXML.

cXML Unbacked Invoice


<?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="2014-06-30T01:24:51-07:00">
	<Header>
		<From>
			<Credential domain="Dom1">
				<Identity>Kyle</Identity>
			</Credential>
		</From>
		<To>
			<Credential domain="Dom2">
				<Identity>Coupa</Identity>
			</Credential>
		</To>
		<Sender>
			<Credential domain="Dom3">
				<Identity>Test</Identity>
				<SharedSecret>Secret</SharedSecret>
			</Credential>
			<UserAgent>Your Very Own Agent 1.23</UserAgent>
		</Sender>
	</Header>
	<Request deploymentMode="production">
		<InvoiceDetailRequest>
			<InvoiceDetailRequestHeader invoiceID="CD24706_882015_8" purpose="standard" operation="new" invoiceDate="2015-04-30T11:45:51-07:00">
				<InvoiceDetailHeaderIndicator />
				<InvoiceDetailLineIndicator isAccountingInLine="yes" />
				<InvoicePartner>
					<Contact role="remitTo" addressID="RTCode">
						<Name xml:lang="en">RTName</Name>
					</Contact>
				</InvoicePartner>
				<InvoicePartner>
					<Contact role="billTo">
						<Name xml:lang="en">xxx yyy</Name>
						<PostalAddress name="default">
							<Street>Line1</Street>
							<Street>Line2</Street>
							<City>City</City>
							<State>State</State>
							<PostalCode>151515</PostalCode>
							<Country isoCountryCode="BE">1</Country>
						</PostalAddress>
						<Email name="default">harinni.coupa01@gmail.com</Email>
						<Phone name="work">
							<TelephoneNumber>
								<CountryCode isoCountryCode="BE">Belgium</CountryCode>
								<AreaOrCityCode>745</AreaOrCityCode>
								<Number>+1 (987) 654-3210</Number>
							</TelephoneNumber>
						</Phone>
					</Contact>
				</InvoicePartner>
				<PaymentTerm payInNumberOfDays="30" />
			</InvoiceDetailRequestHeader>
			<InvoiceDetailOrder>
				<InvoiceDetailOrderInfo>
					<MasterAgreementReference>
						<!-- payloadID is the Contract number -->
						<DocumentReference payloadID="441" />
					</MasterAgreementReference>
				</InvoiceDetailOrderInfo>
				<!-- First invoice quantity line. -->
				<InvoiceDetailItem invoiceLineNumber="1" quantity="1">
					<UnitOfMeasure>EA</UnitOfMeasure>
					<UnitPrice>
						<Money currency="USD">100</Money>
					</UnitPrice>
					<InvoiceDetailItemReference lineNumber="1">
						<Description xml:lang="en">Item01</Description>
					</InvoiceDetailItemReference>
					<SubtotalAmount>
						<Money currency="USD">100</Money>
					</SubtotalAmount>
				</InvoiceDetailItem>
			</InvoiceDetailOrder>
			<InvoiceDetailSummary>
				<SubtotalAmount>
					<Money currency="USD">100</Money>
				</SubtotalAmount>
				<Tax>
					<Money currency="USD" alternateAmount="10" alternateCurrency="EUR">8</Money>
					<Description xml:lang="en">total tax</Description>
					<TaxDetail purpose="tax" category="Standard Rate" percentageRate="20" taxPointDate="2014-06-30T11:45:51-07:00">
						<TaxableAmount>
							<Money currency="USD">100</Money>
						</TaxableAmount>
						<TaxAmount>
							<Money currency="USD">20</Money>
						</TaxAmount>
						<TaxLocation xml:lang="en">CA</TaxLocation>
					</TaxDetail>
				</Tax>
				<NetAmount>
					<Money currency="USD" />
				</NetAmount>
			</InvoiceDetailSummary>
		</InvoiceDetailRequest>
	</Request>
</cXML>

cXML Unbacked Invoice with Requester


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.020/InvoiceDetail.dtd">
<cXML payloadID="20101222 190337.2999" timestamp="2010-12-22T19:03:37" version="1.0">
	 <Header>
			<From>
				 <Credential domain="test">
						<Identity>test</Identity>
				 </Credential>
			</From>
			<To>
				 <Credential domain="test">
						<Identity>test</Identity>
				 </Credential>
			</To>
			<Sender>
				 <Credential domain="test">
						<Identity>test</Identity>
						<SharedSecret>test</SharedSecret>
				 </Credential>
				 <UserAgent>Coupa Integration V01</UserAgent>
			</Sender>
	 </Header>
	 <Request deploymentMode="production">
			<InvoiceDetailRequest>
				 <InvoiceDetailRequestHeader invoiceDate="2010-12-16T00:00:00" invoiceID="Req_test" operation="new" purpose="standard">
						<InvoiceDetailHeaderIndicator />
						<InvoiceDetailLineIndicator isAccountingInLine="yes" />
						<PaymentTerm payInNumberOfDays="30" />
						<Extrinsic name="Requester">
							 <Extrinsic name="Email">supplieremailtest11+xyz@gmail.com</Extrinsic>
							 <Extrinsic name="Name">John Doe</Extrinsic>
						</Extrinsic>
				 </InvoiceDetailRequestHeader>
				 <InvoiceDetailOrder>
						<InvoiceDetailOrderInfo>
							 <MasterAgreementReference>
									<!-- payloadID is the Contract number -->
									<DocumentReference payloadID="110033" />
							 </MasterAgreementReference>
						</InvoiceDetailOrderInfo>
						<InvoiceDetailItem invoiceLineNumber="1" quantity="2.00">
							 <UnitOfMeasure>EA</UnitOfMeasure>
							 <UnitPrice>
									<Money currency="USD">100</Money>
							 </UnitPrice>
							 <InvoiceDetailItemReference lineNumber="1">
									<Description xml:lang="en">Item1</Description>
							 </InvoiceDetailItemReference>
							 <SubtotalAmount>
									<Money currency="USD">200</Money>
							 </SubtotalAmount>
							 <Distribution>
									<Accounting name="Account Matt">
										 <AccountingSegment id="Seg 2">
												<Name xml:lang="en" />
												<Description xml:lang="en" />
										 </AccountingSegment>
									</Accounting>
									<Charge>
										 <Money currency="USD">200.00</Money>
									</Charge>
							 </Distribution>
						</InvoiceDetailItem>
				 </InvoiceDetailOrder>
				 <InvoiceDetailSummary>
						<SubtotalAmount>
							 <Money currency="USD">200.00</Money>
						</SubtotalAmount>
						<Tax>
							 <Money currency="USD">0</Money>
							 <Description xml:lang="en">TaxStuff</Description>
							 <TaxDetail category="tax" purpose="tax" taxPointDate="2010-12-16T00:00:00">
									<TaxableAmount>
										 <Money currency="USD" />
									</TaxableAmount>
									<TaxAmount>
										 <Money currency="USD">0</Money>
									</TaxAmount>
									<TaxLocation xml:lang="en">CA</TaxLocation>
							 </TaxDetail>
						</Tax>
						<SpecialHandlingAmount>
							 <Money currency="USD">0</Money>
						</SpecialHandlingAmount>
						<ShippingAmount>
							 <Money currency="USD">0</Money>
						</ShippingAmount>
						<NetAmount>
							 <Money currency="USD">0</Money>
						</NetAmount>
				 </InvoiceDetailSummary>
			</InvoiceDetailRequest>
	 </Request>
</cXML>

Successful Supplier Invoice Response


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.020/cXML.dtd">;
<cXML xml:lang="en-US" timestamp="2015-07-09T17:38:15+00:00" payloadID="201506241230171230170.926@staples.com">
	<Response>
		<Status text="OK" code="200">Successful - invoice id: 9532</Status>
	</Response>
</cXML>