This is a command line client for the Shopify API. It associates incoming bank transactions from customers with the shopify orders they paid for.
The tool manages the orders and transactions in an internal database. It does never write anything to the shopify shop.
When a customer pays for an order on a shopify shop, shopify automatically marks the order as paid. However, these options (to my knowledge) usually cost a fee and thus a shop owner might want to manage payments by her/himself by only allowing bank transactions.
The client was written for a small shop which mainly sells clothes.
- Clone this repository.
- Install Python 3.9.
- Create a Python virtual environment and activate it.
- Install the dependencies with
pip install -r <path-to-this-project>/resources/requirements.txt
.
./resources/settings.json
stores the configurations. Here, you must specify your shop's web address. Also, you need to create a Shopify private app and store its password in the settings.json
file.
To start the tool, first make sure that the virtual environment is still activated and you are in the directory of this project. Now type python -m main.shopify_bank_transfer_manager
.
To see all of the tool's commands, type help
. To get a more detailed description of a command, type help <command>
.
Does the following:
- Downloads the orders from the Shopify API and imports the bank transactions given in a CSV file.
- Internally stores both, the orders and transactions, in a SQLite database.
- Tries to retrieve order IDs from the transactions' references. It does so by matching certain patterns. These patterns can be modified in
importer.transactions_importer::get_order_nrs
.
If it can retrieve any order IDs, it tries to mark these orders as paid by the transaction.
To do so, it creates an association in the database, consisting of the order ID, the transaction ID and an amount. The association means that transactionx
pays amounty
to orderz
. Of course, the amount associated to a transaction can never exceed the amount of the transaction. - Finally, it asks the user to manually associate the remaining transactions. These are all the transactions, which could not be associated automatically.
Allows the user to manually associate a transaction with one or more orders.
Exits the program.
Some useful queries are already prepared in ./queries.sql
.
Lukas Denk ([email protected])