Skip to main content

An unofficial Python wrapper for the API

Project description

Unofficial Python Wrapper

An unofficial Python wrapper for the API




python -m pip install autobuy


Get Methods

Get order details

Get the details of a specific order.

from autobuyWrapper.autobuy import get

orderDetails = get.order(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea', 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

orders = get.orders(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea', page='1')

Get all products

This will list all your products out along with the stocked product.

from autobuyWrapper.autobuy import get

allProducts = get.products(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea')

Get product details

Get a single product by ID.

from autobuyWrapper.autobuy import get

allProducts = get.products(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea', id='2cdbdc48-b297-41ad-a234-329db0d2dbea')


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

# Use of product.create() with only required aurguments
newProduct = product.create(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea', 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

updatedProduct = product.update(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea', 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='', serials='newAccount, newAccount2', stockDelimiter=',')

Delete product

Delete a product by ID.

from autobuyWrapper.autobuy import product

product.delete(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea', 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

updatedProduct = product.addStock(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea', id='2cdbdc48-b297-41ad-a234-329db0d2dbea', serial='')

To add multiple items to the product's stock, loop over a list of the items.

from autobuyWrapper.autobuy import product

items = ['serial1', 'serial2', 'serial3', 'serial4', 'serial5']
for item in items:
    updatedProduct = product.addStock(APIKey='2cdbdc48-b297-41ad-a234-329db0d2dbea', 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

autobuy-1.2.tar.gz (2.3 kB view hashes)

Uploaded source

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