Skip to main content

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

Build Status

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.

Files for autobuy, version 3.0
Filename, size File type Python version Upload date Hashes
Filename, size autobuy-3.0-py3-none-any.whl (14.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size autobuy-3.0.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View

Supported by

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