Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Python SDK for Salesking, Your Invoicing Billing Accounting CRM
branch: master
Failed to load latest commit information.
LICENSE still failing, but now all empty instances do instanciate...

SalesKing Python SDK (beta)

Your Business Cockpit one REST call away. Online CRM / Invoicing integration / PDF Template

You never need to build your Customer Invoicing yourself again.

The SDK wraps the REST json schema API.


>>> pip install salesking

How the SDK works


Create a Contact

from salesking import resources
model = resources.get_model_class("contact")
data = {"organisation": "first customer via py api", "type": "Client"}
contact = model(data)
contact =

Create contact with nested Address

from salesking import resources
model = resources.get_model_class("contact")
contact = model()
contact.organisation = "second customer"
contact.type = "Lead"
model = resources.get_model_class("address")
address = model() = u"Duisburg"
address.address1 = u"Foo Street"
address.address2 = u"Appartment Bar"
address.address_type = u"work"
contact.addresses = [address]
contact =
print contact.get_data()

List all contacts type Lead with salesking in the name

# collection properties you could find here click url params on the right

# Paging details: 
# GET second page with 100 in list, only id+name


from salesking import collection
valid_filters = {u"organisation": u"salesking", u"type": u"Lead"}
col = collection.get_collection_instance("contact")
items = col.get_items()
for x in items:
    print u"id: %s name: %s" % (, x.organisation)
items = col.get_items()
for x in col.items:
    print u"id: %s name: %s" % (, x.organisation)

What you need to do in order to start

1) Register and activate a DEVELOPMENT USER at


2) Register Your app inside your salesking dev account

3) Take a look at the api


4) Browse the schema


5) create a in site-packages/salesking/.conf

6) edit your details in

7) have fun

Running the tests ##

1) create a fresh virtualenv

2) activate the virtualenv

3) run pip install -e .\salesking

4) configure your

5) run python -m unittest tests (logger silenced)


This SDK uses the automatic jsonschema validation of properties, in order to make it work, it removes porperties from the recieved data, that are containing None values, this means you have to wrap any data access in a try: except block...

Something went wrong with that request. Please try again.