Accounts API
Overview

Accounts API


Version: 2.0.0

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. It should be noted that regional variations may exist - so some fields may not be returned for certain territories.
Summary
Method Name Description Resource
getBalance This method can be used to retrieve the customer\u2019s account balance in UK Sterling. https://sandbox.whapi.com/v2/accounts/account/balance
getDetails 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. https://sandbox.whapi.com/v2/accounts/account
getPayments Retrieves the customer\u2019s account payments in UK Sterling. https://sandbox.whapi.com/v2/accounts/account/payments
getPlusCardDetails Gets a customer's plus card details if they exist. https://sandbox.whapi.com/v2/accounts/account/plusCard
setAccountFlags Sets a flag based on name to value provided for the user. https://sandbox.whapi.com/v2/accounts/account/flags
setLostStolen Sets a customer's plus card as Lost/Stolen https://sandbox.whapi.com/v2/accounts/account/plusCard/lostStolen
setPhoneNumber Sets a customer's plus card phone number https://sandbox.whapi.com/v2/accounts/account/plusCard/phone/{oldPhoneNumber}
setPin Sets a customer's plus card pin https://sandbox.whapi.com/v2/accounts/account/plusCard/pin
updatePin Updates a customer's plus card pin https://sandbox.whapi.com/v2/accounts/account/plusCard/pin
Resources Expand All Collapse All
getBalance()
This method can be used to retrieve the customer\u2019s account balance in UK Sterling.
Request Example
get https://sandbox.whapi.com/v2/accounts/account/balance?fields=extended&include=extended&exclude=expiryDateTime&languageAsPerTerritory=false HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349
territory: ES

Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
territory
query parameters
Name Description
fields
include
exclude
languageAsPerTerritory
Responses Expand All Collapse All
getDetails()
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.
Request Example
get https://sandbox.whapi.com/v2/accounts/account?fields=extended&include=extended&exclude=expiryDateTime&languageAsPerTerritory=false HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349
territory: ES

Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
territory
query parameters
Name Description
fields
include
exclude
languageAsPerTerritory
Responses Expand All Collapse All
getPayments()
Retrieves the customer\u2019s account payments in UK Sterling.
Request Example
get https://sandbox.whapi.com/v2/accounts/account/payments?page=10&pageSize=15&dateFrom=2013-09-25T13:34:20+01:00&dateTo=2013-09-25T13:34:20+01:00&sort=date,desc&transactionType=W&fields=extended&include=extended&exclude=expiryDateTime&languageAsPerTerritory=false HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349
territory: ES

Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
territory
query parameters
Name Description
page
pageSize
dateFrom
dateTo
sort
transactionType
fields
include
exclude
languageAsPerTerritory
Responses Expand All Collapse All
getPlusCardDetails()
Gets a customer's plus card details if they exist.
Request Example
get https://sandbox.whapi.com/v2/accounts/account/plusCard?fields=extended&include=extended&exclude=expiryDateTime HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349

Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
query parameters
Name Description
fields
include
exclude
Responses Expand All Collapse All
setAccountFlags()
Sets a flag based on name to value provided for the user.
Request Example
post https://sandbox.whapi.com/v2/accounts/account/flags?languageAsPerTerritory=false HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349
apiCountryCode: ES
territory: ES

Payload:     
Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
apiCountryCode
territory
body parameters
Name Description
flags *
query parameters
Name Description
languageAsPerTerritory
Responses Expand All Collapse All
setLostStolen()
Sets a customer's plus card as Lost/Stolen
Request Example
post https://sandbox.whapi.com/v2/accounts/account/plusCard/lostStolen HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349

Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
Responses Expand All Collapse All
setPhoneNumber()
Sets a customer's plus card phone number
Request Example
post https://sandbox.whapi.com/v2/accounts/account/plusCard/phone/{oldPhoneNumber} HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349

Payload:     
Request Parameters
path parameters
Name Description
oldPhoneNumber*
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
body parameters
Name Description
phoneNumber *
Responses Expand All Collapse All
setPin()
Sets a customer's plus card pin
Request Example
post https://sandbox.whapi.com/v2/accounts/account/plusCard/pin HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349

Payload:     
Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
body parameters
Name Description
pin *
Responses Expand All Collapse All
updatePin()
Updates a customer's plus card pin
Request Example
put https://sandbox.whapi.com/v2/accounts/account/plusCard/pin HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349

Payload:     
Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
body parameters
Name Description
pin *
Responses Expand All Collapse All
HEAD and OPTIONS
You can call the following idempotent REST methods on all version 2 APIs:

HEAD

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The metainformation contained in the HTTP headers in response to a HEAD request is identical to the information sent in response to a GET request. This method is often used for testing hypertext links for validity, accessibility, and recent modification. The response to a HEAD request may be cacheable in the sense that the information contained in the response can be used to update a previously cached entity from that resource. If the new field values indicate that the cached entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or Last-Modified), then the cache treats the cache entry as stale.

OPTIONS

The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. This method allows you to determine the options and/or requirements associated with a resource without implying a resource action or initiating a resource retrieval. Responses to this method are not cacheable. The response includes any header fields that indicate optional features. The response body also includes information about the communication options.



Copyright (c) WHG (International) Limited 2016
Generated Date: 2020-08-07T13:30:16.240+01:00
Use of this document is subject to the William Hill Partner Developer Portal Terms and Conditions.