createPurchaseOrder()

PurchaseOrder createPurchaseOrder(NewPurchaseOrderRequest newPurchaseOrderRequest) 

This method returns a purchase order document that has been persisted.

Parameters

newPurchaseOrderRequest
Format: NewPurchaseOrderRequest XML
Purpose: Defines a NewPurchaseOrderRequest XML document that specifies the details of the purchase order.

Example: Request a new purchase order

This example shows a NewPurchaseOrderRequest XML document that specifies the details of the purchase order.

Note: The <AccountUSN> and <Number> elements are required fields.
<NewPurchaseOrderRequest xmlns="http://xml.inomial.com/smile/2.xsd">
  <AccountUSN>2142426747</AccountUSN>
  <Number>PO123456</Number>
  <ExpiryDate>2015-06-24+10:00</ExpiryDate>
  <Object>
    <String name="purchase_number_note">Note here</String>
  </Object>
  <Subscriptions>
    <SubscriptionUSN>2142426903</SubscriptionUSN>
  </Subscriptions>
  <ExclusiveInvoice>true</ExclusiveInvoice>
</NewPurchaseOrderRequest>

Results

This method returns a PurchaseOrder XML document.

There are no messages defined by this method.

Example: A returned PurchaseOrder XML document

This example shows a PurchaseOrder XML document.

<PurchaseOrder xmlns="http://xml.inomial.com/smile/2.xsd">
  <AccountUSN>2142426747</AccountUSN>
  <Number>PO123456</Number>
  <ExpiryDate>2015-06-24+10:00</ExpiryDate>
  <Object>
    <String name="purchase_number_note">Note here</String>
  </Object>
  <Subscriptions>
    <SubscriptionUSN>2142426903</SubscriptionUSN>
  </Subscriptions>
  <ExclusiveInvoice>false</ExclusiveInvoice>
  <PurchaseOrderId>b3144086-ad4b-4fbe-b9f7-27dca561e7aa</PurchaseOrderId>
  <Company>1</Company>
  <Deprecated>false</Deprecated>
</PurchaseOrder>

Faults

NoSuchItemException
This fault is returned when:
  • the given account USN can not be found
  • the given subscription USN can not be found
InvalidRequestException
This fault is returned when:
  • the USN provided is not an account
  • the purchase order number is empty
  • the object type values are invalid
  • any subscriptions to be added to the purchase order do not belong to the account
  • the purchase order number already exists in the account

Java client syntax

java -cp build/smilewsv2-client.jar [options]
 com.inomial.smile.client.v2.examples.CreatePurchaseOrder filename
filename
Purpose: Defines the filename of the NewPurchaseOrderRequest XML document.
Note: For more information about the Java client and the options it accepts, see Java client syntax.