Skip to main content

API keys API

Get latest

Use your existing key to get a new key.

The response contains the key you should use from now on. Usually this is your existing key. When your existing key is about to expire, this is your new key.

You should do this once per day.

To test your automatic key renewal code:

  1. Create two API keys using PaymentsPlus.
  2. Configure your application to use the first key.
  3. Confirm that your application automatically switches to the second key.

Request

GET /api-keys/latest

Request body

None.

Response

If successful, this method returns the following in the response body.

Field Format Data
keyName string The API key name. Use for logging.
key string The API key.
expiryDate date-time The date and time the key will expire.

API Key response example

{
  "keyName": "FACILITYCODE_SEC...zrikj5x",
  "key": "FACILITYCODE_SEC_dcm89ugjh5jbcjq5pdymhgimdj7gwwd7dddhty6arjrjftv8hymz8zr",
  "expiryDate": "2022-01-02T03:48:40+00:00"
}

HTTP status codes

See HTTP Status Codes for more.

Status Code Description More information
200 OK The request has succeeded.
401 UNAUTHORIZED The API key in the request is expired. View more.
Westpac Privacy Statement

Privacy Statement (for individuals whose personal information may be collected - in this clause referred to as "you"). All personal information we collect about you is collected, used and disclosed by us in accordance with our Privacy Statement which is available at Privacy Statement or by calling us through your relationship manager or Westpac representative. Our Privacy Statement also provides information about how you can access and correct your personal information and make a complaint. You do not have to provide us with any personal information but, if you don't, we may not be able to process an application or a request for a product or service.