Skip to main content

Linets Bluexpress

Starting 🚀

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

Current features 📋

  • Generate order in Bluexpress.
  • Generate default data for create order in Bluexpress.

Pre-requisitos 📋

  • Python >= 3.7
  • Django >= 3
  • zeep >= 4

Installation 🔧

  1. To get the latest stable release from PyPi:
pip install django-bluexpress

or

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

and, install in your project django

pip install {{path}}/oms-bluexpress/dist/{{tar.gz file}}
  1. Settings in django project
DJANGO_BLUEXPRESS = {
  'BLUEXPRESS': {
        'BASE_URL_REST': '<BLUEXPRESS_BASE_URL_REST>',
        'ISSUE_WSDL': '<BLUEXPRESS_ISSUE_WSDL>',
        'TOKEN_ID': '<BLUEXPRESS_TOKEN_ID>',
        'USER_COD': '<BLUEXPRESS_USER_COD>',
        'COMPANY_CODE': '<BLUEXPRESS_COMPANY_CODE>',
        'SHIPPING_TYPE': '<BLUEXPRESS_SHIPPING_TYPE>',
        'PAYMENT_TYPE': '<BLUEXPRESS_PAYMENT_TYPE>',
        'PRODUCT_CODE': '<BLUEXPRESS_PRODUCT_CODE>',
        'CURRENCY_CODE': '<BLUEXPRESS_CURRENCY_CODE>',
        'SERVICE_TYPE_CODE': '<BLUEXPRESS_SERVICE_TYPE_CODE>',
        'PRODUCT_FAMILY_CODE': '<BLUEXPRESS_PRODUCT_FAMILY_CODE>',
        'PRINT_FORMAT_CODE': '<BLUEXPRESS_PRINT_FORMAT_CODE>',
    },
    'SENDER': {
        'PERSON_CODE': '<BLUEXPRESS_PERSON_CODE>',
        'ACCOUNT_CLIENT': '<BLUEXPRESS_ACCOUNT_CLIENT>',
        'RUT': '<BLUEXPRESS_RUT>',
        'DV': '<BLUEXPRESS_DV>',
        'NAME': '<BLUEXPRESS_NAME>',
        'STREET': '<BLUEXPRESS_STREET>',
        'NUMBER': '<BLUEXPRESS_NUMBER>',
        'FLOOR': '<BLUEXPRESS_FLOOR>',
        'DPTO': '<BLUEXPRESS_DPTO>',
        'PHONE_PREFIX': '<BLUEXPRESS_PHONE_PREFIX>',
        'PHONE_NUMBER': '<BLUEXPRESS_PHONE_NUMBER>',
        'PHONE_ANNEXED': '<BLUEXPRESS_PHONE_ANNEXED>',
        'COUNTRY_CODE': '<BLUEXPRESS_COUNTRY_CODE>',
        'REGION_CODE': '<BLUEXPRESS_REGION_CODE>',
        'COMMUNE_CODE': '<BLUEXPRESS_COMMUNE_CODE>',
        'LOCATION_CODE': '<BLUEXPRESS_LOCATION_CODE>'
    },
    'DESTINATARY': {
        'PHONE_PREFIX': '<BLUEXPRESS_PHONE_PREFIX>',
        'COUNTRY_CODE': '<BLUEXPRESS_COUNTRY_CODE>',
    },
}

Usage 🔧

  1. Create instance to be sent

    import json
    from types import SimpleNamespace
    
    dict_ = {
        'reference': '99999',
        'lumps': 1,
        'created_at': '12/12/21',
        'shipping_date': '12/12/21',
        'expiration_date': '26/12/21'
        'tracking_code': '6075620-1',
        'transport_guide_number': '1121632479536-01-1',
        'purchase_number': 'CLV0048146676851-1',
        'agency_id': '123', # if you need use pickup
        'customer': {
            'first_name': 'Marcos',
            'last_name': 'Sac',
            'full_name': 'Marcos Sac',
            'phone': '932932932',
            'email': 'test@gmail.com',
            'rut': '16936195-9'
        },
        'address': {
            'street': 'ALEJANDRO VENEGAS CADIZ',
            'number': '513',
            'unit': 'DEPTO 6A',
            'full_address': 'ALEJANDRO VENEGAS CADIZ 513 DEPTO 6A'
        },
        'commune': {
            'name': 'Aisen',
            'code': '',
            'zone_code': '11201',
            'zone_post': 'WPA',
        },
        'location': {
            'code': 'MONTANDON',
            'name': 'MNN',
        },
        'region': {
            'name': 'Aysén del General Carlos Ibáñez del Campo',
            'code': '11',
            'iso_code': 'CL-XI',
        }
    }
    
    instance = json.loads(json.dumps(dict_), object_hook=lambda attr: SimpleNamespace(**attr))
    
  2. Generate default data for create a order in Bluexpress:

from bluexpress.handler import BluexpressHandler

handler = BluexpressHandler()
default_data = handler.get_default_payload(instance)

Output:

  1. Create a order in Bluexpress:
from bluexpress.handler import BluexpressHandler

handler = BluexpressHandler()
response = handler.create_shipping(default_data)

Output:

  1. Get events:
from bluexpress.handler import BluexpressHandler

handler = BluexpressHandler()

raw_data = {
    'carrier_tracking_number': int.
    'tracking_data': xml string.
}
response = handler.get_events(raw_data)

Output:
[{
    'city': string
    'state': string
    'description': string
    'date': string
}, ...]
  1. Get status and if "is_delivered":
from bluexpress.handler import BluexpressHandler

handler = BluexpressHandler()

raw_data = {
    'carrier_tracking_number': int.
    'tracking_data': xml string.
}
response = handler.get_status(raw_data)

Output:
('Entregado', True)
  1. Get shipping label:
from bluexpress.handler import BluexpressHandler

handler = BluexpressHandler()
response = handler.get_shipping_label(tracking_number)

Output:
{
    "status": true,
    "data": [
        {
          "base64": "base64 string"
        }
    ]
}

Metadata

Release files for corona-bluexpress-logistica 1.5.16

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

Source distribution (sdist)

Source distribution for corona-bluexpress-logistica 1.5.16
File Size Uploaded Provenance
corona_bluexpress_logistica-1.5.16.tar.gz 9.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for corona-bluexpress-logistica 1.5.16
File Interpreter ABI Platform
corona_bluexpress_logistica-1.5.16-py3-none-any.whl Python 3 none any Details

Total release size: 18.2 kB

Release files / corona_bluexpress_logistica-1.5.16.tar.gz

Download URL corona_bluexpress_logistica-1.5.16.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a8307d05598f51700c3b7b00a0aa446a2c65a9882e4222fc2de11f7a3bf279c2
BLAKE2b-256 checksum
How to use checksums
6d7998d3149c4f3c83e5ab1c89936e6aba342c28b5c28c27a817d6b8f79e826d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.3

Release files / corona_bluexpress_logistica-1.5.16-py3-none-any.whl

Download URL corona_bluexpress_logistica-1.5.16-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8719cf063c5ed704cabd4706d7785de00f0bde54d3c622685d26969acf8813d
BLAKE2b-256 checksum
How to use checksums
46707560d631bc8d0943accf54988c8fec1d50c8014d1fca6624766e5e94464a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.3

Security for corona-bluexpress-logistica 1.5.16

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.

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