⚙️Authentication

Vitesse uses the OAuth 2.0 client credentials flow to issue access tokens. Your application uses these tokens to authenticate requests to the Vitesse API.

To access the Vitesse API, create an identity client and obtain its client ID and secret. Configure your application to use these credentials to dynamically request short-lived access tokens from the access token endpoint. Include a valid access token in every API request.

Access tokens remain valid for the duration configured for the identity client, from 10 to 60 minutes. If your application needs continued access, request a new token before the current token expires.

Before you begin

  1. Create an identity client in MAS for each environment that your application accesses.

    💡

    Consider creating additional identity clients for different applications or microservices, or when you need to control their access independently.

    For instructions, see Manage identity clients.

  2. Contact Support:

    • Provide the client ID for each identity client.
    • Specify the tasks each identity client must perform, such as retrieving accounts, making payments, managing recipients or subscribing to webhook events. Vitesse uses this information to assign the required OAuth scopes to the identity client.
    • Provide your organisation’s public IP addresses that will send Production API requests. Vitesse adds these addresses to the allowlist.
    • If your organisation uses an IP allowlist for inbound webhook traffic, request Vitesse’s outbound IP addresses and add them to your allowlist.

See ⚙️Environments for the access token endpoint for each environment. An identity client's credentials work only in the environment where you created it.

Limit identity client access

Use scopes and roles to limit each identity client’s access. When requesting an access token, your application requests the scopes that cover the API areas it needs. The roles assigned to the identity client determine which operations it can perform within those areas.

Assign only the required roles and request only the required scopes.

If applications or services require different access, create separate identity clients for them. This limits the access available if a client secret or access token is compromised.

Request an access token

Send a POST request to the access token endpoint using the application/x-www-form-urlencoded content type.

Include the following parameters in the request body:

ParameterValue
client_idThe relevant identity client ID.
client_secretThe identity client secret.
grant_typeclient_credentials
scopeA space-separated list of the scopes required by the endpoints your application calls.
❗

If you omit scope, Vitesse issues an access token containing all scopes assigned to the identity client. If you request a scope that the identity client cannot access, Vitesse rejects the token request. If you omit a required scope, requests to the associated endpoints will fail.

Available scopes

Request the scopes specified in the relevant API Guide topic.

The identity client must also have the roles required by the endpoints your application calls.

ScopeAccess granted
approvalsApproval workflows and approval tasks.
payment-requestsPayments, payment lifecycle management and related account actions.
programmesProgrammes that define how Vitesse processes payments.
stored-recipientsRecipient records used with payment endpoints that require the stored-recipients scope.
vendor-managementVendor records and vendor onboarding.
webhooksWebhook subscriptions and subscription events.
APITransaction-based payments and related account actions, recipient records available through endpoints that use this scope, foreign exchange, cheques and validation rules.

Separate multiple scopes with spaces. For example:

scope=payment-requests stored-recipients webhooks

Example request

POST https://staging-identity.vitessepsp.com/connect/token/connect/token
Content-Type: application/x-www-form-urlencoded

client_id=your-client-id&
client_secret=your-client-secret&
grant_type=client_credentials&
scope=payment-requests+stored-recipients+webhooks

The example uses + to encode the spaces between scopes in an application/x-www-form-urlencoded request.

Example response

Vitesse returns an access token and its validity period:

{
  "access_token": "eyJhbGciOi...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "payment-requests stored-recipients webhooks"
}

The value of expires_in represents the number of seconds until the access token expires.

Use the access token

❗

Treat access tokens as credentials. Do not expose them in client-side code or logs.

Include the access token in the Authorization header of each request to the Vitesse API:

Authorization: Bearer <access-token>

For example:

GET /v1/payment-initiation/merchantAccounts
Authorization: Bearer eyJhbGciOi...

Request a new access token before the current token expires.