• Last edited on: 16 October 2024

Post cXML ASN to Coupa

POST ASNs to /user/asn_headers using the supplier's Invoicing cXML credentials.

 The following steps guide you through posting an ASN using cXML.

  1. Decide on the supplier you want to test: make sure the supplier's record, under Invoicing, the suppliers credentials are populated since they're also used for cXML ASNs.
  2. Create an order within Coupa for the supplier by submitting a requisition and approving it.
  3. Modify the sample payload (below) so it's updated with the proper supplier credentials (from the supplier record, above) and order details (from the Orders tab).
  4. Use your favorite REST API client to POST your modified payload the following URL:
     https://{customer_instance_name}/cxml/ship_notice_request.
  5. Within Coupa, to go Setup > Spend History > ASNs at
     https://{customer_instance_name}/user/asn_headers
    and make sure that the <ShipmentIdentifier> from the payload is listed in the Tracking # column.
    asn1.png

Sample Payload

Update the following example cXML with the details of your supplier and order before posting.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.020/Fulfill.dtd">
<cXML payloadID="i-am-a-payload-id" xml:lang="en-US" timestamp="2000-10-14">
	 <Header>
			<From>
				 <Credential domain="sSDzdfxfg">
						<Identity>fgsdhgjh</Identity>
				 </Credential>
			</From>
			<To>
				 <Credential domain="sgdf">
						<Identity>sdfdafdfg</Identity>
				 </Credential>
			</To>
			<Sender>
				 <Credential domain="sSDzdfxfg">
						<Identity>fgsdhgjh</Identity>
						<SharedSecret>abcde</SharedSecret>
				 </Credential>
				 <UserAgent>Random HTTP Agent</UserAgent>
			</Sender>
	 </Header>
	 <Request deploymentMode="production">
			<ShipNoticeRequest>
				 <ShipNoticeHeader shipmentID="Unique ID" noticeDate="Creation date of cXML ASN" shipmentDate="SHIPMENT START DATE" deliveryDate="SHIPMENT DELIVERY DATE">
						<!-- Date format:YYYY-MM-DD -->
						<!-- Get the Ship From details from CSP Legal Entity -->
						<Contact role="shipFrom" addressID="Optional unique code given for address in CSP Legal Entity">
							 <Name xml:lang="en-US">NAME OF LEGAL ENTITY</Name>
							 <PostalAddress>
									<Street />
									<City />
									<State />
									<PostalCode />
									<Country isoCountryCode="US">United States</Country>
							 </PostalAddress>
						</Contact>
						<Comments xml:lang="en-US">Got it all into one shipment.</Comments>
				 </ShipNoticeHeader>
				 <ShipControl>
						<CarrierIdentifier domain="SCAC">USPS</CarrierIdentifier>
						<CarrierIdentifier domain="companyName">US Postal Service</CarrierIdentifier>
						<!-- Example Carrier Company names: USPS/UPS>FedEx etc -->
						<ShipmentIdentifier>1234567890 1234567890 1234577890</ShipmentIdentifier>
				 </ShipControl>
				 <ShipNoticePortion>
						<!-- Get the OrderID/PayloadID from PO in Coupa enterprise -->
						<!-- OrderID and PayloadID refer to OrderID in Enterprise. Both are same -->
						<OrderReference orderID="2883">
							 <DocumentReference payloadID="2883" />
						</OrderReference>
						<!-- Get the line number that we want to provide the ship notice along with the line quantity -->
						<ShipNoticeItem lineNumber="1" quantity="1">
							 <!-- PO Line Unit of Measure -->
							 <UnitOfMeasure>EA</UnitOfMeasure>
						</ShipNoticeItem>
				 </ShipNoticePortion>
			</ShipNoticeRequest>
	 </Request>
</cXML>

Sample cXML ASN with Custom Field at Header Level

Update the following example cXML with the details of your supplier and order before posting.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.020/Fulfill.dtd">
<cXML payloadID="i-am-a-payload-id" xml:lang="en-US" timestamp="2024-12-10">
  <Header>
     <From>
        <Credential domain="DUNS">
           <Identity>107627952</Identity>
        </Credential>
     </From>
     <To>
        <Credential domain="NetworkID">
           <Identity>8707171</Identity>
        </Credential>
     </To>
     <Sender>
        <Credential domain="DUNS">
           <Identity>107627952</Identity>
           <SharedSecret>da96bf7efb</SharedSecret>
        </Credential>
        <UserAgent>Random HTTP Agent</UserAgent>
     </Sender>
  </Header>
  <Request deploymentMode="production">
     <ShipNoticeRequest>
        <ShipNoticeHeader shipmentID="1234" noticeDate="2024-01-04" shipmentDate="2024-01-04" deliveryDate="2024-01-04">
           <!-- Date format:YYYY-MM-DD -->
           <!-- Get the Ship From details from CSP Legal Entity -->
           <Contact role="shipFrom" addressID="Optional unique code given for address in CSP Legal Entity">
              <Name xml:lang="en-US">NAME OF LEGAL ENTITY</Name>
              <PostalAddress>
                 <Street />
                 <City />
                 <State />
                 <PostalCode />
                 <Country isoCountryCode="US">United States</Country>
              </PostalAddress>
           </Contact>
           <Comments xml:lang="en-US">Got it all into one shipment.</Comments>
          <Extrinsic name="CustomFields">
              <IdReference identifier="serial_numbers" domain="CustomFields">
                 <Description xml:lang="en">5757</Description>
              </IdReference>
           </Extrinsic>
        </ShipNoticeHeader>
        <ShipControl>
           <CarrierIdentifier domain="SCAC">USPS</CarrierIdentifier>
           <CarrierIdentifier domain="companyName">US Postal Service</CarrierIdentifier>
           <!-- Example Carrier Company names: USPS/UPS>FedEx etc -->
           <ShipmentIdentifier>1234567890 1234567890 1234577890</ShipmentIdentifier>
        </ShipControl>
        <ShipNoticePortion>
           <!-- Get the OrderID/PayloadID from PO in Coupa enterprise -->
           <!-- OrderID and PayloadID refer to OrderID in Enterprise. Both are same -->
           <OrderReference orderID="COUP3772">
              <DocumentReference payloadID="COUP3772" />
           </OrderReference>
           <!-- Get the line number that we want to provide the ship notice along with the line quantity -->
           <ShipNoticeItem lineNumber="1" quantity="1">
              <!-- PO Line Unit of Measure -->
              <UnitOfMeasure>EA</UnitOfMeasure>
           </ShipNoticeItem>
        </ShipNoticePortion>
     </ShipNoticeRequest>
  </Request>
</cXML>

    

Sample cXML ASN with Custom Field at Line Level

Update the following example cXML with the details of your supplier and order before posting.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.020/Fulfill.dtd">
<cXML payloadID="i-am-a-payload-id" xml:lang="en-US" timestamp="2024-12-10">
  <Header>
     <From>
        <Credential domain="DUNS">
           <Identity>107627952</Identity>
        </Credential>
     </From>
     <To>
        <Credential domain="NetworkID">
           <Identity>8707171</Identity>
        </Credential>
     </To>
     <Sender>
        <Credential domain="DUNS">
           <Identity>107627952</Identity>
           <SharedSecret>da96bf7efb</SharedSecret>
        </Credential>
        <UserAgent>Random HTTP Agent</UserAgent>
     </Sender>
  </Header>
  <Request deploymentMode="production">
     <ShipNoticeRequest>
        <ShipNoticeHeader shipmentID="1234" noticeDate="2024-01-04" shipmentDate="2024-01-04" deliveryDate="2024-01-04">
           <!-- Date format:YYYY-MM-DD -->
           <!-- Get the Ship From details from CSP Legal Entity -->
           <Contact role="shipFrom" addressID="Optional unique code given for address in CSP Legal Entity">
              <Name xml:lang="en-US">NAME OF LEGAL ENTITY</Name>
              <PostalAddress>
                 <Street />
                 <City />
                 <State />
                 <PostalCode />
                 <Country isoCountryCode="US">United States</Country>
              </PostalAddress>
           </Contact>
           <Comments xml:lang="en-US">Got it all into one shipment.</Comments>
          <Extrinsic name="CustomFields">
              <IdReference identifier="serial_numbers" domain="CustomFields">
                 <Description xml:lang="en">5757</Description>
              </IdReference>
           </Extrinsic>
        </ShipNoticeHeader>
        <ShipControl>
           <CarrierIdentifier domain="SCAC">USPS</CarrierIdentifier>
           <CarrierIdentifier domain="companyName">US Postal Service</CarrierIdentifier>
           <!-- Example Carrier Company names: USPS/UPS>FedEx etc -->
           <ShipmentIdentifier>1234567890 1234567890 1234577890</ShipmentIdentifier>
        </ShipControl>
        <ShipNoticePortion>
           <!-- Get the OrderID/PayloadID from PO in Coupa enterprise -->
           <!-- OrderID and PayloadID refer to OrderID in Enterprise. Both are same -->
           <OrderReference orderID="COUP3772">
              <DocumentReference payloadID="COUP3772" />
           </OrderReference>
           <!-- Get the line number that we want to provide the ship notice along with the line quantity -->
           <ShipNoticeItem lineNumber="1" quantity="1">
              <!-- PO Line Unit of Measure -->
              <UnitOfMeasure>EA</UnitOfMeasure>
           </ShipNoticeItem>
        </ShipNoticePortion>
     </ShipNoticeRequest>
  </Request>
</cXML>