Addresses
Parse
The PackageX address parser takes addresses in multiple different formats and returns the address in the PackageX address mode.
Parse String
If your address is in a string
, we'll parse the full string. Commonly this string is from the autocomplete API, where you'll optionally pass the line2 value separately. The line2 value can be passed in as a separate field or can be included in the string.
Parse Object
If you have collected data about your address in a more structured format, you can send the address object. While in the response, we'll give you the state
/ state_code
and country
/ country_code
properties parsed into the full name and abbreviation. You can provide the state and country values in any of the properties, the parser isn't picky about it.
Parse Location
There could be times when you're using a PackageX Location
object which already includes your address in it. You can pass the id
of the location into the address
field of the parser and it will return the address of your location. This can be done anytime we ask for an address property. A common example is when creating a shipment. You can pass the location ID into the address property to the sender and/or recipient objects.
Parse Address ID
Like the location ID, you can also provide a PackageX address id
to the parser and it will respond with the address.