django-vtex
Starting
These instructions will allow you to install the library in your python project.
Current features
- Get tracking info.
Pre-requisitos
- Python >= 3.7
- Django >= 3
- requests >= 2
Installation
- To get the latest stable release from PyPi:
pip install django-vtex
or
- From a build
git clone https://gitlab.com/linets/ecommerce/oms/integrations/django-vtex
cd {{project}}
python setup.py sdist
and, install in your project django
pip install {{path}}/django-vtex/dist/{{tar.gz file}}
- Settings in django project
DJANGO_VTEX = {
'VTEX': {
'BASE_URL': '<VTEX_BASE_URL>',
'APP_KEY': '<VTEX_APP_KEY>',
'APP_TOKEN': '<VTEX_APP_TOKEN>',
}
}
Usage
- Get orders:
from vtex.handler import VtexHandler
handler = VtexHandler()
response = handler.get_orders(<offset>)
- Get order detail:
from vtex.handler import VtexHandler
handler = VtexHandler()
response = handler.get_order_detail(<identifier>)
-
Create instance to be sent in create_invoice
import json from collections import namedtuple dict_ = { 'invoice_number': 'NFe-00001', 'courier': '', 'tracking_number': '', 'tracking_url': '', 'items': [ { 'id': '345117', 'quantity': 1, 'price': 9003 } ], 'total_value': 9508 } instance = namedtuple('VtexInstance', dict_.keys())(*dict_.values()) -
Create invoice:
from vtex.handler import VtexHandler
handler = VtexHandler()
response = handler.create_invoice(<identifier>, <instance>)
- Update order status:
from vtex.handler import VtexHandler
handler = VtexHandler()
response = handler.update_order_status(<identifier>, <status>)
- Update tracking status:
from vtex.handler import VtexHandler
handler = VtexHandler()
# events = [] default
# is_delivered = False default
response = handler.update_tracking_status(
<identifier>, <wms_reference>, <events>, <is_delivered>)
Metadata
Release files for django-vtex 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-vtex-1.1.3.tar.gz | 5.3 kB | Without provenance | Details for django-vtex-1.1.3.tar.gz |
Release files / django-vtex-1.1.3.tar.gz
| Download URL | django-vtex-1.1.3.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46300fe9424bbc94a54ef33883d9f18bb12b71198c4c8b9476cafe364477f17e
|
|
BLAKE2b-256 checksum How to use checksums |
14b7bd2943b47b200dadbded54d0dbab347b6edbef683cc3cda732546855be70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.7.0
|
Security for django-vtex 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.