Address objects are used for creating Shipment, obtaining Rates and printing Labels,
and thus are one of the fundamental building blocks of the Shippo API.
Methods summary
public
string
|
#
getObjectPurpose( )
Quote Address can be generated by only passing selected address information.
Quote Address can only be used for obtaining shipping Rate quotes
and cannot be used to purchase Labels.
Address that should be used for purchases must be fully entered,
i.e., a complete street address with all required fields must be passed.
Quote Address can be generated by only passing selected address information.
Quote Address can only be used for obtaining shipping Rate quotes
and cannot be used to purchase Labels.
Address that should be used for purchases must be fully entered,
i.e., a complete street address with all required fields must be passed.
Required
Returns
string
Throws
TurmericSpice\Container\InvalidAttributeException
|
public
string
|
#
getName( )
First and Last Name of the addressee
First and Last Name of the addressee
Required for purchase
Returns
string
Throws
TurmericSpice\Container\InvalidAttributeException
|
public
string
|
|
public
string
|
#
getStreet1( )
First street line, which is usually the street name.
Note that a building's street number should be passed separately (see below).
First street line, which is usually the street name.
Note that a building's street number should be passed separately (see below).
Required for purchase
Returns
string
Throws
TurmericSpice\Container\InvalidAttributeException
|
public
string
|
#
getStreetNo( )
Street number of the addressed building.
This field can be included in street1 for all carriers except for DHL Paket (Germany).
Street number of the addressed building.
This field can be included in street1 for all carriers except for DHL Paket (Germany).
Optional
Returns
string
|
public
string
|
#
getStreet2( )
Second street line.
Optional
Returns
string
|
public
string
|
#
getCity( )
Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates.
Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US).
Passing a state or a ZIP code (see below), if known, will yield more accurate results.
Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates.
Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US).
Passing a state or a ZIP code (see below), if known, will yield more accurate results.
Required for purchase
Returns
string
Throws
TurmericSpice\Container\InvalidAttributeException
|
public
string
|
#
getZip( )
Postal code of an Address. When creating a Quote Address,
sending a ZIP is optional but will yield more accurate Rates.
Postal code of an Address. When creating a Quote Address,
sending a ZIP is optional but will yield more accurate Rates.
Required for purchase
Returns
string
Throws
TurmericSpice\Container\InvalidAttributeException
|
public
string
|
#
getState( )
State values are only required for shipments from
the United States and Canada(most carriers only accept two-character state abbreviations).
However, to receive more accurate quotes, passing it is generally recommended.
State values are only required for shipments from
the United States and Canada(most carriers only accept two-character state abbreviations).
However, to receive more accurate quotes, passing it is generally recommended.
Required for purchase for some countries
Returns
string
Throws
TurmericSpice\Container\InvalidAttributeException
|
public
string
|
#
getCountry( )
Example: 'US' or 'DE'.
All accepted values can be found on the Official ISO Website(http://www.iso.org/).
Sending a country is always required.
Example: 'US' or 'DE'.
All accepted values can be found on the Official ISO Website(http://www.iso.org/).
Sending a country is always required.
Required
Returns
string
Throws
TurmericSpice\Container\InvalidAttributeException
|
public
string
|
#
getPhone( )
Address containing a phone number allow carriers to call the recipient when delivering the Parcel.
This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
Address containing a phone number allow carriers to call the recipient when delivering the Parcel.
This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
Optional for domestic, required for international
Returns
string
Throws
TurmericSpice\Container\InvalidAttributeException
|
public
string
|
#
getEmail( )
E-mail address of the contact person, RFC3696/5321-compliant.
E-mail address of the contact person, RFC3696/5321-compliant.
Required for purchase
Returns
string
Throws
TurmericSpice\Container\InvalidAttributeException
|
public
null|boolean
|
#
getIsResidential( )
Indicates whether the address provided is a residential address or not
Indicates whether the address provided is a residential address or not
Optional
Returns
null|boolean
|
public
|
|