Magento 2 checkout address validation by FedEx Rest API

By | October 25, 2023
Spread the love


To validate shipping addresses in Magento 2 using the FedEx API during the checkout process, you can follow these general steps:

  1. Sign Up for FedEx Developer Account:
    • If you don’t already have one, sign up for a FedEx Developer account at the FedEx Developer Portal.
  2. Get FedEx API Access Credentials:
    • Log in to your FedEx Developer account and obtain the necessary API credentials (Access Key, User ID, and Password).
  3. Install a Magento 2 Extension:
  4. Configure FedEx Shipping Method:
    • In your Magento 2 admin panel, navigate to Admin  >Stores > Configuration > Techgroup > FedEx Address Validation.
    • Under “FedEx,” enter your FedEx API credentials (Client ID, Client Secret, Account Number).
    • Configure other FedEx settings as per your needs.
  5. Enable Address Validation:
    • Make sure to enable address validation in the FedEx shipping method configuration.
  6. Test the Integration:
    • Perform a test order with various shipping addresses to ensure that the FedEx API is validating the addresses correctly. This will help you confirm that the address validation is working as expected.
  7. Custom Integration (Optional):
    • If you prefer a custom solution, you can implement FedEx address validation directly in your Magento 2 store. Here’s a general outline of what you would need to do:
    • Create a custom module to handle the address validation functionality.
    • Use the FedEx API (specifically, the “Address Validation” service) to verify the shipping address. You can make HTTP requests to the FedEx API using the provided credentials.
    • Handle the API response to determine if the address is valid, and provide feedback to the customer during the checkout process.