Tokens & OTP
Send an OTP to an email address for verification.
POST /v1/auth/admin/otp/send/email
Auth: API key (VantagePayAdminClient).
Request body
| Field | Type | Required | Description |
|---|---|---|---|
fullName | string? | No | The user's full name, used to personalise the OTP email (optional). |
emailAddress | string | Yes | The email address to which the OTP will be sent (required). |
{
"fullName": "string",
"emailAddress": "string"
}Responses
| Status | Description |
|---|---|
200 | The OTP was queued for delivery to the specified email address. |
400 | The request failed validation, the error object will contain further information. |
401 | The authorization information provided is not valid, authentication is required to access this resource. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
{
"success": true
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
await adminClient.Authentication.SendEmailAddressOtpAsync("Jane Doe", "customer@example.com");Send an OTP to a mobile number for verification.
POST /v1/auth/admin/otp/send/mobile
Auth: API key (VantagePayAdminClient).
Request body
| Field | Type | Required | Description |
|---|---|---|---|
mobileNumber | string | Yes | The mobile number (MSISDN) to which the OTP will be sent (required). |
{
"mobileNumber": "string"
}Responses
| Status | Description |
|---|---|
200 | The OTP was queued for delivery to the specified mobile number. |
400 | The request failed validation, the error object will contain further information. |
401 | The authorization information provided is not valid, authentication is required to access this resource. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
{
"success": true
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
await adminClient.Authentication.SendMobileNumberOtpAsync("233555666112");Validate an OTP sent to an email address and optionally mark linked profiles as verified.
POST /v1/auth/admin/otp/validate/email
Auth: API key (VantagePayAdminClient).
Request body
| Field | Type | Required | Description |
|---|---|---|---|
emailAddress | string | Yes | The email address that the OTP was sent to (required). |
reference | string? | Yes | The system reference of the pending verification session, if applicable. |
otpValue | string | Yes | The OTP value entered by the user (required). |
{
"emailAddress": "string",
"reference": "00000000-0000-0000-0000-000000000000",
"otpValue": "string"
}Responses
| Status | Description |
|---|---|
200 | The OTP was valid and email verification was completed successfully. |
400 | The request failed validation, the error object will contain further information. |
401 | The OTP was invalid or expired. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
{
"success": true
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
await adminClient.Authentication.ValidateEmailAddressOtpAsync("123456", "customer@example.com", Guid.Parse("7c9e6679-7425-40de-944b-e07fc1f90ae7"));Validate an OTP sent to a mobile number and optionally mark linked profiles as verified.
POST /v1/auth/admin/otp/validate/mobile
Auth: API key (VantagePayAdminClient).
Request body
| Field | Type | Required | Description |
|---|---|---|---|
mobileNumber | string | Yes | The mobile number (MSISDN) that the OTP was sent to (required). |
reference | string? | Yes | The system reference of the pending verification session, if applicable. |
otpValue | string | Yes | The OTP value entered by the user (required). |
{
"mobileNumber": "string",
"reference": "00000000-0000-0000-0000-000000000000",
"otpValue": "string"
}Responses
| Status | Description |
|---|---|
200 | The OTP was valid and mobile number verification was completed successfully. |
400 | The request failed validation, the error object will contain further information. |
401 | The OTP was invalid or expired. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
{
"success": true
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
await adminClient.Authentication.ValidateMobileNumberOtpAsync("123456", "233555666112", Guid.Parse("7c9e6679-7425-40de-944b-e07fc1f90ae7"));Generate an access and refresh token pair for a consumer.
POST /v1/auth/admin/token/generate/consumer/{consumerReference}
This is useful for partners who register consumers through us but use their own login server and handle authentication themselves.
Sample
POST /v1/auth/token/generate/consumer/50a881c7-ce35-4c3b-be1d-28d643fef6d7Auth: API key (VantagePayAdminClient).
Parameters
| Name | In | Required | Description |
|---|---|---|---|
consumerReference | path | Yes | A globally unique internal consumer reference (UUID). |
Responses
| Status | Description |
|---|---|
200 | Token generation for the specified consumer succeeded and a new access and refresh token pair was returned. |
400 | The request failed validation, the error object will contain further information. |
401 | Token generation failed and flags will be set in the response to indicate what went wrong. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
result | object | No | Provides token information for successful login and refresh operations. |
{
"success": true,
"result": {
"refreshToken": "string",
"accessToken": "string",
"accessTokenValidForSeconds": 0
}
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
var tokens = await adminClient.Authentication.GenerateConsumerTokenAsync(Guid.Parse("7c9e6679-7425-40de-944b-e07fc1f90ae7"));Generate an access and refresh token pair for a merchant.
POST /v1/auth/admin/token/generate/merchant/{merchantReference}
Sample
POST /v1/auth/token/generate/merchant/0bf31b49-9420-4726-8f51-96ce60a770fbAuth: API key (VantagePayAdminClient).
Parameters
| Name | In | Required | Description |
|---|---|---|---|
merchantReference | path | Yes | A globally unique internal merchant reference (UUID). |
Responses
| Status | Description |
|---|---|
200 | Token generation for the specified merchant succeeded and a new access and refresh token pair was returned. |
400 | The request failed validation, the error object will contain further information. |
401 | Token generation failed and flags will be set in the response to indicate what went wrong. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
result | object | No | Provides token information for successful login and refresh operations. |
{
"success": true,
"result": {
"refreshToken": "string",
"accessToken": "string",
"accessTokenValidForSeconds": 0
}
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
var merchantToken = await adminClient.Authentication.GenerateMerchantTokenAsync(Guid.Parse("3fa85f64-5717-4562-b3fc-2c963f66afa6"));Generate tokens manually with a custom set of claims.
POST /v1/auth/admin/token/generate
Sample
POST /v1/auth/token/generate
{
"expiryInSeconds": 16070400,
"claims":
{
"userReference": "string",
"name": "string",
"dateOfBirth": "string",
"mobileNumber": "string",
"emailAddress": "string",
"canUseDoNotProcess": "true/false",
"canDisableThreeDSecure": "true/false",
"canDisableConfirmation": "true/false"
}
}Auth: API key (VantagePayAdminClient).
Request body
| Field | Type | Required |
|---|---|---|
expiryInSeconds | integer? | No |
claims | object? | No |
accessPolicies | array<string>? | No |
{
"expiryInSeconds": 0,
"claims": {
"UserReference": "string",
"ConsumerReference": "string",
"MerchantReference": "string",
"BusinessReference": "string",
"TerminalReference": "string",
"Name": "string",
"LoginName": "string",
"DateOfBirth": "string",
"MobileNumber": "string",
"EmailAddress": "string",
"AccessPolicy": "string",
"CanUseCashSource": "string",
"CanUseDoNotProcess": "string",
"CanDisableThreeDSecure": "string",
"CanDisableConfirmation": "string",
"MaxTotalSourceAmountInCents": "string",
"MaxTotalDestinationAmountInCents": "string",
"OverrideSourcePluginName": "string",
"OverrideSourcePluginSettingsName": "string",
"OverrideDestinationPluginName": "string",
"OverrideDestinationPluginSettingsName": "string",
"AllowedCurrencies": "string",
"RedirectAction": "string",
"PaymentRequestWasRouted": "string"
},
"accessPolicies": [
"string"
]
}Responses
| Status | Description |
|---|---|
200 | Token generation was successful and a new access and refresh token pair was returned. |
400 | The request failed validation, the error object will contain further information. |
401 | Token generation failed and flags will be set in the response to indicate what went wrong. |
403 | The authorization header does not contain the correct type or you do not have access to this resource. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
result | object | No | Provides token information for successful login and refresh operations. |
{
"success": true,
"result": {
"refreshToken": "string",
"accessToken": "string",
"accessTokenValidForSeconds": 0
}
}Code samples
WARNING
The JavaScript SDK does not cover admin APIs - use the .NET SDK.
// Generates a token for the current API-key context. Use the consumer/merchant token overloads for a specific entity.
// Not wrapped by the .NET SDK - call the endpoint directly with an authorized HttpClient.
using var http = new HttpClient { BaseAddress = new Uri("https://sandbox-api.vantagepay.dev") };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", client.ApiTokens.AccessToken);
var response = await http.PostAsync("/v1/auth/admin/token/generate", content: null);
response.EnsureSuccessStatusCode();