Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEDEX] Recipient Duties Account Number #718

Open
vangelow opened this issue Nov 5, 2024 · 0 comments
Open

[FEDEX] Recipient Duties Account Number #718

vangelow opened this issue Nov 5, 2024 · 0 comments

Comments

@vangelow
Copy link

vangelow commented Nov 5, 2024

Describe the bug
The bug is coming from the point that the Karrio fedex create shipment provider is always sending the payor details when the Duties payment is set to "RECIPIENT". From the fedex API docs we can see that the account number is conditional and it is required whenever you are sending the payor details along with the duties payment

In this file https://github.com/karrioapi/karrio/blob/main/modules/connectors/fedex/karrio/providers/fedex/shipment/create.py
between lines 440 and 455 you can see that it is set to None if there is no duty_billing_address, but if you go up to the assignment of that variable you can see that it is always said based on the shipper, recipient or duty billing address data so this condition is never going into the else clause.

To Reproduce
Send an API POST request to https://apis.fedex.com/ship/v1/shipments
To reproduce the bug you need to send the duties payment set to recipient and have some payor info

        "dutiesPayment": {
          "paymentType": "RECIPIENT",
          "payor": {
            "responsibleParty": {
              "address": {
                "city": "Cairo",
                "countryCode": "EG",
                "postalCode": "313123",
                "residential": false,
                "streetLines": [
                  "Al Muskat"
                ]
              },
              "contact": {
                "personName": "Test",
                "phoneNumber": "+9665555555"
              }
            }
          }
        },

This results in the api responding in

{
  "transactionId": "6df71513-36bd-4a5c-8a14-175f21f3db10",
  "errors": [
    {
      "code": "ACCOUNT.NUMBER.INVALID",
      "message": "Account number not found. Please provide a valid account number."
    }
  ]
}

In order to have a successful response with the shipment being created and the duties to be set to recipient you either send the full data of the recipient payor info + the account number or you leave the payor info empty

      "dutiesPayment": {
        "paymentType": "RECIPIENT",
        "payor": {
          "responsibleParty": {

          }
        }
      },

Expected behavior
The duties payment can be set to recipient without sending a specific account number

Using latest karrio version

Additional context
I can help with debugging if you need help. I have a simple flat python file to test with if you need, but the bug is pretty straight forward.
@danh91

danh91 added a commit that referenced this issue Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant