Alternative Payment Framework Web API Overview

The Verifone APF API is designed to give Verifone Terminals the ability to process transactions using different payment methods.

API Design

API operations are performed using HTTPS requests that may include JSON formatted request or response data. HTTP requests will not be permitted.

Authentication

Authentication is performed by including an ‘API-KEY’ header in each request. The API-KEY will be normally loaded onto each terminal device. For testing the key ‘TEST’ can be used.

Determining what Payment Methods are Supported on a Terminal Device

To determine what Payment Methods are supported for a specific device the device in question should use the GET /api/v1/devices/{devID} operation to get a JSON document containing the methods to be supported. The methods will include URL references to PNG files to be displayed on the screen where the payment method is selected.

The terminal should perform this check at a minimum of once a day before the first transaction in the morning.

Transaction Processing Overview

An APF transaction is processed in the following way:

1.       The terminal will start a new transaction using an API call. The terminal will specify a payment method type and an amount.

 

2.       The terminal will execute a number of ‘actions’ as directed by the APF switch (via the API). These actions include things like swiping a card, displaying a QR code, or entering customer data (like and odometer reading).

 

3.       Once all actions are complete, the terminal can get the official result of the transaction.

Starting a Transaction

This is done by calling the PUT /api/v1/devices/{devID}/txns/{txID} operation and supplying the transaction type and an amount. This operation will return the current state of the transaction which will almost always be ‘PENDING’.

Processing Actions

The terminal must process all outstanding actions before the transaction can complete. To determine the current action to be processed the terminal should use the GET /api/v1/devices/{devID}/txns/{txID}/pending-action operation. This will return the next action to be executed. See the API Reference for more information on the types of actions that must be supported.

Once the terminal has completed the action it must then give the APF switch the result of the action. This is done with the PUT /api/v1/devices/{devID}/txns/{txID}/action-results/{actionNo} operation.

Completing the Transaction

Typically, the last action of the transaction will be to get the terminal to display the transaction result on screen. Once there are no more actions to be processed the terminal can use the GET /api/v1/devices/{devID}/txns/{txID} operation to get the official result of the transaction. This result can then be used to complete the transaction on the terminal.