Spinner

Two Tap API

Two Tap allows programmers to place orders on ecommerce sites using code. There are two ways of using it: via the HTML5 interface, or via the API.


HTML5 Interface

The HTML5 interface is a wrapper around our API. It's the easiest way to integrate Two Tap in your applications.

To use it just point a web browser, a UIWebView (iOS), or a WebView (Android) to https://checkout.twotap.com with a list of products, your public api token, an unique token for the transaction, and a callback url.

At the end of the checkout flow the interface will call the callback_url with the unique_token and a purchase_id to ask for the final order confirmation. More information about this below.

The interface acccepts both GET requests with query arguments and POST requests with body arguments. We recommend you use GET requests for quick debugging, and POST requests in production. POST requests ensure you won't hit the maximum number of characters allowed in an URL in browsers.

Parameters via GET

#  https://checkout.twotap.com?
#  public_token=your_public_token&
#  unique_token=an_unique_token&
#  callback_url=your_callback_url&
#  products=product_1_url,product_2_url&
#  affiliate_links=product_1_affiliate_url,product_2_affiliate_url

We recommend you encode each individual url to avoid any issues (js: encodeURIComponent(), ruby: CGI.escape(), python: urllib.parse.quote()).

public_token The public token from your Two Tap developer interface.
unique_token An unique token generated by you that is sent back with the callback call.
callback_url An URL on your end where the interface will ask you to confirm the purchase via POST.
products A list of products urls separated by commas. We encourage you to encode each product url beforehand.
affiliate_links (Optional) A list of affiliate links for the above product urls.
user_token (Optional) If a valid user_token is specified the user will be automatically logged in the interface.
token_url (Optional) If a user signs up or logs in during the session an user_token will be sent to this url via POST.
test_mode (Optional) dummy_data or fake_confirm. A way to test the interface without making actual purchases.
custom_css_url (Optional) An url to your custom css file.
standard_top_banner_url
standard_top_banner_message
success_top_banner_url
success_top_banner_message

(Optional) Add these params if you want a banner at the top of the interface. This is useful in case you want a custom back button or need to display a message.

At the end of the checkout process the interface will set the banner with the values of success_*.

Parameters via POST

public_token The public token from your Two Tap developer interface.
unique_token An unique token generated by you that is sent back with the callback call.
callback_url An URL on your end where the interface will ask you to confirm the purchase via POST.
products

An array of hashes like:

[ { 'url': 'the product url', 'affiliate_link': '(Optional) an affiliate link', 'input_fields': '(Optional) a hash of product values, like size / color' } ].

You can send raw JSON as a string.

input_fields

(Optional) If you want to prefill information about the user/purchase you can send the values. Send a hash like:

{ 'shipping_state': 'California', 'coupons': { site_id: 'coupon_value' } }.

You can send raw JSON as a string.

See a list of possible keys and values.

user_token (Optional) If a valid user_token is specified the user will be automatically logged in the interface.
token_url (Optional) If a user signs up or logs in during the session an user_token will be sent to this url via POST.
test_mode (Optional) dummy_data or fake_confirm. A way to test the interface without making actual purchases.
custom_css_url (Optional) An url to your custom css file.
top_banner

(Optional) Add hash like below if you want a banner at the top of the interface:

{ 'standard_message': 'message', 'standard_url': 'url', 'success_message': 'message', 'success_url': 'url' }.

This is useful in case you want a custom back button or need to display a message.

At the end of the checkout process the interface will set the banner with the values of success_*.

hide_intro (Optional) By default an intro screen is displayed once to all new users. You can disable it.
intro_messages

(Optional) The intro screen displays a title, three benefits, and a dismiss button. Add hash like below if you want to tweak the messages:

{ 'title': 'title', 'first': 'first', 'second': 'second', 'third': 'third', 'button': 'button' }.

Setting up the callback url

The HTML5 interface will go through the API flow by itself, however right at the end it will ask for you to perform the last '/purchase_confirm' API call.

This is done for security reasons and also as a way for you to retrieve/store purchase information.

At this step you should check that the unique_token and list of products match the ones from your initial call.

You have to return the JSON response of the '/purchase_confirm' call.

# example POST API callback:
# POST http://an_url/callback
#
# encoded JSON body arguments:
# unique_token=UNIQUE_TOKEN
# purchase_id=AMBER_PURCHASE_ID
# products=AMBER_PRODUCT_INFORMATION
# prices=AMBER_PURCHASE_PRICES

# example nodejs implementation:

exports.confirmCallback = function(req, res) {
  var privateToken = 'YOUR_PRIVATE_AMBER_TOKEN';
  var testMode = req.body.test_mode;


  var callPath = '/v1.0/purchase_confirm?private_token=' + privateToken; 

  // add &test_mode=dummy_data for testing.
  if (testMode && testMode == 'dummy_data') {
    callPath += "&test_mode=dummy_data";
  }

  var purchaseId  = req.body.purchase_id;
  var uniqueToken = req.body.unique_token;

  // { siteId: { productMD5: { title, price, image, url } } }
  var products  = req.body.products; 

  // { siteId: { sales_tax, shipping_price, final_price_before_coupon, final_price, estimated } }
  // In case the user presses pre-confirm the prices might be missing or 'estimated'.
  var prices  = req.body.prices;

  // ...Check validity of request...

  // Call the amber api to confirm (note https).
  rest.post('https://api.twotap.com' + callPath, {
    data: { purchase_id: purchaseId },
  }).on('complete', function(data, response) {
    res.json(data);
    return;
  });  
};
            

Testing the HTML5 interface

There are two test modes in the interface: dummy_data and fake_confirm.

dummy_data

In this test mode the HTML5 interface will go through a pre-created purchase without making any API calls to the underlying stores.

fake_confirm

In the fake_confirm test mode the HTML5 interface will go through the purchase as usual, except at the final 'Purchase Confirm' step where the system wil return a fake OK and not place the order.

It's important to note that stores validate payment information when the order is actually placed, consequently store data errors (like card not valid) can appear in the last step which are going to be ignored.

Web Integration Example

We provide a very simple skeleton example for a desktop website integrating the HTML5 interface in this github repository.

iOS Integration Example

We provide a very simple skeleton example for a iOS app integrating the HTML5 interface in this github repository.



API Interface

You can use the API to create your own personalized checkout experience.

The interaction is divided into three separate tasks which have to be executed in order: '/add_to_cart', '/purchase_info', '/purchase_confirm'.

Add to cart

The first request you have to make is to '/add_to_cart'. Send '/add_to_cart' a list of products and it will return product information (title, price, image) and the required fields that the user has to fill in to finalize the purchase.

The response will include the required fields for one or two possible checkout flows: authenticated (authCheckout, if the user has an account on that website), and as guest (noauthCheckout).

This request is processed in the background. You have to call '/add_to_cart/status' which will retrieve the relevant information once the job is finished.

Initial request

#!/usr/bin/env ruby

require 'rubygems'
require 'rest_client'

products = [ 'http://fab.com/sale/4850/product/11263/', 'http://fab.com/sale/4800/product/43565/' ]

response = RestClient.post "https://api.twotap.com/v1.0/add_to_cart?public_token=5fbd6c0ffa8cd02801dc", { "products": products }

puts response.body
            

Request

POST https://api.twotap.com/v1.0/add_to_cart?public_token=PUBLIC_TOKEN

Parameters

products A list of product URLs.
test_mode (Optional) dummy_data or fake_confirm. A way to test the API the interface without making actual purchases.

Response

{
  "cart_id": "50f414b9e6a4869bf6000009",
  "message": "still_processing",
  "description": "Still processing."
}                    
            

Response description

cart_id An ID to use when checking the cart status.
message The status, which will be 'still_processing'.
description A more human friendly description of the status.

Add to cart status

Call '/add_to_cart/status' to see the status of an '/add_to_cart' request. The response is different if response['message'] is 'still_processing', 'failed', or 'done'.

Status request

#!/usr/bin/env ruby

require 'rubygems'
require 'rest_client'

cart_id = ARGV[0]

response = RestClient.get "https://api.twotap.com/v1.0/add_to_cart/status?public_token=5fbd6c0ffa8cd02801dc&cart_id=#{cart_id}"

puts response.body
            

Request

GET https://api.twotap.com/v1.0/add_to_cart/status?public_token=PUBLIC_TOKEN

Parameters

cart_id The cart id that is sent by '/add_to_cart'.
test_mode (Optional) dummy_data or fake_confirm. A way to test the API the interface without making actual purchases.

Still processing response

{
  "sites": {
    "50f414b9e6a4869bf6000002": {
      "add_to_cart": {
        "8aa20fab1787c6f9eef77a0bd8a70ae3": {
          "last_message": "Fetching title.",
          "url": "http://fab.com/sale/4850/product/11263/",
          "status": "done"
        },
        "aa5cb27ddd44c3cb639d11419d9574db": {
          "last_message": "Fetching required fields.",
          "url": "http://fab.com/sale/4800/product/43565/",
          "status": "still_processing"
        }
      },
      "info": {
        "name": "Fab",
        "url": "fab.com"
      }
    }
  },
  "cart_id": "50f414b9e6a4869bf6000009",
  "message": "still_processing",
  "description": "Still processing."
} 
          

Completed response

{
  "sites": {
    "50f414b9e6a4869bf6000002": {
      "info": {
        "name": "Fab",
        "url": "fab.com"
      },
      "coupon_support": true,
      "required_fields": {
        "authCheckout": {
          "country": {
            "input_options": [],
            "input_type": "text",
            "input_name": "INPUT"
          }
        },
        "noauthCheckout": {
          "address": {
            "field_type": "shipping",
            "input_values": [],
            "input_type": "text",
            "input_name": "INPUT"
          },
          "last_name": {
            "field_type": "shipping",
            "input_values": [],
            "input_type": "text",
            "input_name": "INPUT"
          },
          "first_name": {
            "field_type": "shipping",
            "input_values": [],
            "input_type": "text",
            "input_name": "INPUT"
          },
           "shipping_country": {
            "field_type": "shipping",
            "input_values": [
              {
                "value": "",
                "text": "Please Select"
              },
              {
                "value": "AG",
                "text": "Antigua And Barbuda"
              },
              {
                "value": "AR",
                "text": "Argentina"
              },
            ],
            "input_type": "select-one",
            "input_name": "SELECT"
          }
        },
        "login": {
          "password": {
            "input_options": [],
            "input_type": "password",
            "input_name": "INPUT"
          },
          "email": {
            "input_options": [],
            "input_type": "text",
            "input_name": "INPUT"
          }
        }
      },
      "add_to_cart": {
        "367bcd6f21fc7568b135c387d3fa5d57": {
          "required_fields": {
            "quantity": {
              "input_type": "text",
              "input_name": "INPUT"
            },
            "Size": {
              "input_type": "select-one",
              "input_name": "SELECT"
            },
            "Color": {
              "input_type": "select-one",
              "input_name": "SELECT"
            }
          },
          "required_field_values": {
            "Color": [
              {
                "value": "",
                "text": "First, choose color",
                "dep": {
                  "Size": [
                    {
                      "value": "",
                      "text": "Then, choose size",
                      "dep": {}
                    }
                  ]
                }
              },
              {
                "value": "13233550|1055745",
                "text": "Red",
                "dep": {
                  "Size": [
                    {
                      "value": "",
                      "text": "Then, choose size",
                      "dep": {}
                    },
                    {
                      "value": "13233550|13442751",
                      "text": "28",
                      "dep": {}
                    },
                    {
                      "value": "13233550|13442753",
                      "text": "30",
                      "dep": {}
                    },
                  ]
                }
              },
              {
                "value": "13233550|1055747",
                "text": "Black",
                "dep": {
                  "Size": [
                    {
                      "value": "",
                      "text": "Then, choose size",
                      "dep": {}
                    },
                    {
                      "value": "13233550|13442771",
                      "text": "28",
                      "dep": {}
                    },
                  ]
                }
              },
              {
                "value": "13233550|1068432",
                "text": "New Blue",
                "dep": {
                  "Size": [
                    {
                      "value": "",
                      "text": "Then, choose size",
                      "dep": {}
                    },
                    {
                      "value": "13233550|13442762",
                      "text": "29",
                      "dep": {}
                    },
                    {
                      "value": "13233550|13442763",
                      "text": "30",
                      "dep": {}
                    }
                  ]
                }
              }
            ]
          },          
          "url": "http://fab.com/sale/4850/product/11263",
          "image": "//d15bx2axpp9a1x.cloudfront.net/product/92931-360x360-1355670380-primary.png",
          "price": "41€",
          "title": "Heart Pendant Red Small",
          "status": "done"
        }
      },
      "failed_to_add_to_cart": {},
        "8aa20fab1787c6f9eef77a0bd8a70ae3": {
          "field_values": {},
          "url": "http://fab.com/sale/4800/product/43565/"
        },
      }
    }
  },
  "unknown_urls": [
    "http://www.google.com"
  ],
  "cart_id": "511fa680692d5d9e06000001",
  "message": "has_failures",
  "description": "Encountered some errors while parsing the urls."
}                        
            

Response description

message The status, which can be 'still_processing', 'has_failures', or 'done'.
description A more human friendly description of the status.
unknown_urls An array with URLs that Two Tap does not support yet.
sites A hash that contains information grouped by a siteID.
sites[id][info] A hash that contains the 'name' and 'url' of the site.
sites[id][coupon_support] true or false. If we have coupon support for a certain site.
sites[id][required_fields]

A hash that contains the required fields grouped by three possible flows: 'login', 'authCheckout', and 'noauthCheckout'.

For non-authenticated checkouts send the 'noauthCheckout' fields. For authenticated checkouts send the 'authCheckout' and 'login' fields.

sites[id][required_fields][flow] A hash that contains the required fields grouped by the field name.
sites[id][required_fields][flow][field] A hash that contains input_name, input_type, and input_options (in case of SELECT).
sites[id][add_to_cart] A hash that contains product information grouped by it's URL MD5.
sites[id][add_to_cart][productMD5][last_message] The latest status message sent by the request processor. This is used during the 'still_processing' phase.
sites[id][add_to_cart][productMD5][required_fields] A hash that contains the product required fields grouped by their field name.
sites[id][add_to_cart][productMD5][required_field_values] A hash that contains the possible product required field values as a dependency tree.
sites[id][add_to_cart][productMD5][url] URL of the product.
sites[id][add_to_cart][productMD5][image] The product's image URL.
sites[id][add_to_cart][productMD5][price] The product's price.
sites[id][add_to_cart][productMD5][title] The product's title.
sites[id][add_to_cart][productMD5][status] The processing status for this product. Can be 'done' or 'still_processing'.
sites[id][failed_to_add_to_cart] Similar to sites[id][add_to_cart] however it lists which products have failed processing for some reason.

Purchase info

Purchase info will retrieve the shipping price and final price of the order. It will start the checkout process but not finish it to ensure the data sent back is valid.

If in the '/add_to_cart' request the required_fields entry contains both 'authCheckout' and 'noauthCheckout' it means that two checkout flows are supported: logged in and not logged in. You have to pick one of the two flows. If you send both the API will proceed with the not logged in checkout flow.

This request needs to be POSTed with the field information that was required in '/add_to_cart'. It is processed in the background which means you have to call '/purchase_info/status' which will retrieve the relevant information once the job is finished.

Once this request finishes you will have 2 minutes available to call '/purchase_confirm' to confirm it.

On authenticated checkout flows (authCheckout) Two Tap currently supports only using the shipping and payment information the user has saved on that particular site.

Initial request

#!/usr/bin/env ruby

require 'rubygems'
require 'rest_client'

cart_id = ARGV[0]

fields_input = { 
  "50f414b9e6a4869bf6000002": {
    "authCheckout": { "country": "Hungary" }, 
    "login": { "password": "password", "email": "user" },
    "addToCart": {
      "367bcd6f21fc7568b135c387d3fa5d57": { "quantity": 1 }
    }
  }
}

affiliate_links = {
  "50f414b9e6a4869bf6000002": "http://affiliate_link"  
}

products = [ 'http://fab.com/sale/4850/product/11263' ]

response = RestClient.post "https://api.twotap.com/v1.0/purchase_info?public_token=5fbd6c0ffa8cd02801dc", { "cart_id": cart_id, "fields_input": fields_input, "affiliate_links": affiliate_links, "products": products }

puts response.body
            

Request

POST https://api.twotap.com/v1.0/purchase_info?public_token=PUBLIC_TOKEN

Parameters

cart_id The cart id that is sent by '/add_to_cart'.
fields_input For non-authenticated checkout a hash that has the form:
{
  "[site_id]":
    {
      "noauthCheckout": { required checkout fields },
      "addToCart": {
        "[productMD5_1]": "required product fields",
        "[productMD5_2]": "required product fields",
      },
      "coupon": "(optional) coupon value"
    }
}
For authenticated checkout a hash that has the form:
{
  "[site_id]":
    {
      "authCheckout": { required checkout fields },
      "login": { required login fields },
      "addToCart": {
        "[productMD5_1]": "required product fields",
        "[productMD5_2]": "required product fields",
      }
      "coupon": "(optional) coupon value"
    }
}
affiliate_links (Optional) A hash that has the form:
{ "[site_id]": "affiliate_link" }
or if you need per product affiliate links:
{ "[site_id]": { "[productMD5]": "affiliate_link" } }
Please note that per product affiliate links will increase the checkout time.
products (Optional) An array of product URLs that have accepted by the user. This is useful in case a user removes some items between /add_to_cart and /purchase_info.

If specified fields_input should contain only the required data for those products.
test_mode (Optional) dummy_data or fake_confirm. A way to test the API the interface without making actual purchases.

Response

{
  "purchase_id": "50f414b9e6a4869bf6000010",
  "message": "still_processing",
  "description": "Still processing."
}              
            

Purchase info status

Call '/purchase_info/status' to see the status of a '/purchase_info' request. The response is different if response['message'] is 'still_processing', 'failed', or 'done'.

Status Request

#!/usr/bin/env ruby

require 'rubygems'
require 'rest_client'

purchase_id = ARGV[0]

response = RestClient.get "https://api.twotap.com/v1.0/purchase_info/status?public_token=5fbd6c0ffa8cd02801dc&purchase_id=#{purchase_id}"

puts response.body
            

Request

GET https://api.twotap.com/v1.0/purchase_info/status?public_token=PUBLIC_TOKEN

Parameters

purchase_id The purchase id that is sent by '/purchase_info'.
test_mode (Optional) dummy_data or fake_confirm. A way to test the API the interface without making actual purchases.

Still processing response

{
  "purchase_id": "50f414b9e6a4869bf6000010",
  "message": "still_processing",
  "description": "Still processing.",
  "sites": {
    "50f414b9e6a4869bf6000002": {
      "info": {
        "url": "fab.com",
        "name": "Fab"
      },
      "last_message": "Logging in.",
      "status": "still_processing"
    }
  }
}
          

Completed response

{
  "sites": {
    "50f414b9e6a4869bf6000002": {
      "prices": {
        "sales_tax": "$4.11",   
        "final_price_before_coupon": "$54.00",   
        "final_price": "$51.10",
        "shipping_price": "$7.00"
      },
      "details": {
        "active_payment_method": "The active payment method (only for authenticated checkouts).",
        "active_shipping_address": "The active shipping address (only for authenticated checkouts).",
        "shipping_estimate": "The estimated delivery date",
      },
      "info": {
        "url": "fab.com",
        "name": "Fab"
      },
      "status": "done",
      "status_messages": [
        "An array of errors.",
        "Present only if status is failed."
      ]
    }
  },
  "purchase_id": "511294b0a73e4a9059000001",
  "message": "done"
}                      
            

Purchase Confirm

Purchase confirm finalizes the order. Only perform this request server side as it uses your private token.

This request is available for 2 minutes after '/purchase_info' finishes.

Initial request

#!/usr/bin/env ruby

require 'rubygems'
require 'rest_client'

purchase_id = ARGV[0]

response = RestClient.post "https://api.twotap.com/v1.0/purchase_confirm?private_token=PRIVATE_TOKEN", { purchase_id: purchase_id }

puts response.body
            

Response

{
  "purchase_id": "50f414b9e6a4869bf6000010",
  "message": "still_processing",
  "description": "Still processing.",
}
            

Request

POST https://api.twotap.com/v1.0/purchase_confirm?private_token=PRIVATE_TOKEN

Parameters

purchase_id The purchase id that is sent by '/purchase_info'.
test_mode (Optional) dummy_data or fake_confirm. A way to test the API the interface without making actual purchases.

Purchase confirm status

Call '/purchase_confirm/status' to see the status of a '/purchase_confirm' request. The response is different if response['message'] is 'still_processing', 'failed', or 'done'.

Status Request

#!/usr/bin/env ruby

require 'rubygems'
require 'rest_client'

purchase_id = ARGV[0]

response = RestClient.get "https://api.twotap.com/v1.0/purchase_confirm/status?public_token=5fbd6c0ffa8cd02801dc&purchase_id=#{purchase_id}"

puts response.body
            

Request

GET https://api.twotap.com/v1.0/purchase_confirm/status?public_token=PUBLIC_TOKEN

Parameters

purchase_id The purchase id that is sent by '/purchase_info'.
test_mode (Optional) dummy_data or fake_confirm. A way to test the API the interface without making actual purchases.

Still processing response

{
  "purchase_id": "50f414b9e6a4869bf6000010",
  "message": "still_processing",
  "description": "Still processing.",
  "sites": {
    "50f414b9e6a4869bf6000002": {
      "info": {
        "url": "fab.com",
        "name": "Fab"
      },
      "last_message": "Logging in.",
      "status": "still_processing"
    }
  }
}
            

Completed response

{
  "sites": {
    "50f414b9e6a4869bf6000002": {
      "info": {
        "url": "fab.com",
        "name": "Fab"
      },
      "status": "done",
      "status_messages": [
        "An array of errors.",
        "Present only if status is failed."
      ],
      "order_id": "The order id might be present for some stores."
    }
  },
  "purchase_id": "511550c2e083368d6d000002",
  "message": "done"
}               
            

Supported sites

Query this url to get a list of our currently supported sites.

Request

#!/usr/bin/env ruby

require 'rubygems'
require 'rest_client'

purchase_id = ARGV[0]

response = RestClient.get "https://api.twotap.com/v1.0/supported_sites"

puts response.body
            

Response

[
  {
    "name":"6PM",
    "url":"6pm.com",
    "logo":"https://amber.io/system/recipes/logos/52a8/4673/55a0/f908/d100/0003/small/logo6pm.png?1387014488870"
  }
  [..]
]

            

Testing

There are two test modes available in the API: dummy_data and fake_confirm. You can send a &test_mode=[dummy_data or fake_confirm] keypair with any API calls.

For more information see testing in the HTML5 interface.

Examples

See complete checkout flows in different programming languages in this github repository.




The Wallet

The wallet allows users and developers to store data with Two Tap and use them for purchases. The retrieving and storing of data is integrated in the '/add_to_cart' and '/purchase_info' requests if 'user_token' is sent as a parameter.


Storing data (/purchase_info)

Storing of data is done automatically during '/purchase_info' if a 'user_token' is supplied.


Retrieving data (/add_to_cart)

When posting a request to '/add_to_cart' if a 'user_token' is present the API will respond with the stored entries for the required fields.

The stored fields are grouped in three possible categories: 'shipping', 'payment', and 'login'. The user can store multiple shipping addresses, payment methods, and login credentials which are grouped together.

The 'shipping' and 'payment' groups are identified by a random id. 'login' groups are identified by the site_id they belong to.

Wallet Retrieval


# Similar to a regular '/add_to_cart' request however an 'user_token' is specified.
response = RestClient.post "https://api.twotap.com/v1.0/add_to_cart?public_token=5fbd6c0ffa8cd02801dc", { "products": products, "user_token": '32cac5ae6db921d0472b07558df290846bce3859fc' }

# Completed Status Response
{
  "sites": {
    # ...
  },
  "stored_field_values": {
    "shipping": {
      "o6nfusor": {
        "data": {
          "email": {
            "value": "anemail@gmail.com"
          },
          "shipping_last_name": {
            "value": "Doe"
          },
          "shipping_first_name": {
            "value": "Joe"
          }
        },
        "name": "John, Doe, anemail@gmail.com"
      }
    },
    "login": {
      "50f414b9e6a4869bf6000002": {
        "data": {
          "email": {
            "value": "anuser@gmail.com"
          }
        },
        "name": "anuser@gmail.com"
      }
    }
  },
  # ...
}
            

Using data (/purchase_info)

Each 'shipping', 'payment', and 'login' groups have an id associated with it. These fields are used during '/purchase_info'.

Instead of adding the key=value pairs to the required field values just use 'shipping_group_id', 'payment_group_id', or 'login_group_id' with the associated value.

Wallet Usage


# During a /purchase_info request.
required_fields = { 
  "516dece5e6a4862049000001": {
    "authCheckout": { "shipping_group_id": "xvv4pldi",  "an_extra_required_field": "has this value" }, 
    "login": { "login_group_id": "50f414b9e6a4869bf6000002" },
    "addToCart": {
      "6e69ada944a4c35bb320615b827ad60a": { "quantity": 1, "Size": "13233550|13442751", "Color": "13233550|1055745" }
    }
  }
}
            

Possible keys and values

Two Tap works with a lot of merchants and as such we require a lot of input data. We've standardized some of them to ensure that the wallet is consistent on all purchases.

Possible keys

shipping
shipping_titleshipping_first_nameshipping_last_nameshipping_nameshipping_address
shipping_cityshipping_stateshipping_countryshipping_zipshipping_telephone
emailemail_confirmationpasswordpassword_confirmation
login
emailusernamepassword
payment
card_typecard_numbercard_nameexpiry_date_yearexpiry_date_month
cvvbilling_titlebilling_first_namebilling_last_namebilling_name
billing_addressbilling_citybilling_statebilling_countrybilling_zip
billing_telephone

Possible values

The fields listed here require data in the format below. If you don't respect this you will break user's wallets.

card_type
VisaVisa ElectronMastercardAmerican ExpressDiscover
month_of_birth
0102030405
0607080910
1112
expiry_date_month
0102030405
0607080910
1112
expiry_date_year
20132014201520162017
20182019202020212022
2023
year_of_birth
19301931193219331934
19351936193719381939
19401941194219431944
19451946194719481949
19501951195219531954
19551956195719581959
19601961196219631964
19651966196719681969
19701971197219731974
19751976197719781979
19801981198219831984
19851986198719881989
19901991199219931994
19951996199719981999
20002001200220032004
20052006200720082009
20102011201220132014
shipping_title, billing_title
Dr.MissMr.Mrs.Ms.
shipping_state, billing_state
AlabamaAlaskaAlbertaAmerican SamoaArizona
ArkansasArmed Forces AmericasArmed Forces EuropeArmed Forces PacificBritish Columbia
CaliforniaColoradoConnecticutDelawareDistrict of Columbia
District of ColumbiaFederated States of MicronesiaFloridaGeorgiaGuam
HawaiiIdahoIllinoisIndianaIowa
KansasKentuckyLouisianaMaineManitoba
Marshall IslandsMarylandMassachusettsMichiganMinnesota
MississippiMissouriMontanaNebraskaNevada
New BrunswickNew HampshireNew JerseyNew MexicoNew York
Newfoundland and LabradorNorth CarolinaNorth DakotaNorthern Mariana IslandsNorthwest Territories
Nova ScotiaNunavutOhioOklahomaOntario
OregonPalauPennsylvaniaPrince Edward IslandPuerto Rico
QuebecRhode IslandSaskatchewanSouth CarolinaSouth Dakota
TennesseeTexasU.S. Virgin IslandsUtahVermont
VirginiaWashingtonWest VirginiaWisconsinWyoming
Yukon
shipping_country, billing_country
AfghanistanAland IslandsAlbaniaAlgeriaAmerican Samoa
AndorraAngolaAnguillaAntarcticaAntigua and Barbuda
ArgentinaArmeniaArubaAustraliaAustria
AzerbaijanBahamasBahrainBangladeshBarbados
BelarusBelgiumBelizeBeninBermuda
BhutanBoliviaBosnia and HerzegowinaBotswanaBouvet Island
BrazilBritish Indian Ocean TerritoryBrunei DarussalamBulgariaBurkina Faso
BurundiCambodiaCameroonCanadaCape Verde
Cayman IslandsCentral African RepublicChadChileChina
Christmas IslandCocos (Keeling) IslandsColombiaComorosCongo
Congo, The Democratic Republic Of TheCook IslandsCosta RicaCote D'IvoireCroatia
CubaCyprusCzech RepublicDenmarkDjibouti
DominicaDominican RepublicEast TimorEcuadorEgypt
El SalvadorEquatorial GuineaEritreaEstoniaEthiopia
Falkland Islands (Malvinas)Faroe IslandsFijiFinlandFrance
French GuianaFrench Southern TerritoriesGabonGambiaGeorgia
GermanyGhanaGibraltarGreeceGreenland
GrenadaGuadeloupeGuamGuatemalaGuinea
Guinea-BissauGuyanaHaitiHeard And Mc Donald IslandsHonduras
Hong KongHungaryIcelandIndiaIndonesia
IranIraqIrelandIsle of ManIsrael
ItalyJamaicaJapanJordanKazakhstan
KenyaKiribatiKuwaitKyrgyzstanLao People's Democratic Republic
LatviaLebanonLesothoLiberiaLibyan Arab Jamahiriya
LiechtensteinLithuaniaLuxembourgMacauMacedonia, The Former Yugoslav Republic
MadagascarMalawiMalaysiaMaldivesMali
MaltaMarshall IslandsMartiniqueMauritaniaMauritius
MayotteMexicoMicronesia (Federated States Of)MoldovaMonaco
MongoliaMontenegroMontserratMoroccoMozambique
MyanmarNamibiaNauruNepalNetherlands
Netherlands AntillesNew CaledoniaNew ZealandNicaraguaNiger
NigeriaNiueNorfolk IslandNorth KoreaNorthern Mariana Islands
NorwayOmanPakistanPalauPalestenian Territories
PanamaPapua New GuineaParaguayPeruPhilippines
PitcairnPolandPortugalPuerto RicoQatar
ReunionRomaniaRussian FederationRwandaSaint Kitts And Nevis
Saint LuciaSaint Vincent And The GrenadinesSamoaSan MarinoSao Tome And Principe
Saudi ArabiaScotlandSenegalSerbiaSeychelles
Sierra LeoneSingaporeSlovakiaSloveniaSolomon Islands
SomaliaSouth AfricaSouth Georgia And The South Sandwich IslSouth KoreaSpain
Spain - Canary IslandsSri LankaSt BarthelemySt. HelenaSt. Pierre And Miquelon
SudanSurinameSvalbard And Jan Mayen IslandsSwazilandSweden
SwitzerlandSyrian Arab RepublicTahitiTaiwan, Province of ChinaTajikistan
Tanzania, United Republic OfThailandTogoTokelauTonga
Trinidad And TobagoTunisiaTurkeyTurkmenistanTurks And Caicos Islands
TuvaluUgandaUkraineUnited Arab EmiratesUnited Kingdom
United Kingdom - GuernseyUnited Kingdom - JerseyUnited States Minor Outlying IslandsUnited States of AmericaUruguay
UzbekistanVanuatuVatican City State (Holy See)VenezuelaVietnam
Virgin Islands (British)Virgin Islands (U.S)Wallis And Futuna IslandsWestern SaharaYemen
ZambiaZimbabwe