Getting Started with the Pay Advantage API

This is a guide to help you get up and running with the Pay Advantage API quickly.

The Pay Advantage API has been written as a RESTful API and classes can be accessed using standard POST, GET, PUT and DELETE actions.

Returns are JSON-encoded responses, and we use standard HTTP response codes, authentication, and verbs. Requests should be passed as JSON in the body, making sure to declare the content type in the header. We provide example requests and responses throughout our documentation.

A fully functioning Sandbox environment is available for testing which consists of a test web-panel, test API, and pre-filled test data. We will keep you updated as we improve our API and add new functionality in future versions.

Step 1: Set up an account

Go to https://payadvantage.com.au and click the "Get Started" button to create an account with Pay Advantage. Once logged into the Pay Advantage portal select Integrations > API on the left hand menu and you will be presented with the API user screen. Then click the button labelled "Create your API test account" to create a sandbox account.

Only account administrators can setup the live and sandbox API. If you want to setup an API account please make sure that you are logged in as a user with administrator permissions. You can read more about setting up user permissions here.

The live environment and sandbox environment have separate login portals. Therefore, it is necessary to generate a set of API credentials for both environments and register any relevant IP addresses in each respective environments.

Step 2: Log into Sandbox portal

The sandbox is located at https://test.payadvantage.com.au/SignIn. The account is created with the same credentials as your live environment.

Note that these credentials are set at the time you create the sandbox account. If you have changed your live password since then it may be different to the sandbox environment password. You can reset the sandbox credentials from the live panel by clicking Reset sandbox credentials from the API setup page.

Step 3: Create an API user

Once logged into the Pay Advantage sandbox portal select Integrations > API on the left hand menu and you will be presented with the API user screen. Then click the button labelled "Add API User" to create an API user. You will be prompted to provide an alias for the API credentials. This alias is useful to describe the system that will be accessing Pay Advantage via these API credentials. After specifying an alias, a username and password will be generated. Use this username and password via the Auth api endpoint to login and create a bearer token.

The sandbox API url is: https://api.test.payadvantage.com.au/v3

const options = {
  method: 'POST',
  headers: {accept: 'application/json', 'content-type': 'application/json'},
  body: JSON.stringify({username: 'apiname', password: 'apipassword'})
};

fetch('https://api.test.payadvantage.com.au/v3/token', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

Step 4: Call an API

Once a bearer token is created you can use it to call subsequent APIs. In order to call another API the bearer token is required to be placed in the Authorization header. In the example below, replace the word token with your bearer token. The bearer token will allow the Pay Advantage APIs to be called until it expires. Once it has expired a new API token will be required. The expiry time is returned from the Auth API endpoint.

const options = {
  method: 'GET',
  headers: {accept: 'application/json', authorization: 'Bearer token'}
};

fetch('https://api.test.payadvantage.com.au/v3/customers?page=0&per_page=100', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

Once you are finished testing you can then create live credentials and also register your API's IP address in the live system.

To assist with testing, the sandbox environment simulates various inter-bank processing tasks including processing of debit batches and dishonouring debit instructions.)


What’s Next

Advanced usage of Sandbox environment