Skip to main content

An unofficial Python client for the Clover API v3

Project description

clover-api-py

PyPI version
License

An unofficial Python client for the Clover API v3. This library enables seamless interaction with the Clover API for managing inventory, orders, taxes, cash transactions, and more.


Features

  • Fetch inventory details and stock levels.
  • Update inventory items, including names, SKUs, and prices.
  • Manage orders and summarize order data.
  • Fetch and manage cash transactions.
  • Retrieve tax rates and other merchant-specific details.
  • Handles API pagination automatically for large datasets.

Installation

Install the package using pip:

pip install clover-api-py

Usage

Initialize the Client

To get started, initialize the client with your Clover API credentials.

from cloverapi.cloverapi_client import CloverApiClient

# Your Clover API credentials
API_TOKEN = "your_api_token"
MERCHANT_ID = "your_merchant_id"
REGION = "us"  # Options: 'us', 'ca', 'eu', 'latam'
TIMEZONE='America/New_York' # optional: UTC is selected by default
# Initialize the Clover API Client
client = CloverApiClient(auth_token=API_TOKEN, merchant_id=MERCHANT_ID, region=REGION, timezone=TIMEZONE)

Supported Regions

When initializing the client, specify the region parameter:

Region Code Base URL
United States us https://api.clover.com
Canada ca https://ca.api.clover.com
Europe eu https://eu.api.clover.com
Latin America latam https://latam.api.clover.com

Common Timezones for Clover API Usage

Timezone Name UTC Offset Example Cities
America/New_York UTC-05:00 New York, Washington D.C.
America/Chicago UTC-06:00 Chicago, Houston
America/Denver UTC-07:00 Denver, Salt Lake City
America/Los_Angeles UTC-08:00 Los Angeles, Seattle
America/Toronto UTC-05:00 Toronto, Ottawa
Europe/London UTC+00:00 London, Dublin
Europe/Berlin UTC+01:00 Berlin, Paris
Europe/Moscow UTC+03:00 Moscow, St. Petersburg
Asia/Tokyo UTC+09:00 Tokyo, Osaka
Asia/Shanghai UTC+08:00 Shanghai, Beijing
Asia/Kolkata UTC+05:30 Kolkata, Mumbai
Australia/Sydney UTC+10:00 Sydney, Melbourne
Pacific/Auckland UTC+13:00 Auckland, Wellington

Note: UTC is selected by default. When using the Clover API client, specify the appropriate timezone in the TIMEZONE parameter to match your business location. This ensures accurate data aggregation for summaries and any date-related operations.

Examples

Fetch All Inventory Items

inventory_items = client.inventory_service.get_all_inventory()
for item in inventory_items.get("elements", []):
    print(item)

Fetch Details for a Specific Item

item_id = "ITEM_ID"
item_details = client.inventory_service.get_item_detail(item_id)
print(item_details)

Update Item Details

item_id = "ITEM_ID"
updated_item = client.inventory_service.update_item_detail(
    item_id,
    name="Updated Item Name",
    sku="NEW_SKU123",
    price=1500  # Price in cents (e.g., $15.00)
)
print(updated_item)

Retrieve Item Stock

item_id = "ITEM_ID"
item_stock = client.inventory_service.get_item_stock(item_id)
print(item_stock)

Update Item Stock

item_id = "ITEM_ID"
new_stock = client.inventory_service.update_item_stock(item_id, stock_count=20)
print(new_stock)

Fetch Tax Rates

tax_rates = client.tax_service.get_tax_rates()
for tax in tax_rates.get("elements", []):
    print(tax)

Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository.
  2. Create a branch (git checkout -b feature-name).
  3. Commit your changes (git commit -m 'Add feature').
  4. Push to your branch (git push origin feature-name).
  5. Create a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

clover-api-py-0.0.29.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clover_api_py-0.0.29-py2.py3-none-any.whl (29.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file clover-api-py-0.0.29.tar.gz.

File metadata

  • Download URL: clover-api-py-0.0.29.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for clover-api-py-0.0.29.tar.gz
Algorithm Hash digest
SHA256 ed4315a358fae6c3c1f6ee1675d45a1c508b17b823afacde6736e4c9841e893d
MD5 f16f65eec777185b31d5c7dd280bed13
BLAKE2b-256 99647f55d91a0986bac5efe131302411199cfc0fcbb850a0def5d373a513e88e

See more details on using hashes here.

File details

Details for the file clover_api_py-0.0.29-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for clover_api_py-0.0.29-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ecf6a17a6da5cb66f18881d9a594b4302155db7b6adae4f1ced30a7b0bf1ced3
MD5 8c8de69d81af4840d6193c2b30f6f8e6
BLAKE2b-256 b45fd133850ed2f54a9e83d9e2f58599f6d40f1ecedc461a6d4ab5a2cb68dcf5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page