Skip to main content

interact with villa cart and ordering endpoints

Project description

SDK for villa e-commerce Backend

postman Terminal file

Full Documentation Here

How to use

  1. Create a bucket
  2. fill in the products
  3. modify the quantity and update products
  4. trigger conversion to cart referencing a bucket

SDK docs

from villaBackendSdk.basket import BasketSdk
basketSdk = BasketSdk(branch='dev')
inputDict = {
    "basketId" : "1234",
    "basketName" : "1234",
    "ownerId" : "1234"
}
basketSdk.create(inputDict)
{'body': '{"result":{"basketId":"1234","creationTime":1605790015.917538,"basketName":"1234","ownerId":"1234","productList":[]},"Metadata":{"ConsumedCapacity":{"TableName":"basket-table-dev","CapacityUnits":3.0}}}',
 'statusCode': 200,
 'headers': {}}
inputDict = {
    'basketId': '1234',
    'items': [{'sku':'123','quantity':-123},{'sku':'456','quantity':123}],
  }
basketSdk.add(inputDict)
{'body': '{"basketId":"1234","creationTime":1605790015.917538,"basketName":"1234","ownerId":"1234","productList":[{"sku":"456","quantity":123}]}',
 'statusCode': 200,
 'headers': {}}
inputDict = {
    'basketId': '1234',
    'basketName': 'test',
    'ownerId': '1234',
    'items': [{'sku':'123234','quantity':123},{'sku':'456','quantity':123}]
  }
basketSdk.update(inputDict)
{'body': '{"basketId":"1234","creationTime":1605790015.917538,"basketName":"1234","ownerId":"1234","productList":[{"sku":"123234","quantity":123},{"sku":"456","quantity":123}]}',
 'statusCode': 200,
 'headers': {}}
inputDict = {
    'basketId': '1234',
  }
basketSdk.get(inputDict)
{'body': '{"basketId":"1234","creationTime":1605790015.917538,"basketName":"1234","ownerId":"1234","productList":[{"sku":"123234","quantity":123},{"sku":"456","quantity":123}]}',
 'statusCode': 200,
 'headers': {}}
inputDict = {
    'basketId': '1234'
  }
basketSdk.empty(inputDict)
{'body': '{"basketId":"1234","creationTime":1605790015.917538,"basketName":"1234","ownerId":"1234","productList":[]}',
 'statusCode': 200,
 'headers': {}}
inputDict = {
    'basketId': '1234'
  }
basketSdk.remove(inputDict)
{'body': '{"basketDeleted":{"basketId":"1234","creationTime":1605790015.917538,"basketName":"1234","ownerId":"1234","productList":[]}}',
 'statusCode': 200,
 'headers': {}}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

villaBackendSdk-0.0.1.tar.gz (9.8 kB view hashes)

Uploaded Source

Built Distribution

villaBackendSdk-0.0.1-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page