diff --git a/fusion_shipping/api/ups_rest/request.py b/fusion_shipping/api/ups_rest/request.py index 2c0990a1..e7a57617 100644 --- a/fusion_shipping/api/ups_rest/request.py +++ b/fusion_shipping/api/ups_rest/request.py @@ -431,9 +431,11 @@ class UPSRequest: (ship_from.country_id.code == 'US' and ship_to.country_id.code == 'US') or (ship_from.country_id.code == 'PR' and ship_to.country_id.code == 'PR') ): - request['ShipmentRequest']['Shipment']['ReferenceNumber'] = { - 'Value': shipment_info.get('reference_number') - } + # reference_number is already a list of {'Code', 'Value'} dicts + # (see _ups_rest_prepare_shipping_data). UPS expects ReferenceNumber + # to be such an object (or an array of them) with a string Value -- + # NOT {'Value': [, ...]}, which UPS rejects on the ship call. + request['ShipmentRequest']['Shipment']['ReferenceNumber'] = shipment_info.get('reference_number') # Shipments from US to CA or PR require extra info if ship_from.country_id.code == 'US' and ship_to.country_id.code in ['CA', 'PR']: