API Key and User ID are required to generate a basic Auth key. API Keys can be directly generated in the Admin Panel.
Perform the following steps to obtain API key.
- Go to <Verifone Central || Verifone Developer Portal> -> API Keys. API Keys screen will be displayed.
- Login with the credentials provided in your e-mail sent by the Verifone POS Cloud Support team. The Transaction screen will be displayed.
- Go to My Account drop box located on the top right corner of the screen. API Keys popup screen will be displayed.
- Click Create API Key to generate an API Key. API Key Created pop-up screen will be displayed.
Click Copy public key to copy the API key. Once the key is copied, a success message appears at the bottom right corner of your screen.
NOTE: Ensure that an API key is created for each customer and also ensure to store the API key in a secure place. The API key will get expired one year from the date of activation. The system will automatically send an e-mail notification to renew the API Key. This e-mail is sent every week during the last three months, and every day during the last week before the expiration date.
Follow the steps to create a User ID.
- Go to <Verifone Central | | Verifone Developer Portal> -> My Account. The Transactions screen will be displayed.
- Select My Account to locate the User ID.
- Copy the User ID from the latter part of the URL.
Encoding API Keys
To encode API keys, follow the authentication method below.
- Indicate Authorization: Basic "user-uid:api key" in the header.
- Replace the "user-uid" and "api key" values.
- Encode the whole string in base64.
The following "user-uid:api key" string 777c31b3-a85f-4823-93a5-9055d1b:cGEFFLjYuUCtmerXlhTfAdaPpYVnXDJZmg
Result: base64 Nzc3YzMxYjMtYTg1Zi00ODIzLTkzYTUtOTA1NWQxYjpjR0VGRkxqWXVVQ3RtZXJYbGhUZkFkYVBwWVZuWERKWm1n
Header: Authorization: Basic Nzc3YzMxYjMtYTg1Zi00ODIzLTkzYTUtOTA1NWQxYjpjR0VGRkxqWXVVQ3RtZXJYbGhUZkFkYVBwWVZuWERKWm1n
Setting up the Basic Auth in POSTMAN
Following are the steps to generate Basic Auth key:
- Go to <POSTMAN>. My Workspace screen will be displayed.
- Enter the API Key and the UID in the respective text boxes.
- Go to Authorization tab and select Basic Auth from the TYPE dropdown list.
- Enter the User ID in the username field and API Key in the password field to send the request.
- Click Send to set up the basic auth key. The Basic Auth key will be generated in the response field.
- Place the Basic Auth code in the Authentication textbox to test the APIs.
Run Get Status API to establish the connection and to get the device information. Once the connection is established, other transaction capabilities can be tested using the provided APIs.
7. Click Send and wait for the response from the POS Cloud server along with the terminal status.
NOTE: Ensure the registered terminal details and the connection status are displayed in the response field, the connection status as POS State: Connected.