Breaking

Tuesday, September 4, 2018

How to validate address using FedEx API in Dynamics Ax 2012

Overview:-

The FedEx Address Validation Service supports validating Canadian, US and Puerto Rican addresses only.
If you use the FedEx shipping provider, you can use the FedEx Address Validation Service to validate or complete recipient addresses. This is a service provided by FedEx – and supported by DynamicWeb. Please note, however, that we are not responsible for any changes made by FedEx.

This service validates recipient addresses before you ship packages, provides descriptive error details and corrected options for invalid addresses, and/or determines whether an address is business or residential to increase the accuracy of courtesy rate quotes.

The Address Validation WSDL AddressValidationRequest allows you to validate recipient address information before you ship a package. Correct addresses on the shipping label will eliminate delivery delays and additional service fees.

ADDRESS VALIDATION REQUEST

The Address Validation WSDL AddressValidationRequest allows you to validate recipient address information before you ship a package. Correct addresses on the shipping label will help eliminate delivery delays and additional service fees.

Use the Address Validation request to perform the following:

1.       Confirm the validity and completeness of U.S., Puerto Rico, and Canadian addresses
2.       Complete incomplete recipient addresses
3.       Correct invalid recipient addresses.
4.      Determine whether an address is business or residential to increase the accuracy of courtesy rate quotes. Applies to U.S. addresses only.

REGISTERING A FEDEX TEST ACCOUNT

To get started with FedEx, you need to register a FedEx test account:

To do so:

Sign up at the FedEx Developer Resource Center and request a developer test key.
Once you have filled out the required form, the following will be mailed to you:
Ø  A test Key
Ø  A test Account
Ø  A test Meter Number
Ø  A test Password
You can use these, along with the Production service URL for testing.

Use the Address Validation request to perform the following:

v Complete incomplete recipient addresses. For example the AVS helps in completing incomplete recipient address information like zip code, but not missing apartment number. In some cases, AVS may be able to add missing information, depending on the verification of the provided information against reference data.  AVS cannot add missing secondary information (i.e. apartment or suite) at this time.
v  Correct invalid recipient addresses.
v  Determine whether an address is business or residential to increase the accuracy of courtesy rate quotes. Applies to U.S. and Canada addresses only.
v  Confirm the validity and completeness of addresses in many countries in these regions- U.S., Canada, Latin America, Europe and Middle East and Asia Pacific. You are now able to validate domestic and international address information in the following countries before shipping a package, eliminating unnecessary delivery delays and additional service fees.

Address Validation uses reference data to determine the classification of a given address. The classification is calculated as part of the address validation process.  The classification for a functional address is calculated independently of the address validation process and is based on feedback by operational personnel, with commercial data sources used for confirmation only.

AddressValidationRequest Elements


Element
Description
AddressValidationRequest
Validation: Given a raw address the AddressValidation system responds with all of the information it can determine about that address including the Business Residential classification that was in effect at the time, including information on how the classification was calculated.
AddressValidationRequest/InEffectAsOfTimestamp
Optional DateTime field used to request the data as of this point in time. This defaults to current date time (of the AddressValidation System). This is useful because the AddressValidation database is dynamic and stores historical data. Characteristics such as Business/Residential indicator may change over time. Eg. 2013-01-11 T 07:52:56
AddressToValidate
AddressToValidate/ClientReferenceId
A reference id provided by the client.
AddressToValidate/Contact
The descriptive data for a point-of-contact person
Contact/ContactId
Client provided identifier corresponding to this contact information.
Contact/PersonName
Optional. Identifies the contact person's name. 
Contact/Title
Identifies the contact person's title.
Contact/CompanyName
Optional. Identifies the company this contact is associated with.
Contact/PhoneNumber
Identifies the phone number associated with this contact.
Contact/PhoneExtension
Identifies the phone extension associated with this contact. 
Contact/TollFreePhoneNumber
Identifies a toll free number, if any, associated with this contact.
Contact/PagerNumber
Identifies the pager number associated with this contact. 
Contact/FaxNumber
Identifies the fax number associated with this contact.
Contact/EMailAddress
Identifies the email address associated with this contact.
AddressToValidate/Address
Descriptive data for a physical location. May be used as an actual physical address (place to which one could go), or as a container of "address parts" which should be handled as a unit (such as a city-state-ZIP combination within the US).
Address/StreetLines (0 to 4 repetitions)
Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included.
Address/City
Required. Name of city, town, etc.
Address/StateOrProvinceCode
Required. Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country.
Address/PostalCode
Required. Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. 
Address/UrbanizationCode
Optional. Relevant only to addresses in Puerto Rico.
Address/CountryCode
The two-letter code used to identify a country. 
Address/CountryName
Required. The fully spelt out name of a country. 
Address/Residential

Reply Notification:-


Element
Description
Reply/HighestSeverity/Notification
Includes the descriptive data detailing the status of a submitted transaction. Includes the severity of the notification, which indicates success or failure or some other information about the request.
Valid values are:
· SUCCESS — Your transaction succeeded with no other applicable information.
· NOTE — Additional information that may be of interest to you about your transaction.
· WARNING — Additional information that you need to know about your transaction that you may need to take action on.
· ERROR — Information about an error that occurred while processing your transaction.
· FAILURE — FedEx was unable to process your transaction.


Samples code

Sample code, sample transactions and the specific individual WSDL/XML guide(s) can be downloaded following these steps:

1.     Go to the FedEx Developer Resource Center (DRC) at www.fedex.com/developer. Log in with your FedEx.com username and password. If you do not have one, then click on the "Register Now" link. Fill out the form for your DRC username and password.
2.         From the left navigation area of the page, click on the link 'FedEx Web Services'.
3.         Click on the link 'Move to documentation' under 'Documentation and Downloads'.
4.   Click on either the Standard Services tab or the Advanced Services tab on the WSDL Downloads component to find the functionality you are interested in.
5.      Use the 'Download code in…' drop-down to select a programming language for the sample code of the WSDL that has the functionality you need and check the 'Include Documentation (PDF)' check-box under the drop-down in order to download the guide for that WSDL. Then select the gray 'Go' button beside the programming language you selected on the drop-down.
6.      In the light gray margin near the name of the functionality (e.g. Ship Service, Rate Service, etc.), there is a link for the WSDL. Click on that link to download the desired WSDL.

7.    If you wish to download all of the WSDLs' sample code, sample transactions, and the Developer Guide, at the top of the WSDL component, click the programming language of your choice on the drop-down next to 'DOWNLOAD ALL' and check the 'Include Documentation (PDF)' check-box. Then select the purple 'Download' button.

No comments:

Post a Comment

Thanks for your comment.