clover-api-py


Nameclover-api-py JSON
Version 0.0.33 PyPI version JSON
download
home_pagehttps://github.com/NateDemi/clover-api-py
SummaryAn unofficial Python client for the Clover API v3
upload_time2025-01-04 22:11:19
maintainerNone
docs_urlNone
authorNathan Demi
requires_pythonNone
licenseMIT
keywords clover api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # clover-api-py

[![PyPI version](https://badge.fury.io/py/clover-py.svg)](https://badge.fury.io/py/clover-py)  
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](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:

```bash
pip install clover-api-py
```

---

## Usage

### Initialize the Client

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

```python
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

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

#### Fetch Details for a Specific Item

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

#### Update Item Details

```python
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

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

#### Update Item Stock

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

#### Fetch Tax Rates

```python
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](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NateDemi/clover-api-py",
    "name": "clover-api-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "clover, api",
    "author": "Nathan Demi",
    "author_email": "ndemissie88@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/29/a0/bfb4ce13bd98b07301aa17f9cfd38f634b2d5a8e74085639ef8285ae1520/clover-api-py-0.0.33.tar.gz",
    "platform": null,
    "description": "# clover-api-py\n\n[![PyPI version](https://badge.fury.io/py/clover-py.svg)](https://badge.fury.io/py/clover-py)  \n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)  \n\nAn 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.\n\n---\n\n## Features\n\n- Fetch inventory details and stock levels.\n- Update inventory items, including names, SKUs, and prices.\n- Manage orders and summarize order data.\n- Fetch and manage cash transactions.\n- Retrieve tax rates and other merchant-specific details.\n- Handles API pagination automatically for large datasets.\n\n---\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install clover-api-py\n```\n\n---\n\n## Usage\n\n### Initialize the Client\n\nTo get started, initialize the client with your Clover API credentials.\n\n```python\nfrom cloverapi.cloverapi_client import CloverApiClient\n\n# Your Clover API credentials\nAPI_TOKEN = \"your_api_token\"\nMERCHANT_ID = \"your_merchant_id\"\nREGION = \"us\"  # Options: 'us', 'ca', 'eu', 'latam'\nTIMEZONE='America/New_York' # optional: UTC is selected by default\n# Initialize the Clover API Client\nclient = CloverApiClient(auth_token=API_TOKEN, merchant_id=MERCHANT_ID, region=REGION, timezone=TIMEZONE)\n```\n\n---\n\n## Supported Regions\n\nWhen initializing the client, specify the `region` parameter:\n\n| Region         | Code   | Base URL                   |\n|----------------|--------|----------------------------|\n| United States  | `us`   | https://api.clover.com     |\n| Canada         | `ca`   | https://ca.api.clover.com  |\n| Europe         | `eu`   | https://eu.api.clover.com  |\n| Latin America  | `latam`| https://latam.api.clover.com|\n\n---\n\n## Common Timezones for Clover API Usage\n\n| Timezone Name         | UTC Offset   | Example Cities            |\n|------------------------|-------------|---------------------------|\n| America/New_York      | UTC-05:00   | New York, Washington D.C. |\n| America/Chicago       | UTC-06:00   | Chicago, Houston          |\n| America/Denver        | UTC-07:00   | Denver, Salt Lake City    |\n| America/Los_Angeles   | UTC-08:00   | Los Angeles, Seattle      |\n| America/Toronto       | UTC-05:00   | Toronto, Ottawa           |\n| Europe/London         | UTC+00:00   | London, Dublin            |\n| Europe/Berlin         | UTC+01:00   | Berlin, Paris             |\n| Europe/Moscow         | UTC+03:00   | Moscow, St. Petersburg    |\n| Asia/Tokyo            | UTC+09:00   | Tokyo, Osaka              |\n| Asia/Shanghai         | UTC+08:00   | Shanghai, Beijing         |\n| Asia/Kolkata          | UTC+05:30   | Kolkata, Mumbai           |\n| Australia/Sydney      | UTC+10:00   | Sydney, Melbourne         |\n| Pacific/Auckland      | UTC+13:00   | Auckland, Wellington      |\n\n**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.\n### Examples\n\n#### Fetch All Inventory Items\n\n```python\ninventory_items = client.inventory_service.get_all_inventory()\nfor item in inventory_items.get(\"elements\", []):\n    print(item)\n```\n\n#### Fetch Details for a Specific Item\n\n```python\nitem_id = \"ITEM_ID\"\nitem_details = client.inventory_service.get_item_detail(item_id)\nprint(item_details)\n```\n\n#### Update Item Details\n\n```python\nitem_id = \"ITEM_ID\"\nupdated_item = client.inventory_service.update_item_detail(\n    item_id,\n    name=\"Updated Item Name\",\n    sku=\"NEW_SKU123\",\n    price=1500  # Price in cents (e.g., $15.00)\n)\nprint(updated_item)\n```\n\n#### Retrieve Item Stock\n\n```python\nitem_id = \"ITEM_ID\"\nitem_stock = client.inventory_service.get_item_stock(item_id)\nprint(item_stock)\n```\n\n#### Update Item Stock\n\n```python\nitem_id = \"ITEM_ID\"\nnew_stock = client.inventory_service.update_item_stock(item_id, stock_count=20)\nprint(new_stock)\n```\n\n#### Fetch Tax Rates\n\n```python\ntax_rates = client.tax_service.get_tax_rates()\nfor tax in tax_rates.get(\"elements\", []):\n    print(tax)\n```\n\n---\n\n## Contributing\n\nWe welcome contributions! Please follow these steps:\n\n1. Fork the repository.\n2. Create a branch (`git checkout -b feature-name`).\n3. Commit your changes (`git commit -m 'Add feature'`).\n4. Push to your branch (`git push origin feature-name`).\n5. Create a pull request.\n\n---\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An unofficial Python client for the Clover API v3",
    "version": "0.0.33",
    "project_urls": {
        "Download": "https://github.com//NateDemi/clover-api-py/archive/refs/heads/main.zip",
        "Homepage": "https://github.com/NateDemi/clover-api-py"
    },
    "split_keywords": [
        "clover",
        " api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5c1fad5271302f087dc03be1392f1ed4f92aaae0bfb9f1695c9500ea621cede1",
                "md5": "4d519e7a3b4e36d59470573345457c04",
                "sha256": "18f071f8f02d11fa71d750cb5667ca7a8d5c164fb6f292bc18aae01d137e672e"
            },
            "downloads": -1,
            "filename": "clover_api_py-0.0.33-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4d519e7a3b4e36d59470573345457c04",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 30675,
            "upload_time": "2025-01-04T22:11:12",
            "upload_time_iso_8601": "2025-01-04T22:11:12.117650Z",
            "url": "https://files.pythonhosted.org/packages/5c/1f/ad5271302f087dc03be1392f1ed4f92aaae0bfb9f1695c9500ea621cede1/clover_api_py-0.0.33-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "29a0bfb4ce13bd98b07301aa17f9cfd38f634b2d5a8e74085639ef8285ae1520",
                "md5": "457061717161e07ad88acdf19939a340",
                "sha256": "0c58c70dc3571882d988839bad82ef29117e20c5b2e77ca1185322c4d954bde1"
            },
            "downloads": -1,
            "filename": "clover-api-py-0.0.33.tar.gz",
            "has_sig": false,
            "md5_digest": "457061717161e07ad88acdf19939a340",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22593,
            "upload_time": "2025-01-04T22:11:19",
            "upload_time_iso_8601": "2025-01-04T22:11:19.953515Z",
            "url": "https://files.pythonhosted.org/packages/29/a0/bfb4ce13bd98b07301aa17f9cfd38f634b2d5a8e74085639ef8285ae1520/clover-api-py-0.0.33.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-04 22:11:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NateDemi",
    "github_project": "clover-api-py",
    "github_not_found": true,
    "lcname": "clover-api-py"
}
        
Elapsed time: 1.63035s