Skip to main content

Miva Merchant JSON API SDK

Project description

Miva Merchant API SDK for Python (3.x)

This python library wraps the Miva Merchant JSON API introduced in Miva Merchant 9.12. It allows you to quickly integrate your python applications with a Miva Merchant store to fetch, create, and update store data.

For api documentation visit https://docs.miva.com/json-api.

Requirements

  • Miva Merchant 10.00+
  • Python 3.x

For Miva Merchant 9.x, use the 1.x release

Installation via pip

To install the SDK simply add it to your project with pip:

pip install merchantapi

Note: On some operating systems the pip program may be named pip3

Adding as a dependency in your packages

You can also add it to your project's requirements.txt file:

merchantapi>=2.6.0

Then install

pip install -r requirements.txt

Note: On some operating systems the pip program may be named pip3

Getting Started

For usage see the examples provided in the examples/ directory.

SSH Private Key Authentication

Compatible Private Key Formats

  • OpenSSH PEM
  • PKCS#1 PEM
  • PKCS#8 PEM

When specifying the key to use within the SSHClient or SSHPrivateKeyAuthenticator, specify the full path to your private key file.

Create PKCS#1 from OpenSSH private key format

If your private key is in OpenSSH format (starts with -----BEGIN OPENSSH PRIVATE KEY-----) then you will need to convert it.

Create a copy of your key preserving permissions:

cp -p /path/to/private/key/id_rsa /path/to/private/key/id_rsa.pem

Convert in place to the proper format:

ssh-keygen -p -m PEM -f /path/to/private/key/id_rsa.pem

Create PKCS#8 PEM from PKCS#1 PEM private key format

Converting the key with encryption:

 openssl pkcs8 -in /path/to/private_key.pem -topk8 -out /path/to/private_key.pkcs8.pem

Converting the key without encryption:

 openssl pkcs8 -in /path/to/private_key.pem -topk8 -nocrypt -out /path/to/private_key.pkcs8.pem

SSH Agent Authentication

Compatible Public Key Formats

Your public key must be in the OpenSSH Public Key format. The default public key format is usually the correct type if you generated your key using ssh-keygen.

See https://tools.ietf.org/html/rfc4253#section-6.6 for format.

A quick way to get the correct format if you have the key associated with your local SSH agent is to run the command ssh-add -L and copying the corresponding key.

High Precision Pricing & Weight

Miva Merchant 10.11 added support for high precision pricing and weight. To support these changes, the decimal module is used on all high precision fields. Transition should be seamless, and you can perform arithmetic against these values as you would native floats.

For more information see https://docs.python.org/3/library/decimal.html

License

This library is licensed under the Miva SDK License Agreement.

See the LICENSE file for more information.

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

merchantapi-2.7.0.tar.gz (245.7 kB view details)

Uploaded Source

Built Distribution

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

merchantapi-2.7.0-py3-none-any.whl (737.1 kB view details)

Uploaded Python 3

File details

Details for the file merchantapi-2.7.0.tar.gz.

File metadata

  • Download URL: merchantapi-2.7.0.tar.gz
  • Upload date:
  • Size: 245.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for merchantapi-2.7.0.tar.gz
Algorithm Hash digest
SHA256 e621af1c9236ea1987281485257a0c43a8ca7ba83388302588a09bc99f7b5366
MD5 af69f35e95b362019b362be2ffcf1991
BLAKE2b-256 ce33692ef05ca2085a809e8dc16119a0a4b5d474676ea3da7f0921d94691fcc4

See more details on using hashes here.

File details

Details for the file merchantapi-2.7.0-py3-none-any.whl.

File metadata

  • Download URL: merchantapi-2.7.0-py3-none-any.whl
  • Upload date:
  • Size: 737.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for merchantapi-2.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9ae3865ddb8d31121ba6bcc5ff9615104c44f4bdfa5c9071604e57d04e736e9
MD5 b29d1ac2277c96c69f2d2d1bda1476b1
BLAKE2b-256 dc5aa956d31711a31a55942a3d865efe21fbead9d1bda5c9fccb3b18bfc7fd3f

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