openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 21.3 kB
JSON
{"openapi":"3.0.0","info":{"contact":{"email":"platform@williamhill.com","name":"William Hill Labs","url":"http://developer.williamhill.com","x-twitter":"WilliamHill"},"description":"The Accounts API is a collection of methods used to query a customer account. It allows the developer to retrieve account-related data such as the user account balance.","title":"Accounts","version":"2.0.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/accounts/swagger/docs","version":"2.0"}],"x-providerName":"whapi.com","x-serviceName":"accounts"},"security":[{"apiKey":[]}],"paths":{"/account":{"get":{"description":"Retrieves a limited set of customer account details. For security purposes, only a subset is supplied, which does not include fields such as security questions and answers.","operationId":"getDetails","parameters":[{"description":"Another unique identifier for your application.","in":"header","name":"apiSecret","required":true,"x-eg":"355b1e522c544222ab4ff318xxxxxxxx","schema":{"type":"string","pattern":"^[a-zA-Z0-9]{19,50}$"}},{"description":"Ticket Granting Ticket obtained from a previous request","in":"header","name":"apiTicket","required":true,"x-eg":"TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349","schema":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9-]{39,100}$"}},{"description":"Specify an absolute field list to return (Comma-Separated List)","in":"query","name":"fields","required":false,"x-eg":"extended","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},{"description":"Specify fields in addition to the default to return (Comma-Separated List)","in":"query","name":"include","required":false,"x-eg":"extended","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},{"description":"Specify fields from the default to exclude (Comma-Separated List)","in":"query","name":"exclude","required":false,"x-eg":"expiryDateTime","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accounts"},"examples":{"response":{"value":"{\n \"status\": \"A\",\n \"accountNum\": \"14652314\",\n \"accountId\": \"18164\",\n \"customerId\": \"48\",\n \"currencyCode\": \"GBP\",\n \"countryCode\": \"GB\",\n \"title\": \"Mr\",\n \"firstName\": \"Joe\",\n \"lastName\": \"Bloggs\",\n \"street1\": \"10 Rillington Place\",\n \"street2\": \"Old Basing\",\n \"street3\": \"Lychpit\",\n \"city\": \"Basingstoke\",\n \"county\": \"Hampshire\",\n \"postcode\": \"RG248YQ\",\n \"country\": \"United Kingdom\",\n \"email\": \"jbloggs@email.com\",\n \"mobile\": \"09876543210\",\n \"partnerContactable\": true,\n \"contactable\": true,\n \"flags\": [\n {\n \"pocf\": true\n }\n ]\n}\n"}}}}},"401":{"description":"Not Authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accountErrors"},"examples":{"response":{"value":"{\n \"errors\" : [\n {\n \"code\":\"000000\",\n \"message\":\"Error Message Text\",\n \"field\":\"aparam\"\n }\n ]\n}\n"}}}}}},"summary":"Retrieves details of a customers account","tags":["Accounts"],"x-canReturnErrors":[20401]}},"/account/balance":{"get":{"description":"This method can be used to retrieve the customer’s account balance in UK Sterling.","operationId":"getBalance","parameters":[{"description":"Another unique identifier for your application.","in":"header","name":"apiSecret","required":true,"x-eg":"355b1e522c544222ab4ff318xxxxxxxx","schema":{"type":"string","pattern":"^[a-zA-Z0-9]{19,50}$"}},{"description":"Ticket Granting Ticket obtained from a previous request","in":"header","name":"apiTicket","required":true,"x-eg":"TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349","schema":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9-]{39,100}$"}},{"description":"Specify an absolute field list to return (Comma-Separated List)","in":"query","name":"fields","required":false,"x-eg":"extended","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},{"description":"Specify fields in addition to the default to return (Comma-Separated List)","in":"query","name":"include","required":false,"x-eg":"extended","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},{"description":"Specify fields from the default to exclude (Comma-Separated List)","in":"query","name":"exclude","required":false,"x-eg":"expiryDateTime","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accountBalance"},"examples":{"response":{"value":"{\n \"currencyCode\": \"GBP\",\n \"balance\": 234.23,\n \"availableFunds\": 234.23,\n \"withdrawableFunds\": 234.23\n}\n"}}}}},"401":{"description":"Not Authorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accountErrors"},"examples":{"response":{"value":"{\n \"errors\" : [\n {\n \"code\":\"000000\",\n \"message\":\"Error Message Text\",\n \"field\":\"aparam\"\n }\n ]\n}\n"}}}}}},"summary":"Get a customers account balance","tags":["Accounts"]}},"/account/flags":{"post":{"description":"Sets a flag based on name to value provided for the user.","operationId":"setAccountFlags","parameters":[{"description":"Another unique identifier for your application.","in":"header","name":"apiSecret","required":true,"x-eg":"355b1e522c544222ab4ff318xxxxxxxx","schema":{"type":"string","pattern":"^[a-zA-Z0-9]{19,50}$"}},{"description":"Ticket Granting Ticket obtained from a previous request","in":"header","name":"apiTicket","required":true,"x-eg":"TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349","schema":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9-]{39,100}$"}},{"description":"A two-character ISO 3166-1-Alpha-2 code representing the country API to use.","in":"header","name":"apiCountryCode","required":false,"x-eg":"ES","schema":{"type":"string","pattern":"^(GB|ES|IT)$","default":"GB"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/flags"}}},"description":"Array of KVP for setting flags.","required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accountFlagsSet"},"examples":{"response":{"value":"{\n \"token\": \"e0dX/YhYaRax7aI0/SkNS9G1rXlZZWOD64t64JDijaCfEhRe0A==\"\n}\n"}}}}},"404":{"description":"No such customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accountErrors"},"examples":{"response":{"value":"{\n \"errors\" : [\n {\n \"code\":\"10003\",\n \"message\":\"Resource Not Found\",\n \"field\":\"token\"\n }\n ]\n}\n"}}}}}},"summary":"Sets a flag based on name to value provided for the user.","tags":["flags"],"x-canReturnErrors":[0]}},"/account/payments":{"get":{"description":"Retrieves the customer’s account payments in UK Sterling.","operationId":"getPayments","parameters":[{"description":"Another unique identifier for your application.","in":"header","name":"apiSecret","required":true,"x-eg":"355b1e522c544222ab4ff318xxxxxxxx","schema":{"type":"string","pattern":"^[a-zA-Z0-9]{19,50}$"}},{"description":"Ticket Granting Ticket obtained from a previous request","in":"header","name":"apiTicket","required":true,"x-eg":"TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349","schema":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9-]{39,100}$"}},{"description":"The page number to return (Used with pageSize)","in":"query","name":"page","required":false,"x-eg":10,"schema":{"type":"number","pattern":"^[1-9]{1,7}$","default":1}},{"description":"Specify the number of results to return per page.","in":"query","name":"pageSize","required":false,"x-eg":15,"schema":{"type":"number","pattern":"^[1-9]{1,7}$","default":100}},{"description":"The FROM datetime from payments to be returned. (yyyy-MM-ddTHH:mm:ss)","in":"query","name":"dateFrom","required":false,"x-eg":"2013-09-25T13:34:20+01:00","schema":{"type":"string","pattern":"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2})\\:(\\d{2})\\:(\\d{2})$"}},{"description":"The TO datetime for payments to be returned. (yyyy-MM-ddTHH:mm:ss)","in":"query","name":"dateTo","required":false,"x-eg":"2013-09-25T13:34:20+01:00","schema":{"type":"string","pattern":"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2})\\:(\\d{2})\\:(\\d{2})[+-](\\d{2})\\:(\\d{2})$"}},{"description":"The order the response will be retuned by. i.e. date,desc","in":"query","name":"sort","required":false,"x-eg":"date,desc","schema":{"type":"string","default":"date,asc"}},{"description":"Allows the user to select with they want to see withdrawls or deposits. If it is omitted from the query both types will be returned","in":"query","name":"transactionType","required":false,"x-eg":"W","schema":{"type":"string","pattern":"^(W|D)$"}},{"description":"Specify an absolute field list to return (Comma-Separated List)","in":"query","name":"fields","required":false,"x-eg":"extended","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},{"description":"Specify fields in addition to the default to return (Comma-Separated List)","in":"query","name":"include","required":false,"x-eg":"extended","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},{"description":"Specify fields from the default to exclude (Comma-Separated List)","in":"query","name":"exclude","required":false,"x-eg":"expiryDateTime","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Success - Payments obtained","content":{"application/json":{"schema":{"$ref":"#/components/schemas/getPayments"},"examples":{"response":{"value":"{\n \"payments\":\n [\n {\n \"id\": \"277\",\n \"methodId\": \"111\",\n \"type\": \"CSH\",\n \"action\": \"D\",\n \"paymentDateTime\": \"2013-09-25T13:34:20\",\n \"amount\": \"20.56\",\n \"commission\": \"0.00\",\n \"status\": \"Y\",\n \"channel\": \"M\",\n \"ipAddress\": \"10.0.0.12\"\n } \n ]\n}\n"}}}}},"400":{"description":"Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accountErrors"},"examples":{"response":{"value":"{\n \"errors\" : [\n {\n \"code\":\"000000\",\n \"message\":\"Error Message Text\",\n \"field\":\"aparam\"\n }\n ]\n}\n"}}}}},"404":{"description":"No such customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accountErrors"},"examples":{"response":{"value":"{\n \"errors\" : [\n {\n \"code\":\"10003\",\n \"message\":\"Resource Not Found\",\n \"field\":\"token\"\n }\n ]\n}\n"}}}}}},"summary":"Gets a customer's account payments","tags":["Accounts"],"x-canReturnErrors":[20401]}},"/account/rewardsEligibility":{"get":{"description":"Gets a customer's rewards eligibility and opt-in/out status","operationId":"getRewardEligibility","parameters":[{"description":"Another unique identifier for your application.","in":"header","name":"apiSecret","required":true,"x-eg":"355b1e522c544222ab4ff318xxxxxxxx","schema":{"type":"string","pattern":"^[a-zA-Z0-9]{19,50}$"}},{"description":"Ticket Granting Ticket obtained from a previous request","in":"header","name":"apiTicket","required":true,"x-eg":"TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349","schema":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9-]{39,100}$"}}],"responses":{"200":{"description":"Success - Rewards Eligibility obtained","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rewardsEligibility"},"examples":{"response":{"value":"{\n \"status\": \"optedIn\"\n}\n"}}}}},"400":{"description":"Errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accountErrors"},"examples":{"response":{"value":"{\n \"errors\" : [\n {\n \"code\":\"000000\",\n \"message\":\"Error Message Text\",\n \"field\":\"aparam\"\n }\n ]\n} \n"}}}}},"404":{"description":"No such customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/accountErrors"},"examples":{"response":{"value":"{\n \"errors\" : [\n {\n \"code\":\"10003\",\n \"message\":\"Account Not Found\",\n \"field\":\"\"\n },\n {\n \"code\":\"20402\",\n \"message\":\" Account status not available\",\n \"field\":\"\"\n }\n ] \n \n}\n"}}}}}},"summary":"Gets a customer's rewards eligibility and opt-in/out status","tags":["Accounts","Rewards"]}}},"x-customerrors":[{"code":10003,"message":"Cannot have includeAllDescendants active without the headlineSummary parameter. Too much data to be returned.","status":404},{"code":20401,"message":"Account details are not available for temporary accounts","status":400},{"code":20402,"message":"Account status not available","status":404}],"x-docchapters":["fieldSelection","apiSummary","headAndOptions","docsAndSdks","errorHandling","statusCodes"],"servers":[{"url":"https://sandbox.whapi.com/v2/accounts"}],"components":{"parameters":{"param_apiCountryCode":{"description":"A two-character ISO 3166-1-Alpha-2 code representing the country API to use.","in":"header","name":"apiCountryCode","required":false,"x-eg":"ES","schema":{"type":"string","pattern":"^(GB|ES|IT)$","default":"GB"}},"param_apiKey":{"description":"A unique identifier of your application that is generated by the API portal.","in":"header","name":"apiKey","required":true,"x-eg":"l7xxa54460c573b5497c9b24b505xxxxxxxx","schema":{"type":"string","pattern":"^[a-zA-Z0-9]{19,50}$"}},"param_apiSecret":{"description":"Another unique identifier for your application.","in":"header","name":"apiSecret","required":true,"x-eg":"355b1e522c544222ab4ff318xxxxxxxx","schema":{"type":"string","pattern":"^[a-zA-Z0-9]{19,50}$"}},"param_apiTicket":{"description":"Ticket Granting Ticket obtained from a previous request","in":"header","name":"apiTicket","required":true,"x-eg":"TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349","schema":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9-]{39,100}$"}},"param_exclude":{"description":"Specify fields from the default to exclude (Comma-Separated List)","in":"query","name":"exclude","required":false,"x-eg":"expiryDateTime","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},"param_fields":{"description":"Specify an absolute field list to return (Comma-Separated List)","in":"query","name":"fields","required":false,"x-eg":"extended","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},"param_fromDateTime":{"description":"The FROM datetime from payments to be returned. (yyyy-MM-ddTHH:mm:ss)","in":"query","name":"dateFrom","required":false,"x-eg":"2013-09-25T13:34:20+01:00","schema":{"type":"string","pattern":"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2})\\:(\\d{2})\\:(\\d{2})$"}},"param_include":{"description":"Specify fields in addition to the default to return (Comma-Separated List)","in":"query","name":"include","required":false,"x-eg":"extended","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}},"param_page":{"description":"The page number to return (Used with pageSize)","in":"query","name":"page","required":false,"x-eg":10,"schema":{"type":"number","pattern":"^[1-9]{1,7}$","default":1}},"param_pageSize":{"description":"Specify the number of results to return per page.","in":"query","name":"pageSize","required":false,"x-eg":15,"schema":{"type":"number","pattern":"^[1-9]{1,7}$","default":100}},"param_sort":{"description":"The order the response will be retuned by. i.e. date,desc","in":"query","name":"sort","required":false,"x-eg":"date,desc","schema":{"type":"string","default":"date,asc"}},"param_toDateTime":{"description":"The TO datetime for payments to be returned. (yyyy-MM-ddTHH:mm:ss)","in":"query","name":"dateTo","required":false,"x-eg":"2013-09-25T13:34:20+01:00","schema":{"type":"string","pattern":"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2})\\:(\\d{2})\\:(\\d{2})[+-](\\d{2})\\:(\\d{2})$"}},"param_transactionFilter":{"description":"Allows the user to select with they want to see withdrawls or deposits. If it is omitted from the query both types will be returned","in":"query","name":"transactionType","required":false,"x-eg":"W","schema":{"type":"string","pattern":"^(W|D)$"}}},"securitySchemes":{"apiKey":{"description":"A unique identifier of your application that is generated by the API portal.","in":"header","name":"apiKey","type":"apiKey"}},"schemas":{"accountBalance":{"properties":{"availableFunds":{"description":"Current available funds in this account","type":"number"},"balance":{"description":"Current balance of account","type":"number"},"currencyCode":{"description":"A three-character ISO4217 currency code. This will be the currency that the user registered in","type":"string"},"withdrawableFunds":{"description":"Current withdrawable balance of this account","type":"number"}},"required":["balance","currencyCode"],"type":"object"},"accountErrors":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/error"},"type":"array"}},"type":"object"},"accountFlagsSet":{"properties":{"token":{"type":"string"}},"type":"object"},"accounts":{"properties":{"accountId":{"description":"Account ID","type":"string"},"accountNum":{"description":"Account number","type":"string"},"city":{"description":"The city of the customer's address","type":"string"},"contactable":{"description":"Is it okay for the bookmaker to contact the customer with marketing information","type":"boolean"},"country":{"description":"The country of the customer's address","type":"string"},"countryCode":{"description":"A two-character ISO 3166-1-Alpha-2 code representing the customer's country of registration","type":"string"},"county":{"description":"The county of the customer's address","type":"string"},"currencyCode":{"description":"A three-character ISO4217 currency code. This will be the currency that the customer registered in","type":"string"},"customerId":{"description":"Customer ID","type":"string"},"email":{"description":"The primary email address of the customer with that account. Must be unique.","type":"string"},"firstName":{"description":"The first name of the customer with that account","type":"string"},"flags":{"$ref":"#/components/schemas/flags"},"lastName":{"description":"The last name of the customer with that account","type":"string"},"mobile":{"description":"The mobile number of the customer with that account","type":"string"},"partnerContactable":{"description":"Is it okay for the bookmaker to give the user's contact details to companies with which it has partnerships","type":"boolean"},"postcode":{"description":"The postCode of the customer's address","type":"string"},"status":{"description":"Account status","type":"string"},"street1":{"description":"Line number 1 of the customer's street address written out in full","type":"string"},"street2":{"description":"Line number 2 of the customer's street address written out in full","type":"string"},"street3":{"description":"Line number 3 of the customer's street address written out in full","type":"string"},"title":{"description":"The title of the name of the customer with that account","type":"string"}},"required":["accountNum","firstName","lastName","status"],"type":"object"},"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"},"flags":{"items":{"$ref":"#/components/schemas/flags_inner"},"type":"array"},"flags_inner":{"properties":{"flagName":{"description":"Name of the flag to set.","type":"string"},"flagReason":{"description":"The reason that the flag has been set.","type":"string"},"flagValue":{"description":"Value to set the flag to.","type":"string"}},"required":["flagName","flagValue"]},"getPayments":{"properties":{"payments":{"items":{"$ref":"#/components/schemas/payment"},"type":"array"}},"type":"object"},"payment":{"properties":{"action":{"description":"Action of the payment (D = Deposit, W = withdrawal)","pattern":"(D|W)","type":"string"},"amount":{"description":"The amount of the payment","type":"number"},"channel":{"description":"The channel through which the payment was made","type":"string"},"commision":{"description":"The commision for the payment","type":"number"},"id":{"description":"ID of the payment","type":"string"},"ipAddress":{"description":"The IP address from which the payment was made","type":"string"},"methodId":{"description":"ID of the payment method","type":"string"},"paymentDateTime":{"description":"The date and time when the payment was made","type":"string"},"status":{"description":"The status of the payment","type":"string"},"type":{"description":"Type of the payment","pattern":"([A-Za-z]*)","type":"string"}},"required":["action","amount","id","paymentDateTime","status"],"type":"object"},"rewardsEligibility":{"description":"eligibilty status","properties":{"status":{"pattern":"(eligible|optedIn|optedOut)","type":"string","x-eg":"eligible"}},"type":"object"}}}}