Get Coordinates

getCoordinates is used to try and get the coordinates of the buyer based on their IP address.

Usage

getCoordinates takes in no parameters.

Example

try {
    const coordinates = await sdk.customers.getCoordinates();
} catch (error) {
    // Handle errors
}

Return Value

On success the following object is returned. Note that if no match is found, it will be an empty object.

interface GetCoordinatesResponse {
    postal_code?: string;
    latitude?: number;
    longitude?: number;
}

Error Handling

The SDK does no special error handling for this GET request. On a network error, it will simply throw the Error object that fetch would throw.