Introduction

The varinode API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We allow you to interact securely with our API from a client-side web application (though you should remember that you should never expose your secret API key in any public website's client-side code). JSON will be returned in all responses from the API, including errors (though if you're using API bindings, we will convert the response to the appropriate language-specific object).

To make the varinode API as explorable as possible, we offer a test_mode option that will never hit the credit card networks and will never cost you money.

The varinode API has the following URL structure:

https://apiv1.varinode.com?
appid=87aa2fa6dc254e9f8ad4b74e36461784&
format=json&
method=products.getFromURLs&
tt_sig=df3689f57f93d548a98b49ffe3057e38
                			

URL Details

Base URL

https://apiv1.varinode.com to access the Products and Orders methods.

https://capiv1.varinode.com to access the Customers, Cards, and Addresses methods.

appid
This value, along with the public_secret, and private_secret will be supplied to you by the varinode team. It will be specific to your company/app.
format
As the api currently only supports JSON, this value should always be set to 'json'.
method
The name of the method you are calling. It can be one of the many methods listed below. Ie. products.addToCart, products.getCart, orders.setInfo
tt_sig
This value is generated in real-time to sign the API call. See the code directly below for examples on how to generate this value.
Important: Use your assigned public_secret value to sign Products and Orders method calls. Use your assigned private_secret value to sign Customers, Cards, and Addresses method calls.

function api_generate_sig($params, $secret) {
  $s = '';
  
  if (is_array($params)) {
  	ksort($params);
  	foreach ($params as $k => $v) 
  	  $s .= "$k=$v";
  }
  
  $s .= $secret;
  return md5($s);
}

//Use your assigned public_secret value to sign Products and Orders method calls
$public_secret = '0ade7fbbf70f4101bf51d16a4c374bab';
//Use your assigned private_secret value to sign Customers, Cards, and Addresses method calls
//$private_secret = 'e448647541be4400abfd60a53005ea13'; 

$qs_arr = array(
  'appid' => '87aa2fa6dc254e9f8ad4b74e36461784',
  'format' => 'json',
  'method' => 'products.getFromURLs'
);

$tt_sig = api_generate_sig($qs_arr, $public_secret);
	                        			
#!/usr/bin/python

import hashlib

def api_generate_sig(params, secret):
  if type(params) == dict:
    # sorted returns a sorted list of keys
    # Generate a list of k=v strings and combine all into a single string
    s = "".join(["%s=%s" % (k, params[k]) for k in sorted(params)])
    s += secret
    return hashlib.md5(s).hexdigest()

# Use your assigned public_secret value to sign Products and Orders method calls
public_secret = '0ade7fbbf70f4101bf51d16a4c374bab'
# Use your assigned private_secret value to sign Customers, Cards, and Addresses method calls
# private_secret = 'e448647541be4400abfd60a53005ea13'

qs_arr = {
    'appid': '87aa2fa6dc254e9f8ad4b74e36461784',
    'format': 'json',
    'method': 'products.getFromURLs'
}

tt_sig = api_generate_sig(qs_arr, public_secret)
                      					
- (NSString*)md5:(NSString*)input
{
  const char *cStr = [input UTF8String];
  unsigned char digest[16];
  CC_MD5( cStr, strlen(cStr), digest );
  
  NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
  
  for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
    [output appendFormat:@"%02x", digest[i]];
    
  return  output;
}
                      						
- (NSString *)api_generate_sig:(NSDictionary *)params secret:(NSString *)secret
{
  NSString *result = @"";
  
  if ([params isKindOfClass:[NSDictionary class]])
  {
  	NSArray *keys = params.allKeys;
  	keys = [self sortArrayByAlphabet:keys];
    for (NSString *key in keys)
    {
    	NSString *value = [params objectForKey:key];
    	result = [result stringByAppendingFormat:@"%@=%@", key, value];
    }
  }
    
  result = [result stringByAppendingString:secret];
  result = [self md5:result];
  return result;
}

// Use your assigned public_secret value to sign Products and Orders method calls
NSString *public_secret = @"0ade7fbbf70f4101bf51d16a4c374bab";
// Use your assigned private_secret value to sign Customers, Cards, and Addresses method calls
// NSString *private_secret = @"e448647541be4400abfd60a53005ea13";

NSMutableDictionary *qs_arr = [NSMutableDictionary dictionary];
[qs_arr setObject:@"87aa2fa6dc254e9f8ad4b74e36461784" forKey:@"appid"];
[qs_arr setObject:@"json" forKey:@"format"];
[qs_arr setObject:@"products.getFromURLs" forKey:@"method"];

NSString *tt_sig = [self api_generate_sig:qs_arr secret:public_secret];
                      					
//Use your assigned public_secret value to sign Products and Orders method calls
var public_secret = '0ade7fbbf70f4101bf51d16a4c374bab';
//Use your assigned private_secret value to sign Customers, Cards, and Addresses method calls
//var private_secret = 'e448647541be4400abfd60a53005ea13'; 

var qs_arr = {
  appid: '87aa2fa6dc254e9f8ad4b74e36461784',
  format: 'json',
  method: 'products.getFromURLs'
};

var tt_sig = require('./api_generate_sig').api_generate_sig(qs_arr, public_secret);


Click here to view api_generate_sig.js
                      					
require 'digest'

def api_generate_sig params, secret
  if params.class == Hash
    params = Hash[params.sort]
    s = params.map{|k,v| "#{k}=#{v}"}.join
  else
    s = ''
  end
  s += secret
  return Digest::MD5.hexdigest s
end

# Use your assigned public_secret value to sign Products and Orders method calls
public_secret = '0ade7fbbf70f4101bf51d16a4c374bab'
# Use your assigned private_secret value to sign Customers, Cards, and Addresses method calls
# private_secret = 'e448647541be4400abfd60a53005ea13'

qs_arr = {
  'appid' => '87aa2fa6dc254e9f8ad4b74e36461784',
  'format' => 'json',
  'method' => 'products.getFromURLs'
}

tt_sig = api_generate_sig(qs_arr, public_secret)
                      					

 

Products

Set of methods that enable you to retrieve and manage products for use with your cart.

 

products.getFromURLs

Use this to retrieve real-time availability and attributes for a product.

Input Parameters

product_urls
Required

This is an array of product urls from supported online retailers.

$inputParams = array('product_urls'=>array(
  'http://bananarepublic.gap.com/browse/product.do?cid=66299&vid=1&pid=423451022',
  'http://shop.nordstrom.com/s/halogen-stretch-woven-a-line-skirt-regular-petite/3627603',
  'http://www.gap.com/browse/product.do?cid=5231&vid=1&pid=767861362'
);
	                        			
Example coming soon
                      					

Example Response

{
  "processed_sites":{
    "b40016e84ed448d7b1b3f9508ee6a492":{
      "site_info":{
        "site_id":"b40016e84ed448d7b1b3f9508ee6a492",
        "site_name":"Banana Republic",
        "site_url":"bananarepublic.gap.com",
        "site_logo":"http://static.varinode.com/bananarepublic-png.png",
        "site_accepted_card_types":{
          "visa":"on",
          "amex":"on",
          "discover":"on",
          "mastercard":"on"
        },
        "site_shipping_options":{
          "US":{
            "default_value":"1304",
            "values":{
              "2012":{
                "text":"7-9 Business days ($50+)",
                "price":"0",
                "value":"2012"
              },
              "1304":{
                "text":"3-5 Business days",
                "price":"7",
                "value":"1304"
              },
              "2066":{
                "text":"2 Business Days",
                "price":"17",
                "value":"2066"
              },
              "2064":{
                "text":"1 Business day",
                "price":"22",
                "value":"2064"
              }
            }
          }
        },
        "site_gifting_options":{
          "US":{
            "default_value":"0",
            "gift_msg_max_chars":"60",
            "values":{
              "0":{
                "text":"No Gift Option",
                "price":"0",
                "value":"0"
              },
              "3":{
                "text":"Gift Message",
                "price":"0",
                "value":"3"
              },
              "1":{
                "text":"Gift Box",
                "price":"5",
                "value":"1"
              },
              "2":{
                "text":"Gift Kit",
                "price":"2",
                "value":"2"
              }
            }
          }
        },
        "required_parameters":{
          "US":{
            "guest_account":{
              "email":""
            },
            "login_account":{
              "username":"",
              "password":""
            }
          }
        },
        "optional_parameters":{
          "US":{
            "promo_codes":[],
            "gift_cards":[
              {
                "number":"",
                "pin_access_code":""
              }
            ],
            "shipping_option":"",
            "gifting_options":[
              {
                "gift_ids":[],
                "gift_option":"",
                "gift_to":"",
                "gift_from":"",
                "gift_msg":""
              }
            ]
          }
        }
      },
      "urls_failed":[],
      "products":{
        "4fccb1f55c8c4e959b4dd9f334d90424":{
          "required_attributes":{
            "color":{
              "default_value":"1021",
              "values":{
                "1017":{
	              "text":"Black",
	              "swatch_image":"http://bananarepublic.gap.com/Asset_Archive/BRWeb/Assets/Product/423/423451/swatch/br423451-00sv01.gif",
	              "images":["http://bananarepublic.gap.com/Asset_Archive/BRWeb/Assets/Product/423/423451/big/br423451-00vliv01.jpg"],
	              "videos":[],
	              "value":"1017"
	            },
	            "1021":{
	              "text":"Navy star",
	              "swatch_image":"http://bananarepublic.gap.com/webcontent/0004/667/450/cn4667450.jpg",
	              "images":["http://bananarepublic.gap.com/webcontent/0004/667/460/cn4667460.jpg"],
	              "videos":[],
	              "value":"1021"
	            },
	            "1029":{
	              "text":"White",
	              "swatch_image":"http://bananarepublic.gap.com/webcontent/0004/353/796/cn4353796.jpg",
	              "images":["http://bananarepublic.gap.com/webcontent/0004/353/802/cn4353802.jpg"],
	              "videos":[],
	              "value":"1029"
	            }
	          }
	        },
	        "size":{
	          "default_value":"1528",
	          "values":{
	            "1528":{
	              "text":"XS",
	              "value":"1528"
	            },
	            "1529":{
	              "text":"S",
	              "value":"1529"
	            },
	            "1530":{
	              "text":"M",
	              "value":"1530"
	            }
	          }
	        },
	        "quantity":{
	          "default_value":1
		    }
		  },
		  "attribute_dependencies":{
		    "color":{
		      "1017":{
		        "size":{
		          "1528":{
		            "price":"39.5",
		            "orig_price":"39.5"
		          },
		          "1529":{
		            "price":"39.5",
		            "orig_price":"39.5"
		          },
		          "1530":{
		            "price":"39.5",
		            "orig_price":"39.5"
		          }
		        }
		      },
		      "1021":{
		        "size":{
		          "1528":{
		            "price":"39.5",
		            "orig_price":"39.5"
		          },
		          "1529":{
		            "price":"39.5",
		            "orig_price":"39.5"
		          },
		          "1530":{
		            "price":"39.5",
		            "orig_price":"39.5"
		          }
		        }
		      },
		      "1029":{
		        "size":{
		          "1528":{
		            "price":"39.5",
		            "orig_price":"39.5"
		          },
		          "1529":{
		            "price":"39.5",
		            "orig_price":"39.5"
		          },
		          "1530":{
		            "price":"39.5",
		            "orig_price":"39.5"
		          }
		        }
		      }
		    }
		  },
		  "product_id":"4fccb1f55c8c4e959b4dd9f334d90424",
		  "product_title":"Signature piqué polo",
		  "product_description":[
		    "Our pique polos have a special performance finish that helps them maintain color and shape, reducing shrinkage and pilling.",
		    "Relaxed polo collar. Buttoned placket.",
		    "Embroidered elephant at chest."
		  ],
		  "product_price":"39.5",
		  "product_image":"http://bananarepublic.gap.com/webcontent/0004/667/460/cn4667460.jpg",
		  "product_url":"http://bananarepublic.gap.com/browse/product.do?cid=66299&vid=1&pid=423451022"
        }
      }
    }
  },
  "status":"complete",
  "unsupported_urls":[]
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
unsupported_urls
An array of URLS that we were not able to process. A URL ends up in this list if it is for a site we have not supported yet.
processed_sites
A hash of site_id's that were processed from the provided URLs. Each hash item will represent a different site.
processed_sites[h][site_info]
A hash containing the site_id, site_name, site_url, site_logo, site_accepted_card_types, site_shipping_options, site_gifting_options, optional_parameters, and required_parameters.
processed_sites[h][site_info][site_accepted_card_types]
A hash of the card types the site accepts. The keys are the values you would pass into the orders.setInfo payment[card_type] parameter.
processed_sites[h][site_info][site_shipping_options][US]
A hash of the attributes that are needed to specify the shipping option. Possible hash values will vary based on the retailer. You can specify the shipping option and pass it into the orders.setInfo shipping_option parameter.
processed_sites[h][site_info][site_gifting_options][US]
A hash of the attributes that are needed to specify the gifting options. Possible hash values will vary based on the retailer. You can specify the gift options in an array of hashes and pass them into the orders.setInfo gifting_options parameter.
processed_sites[h][site_info][required_parameters][US]
A hash of the parameters required to checkout on the given site. Possible hash values include 'guest_account', 'new_account', and 'login_account'. If more than one type of account related hash is returned, you must choose one of them to pass into the orders.setInfo sites[] parameter.
processed_sites[h][site_info][required_parameters][US][guest_account]
A hash of the parameters needed to checkout as a guest user. This parameter is only returned if the site supports guest checkout.
processed_sites[h][site_info][required_parameters][US][new_account]
A hash of the parameters needed to create a new account on the site. This parameter is returned if the site requires an account to checkout.
processed_sites[h][site_info][required_parameters][US][login_account]
A hash of the parameters needed to checkout using an existing account on the site. Not all sites will have this feature supported.
processed_sites[h][site_info][optional_parameters][US]
A hash of the optional parameters that can be specified during checkout on the given site. Possible hash values include 'promo_codes', 'shipping_option', 'gifting_options', and 'gift_cards'. These values are to be passed into the orders.setInfo sites[] parameter.
processed_sites[h][site_info][optional_parameters][US][promo_codes]
This parameter is returned if the given site has support for promo codes. You can specify the promo codes in an array and pass them into the orders.setInfo sites[] parameter.
processed_sites[h][site_info][optional_parameters][US][gift_cards]
This parameter is returned if the given site has support for gift cards. You can specify the gift cards in an array of hashes and pass them into the orders.setInfo sites[] parameter. Some sites may require both the 'number' and 'pin_access_code' hashes, while others only require the 'number' hash.
processed_sites[h][site_info][optional_parameters][US][shipping_option]
This parameter is returned if the given site has support for selecting a specific shipping option. You can specify the shipping option by passing it into the orders.setInfo sites[] parameter.
processed_sites[h][site_info][optional_parameters][US][gifting_options]
This parameter is returned if the given site has support for gifting. You can specify the gifting options in an array of hashes and pass them into the orders.setInfo sites[] parameter.
processed_sites[h][urls_failed]
An array of URLs that is returned when there are failed responses.
processed_sites[h][products]
A hash of products that were retrieved from the supplied URLs.
processed_sites[h][products][h][required_attributes]
A hash of the required attributes that are needed when adding products to cart. Possible hash values include 'color', 'size', 'waist', 'length', and 'quantity'. Some retailers may have additional hash values.
processed_sites[h][products][h][attribute_dependencies]
A hash of the required attributes, and their possible combinations, presented in the form of a dependency tree.
processed_sites[h][products][h][product_id]
A unique identifier for a product. This id is required when specifying products to add to the cart.
processed_sites[h][products][h][product_title]
The title for the product.
processed_sites[h][products][h][product_description]
An array of descriptions for the product.
processed_sites[h][products][h][product_price]
The current price for the product.
processed_sites[h][products][h][product_image]
A URL for a current image of the product.
processed_sites[h][products][h][product_url]
The original URL for the product.
h represents a hash key
n represents an integer index in the array
 

products.addToCart

Add products to the cart.

Input Parameters

cart_id
Optional

If you wish to add products to an existing cart, specifiy the cart_id for the cart you want to add to.

sites
Required

A hash specifying the products to add from a site. The API supports both site specific, and product specific affiliate links. Typically, you would only specify either the site or the product affiliate link, not both. The hash has the form:

{
  [site_id]:{
    "products":{
      [product_id]:{
        "color" => "value",
        "size" => "value",
        "waist" => "value",
        "length" => "value",
        "quantity" => "value",
        "affiliate_link" => "PRODUCT_AFFIL_URL_HERE",
      }
    },
    "affiliate_link":"SITE_AFFIL_URL_HERE"
  }
}

$inputParams = array(
  'cart_id' => '', //optional
  'sites'=> array(
    'b40016e84ed448d7b1b3f9508ee6a492' => array(
      'products' => array(
        '4fccb1f55c8c4e959b4dd9f334d90424' => array(
          'color' => '1017',
          'size' => '1528',
          'quantity' => 1
        )
      ),
      'affiliate_link' => 'http://www.somesite.com/affiliateid=43949392494'
    )
  )
);
	                        			
Example coming soon
	                      				

Example Response

{
  "cart_id":"a49445c333ac4f0d930bdf73ceed3204",
  "processed_sites":{
    "b40016e84ed448d7b1b3f9508ee6a492":{
      "site_info":{
        "site_id":"b40016e84ed448d7b1b3f9508ee6a492",
        "site_name":"Banana Republic",
        "site_url":"bananarepublic.gap.com",
        "site_logo":"http://static.varinode.com/bananarepublic-png.png",
        "site_accepted_card_types":{
          "visa":"on",
          "amex":"on",
          "discover":"on",
          "mastercard":"on"
        },
        "required_parameters":{
          "US":{
            "guest_account":{
              "email":""
            },
            "login_account":{
              "username":"",
              "password":""
            }
          }
        },
        "optional_parameters":{
          "US":{
            "promo_codes":[],
            "gift_cards":[
              {
                "number":"",
                "pin_access_code":""
              }
            ]
          }
        }
      },
      "products_failed":[],
      "products_added":["4fccb1f55c8c4e959b4dd9f334d90424"]
    }
  },
  "status":"complete",
  "unsupported_sites":[]
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
unsupported_sites
An array of site_id's that we were not able to process.
cart_id
A unique identifier for the cart. This id is required when adding more items to an existing cart, retrieving cart contents, removing items from a cart, and saving shipping/payment information for an order.
processed_sites
A hash of site_id's that were processed from the provided "sites" input parameter. Each hash item will represent a different site.
processed_sites[h][site_info]
A hash containing the site_id, site_name, site_url, site_logo, site_accepted_card_types, site_shipping_options, site_gifting_options, optional_parameters, and required_parameters.
processed_sites[h][site_info][site_accepted_card_types]
A hash of the card types the site accepts. The keys are the values you would pass into the orders.setInfo payment[card_type] parameter.
processed_sites[h][site_info][required_parameters][US]
A hash of the parameters required to checkout on the given site. Possible hash values include 'guest_account', 'new_account', and 'login_account'. If more than one of these hashes is returned, you must choose one of them to pass into the orders.setInfo sites[] parameter.
processed_sites[h][site_info][optional_parameters][US]
A hash of the optional parameters that can be specified during checkout on the given site. Possible hash values include 'promo_codes', 'shipping_option', 'gifting_options', and 'gift_cards'. These values are to be passed into the orders.setInfo sites[] parameter.
processed_sites[h][products_added]
An array of product_id's representing the products that were successfully added to the cart.
processed_sites[h][products_failed]
An array of hashes representing the products that failed to add to cart. The hash contains "msg" and "id" values.
h represents a hash key
n represents an integer index in the array
 

products.getCart

Retrieve the products in a specific cart.

Input Parameters

cart_id
Required

The id for the cart you wish to retrieve the contents for.

$inputParams = array(
  'cart_id' => 'a49445c333ac4f0d930bdf73ceed3204'
);
	                        			
Example coming soon
	                      				

Example Response

{
  "cart_id":"a49445c333ac4f0d930bdf73ceed3204",
  "processed_sites":{
    "b40016e84ed448d7b1b3f9508ee6a492":{
      "site_info":{
        "site_id":"b40016e84ed448d7b1b3f9508ee6a492",
        "site_name":"Banana Republic",
        "site_url":"bananarepublic.gap.com",
        "site_logo":"http://static.varinode.com/bananarepublic-png.png",
        "site_accepted_card_types":{
          "visa":"on",
          "amex":"on",
          "discover":"on",
          "mastercard":"on"
        },
        "required_parameters":{
          "US":{
            "guest_account":{
              "email":""
            },
            "login_account":{
              "username":"",
              "password":""
            }
          }
        },
        "optional_parameters":{
          "US":{
            "promo_codes":[],
            "gift_cards":[
              {
                "number":"",
                "pin_access_code":""
              }
            ]
          }
        }
      },
      "products":[
        {
          "product_image":"http://bananarepublic.gap.com//Asset_Archive/BRWeb/Assets/Product/423/423451/category/br423451-00viv01.jpg",
          "product_url":"http://bananarepublic.gap.com/browse/product.do?pid=4234510020000&cid=66299",
          "product_id":"4fccb1f55c8c4e959b4dd9f334d90424",
          "product_title":"Signature piqué polo",
          "product_details":{
            "skuid":"4234510020000",
            "color":"Black",
            "size":"XS"
          },
          "product_unitprice":"39.50",
          "product_quantity":"1",
          "product_subtotal":"39.50",
          "product_remove_id":"8858416269",
          "product_gift_id":"8858416269"
        }
      ],
      "cart_details":{
        "subtotal":"39.50",
        "tax":"",
        "total":"46.50",
        "shipping_cost":7,
        "shipping_estimate":"3-5 Business Days"
      }
    }
  ],
  "unsupported_sites":[],
  "status":"complete"
}
                       

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
unsupported_sites
An array of site_id's that we were not able to process.
cart_id
The unique identifier for the cart retrieved.
processed_sites
A hash of site_id's that had products in the given cart. Each hash item will represent a different site.
processed_sites[h][site_info]
A hash containing the site_id, site_name, site_url, site_logo, site_accepted_card_types, site_shipping_options, site_gifting_options, optional_parameters, and required_parameters.
processed_sites[h][site_info][site_accepted_card_types]
A hash of the card types the site accepts. The keys are the values you would pass into the orders.setInfo payment[card_type] parameter.
processed_sites[h][site_info][required_parameters][US]
A hash of the parameters required to checkout on the given site. Possible hash values include 'guest_account', 'new_account', and 'login_account'. If more than one of these hashes is returned, you must choose one of them to pass into the orders.setInfo sites[] parameter.
processed_sites[h][site_info][optional_parameters][US]
A hash of the optional parameters that can be specified during checkout on the given site. Possible hash values include 'promo_codes', 'shipping_option', 'gifting_options', and 'gift_cards'. These values are to be passed into the orders.setInfo sites[] parameter.
processed_sites[h][products]
An array of hashes for products in the cart. Each array item represents a different product.
processed_sites[h][products][n][product_image]
A URL for a current image of the product.
processed_sites[h][products][n][product_url]
The original URL for the product.
processed_sites[h][products][n][product_id]
The product id for the item in the cart. This is the same product_id specified in the products.addToCart call
processed_sites[h][products][n][product_title]
The title for the product.
processed_sites[h][products][n][product_unitprice]
The unit price for the product.
processed_sites[h][products][n][product_quantity]
The quantity of this product in the cart.
processed_sites[h][products][n][product_subtotal]
The subtotal for this product in the cart. Equivalent to product_quantity * product_unitprice
processed_sites[h][products][n][product_remove_id]
A unique identifier required later when removing this specific product from this specific cart.
processed_sites[h][products][n][product_gift_id]
A unique identifier required when specifying the gifting_options in the orders.setInfo sites[] parameter.
processed_sites[h][products][n][product_details]
A hash containing details regarding the product. The values available will vary based on the product and site. Do not assume that a specific values, such as "color", will always be present.
processed_sites[h][cart_details]
A hash with details concerning the sites cart.
processed_sites[h][cart_details][subtotal]
The subtotal for all products in the sites cart.
processed_sites[h][cart_details][tax]
The tax applied to the sites cart. This value may be empty, due to insufficient information necessary to calculate the associated tax.
processed_sites[h][cart_details][shipping_cost]
The amount the site charges to ship the items in its cart.
processed_sites[h][cart_details][shipping_estimate]
The estimate for when the site will deliver the products to your door.
processed_sites[h][cart_details][total]
The total cost to purchase the products at the site.
h represents a hash key
n represents an integer index in the array
 

products.removeFromCart

Remove products from a specific cart.

Input Parameters

cart_id
Required

The id of the cart you wish to remove products from.

sites
Required

A hash specifying the products to remove from a sites cart. The hash has the form:

{
  [site_id]:{
    [product_remove_id]:"1"
    }
  }
}

$inputParams = array(
  'cart_id' => 'a49445c333ac4f0d930bdf73ceed3204',
  'sites'=> array(
    'b40016e84ed448d7b1b3f9508ee6a492' => array(
      '8858416269' => 1
    )
  )
);
	                        			
Example coming soon
	                      				

Example Response

{
  "cart_id":"a49445c333ac4f0d930bdf73ceed3204",
  "processed_sites":{
    "b40016e84ed448d7b1b3f9508ee6a492":{
      "site_info":{
        "site_id":"b40016e84ed448d7b1b3f9508ee6a492",
        "site_name":"Banana Republic",
        "site_url":"bananarepublic.gap.com",
        "site_logo":"http://static.varinode.com/bananarepublic-png.png",
        "site_accepted_card_types":{
          "visa":"on",
          "amex":"on",
          "discover":"on",
          "mastercard":"on"
        },
        "required_parameters":{
          "US":{
            "guest_account":{
              "email":""
            },
            "login_account":{
              "username":"",
              "password":""
            }
          }
        },
        "optional_parameters":{
          "US":{
            "promo_codes":[],
            "gift_cards":[
              {
                "number":"",
                "pin_access_code":""
              }
            ]
          }
        }
      },
      "products_failed":[],
      "products_removed":[
        8858416269
      ]
    }
  },
  "status":"complete",
  "unsupported_sites":[],
  "invalid_sites":[]
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
unsupported_sites
An array of site_id's that we were not able to process.
invalid_sites
An array of site_id's that had no products in the specified cart.
cart_id
The unique identifier for the cart the remove action was made on.
processed_sites
A hash of site_id's that had the product remove action applied on the given cart. Each hash item will represent a different site.
processed_sites[h][site_info]
A hash containing the site_id, site_name, site_url, site_logo, site_accepted_card_types, site_shipping_options, site_gifting_options, optional_parameters, and required_parameters.
processed_sites[h][site_info][site_accepted_card_types]
A hash of the card types the site accepts. The keys are the values you would pass into the orders.setInfo payment[card_type] parameter.
processed_sites[h][site_info][required_parameters][US]
A hash of the parameters required to checkout on the given site. Possible hash values include 'guest_account', 'new_account', and 'login_account'. If more than one of these hashes is returned, you must choose one of them to pass into the orders.setInfo sites[] parameter.
processed_sites[h][site_info][optional_parameters][US]
A hash of the optional parameters that can be specified during checkout on the given site. Possible hash values include 'promo_codes', 'shipping_option', 'gifting_options', and 'gift_cards'. These values are to be passed into the orders.setInfo sites[] parameter.
processed_sites[h][products_failed]
An array of hashes representing the products that failed to remove from cart. The hash contains "msg" and "id" values.
processed_sites[h][products_removed]
An array of product_id's identifying the products that were successfully removed from the cart.
h represents a hash key
n represents an integer index in the array
 
 

Orders

Set of methods that enable you to enter your information, and submit the order.

orders.setInfo

Submit the checkout method, shipping, billing, and payment information.

Input Parameters

cart_id
Required

The id of the cart you wish to apply the submitted information to.

shipping_address
Required

A hash specifying the shipping address details for the order. The hash has the form:

{
  "first_name":"value"
  "last_name":"value"
  "address_line1":"value"
  "address_line2":"value"
  "city":"value"
  "state":"value"
  "country_code":"value"
  "zip_postal_code":"value"
  "phone":"value"
}

shipping_address_id
Optional

Instead of specifying the "shipping_address" parameter, you can use this parameter to retrieve stored address information.

billing_address
Required (Optionally specify parameter "card_id" instead)

A hash specifying the billing address details for the order. The hash has the form:

{
  "first_name":"value"
  "last_name":"value"
  "address_line1":"value"
  "address_line2":"value"
  "city":"value"
  "state":"value"
  "country_code":"value"
  "zip_postal_code":"value"
  "phone":"value"
}

payment
Required (Optionally specify parameter "card_id" instead)

A hash specifying the payment details for the order. The hash has the form:

{
  "card_type":"value"
  "card_number":"value"
  "card_expiry_month":"value"
  "card_expiry_year":"value"
  "card_cvv":"value"
}

card_id
Optional

Instead of specifying the "billing_address" and "payment" hash parameters, you can use this parameter to retrieve stored billing/payment information.

sites
Required

A hash used to specify the checkout method (Ie. guest_account, new_account, login_account), and apply, one or more, site specific promotion codes to the order. The hash has the form:

{
  [site_id]:{
    "guest_account":{
      "email":"value"
    }
    "new_account":{
      "email":"value"
      "password":"value"
      "gender":"value"
      "birth_date":"value"
      "birth_month":"value"
      "birth_year":"value"
    }
    "login_account":{
      "username":"value"
      "password":"value"
    }
    "promo_codes":["value","value"]
    "gift_cards":[
      {
        "number":"value"
        "pin_access_code":"value"
      }
    ]
    "shipping_option":"value"
    "gifting_options":[
      {
        "gift_ids":["value","value"]
        "gift_option":"value"
        "gift_to":"value"
        "gift_from":"value"
        "gift_msg":"value"
      }
    ]
  }
}

$inputParams = array(
  'cart_id' => 'a49445c333ac4f0d930bdf73ceed3204',
  'shipping_address' => array(
    'first_name' => 'Michelle',
    'last_name' => 'Phan',
    'address_line1' => '98 Fake Street',
    'address_line2' => 'Unit 77',
    'city' => 'San Francisco',
    'state' => 'CA',
    'country_code' => 'US',
    'zip_postal_code' => '94014',
    'phone' => '4158889999'
  ),
  //'shipping_address_id' => 'dfd94786db634a0e5b7a34872hfb168a',
  //You could replace the 'shipping_address' parameter with the shipping_address_id token
  'billing_address' => array(
    'first_name' => 'Michelle',
    'last_name' => 'Phan',
    'address_line1' => '98 Fake Street',
    'address_line2' => 'Unit 77',
    'city' => 'San Jose',
    'state' => 'CA',
    'country_code' => 'US',
    'zip_postal_code' => '94014',
    'phone' => '4158889999'
  ),
  'payment' => array(
    'card_type' => 'visa',
    'card_number' => '4264426442644264',
    'card_expiry_month' => '02',
    'card_expiry_year' => '2017',
    'card_cvv' => '123'
  ),
  //'card_id' => 'c46456a51aba4b1188faee194e413586',	
  //You could replace the 'billing_address' and 'payment' parameters with the card_id token
  'sites' => array(
    'b40016e84ed448d7b1b3f9508ee6a492' => array(
      'guest_account' => array(
        'email' => 'fake@emailaddress.com'
      ),
      'promo_codes' => array('BRSUNDAY','JULYSHIP'),
      'gift_cards' => array(
        array(
          'number' => '8024109844856355',
          'pin_access_code' => '443' //This value may not be required for some retailer gift cards
        )
      ),
      'shipping_option' => '1304',
      'gifting_options' => array(
        array(
          'gift_ids' => array('8858416269'),
          'gift_option' => '1',
          'gift_to' => 'Hey Friend',
          'gift_from' => 'Phan Crew',
          'gift_msg' => 'Hope you enjoy this gift!'
        )
      )
    )
  )
);
	                        			
Example coming soon
	                      				

Example Response

{
  "pre_order_id":"3a34de89d87246f189b43baf6fd3da72",
  "processed_sites":{
    "b40016e84ed448d7b1b3f9508ee6a492":{
      "site_info":{
        "site_id":"b40016e84ed448d7b1b3f9508ee6a492",
        "site_name":"Banana Republic",
        "site_url":"bananarepublic.gap.com",
        "site_logo":"http://static.varinode.com/bananarepublic-png.png"
      },
      "order_details":{
        "subtotal":"39.50",
        "shipping_cost":"7.00",
        "shipping_estimate":"3-5 business days",
        "tax":"4.07",
        "total":"50.57"
      },
      "result":"save_complete",
      "result_message":"complete"
    }
  },
  "status":"complete",
  "unsupported_sites":[]
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
unsupported_sites
An array of site_id's that we were not able to process.
pre_order_id
A unique identifier that you will need to use to submit and complete your order.
processed_sites
A hash of site_id's that identify sites which successfully processed the submitted shipping, billing, and payment information. Each hash item will represent a different site.
processed_sites[h][site_info]
A hash containing the site_id, site_name, site_url, and site_logo.
processed_sites[h][order_details]
A hash containing updated cart details.
processed_sites[h][order_details][subtotal]
The subtotal for all products in the sites cart.
processed_sites[h][order_details][shipping_cost]
The amount the site charges to ship the items in its cart.
processed_sites[h][order_details][shipping_estimate]
The estimate for when the site will deliver the products to your door.
processed_sites[h][order_details][tax]
The tax applied to the sites cart.
processed_sites[h][order_details][total]
The total cost to purchase the products at the site.
processed_sites[h][result]
The result of submitting the shipping, billing, and payment information to the site. If successful, the result returned will be "save_complete".
processed_sites[h][result_message]
Accompanies the 'result' parameter. If an error occurs, the details will be returned here.
h represents a hash key
n represents an integer index in the array
 

orders.submit

Submit and complete the order.

Input Parameters

pre_order_id
Required

The unique identifier returned from the orders.setInfo method. This specifies which order to submit.

test_mode
Optional

Set this parameter when you want to test, and do not wish to have your credit card processed.

$inputParams = array(
  'pre_order_id' => '3a34de89d87246f189b43baf6fd3da72',
  //'test_mode' => 'true'
);
	                        			
Example coming soon
	                      				

Example Response

{
  "pre_order_id":"3a34de89d87246f189b43baf6fd3da72",
  "processed_sites":{
    "b40016e84ed448d7b1b3f9508ee6a492":{
      "site_info":{
        "site_id":"b40016e84ed448d7b1b3f9508ee6a492",
        "site_name":"Banana Republic",
        "site_url":"bananarepublic.gap.com",
        "site_logo":"http://static.varinode.com/bananarepublic-png.png"
      },
      "order_id":"77d3e78d558142a9aa089f8b0861cf5f",
      "result":"complete",
      "result_message":"complete"
    }
  },
  "status":"complete",
  "unsupported_sites":[]
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
unsupported_sites
An array of site_id's that we were not able to process.
pre_order_id
The identifier for the order that was submitted.
processed_sites
A hash of site_id's that identify sites which successfully processed the order request. Each hash item will represent a different site.
processed_sites[h][site_info]
A hash containing the site_id, site_name, site_url, and site_logo.
processed_sites[h][order_id]
The order confirmation id returned from the site the transaction occurred at. Orders at the site should be referenced using this value.
processed_sites[h][result]
The result of the order at the site. If successful, the result returned will be "complete".
processed_sites[h][result_message]
Accompanies the 'result' parameter. If an error occurs, additional details will be returned here.
h represents a hash key
n represents an integer index in the array
 
 

Customers

Set of methods that enable you to manage your customers.

customers.add

Add a new customer. This is a prerequisite in cases where you'd like to store a customers billing and shipping details.

Input Parameters

customer_email
Optional

The customers email address.

customer_phone
Optional

The customers phone number.

customer_description
Optional

miscellaneous information about the customer.

$inputParams = array(
  'customer_email' => 'fake@emailaddress.com',
  'customer_phone' => '4158889999',
  'customer_description' => 'Anything goes here'
);
	                        			
Example coming soon
	                      				

Example Response

{
  "customer":{
    "customer_id":"e78b566900e3413d9434ea9382fd75a1",
    "customer_email":"fake@emailaddress.com",
    "customer_phone":"4158889999",
    "customer_description":"Anything goes here",
    "customer_default_card_id":"0",
    "customer_default_address_id":"0",
    "customer_status":"active"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
customer
A hash containing details from the customer that was just created.
customer[customer_id]
A unique identifier assigned to this customer.
customer[customer_email]
The customers email address. If not set, the value will return "0".
customer[customer_phone]
The customers phone number. If not set, this value will return "0".
customer[customer_description]
Miscellaneous information about the customer. If not set, this value will return "0".
customer[customer_default_card_id]
The customers default card token. For new customers, this value will return "0".
customer[customer_default_address_id]
The customers default address token. For new customers, this value will return "0".
customer[customer_status]
The status of the customer. For new customers, this value will return "active".

customers.get

Retrieve the details for an existing customer.

Input Parameters

customer_id
Required

The unique identifier for the customer you'd like to retrieve.

$inputParams = array(
  'customer_id' => 'e78b566900e3413d9434ea9382fd75a1'
);
	                        			
Example coming soon
	                      				

Example Response

{
  "customer":{
    "customer_id":"e78b566900e3413d9434ea9382fd75a1",
    "customer_email":"fake@emailaddress.com",
    "customer_phone":"4158889999",
    "customer_description":"Anything goes here",
    "customer_default_card_id":"0",
    "customer_default_address_id":"0",
    "customer_status":"active"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
customer
A hash containing details about the customer that was retrieved.
customer[customer_id]
A unique identifier indicating which customer the call pertains to.
customer[customer_email]
The customers email address. If not set, the value will return "0".
customer[customer_phone]
The customers phone number. If not set, this value will return "0".
customer[customer_description]
Miscellaneous information about the customer. If not set, this value will return "0".
customer[customer_default_card_id]
The customers default card token. If the customer has no cards stored, this value will return "0".
customer[customer_default_address_id]
The customers default address token. If the customer has no addresses stored, this value will return "0".
customer[customer_status]
The status of the customer. Potential values include "active", "suspended", "disabled", and "deleted".

customers.update

Update the details for an existing customer.

Input Parameters

customer_id
Required

The unique identifier for the customer you'd like to update.

customer_email
Optional

The customers email address.

customer_phone
Optional

The customers phone number.

customer_description
Optional

miscellaneous information about the customer.

customer_default_card_id
Optional

An existing card token.

customer_default_address_id
Optional

An existing address token.

$inputParams = array(
  'customer_id' => 'e78b566900e3413d9434ea9382fd75a1',
  'customer_email' => 'updated@emailaddress.com',
  'customer_phone' => '4159999999',
  'customer_description' => 'Updated description'
  //'customer_default_card_id' => 'f48b4gf690053413d42343a9382fd75a1',
  //'customer_default_address_id' => 'af33c7c5e9f1456993bf6378e09cf8c1'
);
	                        			
Example coming soon
	                      				

Example Response

{
  "customer":{
    "customer_id":"e78b566900e3413d9434ea9382fd75a1",
    "customer_email":"updated@emailaddress.com",
    "customer_phone":"4159999999",
    "customer_description":"Updated description",
    "customer_default_card_id":"0",
    "customer_default_address_id":"0",
    "customer_status":"active"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
customer
A hash containing details about the customer that was updated.
customer[customer_id]
A unique identifier indicating which customer the call pertains to.
customer[customer_email]
The customers email address. If not set, the value will return "0".
customer[customer_phone]
The customers phone number. If not set, this value will return "0".
customer[customer_description]
Miscellaneous information about the customer. If not set, this value will return "0".
customer[customer_default_card_id]
The customers default card token. If the customer has no cards stored, this value will return "0".
customer[customer_default_address_id]
The customers default address token. If the customer has no addresses stored, this value will return "0".
customer[customer_status]
The status of the customer. Potential values include "active", "suspended", "disabled", and "deleted".

customers.remove

Remove an existing customer.

Input Parameters

customer_id
Required

The unique identifier for the customer you'd like to remove.

$inputParams = array(
  'customer_id' => 'e78b566900e3413d9434ea9382fd75a1'
);
	                        			
Example coming soon
	                      				

Example Response

{
  "customer":{
    "customer_id":"e78b566900e3413d9434ea9382fd75a1",
    "customer_status":"deleted"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
customer
A hash containing details about the customer that was removed.
customer[customer_id]
A unique identifier indicating which customer the call pertains to.
customer[customer_status]
The status of the customer. If the remove was successful, the returned value should be "deleted".
 

Cards

Set of methods that enable you to manage customers' cards.

cards.add

Add a new card. It is recommended that you associate the card with an existing customer.

Input Parameters

card_customer_id
Optional

The customer_id that you'd like to associate this card with.

card_is_default
Optional

If you set the card_customer_id parameter, then optionally, you can also set whether it should become the customers new default_card_id.

billing_address
Required

A hash specifying the billing address details you wish to store. The hash has the form:

{
  "first_name":"value"
  "last_name":"value"
  "address_line1":"value"
  "address_line2":"value"
  "city":"value"
  "state":"value"
  "country_code":"value"
  "zip_postal_code":"value"
  "phone":"value"
}

payment
Required

A hash specifying the payment details you wish to store. The hash has the form:

{
  "card_type":"value"
  "card_number":"value"
  "card_expiry_month":"value"
  "card_expiry_year":"value"
  "card_cvv":"value"
}

$inputParams = array(
  'card_customer_id' => 'e78b566900e3413d9434ea9382fd75a1',
  'card_is_default' => 'true',
  'billing_address' => array(
    'first_name' => 'Michelle',
    'last_name' => 'Phan',
    'address_line1' => '98 Fake Street',
    'address_line2' => 'Unit 77',
    'city' => 'San Francisco',
    'state' => 'CA',
    'country_code' => 'US',
    'zip_postal_code' => '94014',
    'phone' => '4158889999'
  ),
  'payment' => array(
    'card_type' => 'visa',
    'card_number' => '4264426442644264',
    'card_expiry_month' => '02',
    'card_expiry_year' => '2017',
    'card_cvv' => '123'
  )
);
	                        			
Example coming soon
	                      				

Example Response

{
  "card":{
    "card_id":"c46456a51aba4b1188faee194e413586",
    "card_customer_id":"e78b566900e3413d9434ea9382fd75a1",
    "card_funding":"credit",
    "card_type":"visa",
    "card_last4":"4264",
    "card_expiry_month":"02",
    "card_expiry_year":"2017",
    "card_fingerprint":"822f374285acad4e59d9e67f024e4f63",
    "card_timestamp":"2014-07-04T10:08:09+00:00",
    "card_status":"active"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
card
A hash containing details about the card that was created.
card[card_id]
A unique identifier assigned for this card. This token can be used in the orders.setInfo method as a way to supply the billing address and payment information.
card[card_customer_id]
The customer this card is associated with. If none was specified, this will return "0".
card[card_funding]
The type of funding for the card. Can be 'credit', 'debit', 'prepaid', or 'unknown'.
card[card_type]
The type of card. Ie. visa
card[card_last4]
The last four digits of the card number.
card[card_expiry_month]
The expiry month for the card.
card[card_expiry_year]
The expiry year for the card.
card[card_fingerprint]
Uniquely identifies this particular card number. Can be helpful to check whether two customers who've signed up with you are using the same card number.
card[card_timestamp]
Identifies when the card was created.
card[card_status]
The status of the card. Potential values include "active", "suspended", "disabled", and "deleted".

cards.get

Retrieve the details for a card.

Input Parameters

card_id
Required

The unique identifier for the card you'd like to retrieve.

$inputParams = array(
  'card_id' => 'c46456a51aba4b1188faee194e413586'
);
	                        			
Example coming soon
	                      				

Example Response

{
  "card":{
    "card_id":"c46456a51aba4b1188faee194e413586",
    "card_customer_id":"e78b566900e3413d9434ea9382fd75a1",
    "card_funding":"credit",
    "card_type":"visa",
    "card_last4":"4264",
    "card_expiry_month":"02",
    "card_expiry_year":"2017",
    "card_fingerprint":"822f374285acad4e59d9e67f024e4f63",
    "card_timestamp":"2014-07-04T10:08:09+00:00",
    "card_status":"active"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
card
A hash containing details about the card that was retrieved.
card[card_id]
A unique identifier assigned for this card. This token can be used in the orders.setInfo method as a way to supply the billing address and payment information.
card[card_customer_id]
The customer this card is associated with. If none was specified, this will return "0".
card[card_funding]
The type of funding for the card. Can be 'credit', 'debit', 'prepaid', or 'unknown'.
card[card_type]
The type of card. Ie. visa
card[card_last4]
The last four digits of the card number.
card[card_expiry_month]
The expiry month for the card.
card[card_expiry_year]
The expiry year for the card.
card[card_fingerprint]
Uniquely identifies this particular card number. Can be helpful to check whether two customers who've signed up with you are using the same card number.
card[card_timestamp]
Identifies when the card was created.
card[card_status]
The status of the card. Potential values include "active", "suspended", "disabled", and "deleted".

cards.update

Update some of the details for a card. You can only update the billing address, the card expiry month, and the card expiry year.

Input Parameters

card_id
Required

The unique identifier for the card you'd like to update.

billing_address
Optional

A hash specifying the billing address details you wish to update. You do not have to include each item. The hash has the form:

{
  "first_name":"value"
  "last_name":"value"
  "address_line1":"value"
  "address_line2":"value"
  "city":"value"
  "state":"value"
  "country_code":"value"
  "zip_postal_code":"value"
  "phone":"value"
}

payment
Optional

A hash specifying the payment expiry you wish to update. The hash has the form:

{
  "card_expiry_month":"value"
  "card_expiry_year":"value"
}

$inputParams = array(
  'card_id' => 'c46456a51aba4b1188faee194e413586',
  'billing_address' => array(
    'address_line1' => '100 New Fake Street',
    'address_line2' => 'Unit 44',
    'city' => 'San Jose',
    'state' => 'CA',
    'country_code' => 'US',
    'zip_postal_code' => '95112'
  ),
  'payment' => array(
    'card_expiry_month' => '04',
    'card_expiry_year' => '2018'
  )
);
	                        			
Example coming soon
	                      				

Example Response

{
  "card":{
    "card_id":"c46456a51aba4b1188faee194e413586",
    "card_customer_id":"e78b566900e3413d9434ea9382fd75a1",
    "card_funding":"credit",
    "card_type":"visa",
    "card_last4":"4264",
    "card_expiry_month":"04",
    "card_expiry_year":"2018",
    "card_fingerprint":"3d6e56784acd46bc61eb071cdf99e97c",
    "card_timestamp":"2014-07-04T10:08:09+00:00",
    "card_status":"active"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
card
A hash containing details about the card that was updated.
card[card_id]
The unique identifier for the updated card. This token can be used in the orders.setInfo method as a way to supply the billing address and payment information.
card[card_customer_id]
The customer this card is associated with. If none was specified, this will return "0".
card[card_funding]
The type of funding for the card. Can be 'credit', 'debit', 'prepaid', or 'unknown'.
card[card_type]
The type of card. Ie. visa
card[card_last4]
The last four digits of the card number.
card[card_expiry_month]
The expiry month for the card.
card[card_expiry_year]
The expiry year for the card.
card[card_fingerprint]
Uniquely identifies this particular card number. Can be helpful to check whether two customers who've signed up with you are using the same card number.
card[card_timestamp]
Identifies when the card was created.
card[card_status]
The status of the card. Potential values include "active", "suspended", "disabled", and "deleted".

cards.remove

Remove an existing card.

Input Parameters

card_id
Required

The unique identifier for the card you'd like to remove.

$inputParams = array(
  'card_id' => 'c46456a51aba4b1188faee194e413586'
);
	                        			
Example coming soon
	                      				

Example Response

{
  "card":{
    "card_id":"c46456a51aba4b1188faee194e413586",
    "card_status":"deleted"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
card
A hash containing details about the card that was removed.
card[card_id]
A unique identifier indicating which card the call pertains to.
card[card_status]
The status of the card. If the remove was successful, the returned value should be "deleted".

cards.getList

Retrieve a list of a customers cards.

Input Parameters

customer_id
Required

The unique identifier for the customer you'd like to retrieve the list of cards for.

mods
Optional

A hash specifying some parameters used to paginate the returned list. The hash has the form:

{
  "limit":"value"
  "offset":"value"
}

$inputParams = array(
  'customer_id' => 'e78b566900e3413d9434ea9382fd75a1',
  'mods' => array(
    'limit' => '2',
    'offset' => '3'
  )
);
	                        			
Example coming soon
	                      				

Example Response

{
  "cards":[
    {
      "card_id":"c46456a51aba4b1188faee194e413586",
      "card_customer_id":"e78b566900e3413d9434ea9382fd75a1",
      "card_funding":"credit",
      "card_type":"visa",
      "card_last4":"4264",
      "card_expiry_month":"04",
      "card_expiry_year":"2018",
      "card_fingerprint":"3d6e56784acd46bc61eb071cdf99e97c",
      "card_timestamp":"2014-07-04T10:08:09+00:00",
      "card_status":"active"
    },
    {
      "card_id":"704b9219edc144698b60ca9c3eaf8bca",
      "card_customer_id":"e78b566900e3413d9434ea9382fd75a1",
      "card_funding":"credit",
      "card_type":"visa",
      "card_last4":"4585",
      "card_expiry_month":"03",
      "card_expiry_year":"2017",
      "card_fingerprint":"b1504677916ebd129050b285535ed343",
      "card_timestamp":"2014-07-04T11:44:02+00:00",
      "card_status":"active"
    }
  ],
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
cards
An array of hashes containing the card details for the specified customer.
cards[n][card_id]
The unique identifier for the retrieved card. This token can be used in the orders.setInfo method as a way to supply the billing address and payment information.
cards[n][card_customer_id]
The customer this card is associated with.
cards[n][card_funding]
The type of funding for the card. Can be 'credit', 'debit', 'prepaid', or 'unknown'.
cards[n][card_type]
The type of card. Ie. visa
cards[n][card_last4]
The last four digits of the card number.
cards[n][card_expiry_month]
The expiry month for the card.
cards[n][card_expiry_year]
The expiry year for the card.
cards[n][card_fingerprint]
Uniquely identifies this particular card number. Can be helpful to check whether two customers who've signed up with you are using the same card number.
cards[n][card_timestamp]
Identifies when the card was created.
cards[n][card_status]
The status of the card. Potential values include "active", "suspended", "disabled", and "deleted".
n represents an integer index in the array
 
 

Addresses

Set of methods that enable you to manage customers' addresses.

addresses.add

Add a new address. It is recommended that you associate the address with an existing customer.

Input Parameters

address_customer_id
Optional

The customer_id that you'd like to associate the address with.

address_is_default
Optional

If you set the address_customer_id parameter, then optionally, you can also set whether it should become the customers new default_address_id.

address
Required

A hash specifying the address details you wish to store. The hash has the form:

{
  "first_name":"value"
  "last_name":"value"
  "address_line1":"value"
  "address_line2":"value"
  "city":"value"
  "state":"value"
  "country_code":"value"
  "zip_postal_code":"value"
  "phone":"value"
}

$inputParams = array(
  'address_customer_id' => 'e78b566900e3413d9434ea9382fd75a1',
  'address_is_default' => 'true',
  'address' => array(
    'first_name' => 'Michelle',
    'last_name' => 'Phan',
    'address_line1' => '98 Fake Street',
    'address_line2' => 'Unit 77',
    'city' => 'San Francisco',
    'state' => 'CA',
    'country_code' => 'US',
    'zip_postal_code' => '94014',
    'phone' => '4158889999'
  )
);
	                        			
Example coming soon
	                      				

Example Response

{
  "address":{
  	"address_id":"dfd94786db634a0e5b7a34872hfb168a",
  	"address_customer_id":"e78b566900e3413d9434ea9382fd75a1",
  	"first_name":"Michelle",
  	"last_name":"Phan",
  	"address_line1":"98 Fake Street",
  	"address_line2":"Unit 77",
  	"city":"San Francisco",
  	"state":"CA",
  	"country_code":"US",
  	"zip_postal_code":"94014",
  	"phone":"4158889999",
  	"address_status":"active"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
address
A hash containing details about the address that was created.
address[address_id]
A unique identifier assigned for this address. This token can be used in the orders.setInfo method as a way to supply the shipping address information.
address[address_customer_id]
The customer this address is associated with. If none was specified, this will return "0".
address[first_name]
The first name associated with the address.
address[last_name]
The last name associated with the address.
address[address_line1]
The first line of the address.
address[address_line2]
The second line of the address.
address[city]
The city associated with the address.
address[state]
The state code associated with the address.
address[country_code]
The country code associated with the address.
address[zip_postal_code]
The zip code associated with the address.
address[phone]
The phone number associated with the address.
address[address_status]
The status of the address. Potential values include "active", "suspended", "disabled", and "deleted".

addresses.get

Retrieve the details for an address.

Input Parameters

address_id
Required

The unique identifier for the address you'd like to retrieve.

$inputParams = array(
  'address_id' => 'dfd94786db634a0e5b7a34872hfb168a'
);
	                        			
Example coming soon
	                      				

Example Response

{
  "address":{
  	"address_id":"dfd94786db634a0e5b7a34872hfb168a",
  	"address_customer_id":"e78b566900e3413d9434ea9382fd75a1",
  	"first_name":"Michelle",
  	"last_name":"Phan",
  	"address_line1":"98 Fake Street",
  	"address_line2":"Unit 77",
  	"city":"San Francisco",
  	"state":"CA",
  	"country_code":"US",
  	"zip_postal_code":"94014",
  	"phone":"4158889999",
  	"address_status":"active"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
address
A hash containing details about the address that was created.
address[address_id]
A unique identifier assigned for this address. This token can be used in the orders.setInfo method as a way to supply the shipping address information.
address[address_customer_id]
The customer this address is associated with. If none was specified, this will return "0".
address[first_name]
The first name associated with the address.
address[last_name]
The last name associated with the address.
address[address_line1]
The first line of the address.
address[address_line2]
The second line of the address.
address[city]
The city associated with the address.
address[state]
The state code associated with the address.
address[country_code]
The country code associated with the address.
address[zip_postal_code]
The zip code associated with the address.
address[phone]
The phone number associated with the address.
address[address_status]
The status of the address. Potential values include "active", "suspended", "disabled", and "deleted".

addresses.remove

Remove an existing address.

Input Parameters

address_id
Required

The unique identifier for the address you'd like to remove.

$inputParams = array(
  'address_id' => 'dfd94786db634a0e5b7a34872hfb168a'
);
	                        			
Example coming soon
	                      				

Example Response

{
  "address":{
    "address_id":"dfd94786db634a0e5b7a34872hfb168a",
    "address_status":"deleted"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
address
A hash containing details about the address that was removed.
address[address_id]
A unique identifier indicating which address the call pertains to.
address[address_status]
The status of the address. If the remove was successful, the returned value should be "deleted".

addresses.getList

Retrieve a list of a customers' addresses.

Input Parameters

customer_id
Required

The unique identifier for the customer you'd like to retrieve the list of addresses for.

mods
Optional

A hash specifying some parameters used to paginate the returned list. The hash has the form:

{
  "limit":"value"
  "offset":"value"
}

$inputParams = array(
  'customer_id' => 'e78b566900e3413d9434ea9382fd75a1',
  'mods' => array(
    'limit' => '2',
    'offset' => '3'
  )
);
	                        			
Example coming soon
	                      				

Example Response

{
  "addresses":[
    {
  	  "address_id":"dfd94786db634a0e5b7a34872hfb168a",
  	  "address_customer_id":"e78b566900e3413d9434ea9382fd75a1",
  	  "first_name":"Michelle",
  	  "last_name":"Phan",
  	  "address_line1":"98 Fake Street",
  	  "address_line2":"Unit 77",
  	  "city":"San Francisco",
  	  "state":"CA",
  	  "country_code":"US",
  	  "zip_postal_code":"94014",
  	  "phone":"4158889999",
  	  "address_status":"active"
    },
    {
  	  "address_id":"2c6ed9109ad8437a9650b13a86a910e4",
  	  "address_customer_id":"e78b566900e3413d9434ea9382fd75a1",
  	  "first_name":"Michelle",
  	  "last_name":"Phan",
  	  "address_line1":"220 Original Street",
  	  "address_line2":"Unit 5",
  	  "city":"Santa Clara",
  	  "state":"CA",
  	  "country_code":"US",
  	  "zip_postal_code":"95050",
  	  "phone":"4158889999",
  	  "address_status":"active"
    }
  ],
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
addresses
An array of hashes containing the address details for the specified customer.
addresses[n][address_id]
A unique identifier assigned for the retrieved address. This token can be used in the orders.setInfo method as a way to supply the shipping address information.
addresses[n][address_customer_id]
The customer associated with the address. If none was specified, this will return "0".
addresses[n][first_name]
The first name associated with the address.
addresses[n][last_name]
The last name associated with the address.
addresses[n][address_line1]
The first line of the address.
addresses[n][address_line2]
The second line of the address.
addresses[n][city]
The city associated with the address.
addresses[n][state]
The state code associated with the address.
addresses[n][country_code]
The country code associated with the address.
addresses[n][zip_postal_code]
The zip code associated with the address.
addresses[n][phone]
The phone number associated with the address.
addresses[n][address_status]
The status of the address. Potential values include "active", "suspended", "disabled", and "deleted".
n represents an integer index in the array
 

addresses.verify

Verify that a given address exists.

Input Parameters

address
Required

A hash specifying the address details you wish to verify. The hash has the form:

{
  "address_line1":"value"
  "address_line2":"value"
  "city":"value"
  "state":"value"
  "country_code":"value"
  "zip_postal_code":"value"
}

$inputParams = array(
  'address' => array(
    'address_line1' => '650 Post Street',
    'address_line2' => 'Unit 77',
    'city' => 'San Francisco',
    'state' => 'CA',
    'country_code' => 'US',
    'zip_postal_code' => '94109',
  )
);
	                        			
Example coming soon
	                      				

Example Response

{
  "address":{
    "address_line1":"650 POST ST UNIT 77",
    "address_line2":"",
    "city":"SAN FRANCISCO",
    "state":"CA",
    "country_code":"US",
    "zip_postal_code":"94109"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
address
A hash containing details about the address that was verified.
address[address_line1]
The first line of the verified address.
address[address_line2]
The second line of the verified address.
address[city]
The city associated with the verified address.
address[state]
The state code associated with the verified address.
address[country_code]
The country code associated with the verified address.
address[zip_postal_code]
The zip code associated with the verified address.

addresses.cityStateLookup

Lookup the city and state for a given zip code.

Input Parameters

address
Required

A hash specifying the zip code to utilize in looking up a city and state. The hash has the form:

{
  "zip_postal_code":"value"
}

$inputParams = array(
  'address' => array(
    'zip_postal_code' => '94109',
  )
);
	                        			
Example coming soon
	                      				

Example Response

{
  "address":{
    "city":"SAN FRANCISCO",
    "state":"CA",
    "zip_postal_code":"94109"
  },
  "status":"complete",
  "status_message":"complete"
}
                        

Result Description

status
The status of the call. Possible values include 'errors', 'complete', and 'complete_with_errors'.
status_message
Accompanies the 'status' parameter. If an error occurs, additional details will be returned here.
address
A hash containing details about the city and state lookup.
address[city]
The city associated with the specified zip code.
address[state]
The state code associated with the specified zip code.
address[zip_postal_code]
The zip code utilized to look up the city and state.
 

More...

Additional information to help you work your way around the varinode API.

Standard Values

In order to unify the experience, several parameter values have been standardized. Please use the following values when calling the API.

shipping_address[state], billing_address[state]

AL AK AS AZ
AR CA CO CT
DE DC FM FL
GA GU HI ID
IL IN IA KS
KY LA ME MH
MD MA MI MN
MS MO MT NE
NV NH NJ NM
NY NC ND MP
OH OK OR PW
PA PR RI SC
SD TN TX UT
VT VA VI WA
WV WI WY

shipping_address[country_code], billing_address[country_code]

AF AX AL DZ
AS AD AO AI
AQ AG AR AM
AW AU AT AZ
BS BH BD BB
BY BE BZ BJ
BM BT BO BA
BW BV BR IO
BN BG BF BI
KH CM CA CV
KY CF TD CL
CN CX CC CO
KM CG CD CK
CR CI HR CU
CY CZ DK DJ
DM DO EC EG
SV GQ ER EE
ET FK FO FJ
FI FR GF PF
TF GA GM GE
DE GH GI GR
GL GD GP GU
GT GG GN GW
GY HT HM VA
HN HK HU IS
IN ID IR IQ
IE IM IL IT
JM JP JE JO
KZ KE KI KR
KW KG LA LV
LB LS LR LY
LI LT LU MO
MK MG MW MY
MV ML MT MH
MQ MR MU YT
MX FM MD MC
MN ME MS MA
MZ MM NA NR
NP NL AN NC
NZ NI NE NG
NU NF MP NO
OM PK PW PS
PA PG PY PE
PH PN PL PT
PR QA RE RO
RU RW BL SH
KN LC MF PM
VC WS SM ST
SA SN RS SC
SL SG SK SI
SB SO ZA GS
ES LK SD SR
SJ SZ SE CH
SY TW TJ TZ
TH TL TG TK
TO TT TN TR
TM TC TV UG
UA AE GB US
UM UY UZ VU
VE VN VG VI
WF EH YE ZM
ZW

payment[card_type]

visa amex mastercard discover

payment[card_expiry_month]

01 02 03 04
05 06 07 08
09 10 11 12

payment[card_expiry_year]

2014 2015 2016 2017
2018 2019 2020 2021
2022 2023 2024 2025
2026 2027 2028 2029
2030

search[gender]

male female

Category Mapping

Main Categories Sub Categories
Tops : 2
Sweater/Hoody : 36 Tees : 20 Tanks : 165
Shirt : 58 Polo : 19 Miscellaneous : 414
Bottoms : 3
Pant : 33 Short : 30 Skirt : 32
Jeans : 172 Miscellaneous : 543
Outerwear : 4
Coat : 42 Raincoat : 104 Vest : 38
Jacket : 73 Bottom : 406 Miscellaneous : 415
Dresses : 5
Dress : 18 Gown : 99
Shoes : 6
Dress : 64 Casual : 40 Sneakers & Athletic : 24
Boots : 39 Flats : 51 Heels & Pumps : 46
Wedges : 53 Accessories : 407
Beauty : 7
Cosmetics : 23 Treatment : 34 Fragrances : 114
Hair : 98 Bath & Body : 120 Nail : 97
Miscellaneous : 548
Home : 14
Bedding : 134 Bath : 173 Kitchen : 148
Décor : 127 Dining : 145 Furnishings : 174
Tech & Office : 103 Book & Games : 94 Miscellaneous : 144
Accessories : 9
Hats : 57 Neckwear : 80 Scarves : 84
Eyewear : 112 Gloves : 142 Belts & Suspenders : 82
Umbrellas : 171 Miscellaneous : 416
Bags : 10
Formal & Designer : 26 Shoulder : 47 Backpacks : 52
Wallets : 89 Clutches : 65 Tech : 86
Luggage & Travel : 138 Small Accessories : 151 Duffels : 154
Jewelry : 11
Necklace : 37 Bracelet : 63 Earring : 45
Watch : 43 Ring : 59 Miscellaneous : 417
Swimwear : 12
Swimsuit : 55 Swimtop : 56 Swimbottom : 93
Cover-up : 54 Swimtrunk : 175
Sets : 13
Suit : 153 Formal & Contemporary : 176 Miscellaneous : 418
Underwear & Socks : 8
Bra : 61 Brief : 91 Camisole : 70
Boxer : 155 Slip/Garter : 78 Sleepwear : 74
Socks : 170 Miscellaneous : 419
Baby : 413
Furniture : 408 Mobile : 409 Bath : 410
Feeding : 411 Apparrel : 412 Miscellaneous : 547
Baby : 130
Furniture : 408 Mobile : 409 Bath : 410
Feeding : 411 Apparrel : 412 Accessories : 413
Miscellaneous : 547
Food : 177
Sports : 404
Pets : 405