sr1871 / fedex-python

MIT License
0 stars 0 forks source link

Cannot use for International shipment #2

Closed NirajSN closed 3 years ago

NirajSN commented 3 years ago

How do I add Customs Value during International PRIORITY_OVERNIGHT, REGULAR_PICKUP and Fedex_box? I have tried to find in source code but not any class or parameters given. Also, one more things about the commodity - how do we add?

I have tried to send shipment from Germany to United states. It is given me issue - 2033 Customs Value is required. But I have checked in whole source code where not defined the class or parameters for Customs values.

Requested Data:

ship_timestamp='2021-03-03T02:09:41+00:00' dropoff_type=<DropoffTypeEnum.REGULAR_PICKUP: 'REGULAR_PICKUP'> packaging_type=<PackagingTypeEnum.FEDEX_BOX: 'FEDEX_BOX'> service_type=<ShipServiceTypeEnum.PRIORITY_OVERNIGHT: 'PRIORITY_OVERNIGHT'> shipper=ContactAddress(account_number=None, contact=Contact(contact_id=None, person_name='', title=None, company_name='My Company (San Francisco)', phone_number='+1 (650) 691-3277 ', phone_extension=None, toll_free_phone_number=None, pager_number=None, fax_number=None, eMail_address='info@yourcompany.com'), address=Address(street_lines=['250 Executive Park Blvd, Suite 3400', ''], city='San Francisco', state_or_province_code='CA', postal_code='94134', urbanization_code=None, country_code='DE', country_name=None, residential=None, geographic_coordinates=None)) recipient=ContactAddress(account_number=None, contact=Contact(contact_id=None, person_name='', title=None, company_name='Lumber Inc', phone_number='(828)-316-0593', phone_extension=None, toll_free_phone_number=None, pager_number=None, fax_number=None, eMail_address='lumber-inv92@example.com'), address=Address(street_lines=['1337 N San Joaquin St', ''], city='Stockton', state_or_province_code='CA', postal_code='95202', urbanization_code=None, country_code='US', country_name=None, residential=None, geographic_coordinates=None)) total_weight=Weight(units=<WeightUnits.LB: 'LB'>, value=Decimal('44.0924')) package_count=1 shipping_charges_payment=ShippingChargesPayment(payment_type=<PaymentTypeEnum.SENDER: 'SENDER'>, payor=Payor(responsible_party=ContactAddress(account_number='601356805', contact=None, address=None))) requested_package_line_items=[RequestedPackageLineItemBase(sequence=None, weight=Weight(units=<WeightUnits.LB: 'LB'>, value=Decimal('44.0924')), dimensions=Dimensions(length=0, height=0, width=0, units=<LinearUnits.IN: 'IN'>), customer_references=None, sequence_number=1)] preferred_currency=<CurrencyCodeEnum.EURO: 'EUR'> label_specification=LabelSpecification(label_format_type=<LabelFormatTypeEnum.COMMON2D: 'COMMON2D'>, image_type=<ImageTypeEnum.PDF: 'PDF'>, label_stock_type=<LabelStockTypeEnum.PAPER_LETTER: 'PAPER_LETTER'>, label_printing_orientation=<LabelPrintingOrientationEnum.TOP_EDGE_OF_TEXT_FIRST: 'TOP_EDGE_OF_TEXT_FIRST'>, label_order=<LabelOrderEnum.SHIPPING_LABEL_FIRST: 'SHIPPING_LABEL_FIRST'>) rate_request_types=<RateRequestTypeEnum.PREFERRED: 'PREFERRED'> master_tracking_id=None

Response: { 'HighestSeverity': 'ERROR', 'Notifications': [ { 'Severity': 'ERROR', 'Source': 'ship', 'Code': '2033', 'Message': 'Customs Value is required.', 'LocalizedMessage': 'Customs Value is required.', 'MessageParameters': [] } ], 'TransactionDetail': { 'CustomerTransactionId': 'ShipService_WH/OUT/00017', 'Localization': None }, 'Version': { 'ServiceId': 'ship', 'Major': 25, 'Intermediate': 0, 'Minor': 0 }, 'JobId': None, 'CompletedShipmentDetail': None, 'ErrorLabels': [] }

Please guide me on this, Where I am wrong?

sr1871 commented 3 years ago

There was a Commodity component into the module.

I added. Please tell me if this works, and in case that you need to modify the code, please review the change of that commit to know how to do it. https://github.com/sr1871/fedex-python/commit/4f29fba6715e9cd7ac3a96a56892ec265d6a2e6b

NirajSN commented 3 years ago

Thanks for the adding the commodities.