interact with villa cart and ordering endpoints
Project description
SDK for villa e-commerce Backend
postman Terminal file
Full Documentation Here
How to use
- Create a bucket
- fill in the products
- modify the quantity and update products
- 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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for villaBackendSdk-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7c1d3155612f6ac5775e808931fa9e64cc0c8d3cfeb23a0c11ee39110827b37 |
|
MD5 | 0a11cf26d0fd80f986cb2b550189a1d0 |
|
BLAKE2b-256 | c83f7603a0efa74821e1b4c57c07b0282fcdc6417b252a795401e7d1de889017 |