plisio


Nameplisio JSON
Version 1.0.8 PyPI version JSON
download
home_pagehttps://github.com/Plisio/plisio-python
SummaryOfficial Python SDK for Plisio API
upload_time2024-03-19 06:35:25
maintainer
docs_urlNone
authorPlisio
requires_python
licenseMIT
keywords plisio crypto payment sdk bitcoin etherium crypto blockchain
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python SDK for Plisio API

Current project is a **Python SDK for [Plisio API](https://plisio.net/documentation)**.
To use it, you should be registered on Plisio
The account can be created [here](https://plisio.net/account/signup "Sign up"))
You will receive a personal secret key, that is used for all calls to API.

![Supported Versions](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-yellowgreen)


##  Install

To download Plisio SDK, either fork this GitHub repo or simply use PyPI via pip:
```sh
$ pip install plisio
```

## Usage


### Initialize the connection

To be able to send the requests, create an instance of class
<code>PlisioClient</code>.

```python
import plisio
...

client = plisio.PlisioClient(api_key='your_secret_key')
```

### Balance

Plisio supports 9 cryptocurrencies(https://plisio.net/documentation/appendices/supported-cryptocurrencies).
To view, for example the Ethereum (ETH) balance:
Send the request by <code>client</code> and process the response
with the help of an appropriate model.

```python
# Sending request and getting processed response
balance = client.get_balance(plisio.CryptoCurrency.ETH)
```

### Currencies

To view current exchange rate for the supported cryptocurrencies to
[the definite fiat currency](https://plisio.net/documentation/appendices/supported-fiat-currencies),
send a request to API by the method <code>get_currency</code>
with the selected fiat currency.

Example: getting the rate of *Australian Dollar (AUD)*.
If no fiat currency is selected, the rate of
*United States Dollar (USD)* is used by default. **The response** is a list of models
that consist rates of exchanges.

```python
currencies = client.get_currencies(plisio.FiatCurrency.AUD)
```

### Creating a new invoice

The request has to receive the following **required** parameters:
+ <code>currency</code> - the name of cryptocurrency;
+ <code>order_name</code> - merchant internal order name;
+ <code>order_number</code> - merchant internal order number.

**Additional** parameters:
+ <code>amount</code> - any cryptocurrency float value. If a fiat currency is to be converted,
skip this field and use the next two fields instead;
+ <code>source_currency</code> - the name of the fiat currency;
+ <code>source_amount</code> - any float value;
+ <code>allowed_psys_cids</code> - comma-separated list of cryptocurrencies that are
  allowed for a payment. Also, you will be able to select one of them. Example: *'BTC,ETH,TZEC'*;
+ <code>description</code> - merchant invoice description;
+ <code>callback_url</code> - merchant full URL to get invoice updates.
  The *POST* request will be sent to this URL. If this parameter isn't set,
  a callback will be sent to the URL that can be set under profile in API settings, in the 'Status URL' field; **Add ?json=true to this url to get data in JSON and validate it client.validate_callback**
+ <code>email</code> - an auto-fill invoice email.
  You will be asked to enter an email to which a notification will be sent;
+ <code>language</code> - en_US (supports English only);
+ <code>plugin</code> - Plisio's internal field to determine integration plugin;
+ <code>version</code> - Plisio's internal field to determine integration plugin version.
+ <code>redirect_to_invoice</code> - Instead of JSON response user will be redirected to the Plisio's invoice page (is not working for a white-label shop).
+ <code>expire_min</code> - Interval in minutes when invoice will be expired.

The response is a model that can fill differently depending on
whether you have [**While Label**](https://plisio.net/white-label) or not.
In the first case, only two fields are returned:
<code>txn_id</code> is a Plisio's intertnal ID and
<code>invoice_url</code> is an invoice URL. And in the second case,
 extra fields are added to them:
+ <code>amount</code> - invoice amount in the selected cryptocurrency;
+ <code>pending_amount</code> - the remaining amount to be paid in
  the selected cryptocurrency;
+ <code>wallet_hash</code> - invoice hash;
+ <code>psys_cid</code> - cryptocurrencies ID;
+ <code>currency</code> - cryptocurrencies code;
+ <code>source_currency</code> - fiat currency;
+ <code>source_rate</code> - exchange rate from the <code>psys_cid</code>
  to the <code>source_currency</code> at the moment of transfer;
+ <code>expected_confirmations</code> - the number of expected confirmations
  to mark the invoice as completed;
+ <code>qr_code</code> - QR code image in base64 format;
+ <code>verify_hash</code> - hash to verify the *POST*
  data signed with your *API_KEY*;
+ <code>invoice_commission</code> - Plisio commission;
+ <code>invoice_sum</code> - *shop pays commission*: invoice amount -
  <code>invoice_commission</code>, *client pays commission*: invoice amount;
+ <code>invoice_total_sum</code> - *shop pays commission*: invoice amount,
  *client pays commission*: <code>invoice_commission</code> + <code>invoice_sum</code>.

Create a few *Python* examples, where use:
+ required fields only;
+ all the fields besides the <code>amount</code>;
+ all the fields besides the <code>source_currency</code> and the <code>source_amount</code>.
```python
# Example: using required fields only
first_invoice = plisio.invoice(plisio.CryptoCurrency.BTC, 'order1', 20230903182401, 0.00001)

# Example: using cryptocurrency
second_invoice = plisio.invoice(
    plisio.CryptoCurrency.TRX,
    'order2',
    20230903182402,
    amount=100,
    email='test@plisio.net'
)

# Example: using fiat currency
third_invoice = plisio.invoice(
    plisio.CryptoCurrency.TRX,
    'order3',
    20230903182403,
    source_currency=plisio.FiatCurrency.USD,
    source_rate=10.2,
    allowed_currencies=[plisio.CryptoCurrency.TRX,plisio.CryptoCurrency.USDT_TRX]
)
```

### Validate callback data

To validate invoice's callback data use next code:

<code>PlisioClient</code>.

```python
import plisio
...

client = plisio.PlisioClient(api_key='your_secret_key')
isValid = client.validate_callback(request.body)
```

*If you have some issues with it - verify that you've added **json=true** to yours callback_url*

### Commission

To estimate the cryptocurrency fee and Plisio commission,
call method <code>get_commission</code>. It takes
one required parameter (<code>crypto_currency</code>, the name of the cryptocurrency) and five additional parameters:
+ <code>addresses</code> - wallet address or comma separated addresses when estimating fee for mass withdrawal;
+ <code>amounts</code> - amount or comma separated amount that will be send in case of mass withdraw;
+ <code>type_</code> - operation type, such as:
    + *cash_out*;
    + *mass_cash_out*;
+ <code>fee_plan</code> - the name of [fee plan](https://plisio.net/documentation/endpoints/fee-plans);
+ <code>custom_fee_rate</code> - custom fee plan value.

Method returns the model <code>Commission</code>, which has fields:
+ <code>commission</code> - Plisio commission value;
+ <code>fee</code> - cryptocurrency fee value;
+ <code>max_amount</code> - maximum allowed amount to withdrawal;
+ <code>plan</code> - Plisio's cryptocurrency fee estimation plan,
the <code>PlanName</code> enum;
+ <code>use_wallet</code> - pay fee from wallet;
+ <code>use_wallet_balance</code> - balance of wallet that will be used to pay fee;
+ <code>plans</code> - the model <code>FeePlan</code>;
+ <code>custom</code> - the model <code>Custom</code>;
+ <code>errors</code> - the number of errors;
+ <code>custom_fee_rate</code> - custom fee plan value.

Example: a request using *Ethereum (ETH)*:

```python
commission = plisio.get_commission(
    plisio.CryptoCurrency.ETH
)
```

#### Custom

There are **5** fields:

+ <code>min_</code> - minimal custom fee plan value;
+ <code>max_</code> - maximum custom fee plan value;
+ <code>default</code> - estimated fee parameter to confirm the transaction in
the "conf_target" blocks;
+ <code>borders</code> - rate of the supported plan;
+ <code>unit</code> - fee unit.

### Withdrawal

To withdraw, call the <code>withdraw</code> method and
apply the following parameters:
+ <code>crypto_currency</code> - a name of cryptocurrency;
+ <code>to</code> - hash or multiple comma separated hashes pooled for the *mass_cash_out*;
+ <code>amount</code> - any comma separated float values for the *mass_cash_out*
  in the order that hashes are in <code>to</code> parameter;
+ <code>fee_plan</code> - a name of the one of
  [fee plans](https://plisio.net/documentation/endpoints/fee-plans);
+ <code>fee_rate</code> (expected param, unavailable) - custom feeRate. conf_target (blocks) for BTC like
cryptocurrencies or gasPrice in GWAI for ETH based cryptocurrencies;
+ <code>type_</code> - operation type, likes in <code>get_commission</code> method
  (it's an optional parameter).

After that you are getting model <code>Withdraw</code> with fields:
+ <code>type_</code> - operation type, given in the request;
+ <code>status</code> - specifies whether the operation was completed or not (*completed*, *error*);
+ <code>currency</code> - name of the cryptocurrency;
+ <code>source_currency</code> - name of the fiat currency (only USD available);
+ <code>source_rate</code> - exchange rate from the <code>currency</code> to
  the <code>source_currency</code> at the moment of transfer;
+ <code>fee</code> - transaction fee stated in the transfer;
+ <code>wallet_hash</code> - destination hash (if <code>type_</code> is the *cash_out*);
+ <code>sendmany</code> - dictionary of hashes and values (if <code>type</code> is the *mass_cash_out*);
+ <code>params</code> - a model <code>WithdrawParams</code>;
+ <code>created_at_utc</code> - timestamp in the UTC timezone; it may need to be divided by 1000;
+ <code>amount</code> - transfer amount in cryptocurrency
+ <code>tx_url</code> - link to the cryptocurrency block explorer;
+ <code>tx_id</code> - link of transaction ids;
+ <code>id</code> - internal Plisio operation ID.

```python
withdraw = plisio.withdraw(
    crypto_currency = plisio.CryptoCurrency.LTC,
    to = 'wallet_address',
    amount = float(0.01),
    type_ = plisio.OperationType.cash_out
)
```

### Fee estimation

To estimate fee, apply to <code>get_fee</code> the following parameters:
+ <code>crypto_currency</code> - name of the cryptocurrency;
+ <code>addresses</code> - wallet address or comma separated addresses
  when estimating fee for a mass withdrawal;
+ <code>amounts</code> - amount or comma separated amount
  that will be sent in case of a mass withdraw;
+ <code>fee_plan</code> - a name of the one of
  [fee plans](https://plisio.net/documentation/endpoints/fee-plans)
  (it is not required).

The response model has three fields:
+ <code>fee</code> - transaction fee;
+ <code>currency</code> - name of the cryptocurrency;
+ <code>plan</code> - name of fee plan.

```python
fee = plisio.get_fee(
    plisio.CryptoCurrency.ETH,
    'wallet_address',
    'amount',
    'normal',
)
```

### Fee plan

Returns the model with [fee plans](https://plisio.net/documentation/endpoints/fee-plans)
by selected <code>cryptocurrency</code>. Also this model has additional fields
according to the fee plan.

```python
fee = plisio.get_fee_plan(
    plisio.CryptoCurrency.ETH
)
```

### Operations

To view transactions, call:
1) <code>get_operation</code> to view a specific transaction by <code>id</code>;
2) <code>get_operations</code> to view all transactions.

In the first case, it returns a model <code>Operation</code>
for the required operation's id.
In the second case - model <code>Operations</code>,
which consists of operations list, links for current, first and last pages
and metadata about all your operations. The second case has several
optional variables:
+ <code>page</code> - page number;
+ <code>limit</code> - number of elements on the page;
+ <code>shop_id</code> - filter operation by shop;
+ <code>type_</code> - transaction type;
+ <code>status</code> - transaction status;
+ <code>currency</code> - name of the cryptocurrency;
+ <code>search</code> - text search by the transaction id (txid),
invoice's order number or customer email from invoice.

#### Operation

The <code>Operation</code> model has the next fields:
+ <code>user_id</code> - Profile ID;
+ <code>shop_id</code> - Shop ID;
+ <code>type_</code> - model <code>OperationType</code>
consisted **4** types: *cash_in*, *cash_out*, *mass_cash_out*, *invoice*;
+ <code>status</code> - model <code>OperationStatus</code>, described with **6**
statuses: *pending*, *completed*, *error*, *new*, *expired*, *mismatch*, *cancelled*;
+ <code>pending_sum</code> - unconfirmed amount (mempool);
+ <code>currency</code> - name of the cryptocurrency;
+ <code>source_currency</code> - fiat currency;
+ <code>source_rate</code> - exchange rate from the "cryptocurrency";
to the "source_currency" at the moment of transfer;
+ <code>fee</code> - transaction fee stated in the transfer;
+ <code>wallet_hash</code> - destination hash or invoice hash;
+ <code>sendmany</code> - pairs of hashes and values;
+ <code>params</code> - model <code>WithdrawParams</code>;
+ <code>expire_at_utc</code> - timestamp in UTC timezone; it may need to be divided by 1000;
+ <code>created_at_utc</code> - timestamp in the UTC timezone; it may need to be divided by 1000;
+ <code>amount</code> - amount received/transferred by an operation;
+ <code>sum_</code>:
  + *invoice*: params.amount + Plisio commission (if the customer pays the commission)
  or params.amount (if the merchant pays the commission);
  + *cash-out*: transfer amount + network fee;
  + *cash-in*: received amount.
+ <code>commission</code> - Plisio commission;
+ <code>tx_url</code> - link to the cryptocurrency block explorer;
+ <code>tx_id</code> - list of transaction ids;
+ <code>id_</code> - internal Plisio operation ID;
+ <code>actual_sum</code> - real incoming amount;
+ <code>actual_commission</code> - Plisio commission taken;
+ <code>actual_fee</code> - network fee (move invoice to wallet);
+ <code>actual_invoice_sum</code> - <code>actual_sum</code> -
<code>actual_commission_sum</code> - <code>actual_fee</code>;
+ <code>tx</code> - list of transactions details;
+ <code>status_code</code> - code of status.

#### WithdrawParams

There are **4** params:

+ <code>source_currency</code> - name of the cryptocurrency;
+ <code>source_rate</code> - exchange rate from the "cryptocurrency";
to the "source_currency" at the moment of transfer;
+ <code>usd_rate</code> - exchange rate from the "cryptocurrency";
to the **USD** at the moment of transfer;
+ <code>fee</code> - transaction fee stated in the transfer.


## Async usage

All these methods have their async analogues in **PlisioAioClient**.
They can be easily integrated into your async functions.

```python
import plisio
...

client = plisio.PlisioAioClient('your_secret_key')

currencies = await client.get_currencies(plisio.FiatCurrency.AUD)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Plisio/plisio-python",
    "name": "plisio",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "plisio,crypto payment,sdk,bitcoin,etherium,crypto,blockchain",
    "author": "Plisio",
    "author_email": "support@plisio.net",
    "download_url": "https://files.pythonhosted.org/packages/be/d9/8d912a52f56d7f2f0aff04ee60516d4375bc3bed732de2a061952dd88e91/plisio-1.0.8.tar.gz",
    "platform": null,
    "description": "# Python SDK for Plisio API\n\nCurrent project is a **Python SDK for [Plisio API](https://plisio.net/documentation)**.\nTo use it, you should be registered on Plisio\nThe account can be created [here](https://plisio.net/account/signup \"Sign up\"))\nYou will receive a personal secret key, that is used for all calls to API.\n\n![Supported Versions](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-yellowgreen)\n\n\n##  Install\n\nTo download Plisio SDK, either fork this GitHub repo or simply use PyPI via pip:\n```sh\n$ pip install plisio\n```\n\n## Usage\n\n\n### Initialize the connection\n\nTo be able to send the requests, create an instance of class\n<code>PlisioClient</code>.\n\n```python\nimport plisio\n...\n\nclient = plisio.PlisioClient(api_key='your_secret_key')\n```\n\n### Balance\n\nPlisio supports 9 cryptocurrencies(https://plisio.net/documentation/appendices/supported-cryptocurrencies).\nTo view, for example the Ethereum (ETH) balance:\nSend the request by <code>client</code> and process the response\nwith the help of an appropriate model.\n\n```python\n# Sending request and getting processed response\nbalance = client.get_balance(plisio.CryptoCurrency.ETH)\n```\n\n### Currencies\n\nTo view current exchange rate for the supported cryptocurrencies to\n[the definite fiat currency](https://plisio.net/documentation/appendices/supported-fiat-currencies),\nsend a request to API by the method <code>get_currency</code>\nwith the selected fiat currency.\n\nExample: getting the rate of *Australian Dollar (AUD)*.\nIf no fiat currency is selected, the rate of\n*United States Dollar (USD)* is used by default. **The response** is a list of models\nthat consist rates of exchanges.\n\n```python\ncurrencies = client.get_currencies(plisio.FiatCurrency.AUD)\n```\n\n### Creating a new invoice\n\nThe request has to receive the following **required** parameters:\n+ <code>currency</code> - the name of cryptocurrency;\n+ <code>order_name</code> - merchant internal order name;\n+ <code>order_number</code> - merchant internal order number.\n\n**Additional** parameters:\n+ <code>amount</code> - any cryptocurrency float value. If a fiat currency is to be converted,\nskip this field and use the next two fields instead;\n+ <code>source_currency</code> - the name of the fiat currency;\n+ <code>source_amount</code> - any float value;\n+ <code>allowed_psys_cids</code> - comma-separated list of cryptocurrencies that are\n  allowed for a payment. Also, you will be able to select one of them. Example: *'BTC,ETH,TZEC'*;\n+ <code>description</code> - merchant invoice description;\n+ <code>callback_url</code> - merchant full URL to get invoice updates.\n  The *POST* request will be sent to this URL. If this parameter isn't set,\n  a callback will be sent to the URL that can be set under profile in API settings, in the 'Status URL' field; **Add ?json=true to this url to get data in JSON and validate it client.validate_callback**\n+ <code>email</code> - an auto-fill invoice email.\n  You will be asked to enter an email to which a notification will be sent;\n+ <code>language</code> - en_US (supports English only);\n+ <code>plugin</code> - Plisio's internal field to determine integration plugin;\n+ <code>version</code> - Plisio's internal field to determine integration plugin version.\n+ <code>redirect_to_invoice</code> - Instead of JSON response user will be redirected to the Plisio's invoice page (is not working for a white-label shop).\n+ <code>expire_min</code> - Interval in minutes when invoice will be expired.\n\nThe response is a model that can fill differently depending on\nwhether you have [**While Label**](https://plisio.net/white-label) or not.\nIn the first case, only two fields are returned:\n<code>txn_id</code> is a Plisio's intertnal ID and\n<code>invoice_url</code> is an invoice URL. And in the second case,\n extra fields are added to them:\n+ <code>amount</code> - invoice amount in the selected cryptocurrency;\n+ <code>pending_amount</code> - the remaining amount to be paid in\n  the selected cryptocurrency;\n+ <code>wallet_hash</code> - invoice hash;\n+ <code>psys_cid</code> - cryptocurrencies ID;\n+ <code>currency</code> - cryptocurrencies code;\n+ <code>source_currency</code> - fiat currency;\n+ <code>source_rate</code> - exchange rate from the <code>psys_cid</code>\n  to the <code>source_currency</code> at the moment of transfer;\n+ <code>expected_confirmations</code> - the number of expected confirmations\n  to mark the invoice as completed;\n+ <code>qr_code</code> - QR code image in base64 format;\n+ <code>verify_hash</code> - hash to verify the *POST*\n  data signed with your *API_KEY*;\n+ <code>invoice_commission</code> - Plisio commission;\n+ <code>invoice_sum</code> - *shop pays commission*: invoice amount -\n  <code>invoice_commission</code>, *client pays commission*: invoice amount;\n+ <code>invoice_total_sum</code> - *shop pays commission*: invoice amount,\n  *client pays commission*: <code>invoice_commission</code> + <code>invoice_sum</code>.\n\nCreate a few *Python* examples, where use:\n+ required fields only;\n+ all the fields besides the <code>amount</code>;\n+ all the fields besides the <code>source_currency</code> and the <code>source_amount</code>.\n```python\n# Example: using required fields only\nfirst_invoice = plisio.invoice(plisio.CryptoCurrency.BTC, 'order1', 20230903182401, 0.00001)\n\n# Example: using cryptocurrency\nsecond_invoice = plisio.invoice(\n    plisio.CryptoCurrency.TRX,\n    'order2',\n    20230903182402,\n    amount=100,\n    email='test@plisio.net'\n)\n\n# Example: using fiat currency\nthird_invoice = plisio.invoice(\n    plisio.CryptoCurrency.TRX,\n    'order3',\n    20230903182403,\n    source_currency=plisio.FiatCurrency.USD,\n    source_rate=10.2,\n    allowed_currencies=[plisio.CryptoCurrency.TRX,plisio.CryptoCurrency.USDT_TRX]\n)\n```\n\n### Validate callback data\n\nTo validate invoice's callback data use next code:\n\n<code>PlisioClient</code>.\n\n```python\nimport plisio\n...\n\nclient = plisio.PlisioClient(api_key='your_secret_key')\nisValid = client.validate_callback(request.body)\n```\n\n*If you have some issues with it - verify that you've added **json=true** to yours callback_url*\n\n### Commission\n\nTo estimate the cryptocurrency fee and Plisio commission,\ncall method <code>get_commission</code>. It takes\none required parameter (<code>crypto_currency</code>, the name of the cryptocurrency) and five additional parameters:\n+ <code>addresses</code> - wallet address or comma separated addresses when estimating fee for mass withdrawal;\n+ <code>amounts</code> - amount or comma separated amount that will be send in case of mass withdraw;\n+ <code>type_</code> - operation type, such as:\n    + *cash_out*;\n    + *mass_cash_out*;\n+ <code>fee_plan</code> - the name of [fee plan](https://plisio.net/documentation/endpoints/fee-plans);\n+ <code>custom_fee_rate</code> - custom fee plan value.\n\nMethod returns the model <code>Commission</code>, which has fields:\n+ <code>commission</code> - Plisio commission value;\n+ <code>fee</code> - cryptocurrency fee value;\n+ <code>max_amount</code> - maximum allowed amount to withdrawal;\n+ <code>plan</code> - Plisio's cryptocurrency fee estimation plan,\nthe <code>PlanName</code> enum;\n+ <code>use_wallet</code> - pay fee from wallet;\n+ <code>use_wallet_balance</code> - balance of wallet that will be used to pay fee;\n+ <code>plans</code> - the model <code>FeePlan</code>;\n+ <code>custom</code> - the model <code>Custom</code>;\n+ <code>errors</code> - the number of errors;\n+ <code>custom_fee_rate</code> - custom fee plan value.\n\nExample: a request using *Ethereum (ETH)*:\n\n```python\ncommission = plisio.get_commission(\n    plisio.CryptoCurrency.ETH\n)\n```\n\n#### Custom\n\nThere are **5** fields:\n\n+ <code>min_</code> - minimal custom fee plan value;\n+ <code>max_</code> - maximum custom fee plan value;\n+ <code>default</code> - estimated fee parameter to confirm the transaction in\nthe \"conf_target\" blocks;\n+ <code>borders</code> - rate of the supported plan;\n+ <code>unit</code> - fee unit.\n\n### Withdrawal\n\nTo withdraw, call the <code>withdraw</code> method and\napply the following parameters:\n+ <code>crypto_currency</code> - a name of cryptocurrency;\n+ <code>to</code> - hash or multiple comma separated hashes pooled for the *mass_cash_out*;\n+ <code>amount</code> - any comma separated float values for the *mass_cash_out*\n  in the order that hashes are in <code>to</code> parameter;\n+ <code>fee_plan</code> - a name of the one of\n  [fee plans](https://plisio.net/documentation/endpoints/fee-plans);\n+ <code>fee_rate</code> (expected param, unavailable) - custom feeRate. conf_target (blocks) for BTC like\ncryptocurrencies or gasPrice in GWAI for ETH based cryptocurrencies;\n+ <code>type_</code> - operation type, likes in <code>get_commission</code> method\n  (it's an optional parameter).\n\nAfter that you are getting model <code>Withdraw</code> with fields:\n+ <code>type_</code> - operation type, given in the request;\n+ <code>status</code> - specifies whether the operation was completed or not (*completed*, *error*);\n+ <code>currency</code> - name of the cryptocurrency;\n+ <code>source_currency</code> - name of the fiat currency (only USD available);\n+ <code>source_rate</code> - exchange rate from the <code>currency</code> to\n  the <code>source_currency</code> at the moment of transfer;\n+ <code>fee</code> - transaction fee stated in the transfer;\n+ <code>wallet_hash</code> - destination hash (if <code>type_</code> is the *cash_out*);\n+ <code>sendmany</code> - dictionary of hashes and values (if <code>type</code> is the *mass_cash_out*);\n+ <code>params</code> - a model <code>WithdrawParams</code>;\n+ <code>created_at_utc</code> - timestamp in the UTC timezone; it may need to be divided by 1000;\n+ <code>amount</code> - transfer amount in cryptocurrency\n+ <code>tx_url</code> - link to the cryptocurrency block explorer;\n+ <code>tx_id</code> - link of transaction ids;\n+ <code>id</code> - internal Plisio operation ID.\n\n```python\nwithdraw = plisio.withdraw(\n    crypto_currency = plisio.CryptoCurrency.LTC,\n    to = 'wallet_address',\n    amount = float(0.01),\n    type_ = plisio.OperationType.cash_out\n)\n```\n\n### Fee estimation\n\nTo estimate fee, apply to <code>get_fee</code> the following parameters:\n+ <code>crypto_currency</code> - name of the cryptocurrency;\n+ <code>addresses</code> - wallet address or comma separated addresses\n  when estimating fee for a mass withdrawal;\n+ <code>amounts</code> - amount or comma separated amount\n  that will be sent in case of a mass withdraw;\n+ <code>fee_plan</code> - a name of the one of\n  [fee plans](https://plisio.net/documentation/endpoints/fee-plans)\n  (it is not required).\n\nThe response model has three fields:\n+ <code>fee</code> - transaction fee;\n+ <code>currency</code> - name of the cryptocurrency;\n+ <code>plan</code> - name of fee plan.\n\n```python\nfee = plisio.get_fee(\n    plisio.CryptoCurrency.ETH,\n    'wallet_address',\n    'amount',\n    'normal',\n)\n```\n\n### Fee plan\n\nReturns the model with [fee plans](https://plisio.net/documentation/endpoints/fee-plans)\nby selected <code>cryptocurrency</code>. Also this model has additional fields\naccording to the fee plan.\n\n```python\nfee = plisio.get_fee_plan(\n    plisio.CryptoCurrency.ETH\n)\n```\n\n### Operations\n\nTo view transactions, call:\n1) <code>get_operation</code> to view a specific transaction by <code>id</code>;\n2) <code>get_operations</code> to view all transactions.\n\nIn the first case, it returns a model <code>Operation</code>\nfor the required operation's id.\nIn the second case - model <code>Operations</code>,\nwhich consists of operations list, links for current, first and last pages\nand metadata about all your operations. The second case has several\noptional variables:\n+ <code>page</code> - page number;\n+ <code>limit</code> - number of elements on the page;\n+ <code>shop_id</code> - filter operation by shop;\n+ <code>type_</code> - transaction type;\n+ <code>status</code> - transaction status;\n+ <code>currency</code> - name of the cryptocurrency;\n+ <code>search</code> - text search by the transaction id (txid),\ninvoice's order number or customer email from invoice.\n\n#### Operation\n\nThe <code>Operation</code> model has the next fields:\n+ <code>user_id</code> - Profile ID;\n+ <code>shop_id</code> - Shop ID;\n+ <code>type_</code> - model <code>OperationType</code>\nconsisted **4** types: *cash_in*, *cash_out*, *mass_cash_out*, *invoice*;\n+ <code>status</code> - model <code>OperationStatus</code>, described with **6**\nstatuses: *pending*, *completed*, *error*, *new*, *expired*, *mismatch*, *cancelled*;\n+ <code>pending_sum</code> - unconfirmed amount (mempool);\n+ <code>currency</code> - name of the cryptocurrency;\n+ <code>source_currency</code> - fiat currency;\n+ <code>source_rate</code> - exchange rate from the \"cryptocurrency\";\nto the \"source_currency\" at the moment of transfer;\n+ <code>fee</code> - transaction fee stated in the transfer;\n+ <code>wallet_hash</code> - destination hash or invoice hash;\n+ <code>sendmany</code> - pairs of hashes and values;\n+ <code>params</code> - model <code>WithdrawParams</code>;\n+ <code>expire_at_utc</code> - timestamp in UTC timezone; it may need to be divided by 1000;\n+ <code>created_at_utc</code> - timestamp in the UTC timezone; it may need to be divided by 1000;\n+ <code>amount</code> - amount received/transferred by an operation;\n+ <code>sum_</code>:\n  + *invoice*: params.amount + Plisio commission (if the customer pays the commission)\n  or params.amount (if the merchant pays the commission);\n  + *cash-out*: transfer amount + network fee;\n  + *cash-in*: received amount.\n+ <code>commission</code> - Plisio commission;\n+ <code>tx_url</code> - link to the cryptocurrency block explorer;\n+ <code>tx_id</code> - list of transaction ids;\n+ <code>id_</code> - internal Plisio operation ID;\n+ <code>actual_sum</code> - real incoming amount;\n+ <code>actual_commission</code> - Plisio commission taken;\n+ <code>actual_fee</code> - network fee (move invoice to wallet);\n+ <code>actual_invoice_sum</code> - <code>actual_sum</code> -\n<code>actual_commission_sum</code> - <code>actual_fee</code>;\n+ <code>tx</code> - list of transactions details;\n+ <code>status_code</code> - code of status.\n\n#### WithdrawParams\n\nThere are **4** params:\n\n+ <code>source_currency</code> - name of the cryptocurrency;\n+ <code>source_rate</code> - exchange rate from the \"cryptocurrency\";\nto the \"source_currency\" at the moment of transfer;\n+ <code>usd_rate</code> - exchange rate from the \"cryptocurrency\";\nto the **USD** at the moment of transfer;\n+ <code>fee</code> - transaction fee stated in the transfer.\n\n\n## Async usage\n\nAll these methods have their async analogues in **PlisioAioClient**.\nThey can be easily integrated into your async functions.\n\n```python\nimport plisio\n...\n\nclient = plisio.PlisioAioClient('your_secret_key')\n\ncurrencies = await client.get_currencies(plisio.FiatCurrency.AUD)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Official Python SDK for Plisio API",
    "version": "1.0.8",
    "project_urls": {
        "Download": "https://github.com/Plisio/plisio-python",
        "Homepage": "https://github.com/Plisio/plisio-python"
    },
    "split_keywords": [
        "plisio",
        "crypto payment",
        "sdk",
        "bitcoin",
        "etherium",
        "crypto",
        "blockchain"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "accc5e86f768d99c369b22e12f6ab7c60bbd68b2c4a5dcfe872d1ddb386782ab",
                "md5": "6464aa56bdf011260e3863c784bc07e3",
                "sha256": "a32a9cb478059d0042207eecdd97db5ca0b78802406767b32558934f18284683"
            },
            "downloads": -1,
            "filename": "plisio-1.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6464aa56bdf011260e3863c784bc07e3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 17579,
            "upload_time": "2024-03-19T06:35:22",
            "upload_time_iso_8601": "2024-03-19T06:35:22.766773Z",
            "url": "https://files.pythonhosted.org/packages/ac/cc/5e86f768d99c369b22e12f6ab7c60bbd68b2c4a5dcfe872d1ddb386782ab/plisio-1.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bed98d912a52f56d7f2f0aff04ee60516d4375bc3bed732de2a061952dd88e91",
                "md5": "057782f76286b544f1929ffb402a70bc",
                "sha256": "569986963dc1f06c339ee7b39b948a580016db0f7fa20735ff7c8d0a66c29816"
            },
            "downloads": -1,
            "filename": "plisio-1.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "057782f76286b544f1929ffb402a70bc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 21198,
            "upload_time": "2024-03-19T06:35:25",
            "upload_time_iso_8601": "2024-03-19T06:35:25.747348Z",
            "url": "https://files.pythonhosted.org/packages/be/d9/8d912a52f56d7f2f0aff04ee60516d4375bc3bed732de2a061952dd88e91/plisio-1.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-19 06:35:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Plisio",
    "github_project": "plisio-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "plisio"
}
        
Elapsed time: 0.20498s