HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityLog In

Checkout page

The checkout page is similar to the basket page tracking request with additional properties including subtotal, shipping, and total value of the basket.

These values should match what the user sees. That is, if any discounts or surcharges are applied at the order level, include them in the relevant values in the tracking data provided.

Name Description and usage
checkout Element containing checkout-specific sub-elements.
      items List of checkout items.
        refCode Product reference code.

The refCode must exactly match the refCode (guid) specified in the product catalog feed. Also, if you have a custom feed, contact Optimizely to find out which field from the feed is used as a product identifier.
    qty [Number]

Quantity.
    price [Number]

Unit price.
    variant [Optional]

Available from version 1.3 of the Server-to-Server API.

The product variant’s SKU code. Alternatively, you can supply the product variant’s attributes colour and size. By arrangement with Optimizely, these can be replaced with another product attribute.

Sub-elements are of the type [String].

See the Variant tracking section.
  currency Currency code.

See Currency codes.
  subtotal [Number]

Subtotal amount.
  shipping [Number]

Shipping cost.
  total [Number]

Total amount of the checkout.

Checkout page tracking request example.

{  
      "type"        : "checkout",
      "ip"          : "10.42.37.139",
      "session"     : "123456789012|a1b2c3d4e5A6B7C8D9E0f1g2h3i4j5F1G2H3I4J5k1l",
      "cuid"        : "09876543210|Z0Y9X8W7V6z5y4x3w2v1U0T9S8R7Q6u5t4s3r2q1P0O",
      "site"        : "retailer",
      "clientToken" : "1234abcd5678",
      "channel"     : "web",
      "lang"        : "en-gb",
      "currentURI"  : "www.retailer.com/checkout.html",
      "previousURI" : "www.retailer.com/basket.html",
      "userAgent"   : "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
      "checkout"    : {
                        "items"    : [
                                       { "refCode" : "RC123", "qty" : 5,  "price" : 50.5 },
                                       { "refCode" : "RC124", "qty" : 8,  "price" : 52.5 }
                                     ],
                        "currency" : "GBP",
                        "subtotal" : 103,  
                        "shipping" : 11.75,
                        "total"    : 114.75
                     }    
    }

What’s Next
Did this page help you?