CreateNewPurchaseOrder

Request

Field Name  Data Type  Description
request
po
purchase order class.

POServices is different than SCService, please use a different namespace
when adding the new web reference due to duplicate classes (AuthHeader, etc.)
IMPORTANT!
The URL needs a /POServices.asmx suffix
e.g. if your regular ws URL is http://ws.sellercloud.com
then your PO Services URL is http://ws.sellercloud.com/POSe... 

Sample vb.net code

Dim sc As New POServices.POServices
sc.Url = "XXXXXXXXXX/POServices.asmx"
sc.AuthHeaderValue = New POServices.AuthHeader With _
{ _
.UserName = "XXXXXXXXXXXXXX", _
.Password = "XXXXXXXXXXXXXX" _
}
Dim po As New POServices.Purchase
With po
.ID = 0
.CreatedBy = USER_ID_HERE
.DateOrdered = New DateTime(2014, 10, 27)
.LastRevisedOn = New DateTime(2014, 10, 27)
.Status = POServices.PurchaseStatus.Saved
.VendorID = VENDOR_ID_HERE
.CompanyID = COMPANY_ID_HERE
.DiscountTotal = 0.0
.TaxTotal = 0.0
.PurchaseTitle = "Sample Purchase Title 10/27/2014"
// Set the ship to address street & country to empty
// in order to use the Company ID address
 
// Alternatively, set another full address
.ShipToAddress = New POServices.Address With { _
.StreetLine1 = "", _
.CountryCode = "" _
}
End With
// Add PO
Dim AddedPurchaseOrder = sc.CreateNewPurchaseOrder(po)
// Add product
Dim product As New POServices.PurchaseItem
With product
.PurchaseID = AddedPurchaseOrder.ID
.QtyOrdered = QTY_ORDERED_HERE
.QtyReceived = 0
.QtyReceivedToDate = 0
.ProductID = "PRODUCT-ID"
.ProductName = "Product Name"
.UnitPrice = SAMPLE_UNIT_PRICE
.AdjustedPrice = SAMPLE_UNIT_PRICE
.Total = .QtyOrdered * .UnitPrice
.UpdatedBy = AddedPurchaseOrder.CreatedBy
.UpdatedOn = New DateTime(2014, 10, 31)
.ExpectedDeliveryDate = New DateTime(2014, 11, 15)
End With
Dim AddedProduct As POServices.PurchaseItem = sc.PurchaseOrderItems_CreateNew(product)
// As a sanity check, get the whole PO object from server side
AddedPurchaseOrder = sc.GetPurchaseOrder(AddedPurchaseOrder.ID)



How did we do?