src/PostOffice.php
public function getNearestPostOfficeByGeographicalLocation(
        $longitude,
        $latitude,
        $d2po = false,
        $max_addresses = 10,
        array $options = []
    ) {
        $query_params = "d2po={$d2po}&longitude={$longitude}&latitude={$latitude}&maximum={$max_addresses}";

        $response = $this->get(
            "rs/postoffice?{$query_params}",
            ['Accept' => 'application/vnd.cpc.postoffice+xml'],
            $options
        );
        return $response;
    }
public function getNearestPostOfficeByGeographicalLocation(
        $longitude,
        $latitude,
        $d2po = false,
        $max_addresses = 10,
        array $options = []
    ) {
        $query_params = "d2po={$d2po}&longitude={$longitude}&latitude={$latitude}&maximum={$max_addresses}";

        $response = $this->get(
            "rs/postoffice?{$query_params}",
            ['Accept' => 'application/vnd.cpc.postoffice+xml'],
            $options
        );
        return $response;
    }
public function getNearestPostOfficeByGeographicalLocation ( $ longitude , $ latitude , $ d2po = false , $ max_addresses = 10 , array $ options = [ ] ) { $ query_params = "d2po={$d2po}&longitude={$longitude}&latitude={$latitude}&maximum={$max_addresses}" ; $ response = $ this -> get ( "rs/postoffice?{$query_params}" , [ 'Accept' => 'application/vnd.cpc.postoffice+xml' ] , $ options ) ; return $ response ; }
Get information on Post Offices nearest to a given geographical
location.

@param string $longitude
The longitude. Format is 10 characters of the form: [-]3.5
ie. up to 3 digits before the decimal and 5 digits after the decimal
eg. -101.32354
@param string $latitude
The latitude.
Format is 10 characters of the form: [-]3.5
ie. up to 3 digits before the decimal and 5 digits after the decimal
eg. 55.32354
@param bool $d2po
True indicates that you want a list of Post Offices that accept the
"Deliver to Post Office" delivery of parcels. Use this when you want
the parcel to be delivered directly to a Post Office rather than to
the recipient’s address.
@param int $max_addresses
The maximum number of Post Offices to return with the response. The
maximum allowed is 50. In remote locations, fewer Post Offices than
requested may be returned.
@param array $options
The options array.

@return \DOMDocument|\Psr\Http\Message\StreamInterface
@throws \GuzzleHttp\Exception\GuzzleException
Get information on Post Offices nearest to a given geographical location .