Skip to main content

Python SDK for MOKA API

Project description

Moka Python Library

This library is the abstraction of Moka API for access from applications written with Python.

Table of Contents

API Documentation

Please check Moka API Reference.

Requirements

Python 3.7 or later

Installation

To use the package, run pip install moka-python-sdk

Usage

API Key

from moka_python_sdk.moka import Moka

API_KEY = "test_f7f7955d44cd10dd2bbbdc4381eb8d4c"
SECRET_KEY = "d269d087-25a6-49fa-b17c-22cd1b23c515"
x = Moka(api_key=API_KEY, secret_key=SECRET_KEY, production=False)

# Then access each class from x attribute
merchant = x.Merchant

Merchant

Get information about merchant

Show Business Info

merchant = x.Merchant
merchant.show_business_info()

Usage example:

API_KEY = "test_f7f7955d44cd10dd2bbbdc4381eb8d4c"
SECRET_KEY = "d269d087-25a6-49fa-b17c-22cd1b23c515"
x = Moka(api_key=API_KEY, secret_key=SECRET_KEY, production=False)

merchant = x.Merchant

print("Business Info:")
print(merchant.show_business_info())

print("Customer List:")
print(merchant.get_list_customer(
    business_id=1,
    mobile_device=1,
    page=1,
    per_page=10,
    include_deleted=True,
    include_loyalty=True,
))

print("Business Checkout Setting:")
print(merchant.get_business_checkout_setting(
    business_id=1,
))

print("List Outlets:")
print(merchant.get_list_outlets(
    business_id=1,
))

Reference: https://api.mokapos.com/docs#tag/Business

Transaction

Get latest transaction

transaction = x.Transaction

print("Show Latest Transaction:")
print(transaction.show_latest(
    outlet_id=1,
    per_page=10,
    include_promo=True
))

Reference: https://api.mokapos.com/docs#operation/showLatestTransactionsV3

Get all open bills

transaction = x.Transaction

print("Get All Open Bill: ")
print(transaction.bill.get(
    outlet_id=1,
    page=1,
    per_page=10,
    dine_in_only=True,
    deep=True
))

Reference: https://api.mokapos.com/docs#operation/listBillsV1

Report

Category Sales

report = x.Report
report.show_category_sales(
    outlet_id=1,
    per_page=10,
)

Reference: https://api.mokapos.com/docs#operation/showCategorySalesV2

Modifier Sales

report = x.Report
report.show_modifier_sales(
    outlet_id=1,
    per_page=10,
)

Reference: httpshttps://api.mokapos.com/docs#tag/Modifier-Sales

Discount Sales

report = x.Report
report.show_discount_sales(
    outlet_id=1,
    per_page=10,
)

Reference: https://api.mokapos.com/docs#tag/Discount-Sales

Tax Sales

report = x.Report
report.show_tax_sales(
    outlet_id=1,
    per_page=10,
)

Reference: https://api.mokapos.com/docs#tag/Tax-Sales

License

MIT License

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

moka-python-sdk-0.1.2.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

moka_python_sdk-0.1.2-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

Details for the file moka-python-sdk-0.1.2.tar.gz.

File metadata

  • Download URL: moka-python-sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.15 CPython/3.9.13 Linux/5.15.0-1017-azure

File hashes

Hashes for moka-python-sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ca5c29036171459e610861c671ea6392696d8b4b54c31bea2ec8b9f2627811f0
MD5 264df7efa2a22ce84af646bd6f7fbc90
BLAKE2b-256 bafd666286c9fc27702bd1f969f1ce9d6165078a639c0b75f2645b4470fa9060

See more details on using hashes here.

File details

Details for the file moka_python_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: moka_python_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 36.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.15 CPython/3.9.13 Linux/5.15.0-1017-azure

File hashes

Hashes for moka_python_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d673702d5aab4fd7a4ee6df38301f6f82bed8251f5a987b4db1d02ff1443a67d
MD5 f44834d0902477f3c8e4ebdd4a9743d4
BLAKE2b-256 25f6765f5e9ca8deb8bec35d267e104f52d7694432efaaa30c468685ba3f875b

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