Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Deprecated

Linets Magento

Starting

These instructions will allow you to install the library in your django project.

Current features

  1. Generate order in Magento.
  2. Generate default data for create order in Magento.

Pre-requisitos

  1. Python >= 3.7
  2. requests >= 2
  3. Django >= 3,

Installation

To get the latest stable release from PyPi:

pip install oms-magento

or From a build

git clone https://gitlab.com/linets/ecommerce/oms/integrations/oms-magento
cd {{project}} && git checkout develop
python setup.py sdist

and, install in your project Django.

pip install {{path}}/oms-magento/dist/{{tar.gz file}}

Settings in django project

LINETS_MAGENTO = {
    'MAGENTO': {
        'BASE_URL': 'https://linets.api.magento.io/rest/all/',
        'API_KEY': '7d06682sdgff6d06682sdgff66d06682sdgff66',
    },
}

Usage

from linets_magento.handler import MagentoHandler
handler = MagentoHandler()

List orders in Magento:

List oders by days count.

default_data = handler.order_get_last_completed(days_count=5)

List orders with status pending.

default_data = handler.order_get_pending_list()

List all orders, can filter by status, default(status = 'complete')

default_data = handler.order_get_list(status='complete')

All list methods return:

# Output:
{
    'items': [....],
    'search_criteria': {
        'filter_groups': [
            {
                'filters': [
                    {
                        'field': 'status',
                        'value': 'pending',
                        'condition_type': 'eq'
                    }
                  ]
            },
            {
                'filters': [
                    {
                        'field': 'created_at',
                        'value': '2021-05-14 15:00:37',
                        'condition_type': 'lt'
                    }
                ]
            }
        ]
    },
    'total_count': 0
}

Get detail order in Magento:

default_data = handler.order_get_detail(identifier)

# Output:
{
    'base_currency_code': 'CLP',
    'base_discount_amount': 0,
    'base_discount_invoiced': 0,
    'base_grand_total': 31990,
    'base_discount_tax_compensation_amount': 0,
    'base_discount_tax_compensation_invoiced': 0,
    'base_shipping_amount': 0,
    'base_shipping_discount_amount': 0,
    'base_shipping_discount_tax_compensation_amnt': 0,
    'base_shipping_incl_tax': 0,
    'base_shipping_invoiced': 0,
    'base_shipping_tax_amount': 0,
    'base_subtotal': 31990,
    'items': [...],
    'billing_address': {...},
    'payment': {...},
    'status_histories': {...},
    'extension_attributes': {...},
    'payment_additional_info': {...},
    'gift_cards': [...],
    'base_gift_cards_amount': 0,
    'gift_cards_amount': 0,
    'applied_taxes': [...],
    'item_applied_taxes': [...],
    'gw_base_price': '0.0000',
    'gw_price': '0.0000',
    'gw_items_base_price': '0.0000',
    'gw_items_price': '0.0000',
    'gw_card_base_price': '0.0000',
    'gw_card_price': '0.0000',
    'checkout_request_invoice': 'No',
    'rut': '17.716.251-5
}

Get items for order:

response = handler.order_get_items(identifier)

# Output:
{
    "items": [
        {
            "item_id": 140,
            "qty_ordered": 1,
            "sku": "ALCNHDA01B57Z"
        }
    ]
}

Add the items to a shipment to substract the used stock:

from linets_magento.handler import MagentoHandler

handler = MagentoHandler()
response = handler.order_post_ship(identifier, items)

Output:
9999

Adds the items to a invoice and completes the order:

response = handler.order_post_invoice(identifier, items)

# Output:
9999

Add comment and update status for order in Magento:

response = handler.order_post_comment(identifier, comment, status, notify_customer)

# Output:
True

Cancel order in Magento:

response = handler.order_post_cancel(identifier)

# Output:
True

Release files for oms-magento 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oms-magento 1.0.0
File Size Uploaded
oms-magento-1.0.0.tar.gz 6.8 kB Details

Release files / oms-magento-1.0.0.tar.gz

Download URL oms-magento-1.0.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9c53432e07e90c2b62ee8c474d8c2bdf7fb903f0512fed54f93ac5c53c580044
BLAKE2b-256 checksum
How to use checksums
8c8450f92d8554c6141c687739984e55ce4b73d587974158f5d5bab23a7e4349
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page