An unofficial Python wrapper for the autobuy.io API
Project description
Unofficial autobuy.io Python Wrapper
An unofficial Python wrapper for the autobuy.io API
Background Information
AutoBuy.io is an e-commerce platform for merchants who sell digital items. AutoBuy.io is currently in open beta. You can visit AutoBuy.io HERE
prerequisites
requests==2.22.0
Installation
python -m pip install autobuy
Methods
Get Methods
Get order details
Get the details of a specific order.
from autobuyWrapper.autobuy import Get
GetMethod = Get(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea')
orderDetails = GetMethod.order(order='c1497823-370c-4c7a-82cd-dacddb36fc30')
Get all orders
Lists orders in descending order by creation date in pages of 10.
from autobuyWrapper.autobuy import Get
GetMethod = Get(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea')
oders = GetMethod.orders(page='1')
Get all products
This will list all your products out along with the stocked product.
from autobuyWrapper.autobuy import Get
GetMethod = Get(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea')
allProducts = GetMethod.products()
Get product details
Get a single product by ID.
from autobuyWrapper.autobuy import Get
GetMethod = Get(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea')
allProducts = GetMethod.products(id='2cdbdc48-b297-41ad-a234-329db0d2dbea')
Products
Create product
Creates a new product.
Only four arguments are required. APIKey, name, description, productType. The rest of the arguments are optional. Optional arguments with default values are: unlisted=False, blockProxy=False, purchaseMax='100000', purchaseMin='1', webhookUrl=None, serials='', stockDelimiter=','.
from autobuyWrapper.autobuy import Product
ProductMethod = Product(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea')
# Use of Product.create() with only required arguments
newProduct = ProductMethod.create(name='test12', description='just a test', price='9.99', productType='SerialNumber')
Update product
Updates a product by ID. This call requires all arguments to be present.
from autobuyWrapper.autobuy import Product
ProductMethod = Product(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea')
updatedProduct = ProductMethod.update(id='2cdbdc48-b297-41ad-a234-329db0d2dbea', name='test13', description='updated description', price='8.99', productType='SerialNumber', unlisted=False, blockProxy=False, purchaseMax='100000', purchaseMin='1', webhookUrl='https://ptb.discordapp.com/api/webhooks/618938749723869205/wMjAX1okpWGuMvIScJXk2cU_r8D1qAiPty5W78vs9znoX254i1l7-8gYM4Ew_A3io0r8', serials='newAccount, newAccount2', stockDelimiter=',')
Delete product
Delete a product by ID.
from autobuyWrapper.autobuy import Product
ProductMethod = Product(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea')
ProductMethod.delete(id='2cdbdc48-b297-41ad-a234-329db0d2dbea')
Add stock to product
Adds stock to a product. Only one item can be added per call.
from autobuyWrapper.autobuy import Product
ProductMethod = Product(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea')
updatedProduct = ProductMethod.addStock(id='2cdbdc48-b297-41ad-a234-329db0d2dbea', serial='email@email.com:randomPassword')
To add multiple items to the product's stock, loop over a list of the items.
from autobuyWrapper.autobuy import Product
ProductMethod = Product(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea')
items = ['serial1', 'serial2', 'serial3', 'serial4', 'serial5']
for item in items:
updatedProduct = ProductMethod.addStock(id='2cdbdc48-b297-41ad-a234-329db0d2dbea', serial=item)
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
Built Distribution
File details
Details for the file autobuy-3.0.tar.gz
.
File metadata
- Download URL: autobuy-3.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 011b5a0990d120031c6c69fdf9f601fb55acf8f29fc301e0ec997aa16e4db623 |
|
MD5 | 6c8e39aabe181a96f5e76091999ee09e |
|
BLAKE2b-256 | 2f14da86475c8bf013392fdcb8987bab2db5fe09fea9615d51f107ae66673fe0 |
File details
Details for the file autobuy-3.0-py3-none-any.whl
.
File metadata
- Download URL: autobuy-3.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31b683405df2916d5870b5a8a4a94a352093f6fe56fbb9fe53b8cf12f701872b |
|
MD5 | 8461359a88be2cf548561597e96fee46 |
|
BLAKE2b-256 | c0690ac362d2e6433c8d37c45dedb47513d76360559ac7328b0de79db0823fe5 |