Describe the bug
When setting the Duty payments to recipient, fedex throws an error that the account number is invalid, when i am not sending an account number at all. Originally in the fedex API, the account number is not required. Also the GUI of fedex allows you to set duty payments to recipient without setting an account number (it's optional)
To Reproduce
Steps to reproduce the behavior:
Send a POST
request to /v1/shipments
{
"carrier_ids": [
"fedex-test"
],
"customs": {
"certify": true,
"commodities": [
{
"quantity": 1,
"title": "Personal documents",
"value_amount": 1,
"value_currency": "EUR",
"weight": 1,
"weight_unit": "KG"
}
],
"content_type": "documents",
"duty": {
"currency": "EUR",
"declared_value": 1,
"paid_by": "recipient"
},
"incoterm": "DDU",
"signer": "John Doe"
},
"label_type": "PDF",
"metadata": {},
"options": {
"currency": "EUR",
"declared_value": 1,
"preferred_service": "fedex_international_economy"
},
"parcels": [
{
"dimension_unit": "CM",
"height": 1,
"is_document": true,
"length": 1,
"weight": 1,
"weight_unit": "KG",
"width": 1
}
],
"payment": {
"paid_by": "sender"
},
"recipient": {
"address_line1": "Valid addres line 1",
"city": "Rostock",
"country_code": "DE",
"person_name": "Valid person name",
"postal_code": "Valid postal code",
"residential": true,
"validate_location": false
},
"service": "fedex_international_economy",
"shipper": {
"address_line1": "Valid address line 1",
"city": "6-October",
"country_code": "EG",
"person_name": "John doe 2",
"postal_code": "Valid postal code",
"residential": true,
"validate_location": false
}
}
Expected behavior
I expect that the shipment is created and duty payments are set to recipient without invalid account number error.
Additional context
What makes me think that the bug exists is that i can see in the logs create shipment request sends 2 API calls to fedex,
One at: https://apis-sandbox.fedex.com/rate/v1/rates/quotes
And one at: https://apis-sandbox.fedex.com/ship/v1/shipments
I can clearly see that the Duty context i sent is only applied to the shipments call and not the rates/quotes call, which makes me think that that is a potential place from where the problem comes from
Examples;
Request for /shipments
has the paymentType
set to recipient:
"dutiesPayment": {
"paymentType": "RECIPIENT",
"payor": {
"responsibleParty": {
"address": {
"city": "Rostock",
"countryCode": "DE",
"postalCode": "Some valid postal code",
"residential": true,
"streetLines": [
"Some valid address line"
]
},
"contact": {
"personName": "Some valid person name"
}
}
}
},
While the /rates/quotes
request is sent as:
"dutiesPayment": {
"paymentType": "SENDER",
"payor": {
"responsibleParty": {
"accountNumber": {
"value": "THE ACCOUNT NUMBER FROM CARRIER CONNECTION"
}
}
}
Took this from karrio api logs
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too