Welcome‎ > ‎Version 3‎ > ‎Publisher Api‎ > ‎Methods‎ > ‎1 - Offer Related‎ > ‎

Validate Order

Validate order takes the same request object as a purchase call, and returns any errors that would come up if you were to make the purchase call with that request object.  It also returns other order related fields that are useful if you have an order overview/confirmation screen that the user is directed to after entering billing information but before actually making the purchase.

Note:  Validate order creates or updates consumers based on the consumer info in the validate order request before beginning the purchase specific logic, just as a regular purchase would.

Method: POST /api/v3/publisher/order/validate

Authentication: oauth
 
Post
See the form for the purchase call.  Validate order takes the exact same parameters.

Returns
chargeAmount - The amount that will be charged to the consumer's credit card.

creditValueUsed - The value of the consumer's credits that will be used to pay for some or all of this order.

currencySymbol - The symbol for the currency of this order (e.g. $)

isoCurrencyCode - The iso currency code for this order (e.g. USD)

normalizedShippingAddresses - a list of pairs { originalAddress, List<normalizedAddress> } (null if this order has no order details that require shipping).  There will be one pair in the list for each distinct shipping address in the collection of order details on the purchase request.  A normalized address is an address in which every field in the address has been standardized.  For example, if the consumer enters city:"nyc" zipcode:"10010" then after normalization, these fields might be city:"New York" zipcode:"10012-2613".  A normalized address can make shipping and tax calculations more accurate.  We recommend that you use normalized addresses in purchase requests for taxable purchases.  Each original address may have more than one possible normalized address.  You should offer a user the ability to choose to make the purchase with one of the normalized addresses (preferred) or to make the purchase with the original non-normalized address (there may be rare cases where the normalized addresses are incorrect).

pendingCreditValueAwarded -  The value of the credit(s) (pending credit trigger types ForNextPurchase + AfterNextPurchase) that will be awarded to the consumer of the order when the purchase is made.

promoCodeInformationList - A list of information about each promo code being applied to the order (see Promo Code Information).

shippingFee - The total shipping cost for the entire order (null if this order does not require shipping).

subtotal - The total cost of goods for this order (price * quantity)

taxAmount - The estimated tax for the order (null if this order has no taxable order details)

base response fields


Sample Request:

POST http://api.groupcommerce.com/api/v3/publisher/order/validate

Form:  AllowDuplicatePurchase=False&ConsumerInfo.Email=gsadowski%40groupcommerce.com&ConsumerInfo.UserKey=gsadowski%40groupcommerce.com&ConsumerInfo.FirstName=Greg&ConsumerInfo.LastName=Sadowski&ConsumerInfo.ReferredByUserKey=mlee%40groupcommerce.com&BillingInfo.NameOnCard=Andrew%20Glenn&BillingInfo.CardNumber=4111111111111111&BillingInfo.PaymentType=Unknown&BillingInfo.CVV=111&BillingInfo.ExpirationMonth=7&BillingInfo.ExpirationYear=2020&BillingInfo.BillingPhone=2165615908&BillingInfo.BillingAddress=628%20Broadway&BillingInfo.BillingAddress2=&BillingInfo.BillingCity=New%20York&BillingInfo.BillingState=NY&BillingInfo.BillingZip=10010&BillingInfo.BillingCountry=US&BillingInfo.StoreCreditCard=False&BillingInfo.StoredCreditCardId=&OrderDetails%5B0%5D.Quantity=1&OrderDetails%5B0%5D.OfferId=24142&OrderDetails%5B0%5D.OfferOptionId=27120&OrderDetails%5B0%5D.SegmentKey=new-york&OrderDetails%5B0%5D.IsGift=False&OrderDetails%5B0%5D.Address=628%20Broadway&OrderDetails%5B0%5D.Address2=&OrderDetails%5B0%5D.City=nyc&OrderDetails%5B0%5D.Country=US&OrderDetails%5B0%5D.PostalCode=10075&OrderDetails%5B0%5D.ShippingName=Ship%20To%20Me&OrderDetails%5B0%5D.State=NY&UsePromotionalPrice=False

OAuth oauth_signature="6W89QSLuBb1mNwfUXuneN%2Fyp3Go%3D", oauth_nonce="273642", oauth_timestamp="1336679915", oauth_consumer_key="eeb6b959-b854-4ad1-b563-e801c83cf81d", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"


Sample JSON Response:

{
    "errors": [],
    "lastPublished": "/Date(1340320471978)/",
    "success": true,
    "version": "3",
    "chargeAmount": 122.28,
    "creditValueUsed": 0,
    "currencySymbol": "$",
    "isoCurrencyCode": "USD",
    "normalizedShippingAddresses": [
        {
            "normalizedAddresses": [
                {
                    "city": "Shaker Heights",
                    "country": "US",
                    "latitude": null,
                    "longitude": null,
                    "name": "Ship To Me",
                    "phone": null,
                    "postalCode": "44122-3156",
                    "state": "OH",
                    "street1": "123 Wimbledon Rd",
                    "street2": "",
                    "website": null
                }
            ],
            "originalAddress": {
                "city": "Cleveland",
                "country": "US",
                "latitude": null,
                "longitude": null,
                "name": "Ship To Me",
                "phone": null,
                "postalCode": "44122",
                "state": "OH",
                "street1": "123 wimbledon",
                "street2": "",
                "website": null
            }
        }
    ],
    "pendingCreditValueAwarded": 0, 
    "promoCodeInformationList": [
        {
            // see Promo Code Information
        }
    ],
    "shippingFee": 8.5,
    "subtotal": 120,
    "taxAmount": 8.18
}


Sample XML Response:

<validateOrderResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <errors />
  <lastPublished>2012-06-21T23:16:28.6696627Z</lastPublished>
  <success>true</success>
  <version>3</version>
  <chargeAmount>122.28</chargeAmount>
  <creditValueUsed>0</creditValueUsed>
  <currencySymbol>$</currencySymbol>
  <isoCurrencyCode>USD</isoCurrencyCode>
  <normalizedShippingAddresses>
    <normalizedAddressInfo>
      <normalizedAddresses>
        <address>
          <city>Shaker Heights</city>
          <country>US</country>
          <latitude i:nil="true" />
          <longitude i:nil="true" />
          <name>Ship To Me</name>
          <phone i:nil="true" />
          <postalCode>44122-3156</postalCode>
          <state>OH</state>
          <street1>123 Wimbledon Rd</street1>
          <street2 />
          <website i:nil="true" />
        </address>
      </normalizedAddresses>
      <originalAddress>
        <city>Cleveland</city>
        <country>US</country>
        <latitude i:nil="true" />
        <longitude i:nil="true" />
        <name>Ship To Me</name>
        <phone i:nil="true" />
        <postalCode>44122</postalCode>
        <state>OH</state>
        <street1>123 wimbledon</street1>
        <street2 />
        <website i:nil="true" />
      </originalAddress>
    </normalizedAddressInfo>
  </normalizedShippingAddresses>
  <pendingCreditValueAwarded>0</pendingCreditValueAwarded> 
  <promoCodeInformationList>
    <promoCodeInformation>
      <!-- see Promo Code Information -->
    </promoCodeInformation>
  </promoCodeInformationList>
  <shippingFee>8.50</shippingFee>
  <subtotal>120</subtotal>
  <taxAmount>8.18</taxAmount>
</validateOrderResponse>
Comments