Skip to main content

Simple commandline client for Mollie

Project description

mollie-cli

PyPI - Version PyPI - Python Version


Table of Contents

About

Mollie CLI is a simple command-line client, designed to send requests to the Mollie API and return data in an easily readable format. It can be used to have a quick look into your Mollie data, or to test your authentication credentials: it supports all authentication methods that Mollie provides (API key, access token and OAuth2).

This tool could be useful to developers working with Mollie, for quick insights into the data state on the Mollie side of things.

Features

Currently the following features are supported:

  • Authentication using API key, access token or OAuth2 flow (Oauth2 needs help of an external tunnel tool like pagekite or ngrok)
  • Authentication credentials can be provided using the CLI or with environment variables
  • Data retrieval from simple sources (chargebacks, clients, customers, invoices, orders, organizations, payment links, payments, profiles, refunds, settlements, subscriptions)
  • Output in a nicely formatted table on the CLI, or in JSON or CSV, which can be saved to a file using regular shell interaction (e.g. mollie-cli -f csv list payments > payments.csv)

Possible future additions

  • Retrieval of nested data from the API (e.g. payment->refund)
  • Fully automated OAuth2 flow
  • More output formats, if needed
  • Creation of new data (e.g. create a new payment), possible with a guided interface: the CLI presents all required fields and checks for correct datatypes etc before sending it to Mollie
  • You name it

Installation

pip install mollie-cli

Examples

$ mollie-cli --help
Usage: mollie-cli [OPTIONS] COMMAND [ARGS]...

Options:
  --version                      Show the version and exit.
  -f, --format [table|json|csv]  Change output formatting
  --help                         Show this message and exit.

Commands:
  apikey  Connect to Mollie using an api key
  oauth   Connect to Mollie using OAuth2.0
  token   Connect to Mollie using an access token

$ mollie-cli apikey --help
Usage: mollie-cli apikey [OPTIONS] COMMAND [ARGS]...

  Connect to Mollie using an api key

Options:
  -k, --key TEXT  The Mollie API key to use for authentication  [required]
  --help          Show this message and exit.

Commands:
  get   Retrieve a single item by resource ID
  list  List items by resource name

$ mollie-cli apikey --key <apikey> list payments --limit 3

List of payments:

╒═══════════════╤═════════════════════════════════════════╤══════════╤═══════════════════════════╕
│ ID            │ Amount                                  │ Status   │ Paid at                   │
╞═══════════════╪═════════════════════════════════════════╪══════════╪═══════════════════════════╡
│ tr_bN<...>fJG │ {'value': '1568.16', 'currency': 'EUR'} │ paid     │ 2022-03-22T10:08:18+00:00 │
├───────────────┼─────────────────────────────────────────┼──────────┼───────────────────────────┤
│ tr_A5<...>pCx │ {'value': '25.00', 'currency': 'EUR'}   │ pending  │                           │
├───────────────┼─────────────────────────────────────────┼──────────┼───────────────────────────┤
│ tr_fH<...>WAQ │ {'value': '810.00', 'currency': 'EUR'}  │ pending  │                           │
╘═══════════════╧═════════════════════════════════════════╧══════════╧═══════════════════════════╛

$ mollie-cli apikey -k <apikey> get <paymentid>

Properties of payment with id tr_bN<...>fJG:

╒════════════════════════╤════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╕
│ Property               │ Value                                                                                                                                          │
╞════════════════════════╪════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╡
│ amount                 │ {'value': '1568.16', 'currency': 'EUR'}                                                                                                        │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ amount_captured        │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ amount_chargedback     │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ amount_refunded        │ {'value': '0.00', 'currency': 'EUR'}                                                                                                           │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ amount_remaining       │ {'value': '1568.16', 'currency': 'EUR'}                                                                                                        │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ application_fee        │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ authorized_at          │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ canceled_at            │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ changepaymentstate_url │ https://www.mollie.com/checkout/test-mode?method=ideal&token=3.9xh6dq                                                                          │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ checkout_url           │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ country_code           │ NL                                                                                                                                             │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ created_at             │ 2022-03-22T10:07:33+00:00                                                                                                                      │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ customer_id            │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ description            │ Order 2431                                                                                                                                     │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ details                │ {'consumerName': 'T. TEST', 'consumerAccount': 'NL83RABO0012345678', 'consumerBic': 'RABONL2U'}                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ expired_at             │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ expires_at             │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ failed_at              │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ id                     │ tr_bN<...>fJG                                                                                                                                  │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ is_cancelable          │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ locale                 │ nl_NL                                                                                                                                          │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ mandate_id             │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ metadata               │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ method                 │ ideal                                                                                                                                          │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ mode                   │ test                                                                                                                                           │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ order_id               │ ord_k<...>4                                                                                                                                    │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ paid_at                │ 2022-03-22T10:08:18+00:00                                                                                                                      │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ payonline_url          │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ profile_id             │ pfl_pb<...>eDF                                                                                                                                 │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ redirect_url           │ https://example.org/mollie/eysabcjhdshjescbnxvbchshvbV0dXJuX3VybCI6bnVsbH0:1nWbQL:efsdghfjsdghfsdfgjshgfsG_yE5FYuThL3fZtY-nos/return/          │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ resource               │ payment                                                                                                                                        │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ routing                │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ sequence_type          │ oneoff                                                                                                                                         │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ settlement_amount      │ {'value': '1568.16', 'currency': 'EUR'}                                                                                                        │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ settlement_id          │                                                                                                                                                │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ status                 │ paid                                                                                                                                           │
├────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ webhook_url            │                                                                                                                                                │
╘════════════════════════╧════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╛

License

mollie-cli is distributed under the terms of the 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

mollie_cli-0.1.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

mollie_cli-0.1.1-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file mollie_cli-0.1.1.tar.gz.

File metadata

  • Download URL: mollie_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for mollie_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 52df9f8301910cea1fa43089b4c4ffc08e794c1b26d3133fe9591032b39dd8e0
MD5 02c43c0f791e863474768a716e8d135d
BLAKE2b-256 d5d5a1c11054de7e42e114c2b2360923c0ddb6e6729553a524d659358d01d0ef

See more details on using hashes here.

File details

Details for the file mollie_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mollie_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for mollie_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26864c7f78944029b32cada4d1e2615b0856f562599eda324693e1b9be8fe9d4
MD5 1571e54ccd7c533147d2bfbb0bd69667
BLAKE2b-256 d0076423ab28c8918a5f1f67e1fb233fab2d151175f5fcd046b752669e6f1b60

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