Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
2.6 kB
2
Indexable
Never
response = client.service.createShipments(
    authData={
        'username': username,
        'password': password
    },

    shipments={
        'item': {
            'shipper': {
                'name': 'Testomir',
                'postalCode': '00909',
                'city': 'Warszawa',
                'street': 'Wąwozowa',
                'houseNumber': 2,
                #'contactPhone': 123456789
            },

            'receiver': {
                'addressType': 'B',  # required, TODO: ustalić co to
                'country': 'PL',  # data['order']['address']['receiver']['country_code'],  # required
                'name': 'Odbiorca',  # data['order']['address']['receiver']['name'],  # required
                'postalCode': 24100,  # data['order']['address']['receiver']['postal_code'],  # required
                'city': 'Puławy',  # data['order']['address']['receiver']['city'],  # required
                'street': 'Wróblewskiego',  # required, TODO: line1
                'houseNumber': 7,  # required, TODO: line2
                #'contactPerson': 'Jan JakoTaki', # data['order']['address']['receiver']['contact_person'],
                #'contactPhone': 818765432, # data['order']['address']['receiver']['phone'],
                #'contactEmail': 'odbiorca@gmail.com', # data['order']['address']['receiver']['email'],
                # apatramentNumber - sprawdzić w debug
                # postnummer - sprawdzić w debug
            },

            'skipRestrictionCheck': True,

            'pieceList': [{'item': {
                'type': 'PALLET',
                'width': 40,
                'height': 100,
                'length': 60,
                'weight': 250,
                'quantity': 1,
                'nonStandard': True,
                'blpPieceId': 'JJD111100022203041'
            }}, {'item': {
                'type': 'ENVELOPE',
                'quantity': 1
            }}],

            'payment': {
                'paymentMethod': 'BANK_TRANSFER',
                'payerType': 'SHIPPER',
                'accountNumber': 6000000,
                #'costsCenter': 501502
            },

            'service': {
                'product': 'AH',  # DHL Parcel Polska
                #'collectOnDelivery': True,
                #'collectOnDeliveryValue': 2199.99,
                #'collectOnDeliveryForm': 'BANK_TRANSFER',
                #'insurance': True,
                #'insuranceValue': 2500
            },

            'shipmentDate': '2022-03-28',

            'comment': 'aaaa',

            'content': 'Sprzęt AGD'
        }
    }
)