Betaout HTTP

 

Structure

Every HTTP calls follow a very standard structure and the fields. In most case you will find two section of information to be provided, one is identifier and other which is required for the processing. Fields describe user identity, time stamping and mechanical aides like API version.

Identify

API End Point: https://api.betaout.com/v2/user/identify

This code is responsible for tracking every registered/subscribed user.

Example

{
   “apikey”: “–YOUR API KEY–“,
   “project_id”: “–YOUR PROJECT ID —“,
   “url”: “string”,
   “referrer”:”string”,
   “ip”: “string”,
   “timestamp”: “UNIX TIMESTAMP”,
   “identifiers”:{“customer_id”: “string”,
                 “email”: “string”,
                 “phone”: “string”,
                 “device_id”:”String”    
             },        
    “useragent”: “string”,
    “system”:{“os”:”string”,
              “browser”:”string”,
              “platform”:”string”,
              “device”:”string”
    },

     “campaign”: {

                    “utm_medium”: “string”,

                    “utm_source”: “string”,

                    “utm_campaign”: “string”,

                    “utm_term”:”string”,

                    “utm_content”:”string”

}
   }

Implementation of E-commerce Activities

  1. VIEW / Wishlist / Review / Share Product

API End Point: https://api.betaout.com/v2/ecommerce/activities

This code is responsible for tracking the product viewed,add_to_wishlist , remove_from_wishlist , review , share by user.

Example

{
   “apikey”: “–YOUR API KEY–“,
   “project_id”: “–YOUR PROJECT ID —“,
“identifiers”:{  
   “customer_id”:”string”,
   “email”:”string”,
   “phone”:”string”,
   “device_id”:”String”
},
“activity_type”:”view”,//add_to_wishlist / remove_from_wishlist / review / share

“timestamp”: 1483189751,

“products”:[
           {

                       “brandName”: “String”,
             “id”: “String”,
             “sku”: “String”,
             “name”: “String”,
             “price”: FLOAT,

                       “quantity”: INT
                         }
 ]}

2. Add / Remove / Update

API End Point: https://api.betaout.com/v2/ecommerce/activities

This code is responsible for capturing any product that’s added to cart / update cart/ remove from cart with the relevant quantity and also activating the cart.

Mapping the product with it’s category hierarchy will also give attribution to product’s for the user against the categories mapped.

 

E.g.

 

{
“apikey”: “–YOUR API KEY–“,
“project_id”: “–YOUR PROJECT ID —“,
“identifiers”:{  
   “customer_id”:”string”,
   “email”:”string”,
   “phone”:”string”,
   “device_id”:”String”
   
},
“activity_type”:”add_to_cart”,//remove_from_cart, update_cart
“cart_info”:{
            “cart_id”:”String”,
            “abandon_cart_url”:”String”,
            “abandon_cart_deeplink_android”:”String”,
            “abandon_cart_deeplink_ios”:”String”,
            “total”:FLOAT,
            “revenue”:FLOAT,
            “currency”:”String”
           },             
“products”:[
           {

“brandName”: “String”,
             “id”: “String”,
             “sku”: “String”,
             “name”: “String”,
             “price”:FLOAT,
             “quantity”: INT,
             “product_url”:”string”,
              “image_url”: “string”,
             “categories”:[
                        {
                        “cat_name”:”String”,
                        “cat_id”:”String”,                         “parent_cat_id”:”String”
                        },
                        {
                        “cat_name”:”String”,
                        “cat_id”:”String”,                         “parent_cat_id”:”String”
                        }
                    ]
           }
 ]
}

3. Purchase

API End Point: https://api.betaout.com/v2/ecommerce/activities

This code is responsible for capturing a purchase / order.

Example

{
   “apikey”: “–YOUR API KEY–“,
   “project_id”: “–YOUR PROJECT ID —“,
     “identifiers”:{  
        “customer_id”:”string”,
        “email”:”string”,
        “phone”:”string”,
        “device_id”:”String”
        
     },
     “activity_type”:”purchase”,
     “order_info”:{
                  “order_id”: “String”,
                  “total”: FLOAT,
                  “revenue”: FLOAT,
                  “shipping”: FLOAT,
                  “tax”: FLOAT,
                  “discount”: FLOAT,
                  “coupon”: “String”,
                  “currency”: “String”,
                  “status”:”String”,                   “payment_method”:”String”,
                  “shipping_method”:”String”
                  },

“cart_info”:{
            “cart_id”:”String”,
            “abandon_cart_url”:”String”,
            “abandon_cart_deeplink_android”:”String”,
            “abandon_cart_deeplink_ios”:”String”,
            “total”:FLOAT,
            “revenue”:FLOAT,
            “currency”:”String”
           },  

     “custom_properties”:{
       “customproperty1″:”custom value”,
       “customproperty2″:”custom value”
      },
     “products”:[
                {
                  “id”: “String”,
                  “sku”:”String”,
                  “name”:”String”,
                  “price”: FLOAT,
                  “quantity”: INT,
                  “categories”:[
                             {
                             “cat_name”:”String”,
                             “cat_id”:”String”,
                             “parent_cat_id”:”String”
                             },
                             {
                             “cat_name”:”String”,
                             “cat_id”:”String”,
                             “parent_cat_id”:”String”
                             }
                         ]
                }                          ]
              }

 

Clear Cart

API End Point: https://api.betaout.com/v2/ecommerce/activities

Responsible for clearing user’s cart.

If cart id is passed while adding/removing or updating product then you should pass cart id in cart info.

Example

{

   “apikey”: “–YOUR API KEY–“,
   “project_id”: “–YOUR PROJECT ID —“,

   “identifiers”:

{

   “customer_id”:”string”,

        “email”:”string”,

        “phone”:”string”,

        “device_id”:”String”} ,     

“activity_type”:”clear_cart”,

“cart_info”:

{ “cart_id”:”string” }

}

 

Custom User properties

API End Point: https://api.betaout.com/v2/user/properties

This is any custom property, which can be passed anywhere. Property key need to be defined on property schema page

Example

{
   “apikey”: “–YOUR API KEY–“,
   “project_id”: “–YOUR PROJECT ID —“,
   “timestamp”: “UNIX TIMESTAMP”,
  “identifiers”:{  
       “customer_id”:”string”,
       “email”:”string”,
       “phone”:”string”,
       “device_id”:”String”     
    },
    “properties”:{  
       “append”:{  
          “property_name1″:”property_value1”,
          “property_name2″:”property_value2”
       },
       “increment”:{  
          “property_name1″:”property_value1”,
          “property_name2″:”property_value2”
       },
       “update”:{  
          “property_name1″:”property_value1”,
          “property_name2″:”property_value2”
       }
    }
}

Custom User Events

API End Point: https://api.betaout.com/v2/user/events

This is any custom event other than the ecommerce events, which can be passed with timestamp and the name.

Placement :  According to where the event gets fired, the same can be passed.

{  
   “apikey”: “–YOUR API KEY–“,
   “project_id”: “–YOUR PROJECT ID —“,
   “timestamp”: “UNIX TIMESTAMP”,
     “identifiers”:{  
        “customer_id”:”string”,
        “email”:”string”,
        “phone”:”string”,
        “device_id”:”String”  
     },
     “events”:[  
                {
                  “name”:”string”,
                  “timestamp”:”UNIX TIMESTAMP”
               },
               {
                  “name”:”string”,
                  “timestamp”:”UNIX TIMESTAMP”
               }
              ]
}

Update order status

API End Point: https://api.betaout.com/v2/ecommerce/orders

This code is required to update the order status.

Example

{

“apikey”: “–YOUR API KEY–“,

“project_id”: “–YOUR PROJECT ID —“,

“orders”:[

{

“order_id”:”String”,

“custom_property”:{

“update”:

{ “PROP1″:”VALUE1”},

“increment”:

{ “PROP2″:”VALUE2”},

“append”:

{ “PROP3″:”VALUE3”} },

“status”:”string”,

“total”:FLOAT,

“revenue”:FLOAT,

“shipping”:FLOAT,

“tax”:FLOAT,

“discount”:FLOAT,

“coupon”:”String”,

“currency”:”String”,

“payment_method”:”String”,

“shipping_method”:”String”

},

{

“order_id”:”String”,

“custom_property”:{

“update”:

{ “PROP1″:”VALUE1”},

“increment”:

{ “PROP2″:”VALUE2”},

“append”:

{ “PROP3″:”VALUE3”}},

“status”:”String”,

“total”:FLOAT,

“revenue”:FLOAT,

“shipping”:FLOAT,

“tax”:FLOAT,

“discount”:FLOAT,

“coupon”:”String“,

“currency”:”String“,

“payment_method”:”String“,

“shipping_method”:”String

}

]

}

Old / New Products

API End Point:

https://api.betaout.com/v2/ecommerce/products

Example

{  
   “apikey”: “–YOUR API KEY–“,
   “project_id”: “–YOUR PROJECT ID —“,
   “products”:[
             {
               “id”: “String”,
               “sku”: “String”,
               “name”: “String”,
               “price”: FLOAT,
               “brandName”:”String”,
               “stock_availability”: INT,
               “product_url”:”string”,
               “image_url”: “string”,
               “currency”:”String”,
               “categories”:[
                          {
                          “cat_name”:”String”,
                          “cat_id”:”String”,
                          “parent_cat_id”:”String”
                          },
                          {
                          “cat_name”:”String”,
                          “cat_id”:”String”,
                          “parent_cat_id”:”String”
                          }
                      ]
               
             }    ]
   
}

 

Transactional Email

API End Point: https://api.betaout.com/v2/campaign/transactional

Properties

23

Example


  {
  “identifiers”:{
               “customer_id”: “string”,
               “email”: “string”,
               “phone”: “string”,
               “device_id”:”String”
           },          
    “campaign_id”:”String”,
    “campaign_type”:”String”,//email,sms,push
    “content”:{
              “variable_name”:”variable_value”,
              “variable_name”:”variable_value”,
              “variable_name”:”variable_value”
              }}
    

 

Click here to schedule a free demo.