TOP

UpsertOrder()

Part Of: Order Webservice 3.04

WSDL:

https://webservices.vin65.com/V304/OrderService.cfc?wsdl

Australian URL:

https://webservices.aus.vin65.com/V304/OrderService.cfc?wsdl

Description:

Use the UpsertOrder() function to upsert an array of orders. Required fields are indicated by a *.

Parameters:

Attribute Data Type Default Description
Orders * Array of Objects   Contains the following attributes. At least 1 is required in the Orders array.
Order.WebsiteCode String 50   A text code to identify a source of orders for websites with multiple sources pushing orders in. Typically this is used for wineries with multiple tasting rooms.
Order.ContactID UUID   The internal WineDirect ID for the contact this order belongs to, if known.
Order.AltContactID String 50   Your external reference for the contact this order belongs to, if known.
Order.OrderType String 50 POS One of 'AdminPanel, ClubOrder, Facebook, iPad, Mobile, POS, Telemarketing or Website'. Note client can modify order types, if defaults are changed and you pass in an order type that does not exist, the response will be a friendly error with a list of order types that are accepted.
Order.OrderNumber * String 50   The order number in your system.
Order.OrderDate * Date   The date the order was first placed.
Order.ShipDate Date   The date the order is shipped.

Order.ShippingStatus

String 255 Handled Externally Shipping Status must be one of: 'Picked Up, Handled Externally, No Shipping Required, Sent to Fulfillment, Shipped'.
 
Order.BillingBirthdate Date   Billing contact's birthdate. Format is in: MM/DD/YYYY or DD/MM/YYYY.
Order.BillingFirstName String 50   Billing contact's first name. 
Order.BillingLastName String 50   Billing contact's last name. 
Order.BillingCompany String 100   Billing contact's company.
Order.BillingAddress String 100   Billing contact's address.
Order.BillingAddress2 String 100   Additional information regarding the billing contact's address.
Order.BillingCity String 100   Billing contact's city.
Order.BillingStateCode String 2   Billing address State/Provice code. Two character abreviated state or province code. Example: California = CA and British Columbia = BC​​
Order.BillingZipCode String 50   Billing contact's address zip code.
Order.BillingPhone String 50   Billing contact's phone number. Format is in: 000-000-0000.
Order.BillingEmail * String 100   Billing contact's email address. Used as a secondary means of matching order history to customer records. If no customer number is included orders will be matched with a customer record using the billing email address. If no customer record is found that matches the email, a new contact record will be created.
Order.ShippingBirthdate Date   Shipping contact's birthdate. Format is in: MM/DD/YYYY or DD/MM/YYYY.
Order.ShippingFirstName String 50   Shipping contact's first name. 
Order.ShippingLastName String 50   Shipping contact's last name. 
Order.ShippingCompany String 100   Shipping contact's company.
Order.ShippingAddress String 100   Shipping contact's address.
Order.ShippingAddress2 String 100   Additional information regarding the shipping contact's address.
Order.ShippingCity String 100   Shipping contact's city.
Order.ShippingStateCode String 2   Shipping address State/Provice code. Two character abreviated state or province code. Example: California = CA and British Columbia = BC​​
Order.ShippingZipCode String 50   Shipping contact's address zip code.
Order.ShippingPhone String 50   Shipping contact's phone number. Format is in: 000-000-0000.
Order.ShippingEmail String 100   Shipping recipient's email address.
Order.ShippingAddressID UUID  

If the order is being shipped to a known address book entry whose internal WineDirect ID is known, you can provide that here and it will be updated with any changes included in the order.

Order.AltShippingAddressID String 50   Your shipping address ID, if known, will be used to either match to an existing entry in WineDirect or create a new one on the fly.
Order.GiftMessage String 1024   Gift message included on the order.
Order.OrderNotes String 1024  

These notes are typically from the customer intended to be viewed by the winery or fulfillment. They are visible to the customer, so do not put internal notes in this field that you don’t want them to see.

Order.SubTotal Numeric  

The total of line items in the order only.

Order.Shipping Numeric  

The amount charged for shipping.

Order.Handling Numeric  

The amount charged for handling.

Order.Tax Numeric  

The amount charged for tax, not the tax rate.

Order.Total Numeric   The total amount charged which should equal the sum of subtotal, shipping, handling, and tax. 
Order.SendToFulfillment Boolean False Sends orders to fulfillment through the WineDirect fulfillment manager if set to true.
Order.TransactionType String  

Either 'Order' or 'Refund'. If it's a 'Refund' - need to pass in 'PreviousOrderID' or 'PreviousOrderNumber'.

Order.PreviousOrderNumber Numeric   Internal WineDirect order number for the previous order. 
Order.PreviousOrderID UUID   Internal WineDirect ID for the previous order. 
Order.SourceCode String   A way to identify where orders came from (used in reporting).
Order.SalesAssociate String   Matches the name of an existing Sales Associate in the system. A friendly error will be returned if there are no matches.
Order.IsPickup Boolean True Whether the order is a pickup or shipping order.
Order.Tenders Array of Objects   Each Tender contains the following attributes.
Order.Tender.PaymentType * String 50   Payment Type must be one of the following: 'GiftCard, Points, Cash, Check, CreditCard, OnAccount, ZeroDollarInvoice, Other'. 
If the payment type is 'CreditCard', then 'CreditCardExpirationMonth', 'CreditCardExpirationYear', and 'CreditCardType' are required
Order.Tender.PaymentDate Date   Date the payment took place.
Order.Tender.AmountTendered * Numeric   Amount the tender covered of the order.
Order.Tender.CreditCardExpirationMonth Integer   Month of the credit card's expiry. Required if 'PaymentType' is 'CreditCard'.
Order.Tender.CreditCardExpirationYear Integer   Year of the credit card's expiry. Required if 'PaymentType' is 'CreditCard'.
Order.Tender.CreditCardType String   An enumerated field that is one of: 'Visa, MasterCard, AmericanExpress, Discover, JCB, Diners'. Required if 'PaymentType' is 'CreditCard'.
Order.Tender.CreditCardName String 100   The name on the credit card.
Order.Tender.CreditCardNumber String   The credit card number.
Order.Tender.PointsRedeemed Integer   Number of points redeemed.
Order.Tender.GiftCardID UUID   The WineDirect ID of a gift card, if known.
Order.Tender.GiftCardCode String 50   The code for the Gift Card.
Order.Tender.GiftCardNumber Integer   The Gift Card number.
Order.Tender.GiftCardVendor Integer   The vendor of the Gift Card.
Order.OrderItems Array of Objects   Each OrderItem contains the following attributes.
Order.OrderItem.Quantity * Integer   Quantity of the order item.
Order.OrderItem.ProductName String 255   Name of the product.
Order.OrderItem.ProductSKU * String 255   SKU of the product.
Order.OrderItem.InventoryPoolID UUID   The WineDirect ID for the inventory pool that the SKU's quantity should be deprecated from.
Order.OrderItem.DepartmentCode String 50   The department code for this item. If this code is pre-setup in WineDirect then reports will show the department name otherwise they will just show the code that is uploaded for this item.
Order.OrderItem.SubDepartmentCode String 50   The sub department code for this item. If this code is pre-setup in WineDirect then reports will show the sub department name otherwise they will just show the code that is uploaded for this item.
Order.OrderItem.OriginalPrice Numeric   Unit original price before discounts.
Order.OrderItem.Price * Numeric   Unit price after discounts that will be multiplied by quantity to get the extended price.
Order.OrderItem.CostOfGood Numeric   Unit cost of good.
Order.OrderItem.SalesTax Numeric   Optionally, set the amount of tax to be applied to a specific item in the order.
Order.OrderItem.IsNonTaxable Boolean False Set to true to mark an item as non-taxable for the purpose of calculating tax by line item.
Order.OrderItem.ShippingService String 100   The shipping code used on this order item. Typically things like “GROUND”, “2DAY”, etc.
Order.OrderItem.ShippingPartner String 100   The shipping company used. Typically “InHouseFedEx”, “InHouseUPS”, “WineShipping”, etc.
Order.RMS Object   Only used for WineDirect RMS cloud connect POS order uploads. Attributes are described below.
Order.RMS.BatchID String 50    

Order.RMS.CashierID

String 20    

Order.RMS.RegisterNumber

String 20    

Order.RMS.StoreID

String 20    

Sample Request:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header/>
<soapenv:Body>
  <UpsertOrder>
    <Request>
      <Security>
        <Password>//Your Username//</Password>
        <Username>//Your Password//</Username>
      </Security>
      <Orders>
        <item>
          <OrderNumber>123</OrderNumber>
          <OrderDate>2019-07-20</OrderDate>
          <OrderType>AdminPanel</OrderType>
          <BillingEmail>michael.hersch@winedirect.com</BillingEmail>
          <BillingFirstName>Michael</BillingFirstName>
          <BillingLastName>Hersch</BillingLastName>
          <OrderItems>
            <item>
              <ProductSKU>2004Shiraz</ProductSKU>
              <Quantity>2</Quantity>
              <Price>75.00</Price>
            </item>
          </OrderItems>
          <Tenders>
            <item>
              <PaymentType>Cash</PaymentType>
              <AmountTendered>150</AmountTendered>
            </item>
          </Tenders>
          <SubTotal>150.00</SubTotal>
          <Total>150.00</Total>
        </item>
        <item>
          <OrderNumber>456</OrderNumber>
          <OrderType>AdminPanel</OrderType>
        </item>
      </Orders>
    </Request>
  </UpsertOrder>
</soapenv:Body>
</soapenv:Envelope>

Sample Response:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <UpsertOrderResponse>
      <UpsertOrderReturn>
        <Errors>
          <Errors>
            <ErrorCode>InvalidOrder</ErrorCode>
            <ErrorMessage>1 orders(s) failed to upsert. View 'OrderResults' for more details.</ErrorMessage>
          </Errors>
        </Errors>
        <IsSuccessful>false</IsSuccessful>
        <OrderResults>
          <OrderResults>
            <Errors />
            <IsSuccessful>true</IsSuccessful>
            <Order>
              <AltOrderNumber>123</AltOrderNumber>
              <BillContact>
                <Address></Address>
                <Address2></Address2>
                <BirthDate />
                <CashierID />
                <City></City>
                <Company></Company>
                <ContactID>5897B83E-EC54-1187-9214-72B17F0ED71C</ContactID>
                <CountryCode></CountryCode>
                <CustomerNumber />
                <DateAdded>2014-04-03T21:54:16.703Z</DateAdded>
                <DateModified>2019-07-29T16:59:04.003Z</DateModified>
                <Email>michael.hersch@winedirect.com</Email>
                <FirstName>Michael</FirstName>
                <IsNonTaxable>false</IsNonTaxable>
                <LastLoginDate>2018-07-25T17:51:31.000Z</LastLoginDate>
                <LastName>Hersch</LastName>
                <LastOrderDate>2019-07-20T07:00:00.000Z</LastOrderDate>
                <LifetimeValue>52316.17</LifetimeValue>
                <MasterContactID />
                <OrderCount>517.0</OrderCount>
                <Phone></Phone>
                <SourceCode></SourceCode>
                <StateCode></StateCode>
                <Title></Title>
                <Username>michael.hersch@winedirect.com</Username>
                <WebsiteID>00000000-0000-0000-0000-000000000000</WebsiteID>
                <WholesaleNumber></WholesaleNumber>
                <ZipCode></ZipCode>
              </BillContact>
              <ClubName></ClubName>
              <ClubShipmentName></ClubShipmentName>
              <CompletedDate>2019-07-20T07:00:00.000Z</CompletedDate>
              <CorporateOrderBatchID />
              <CorporateOrderNumber />
              <Deposit>0.0</Deposit>
              <FFSN></FFSN>
              <FulfillmentHouse></FulfillmentHouse>
              <FutureShipDate />
              <GiftMessage></GiftMessage>
              <Handling>0.0</Handling>
              <IsAPickupOrder>true</IsAPickupOrder>
              <IsExternalOrder>true</IsExternalOrder>
              <Marketplace />
              <OrderCoupons />
              <OrderID>72B6CF66-B479-47A6-B51E-7844EF88A207</OrderID>
              <OrderItems>
                <OrderItems>
                  <CostOfGood>0.0</CostOfGood>
                  <Department></Department>
                  <DepartmentCode></DepartmentCode>
                  <InventoryPool></InventoryPool>
                  <IsNonTaxable>false</IsNonTaxable>
                  <IsSubSKU>false</IsSubSKU>
                  <OriginalPrice>75.0</OriginalPrice>
                  <ParentSKU />
                  <ParentSKUID></ParentSKUID>
                  <Price>75.0</Price>
                  <ProductID>B6E75D00-DA92-F695-E7A5-0ADDC6ACB6D6</ProductID>
                  <ProductSKUID>B6E75D59-AB45-48C3-49F8-7FD821B39EA8</ProductSKUID>
                  <Quantity>2.0</Quantity>
                  <SKU>2004Shiraz</SKU>
                  <SalesTax>0.0</SalesTax>
                  <ShippedDate />
                  <ShippingSKU></ShippingSKU>
                  <ShippingService></ShippingService>
                  <SubDepartment></SubDepartment>
                  <SubDepartmentCode></SubDepartmentCode>
                  <SubTitle></SubTitle>
                  <Title></Title>
                  <TrackingNumber></TrackingNumber>
                  <Type>Wine</Type>
                  <UnitDescription>Bottle</UnitDescription>
                  <Weight />
                </OrderItems>
              </OrderItems>
              <OrderNotes></OrderNotes>
              <OrderNumber>77728</OrderNumber>
              <OrderStatus>Completed</OrderStatus>
              <PaymentStatus>External</PaymentStatus>
              <PaymentTerms />
              <PickupDate />
              <PickupLocationCode></PickupLocationCode>
              <PreviousOrderNumber />
              <PriceLevel></PriceLevel>
              <RMS>
                <BatchID></BatchID>
                <CashierID></CashierID>
                <RegisterNumber></RegisterNumber>
                <StoreID></StoreID>
              </RMS>
              <RequestedDeliveryDate />
              <RequestedShipDate />
              <SalesAssociate></SalesAssociate>
              <SalesAttribute></SalesAttribute>
              <ShipToAddress>
                <Address></Address>
                <Address2></Address2>
                <BirthDate />
                <City></City>
                <Company></Company>
                <CountryCode></CountryCode>
                <Email></Email>
                <FirstName></FirstName>
                <LastName></LastName>
                <Phone></Phone>
                <StateCode></StateCode>
                <Title></Title>
                <ZipCode></ZipCode>
              </ShipToAddress>
              <ShippedDate />
              <Shipping>0.0</Shipping>
              <ShippingService></ShippingService>
              <ShippingStatus>Handled Externally</ShippingStatus>
              <ShippingType />
              <SourceCode></SourceCode>
              <SubTotal>150.0</SubTotal>
              <SubmittedDate>2019-07-20T07:00:00.000Z</SubmittedDate>
              <Tax>0.0</Tax>
              <Tender>
                <Tender>
                  <AmountTendered>150.0</AmountTendered>
                  <CardExpiryMo />
                  <CardExpiryYr />
                  <CardNumber></CardNumber>
                  <CardType></CardType>
                  <GiftCardCode />
                  <GiftCardID />
                  <GiftCardNumber />
                  <GiftCardVendor />
                  <IsActive>true</IsActive>
                  <NameOnCard></NameOnCard>
                  <PaymentDate />
                  <PaymentStatus>External</PaymentStatus>
                  <PaymentTerms></PaymentTerms>
                  <PaymentType>Cash</PaymentType>
                  <PointsID />
                  <PointsRedeemed />
                </Tender>
              </Tender>
              <Tip>0.0</Tip>
              <Total>150.0</Total>
              <TotalAfterTip>150.0</TotalAfterTip>
              <TrackingNumber></TrackingNumber>
              <TransactionType>Order</TransactionType>
              <Type>AdminPanel</Type>
              <WebsiteID>00000000-0000-0000-0000-000000000000</WebsiteID>
              <WholesaleNumber></WholesaleNumber>
            </Order>
          </OrderResults>
          <OrderResults>
            <Errors>
              <Errors>
                <ErrorCode>InvalidMemberParameters</ErrorCode>
                <ErrorMessage>A valid email address, contactID, or altContactID is required.</ErrorMessage>
              </Errors>
              <Errors>
                <ErrorCode>InvalidOrderDate</ErrorCode>
                <ErrorMessage>Order Date must be a valid date.</ErrorMessage>
              </Errors>
            </Errors>
            <IsSuccessful>false</IsSuccessful>
            <Order />
          </OrderResults>
        </OrderResults>
        <RecordCount>1.0</RecordCount>
      </UpsertOrderReturn>
    </UpsertOrderResponse>
  </soapenv:Body>
</soapenv:Envelope>

Page Top