SDK Documentation
Python SDK
WalletKit SDK for Ruby and Java is also available!

Installation

     pip install walletkit

Usage

     from walletkit import Walletkit

Summary

The below table contains a summary of the SDK.

Module: walletkit
Class: Walletkit

Method Description Input Returns
__init__(api_key,brand_id) Initializes a WalletKit REST client api_key: The API key
brand_id: The Brand Id
-
create_pass_template(template_data) Creates a pass template template_data: The template data as a hash Json string containing the template id
show_pass_template_list() Gets a list of pass templates created - Json string containing id and description of templates
show_pass_template_info(template_id) Gets information about a pass template template_id: The template id Json string containing information about the template
create_pass(pass_data,template_id) Creates a pass pass_data: The pass data as a hash
template_id: The template id
Json string containing information about the pass created
update_pass(pass_data,template_id) Updates a pass pass_data: The pass data as a hash
template_id: The template id
Json string containing information about the pass updated
delete_pass_template(template_id) Deletes a pass template template_id: The template id Json string containing the server response

Tutorial

Creating a pass template

For more information about the data to be sent, refer to the API Docs page.

       template_data = {
            "logotext" : "Brand name", 
            "background" : "http://www.example.com/yourBackground.png", 
            "description" : "Description of the pass", 
            "icon" : "http://www.example.com/yourIcon.png",
            "pass_type" : "coupon"
        }
         
        cc = walletkit.Walletkit('<api key>','<brand id>')
        template_id = cc.create_pass_template(template_data)
    

Creating a pass

For more information about the data to be sent, refer to the API Docs page.

        pass_create_data = {
            "keys" : [{ 
                        "key" : "Destination",
                        "value" : "SFO" 
                    },
                    {
                        "key" : "Departure",
                        "value" : "Chennai,India"
                }],
            "location" : [{
                    "latitude" : "178.67",
                    "longitude" : "167.60"
                }]
        }

        cc = walletkit.Walletkit('<api key>','<brand id>')
        cc.create_pass(pass_data,template_id)
        
    

Updating a pass

For more information about the data to be sent, refer to the API Docs page.


        pass_update_data = {
                "id" : template_id.to_s,
                "keys" : [{ 
                            "key" : "Destination",
                            "value" : "SFO"
                        },
                        {
                            "key" : "Departure",
                            "value" : "Chennai,India"
                    }],
                 "updatekeys" : [{

                            "key" : "Departure",
                            "value" : "Mumbai,India"
                    }]
        }
        
        cc = walletkit.Walletkit('<api key>','<brand id>')
        cc.create_pass(update_data,template_id)