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.

Files for villaBackendSdk, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size villaBackendSdk-0.0.1.tar.gz (9.8 kB) File type Source Python version None Upload date Hashes View
Filename, size villaBackendSdk-0.0.1-py3-none-any.whl (7.8 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page