UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 11.7 kB
{"openapi":"3.0.0","info":{"contact":{"x-twitter":"WilliamHill"},"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.","title":"Locations","version":"2.0","x-apisguru-categories":["entertainment"],"x-logo":{"url":"https://twitter.com/WillHillHelp/profile_image?size=original"},"x-origin":[{"format":"swagger","url":"https://developer.williamhill.com/wh-docs/docs-sdks/locations/swagger/docs","version":"2.0"}],"x-providerName":"whapi.com","x-serviceName":"locations"},"security":[{"apiKey":[]}],"paths":{"/address/lookup/":{"get":{"description":"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.\n","operationId":"addressLookup","parameters":[{"description":"House number or name of the address.","in":"query","name":"houseNum","required":true,"x-eg":4,"schema":{"type":"string"}},{"description":"Postcode of the address, no spaces required.","in":"query","name":"postCode","required":true,"x-eg":"GX11AA","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/addresses"},"examples":{"response":{"value":"{\n \"addresses\": \n [\n {\n \"fullAddress\": \"4 Bywater Place, LONDON, SE16 5ND\",\n \"street\": \"4 Bywater Place\",\n \"postcode\": \"SE16 5ND\",\n \"city\": \"London\",\n \"county\": \"London\"\n }\n ]\n} \n"}}}}},"400":{"description":"Missing or Invalid Parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/locationsErrors"},"examples":{"response":{"value":"{\n \"errors\":\n [\n {\n \"code\":\"10070\",\n \"message\":\"Missing Parameter\",\n \"field\":\"postCode\"\n },\n {\n \"code\":\"10071\",\n \"message\":\"Invalid Parameter\",\n \"field\":\"postCode\"\n }\n ]\n}\n"}}}}},"404":{"description":"Address not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/locationsErrors"},"examples":{"response":{"value":"{\n \"errors\" : \n [\n {\n \"code\":\"20301\",\n \"message\":\"Could not find any addresses\",\n \"field\":\"postCode\"\n }\n ]\n}\n"}}}}}},"tags":["Locations"],"x-canReturnErrors":[20301,20303,10070,10071]}},"/countries/":{"get":{"description":"Retrieves a list of countries and its currencies.","operationId":"getCountries","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/countries"},"examples":{"response":{"value":"{\n \"countries\": \n [\n {\n \"code\": \"GB\",\n \"name\": \"United Kingdom\", \n \"currencyCode\" : \"GBP\", \n \"dialCode\" : \"+44\"\n }\n ]\n}\n"}}}}},"400":{"description":"Missing or Invalid Parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/locationsErrors"},"examples":{"response":{"value":"{\n \"errors\" : \n [\n {\n \"code\":\"10070\",\n \"message\":\"Missing Parameter\",\n \"field\":\"postCode\"\n },\n {\n \"code\":\"10071\",\n \"message\":\"Invalid Parameter\",\n \"field\":\"postCode\"\n } \n ]\n}\n"}}}}},"404":{"description":"Country/Countries not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/locationsErrors"},"examples":{"response":{"value":"{\n \"errors\" : \n [\n {\n \"code\":\"20303\",\n \"message\":\"Country not Found\"\n }\n ]\n}\n"}}}}}},"tags":["Locations"],"x-canReturnErrors":[20303]}},"/countries/{countryCode}":{"get":{"description":"Retrieves the specified country and its currency.","operationId":"getCountry","parameters":[{"description":"Code of the country","in":"path","name":"countryCode","required":true,"x-eg":"GB","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/country"},"examples":{"response":{"value":"{\n \"code\":\"gb\",\n \"name\":\"Great Britain\",\n \"currencyCode\":\"GBP\",\n \"dialCode\":\"+44\"\n}\n"}}}}},"400":{"description":"Missing or Invalid Parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/locationsErrors"},"examples":{"response":{"value":"{\n \"errors\" : \n [\n {\n \"code\":\"10070\",\n \"message\":\"Missing Parameter\",\n \"field\":\"postCode\"\n },\n {\n \"code\":\"10071\",\n \"message\":\"Invalid Parameter\",\n \"field\":\"postCode\"\n } \n ]\n}\n"}}}}},"404":{"description":"Country/Countries not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/locationsErrors"},"examples":{"response":{"value":"{\n \"errors\" : \n [\n {\n \"code\":\"20303\",\n \"message\":\"Country not Found\"\n }\n ]\n}\n"}}}}}},"tags":["Locations"],"x-canReturnErrors":[20303,10070,10071]}},"/currencies/":{"get":{"description":"Retreives the list of currencies.","operationId":"getCurrencies","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/currencies"},"examples":{"response":{"value":"{\n \"currencies\": \n [\n {\n \"code\":\"GBP\",\n \"name\":\"Pound\",\n \"minDeposit\":\"5.00\",\n \"maxDeposit\":\"100.00\",\n \"minWithdrawal\":\"20.00\",\n \"maxWithdrawal\":\"1000.00\",\n \"exchangeRate\":\"1.00\"\n }\n ]\n}\n"}}}}},"404":{"description":"Currency not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/locationsErrors"},"examples":{"response":{"value":"{\n \"errors\" : \n [\n {\n \"code\":\"20304\",\n \"message\":\"Currency not Found\"\n }\n ]\n}\n"}}}}}},"tags":["Locations"],"x-canReturnErrors":[20304]}},"/currencies/{currencyCode}":{"get":{"description":"Retreives the specified currency.","operationId":"getCurrency","parameters":[{"description":"Code of the currency","in":"path","name":"currencyCode","required":true,"x-eg":"GBP","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/currency"},"examples":{"response":{"value":"{\n \"code\":\"GBP\",\n \"name\":\"Pound\",\n \"minDeposit\":\"5.00\",\n \"maxDeposit\":\"100.00\",\n \"minWithdrawal\":\"20.00\",\n \"maxWithdrawal\":\"1000.00\",\n \"exchangeRate\":\"1.00\"\n}\n"}}}}},"400":{"description":"Missing or Invalid Parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/locationsErrors"},"examples":{"response":{"value":"{\n \"errors\" : \n [\n {\n \"code\":\"10070\",\n \"message\":\"Missing Parameter\",\n \"field\":\"postCode\"\n },\n {\n \"code\":\"10071\",\n \"message\":\"Invalid Parameter\",\n \"field\":\"postCode\"\n } \n ]\n}\n"}}}}},"404":{"description":"Currency not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/locationsErrors"},"examples":{"response":{"value":"{\n \"errors\" : \n [\n {\n \"code\":\"20304\",\n \"message\":\"Currency not Found\"\n }\n ]\n}\n"}}}}}},"tags":["Locations"],"x-canReturnErrors":[20304,10070,10071]}}},"x-customerrors":[{"code":20301,"message":"Could not find any addresses","status":404},{"code":20302,"message":"Result limit has been exceeded","status":400},{"code":20303,"message":"Country not found","status":404},{"code":20304,"message":"Currency not found","status":404}],"x-docchapters":["fieldSelection","apiSummary","headAndOptions","docsAndSdks","errorHandling","statusCodes"],"servers":[{"url":"https://sandbox.whapi.com/v2/locations"}],"components":{"parameters":{"apiKey":{"description":"A unique identifier of your application that is generated by the API portal and presented in the header.","in":"header","name":"apiKey","required":true,"x-eg":"l7xxa54460c573b5497c9b24b505xxxxxxxx","schema":{"type":"string"}},"countryCode":{"description":"Code of the country","in":"path","name":"countryCode","required":true,"x-eg":"GB","schema":{"type":"string"}},"currencyCode":{"description":"Code of the currency","in":"path","name":"currencyCode","required":true,"x-eg":"GBP","schema":{"type":"string"}},"houseNum":{"description":"House number or name of the address.","in":"query","name":"houseNum","required":true,"x-eg":4,"schema":{"type":"string"}},"postCode":{"description":"Postcode of the address, no spaces required.","in":"query","name":"postCode","required":true,"x-eg":"GX11AA","schema":{"type":"string"}}},"securitySchemes":{"apiKey":{"description":"A unique identifier of your application that is generated by the API portal and presented in the header.","in":"header","name":"apiKey","type":"apiKey"}},"schemas":{"address":{"properties":{"city":{"description":"The name of the postal city/town","type":"string"},"county":{"description":"The name of the county","type":"string"},"fullAddress":{"description":"The customer’s complete address including postcode","type":"string"},"postCode":{"description":"The postcode of the address","type":"string"},"street":{"description":"The name of the street including the house number/house name","type":"string"}},"title":"address","type":"object"},"addresses":{"properties":{"addresses":{"items":{"$ref":"#/components/schemas/address"},"type":"array"}},"type":"object"},"countries":{"properties":{"countries":{"items":{"$ref":"#/components/schemas/country"},"type":"array"}},"type":"object"},"country":{"properties":{"code":{"description":"The code of the country","type":"string"},"currencyCode":{"description":"The currency code","type":"string"},"dialCode":{"description":"The dial code of the country","type":"string"},"name":{"description":"The name of the country","type":"string"}},"title":"country","type":"object"},"currencies":{"properties":{"currencies":{"items":{"$ref":"#/components/schemas/currency"},"type":"array"}},"type":"object"},"currency":{"properties":{"code":{"description":"The code of the currency","type":"string"},"exchangeRate":{"description":"The exchange rate for the currency","format":"double","type":"number"},"maxDeposit":{"description":"The maximum deposit for the currency","format":"double","type":"number"},"maxWithdrawal":{"description":"The maximum withdrawl for the currency","format":"double","type":"number"},"minDeposit":{"description":"The minimum deposit for the currency","format":"double","type":"number"},"minWithdrawal":{"description":"The minimum withdrawal for the currency","format":"double","type":"number"},"name":{"description":"The name of the currency","type":"string"}},"title":"currency"},"error":{"properties":{"code":{"description":"A unique William Hill identifier for the error","type":"string"},"field":{"description":"To help pinpoint the exact parameter where a request has failed","type":"string"},"message":{"description":"A unique William Hill text string to enable you to identify the error (in English only)","type":"string"}},"type":"object"},"locationsErrors":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/error"},"type":"array"}},"type":"object"}}}}