5.0.0 • Published 3 years ago

@datafire/whapi_locations v5.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

@datafire/whapi_locations

Client library for Locations

Installation and Usage

npm install --save @datafire/whapi_locations
let whapi_locations = require('@datafire/whapi_locations').create({
  apiKey: ""
});

.then(data => {
  console.log(data);
});

Description

The Locations API is a collection of methods that support geographical information. The first method is an address lookup service for UK addresses. This service can be used to provide a new customer with a list of possible addresses from which they can populate a registration form.

Actions

addressLookup

Retrieves a list of addresses when supplied with a house number or name and a postcode. It is generally used during customer registration to provide a list of possible addresses from where the customer can select their own address details.

whapi_locations.addressLookup({
  "houseNum": "",
  "postCode": ""
}, context)

Input

  • input object
    • houseNum required string: House number or name of the address.
    • postCode required string: Postcode of the address, no spaces required.

Output

getCountries

Retrieves a list of countries and its currencies.

whapi_locations.getCountries(null, context)

Input

This action has no parameters

Output

getCountry

Retrieves the specified country and its currency.

whapi_locations.getCountry({
  "countryCode": ""
}, context)

Input

  • input object
    • countryCode required string: Code of the country

Output

getCurrencies

Retreives the list of currencies.

whapi_locations.getCurrencies(null, context)

Input

This action has no parameters

Output

getCurrency

Retreives the specified currency.

whapi_locations.getCurrency({
  "currencyCode": ""
}, context)

Input

  • input object
    • currencyCode required string: Code of the currency

Output

Definitions

address

  • address object
    • city string: The name of the postal city/town
    • county string: The name of the county
    • fullAddress string: The customer’s complete address including postcode
    • postCode string: The postcode of the address
    • street string: The name of the street including the house number/house name

addresses

  • addresses object

countries

  • countries object

country

  • country object
    • code string: The code of the country
    • currencyCode string: The currency code
    • dialCode string: The dial code of the country
    • name string: The name of the country

currencies

  • currencies object

currency

  • currency object
    • code string: The code of the currency
    • exchangeRate number: The exchange rate for the currency
    • maxDeposit number: The maximum deposit for the currency
    • maxWithdrawal number: The maximum withdrawl for the currency
    • minDeposit number: The minimum deposit for the currency
    • minWithdrawal number: The minimum withdrawal for the currency
    • name string: The name of the currency

error

  • error object
    • code string: A unique William Hill identifier for the error
    • field string: To help pinpoint the exact parameter where a request has failed
    • message string: A unique William Hill text string to enable you to identify the error (in English only)

locationsErrors

  • locationsErrors object