Validate API - Quick Start

Overview

In this tutorial we will go over how to use the keycode and API key you have been given to make a request to the validate API.

Setup

For this I am going to be using Insomnia, although anything that can make http requests can be used. I’m going to be making a POST request to https://validate.paygateservice.com/validateonlineapi/api/AccountNumber

With the sortcode set to 11-11-16

Getting the access token

You should’ve been provided with a Grant Type, Access Token URL, Client Id, Required Scopes and an API key, you will need all of those to get an access token. To start set auth to OAuth 2

Fig1

Change the type to “Client Credentials” input the details as follows: - Access Token Url = https://portal.paygateservice.com/IdentityServer/identity/connect/token - Client Id = validate_api - Client Secret = Your API Key - Expand “Advanced Options” - Scope = API

Then press Fetch Tokens

Fig2

This should create a token and append it to the request.

If the access token is invalid, you will get a 401 response. Access tokens should come with an expiration date, you can store an access token and use it any number of times before this expiration date.

Using the Keycode

The keycode should be provided to you, you must include it in the data that you send to the API, take this for example.

Fig3

You would just need to add a property “keycode” with the value of your keycode

Fig4

If the keycode is incorrect but the access token is valid, you will get a response with the error code “1100”

Fig5

Paygate Developer Portal: https://developer.paygateservice.com/index.html

Validate OpenAPI Documentation: https://developer.paygateservice.com/api/validate/validate.html