- [HTTP request](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#body.request_body)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#body.response_body)
- [SendOtpResponse](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpResponse)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpResponse.SCHEMA_REPRESENTATION)
- [SendOtpResult](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpResult)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpResult.SCHEMA_REPRESENTATION)
- [SendOtpSuccessResult](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpSuccessResult)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpSuccessResult.SCHEMA_REPRESENTATION)

Request to the vendor to send an OTP to the user.

If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type `https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/ErrorResponse`.

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1
        },
        "requestId": "BKD0GF23KSD8S23",
        "requestTimestamp": {
          "epochMillis": "1481899949606"
        },
        "paymentIntegratorAccountId": "abcdef123456"
      },
      "enrollmentRequestId": "SFLKJS23542ALFJ",
      "challengeOptionId": "G1MQ0YERJ0Q7LPM"
    }

An example success response looks like:


    {
      "responseHeader": {
        "responseTimestamp": {
          "epochMillis": "1481899950236"
        }
      },
      "result": {
        "success" :{
          "maxVerificationAttempts": "5",
          "maxSendAttempts": "3",
          "expirationTimestamp": {
             "epochMillis": "1481899960236"
          }
        }
      }
    }

### HTTP request

`POST https://www.integratorhost.example.com/integrator-base-path/virtual-cards-v1/sendOtp`

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requestHeader": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/RequestHeader`) }, "enrollmentRequestId": string, "challengeOptionId": string } ``` |

| Fields ||
|---|---|
| `requestHeader` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/RequestHeader`)`` **REQUIRED**: Common header for all requests. |
| `enrollmentRequestId` | `string` **REQUIRED** : A reference to an earlier enrollment request. Specifically, the identifier set in the `requestId` of the `requestHeader` sent in the `enrollRequest` that registered a card for Virtual Cards. This is a string that has a maximum length of 100 characters. |
| `challengeOptionId` | `string` **REQUIRED**: A reference to an OTP challenge option returned in a previous call, indicating that the user has selected this particular OTP option. This is a string that has a maximum length of 100 characters. Valid characters: \[`a-zA-Z0-9:_-`\] |

### Response body

This method supports multiple return types. For additional information about what 4XX or 5XX HTTP status code to return with an `ErrorResponse`, consult the `ErrorResponse` object and [HTTP status codes documentation](https://developers.google.com/pay/virtual-cards-v1/guides/connectivity/protocol-standards#http_status_codes).

| Possible response messages ||
|---|---|
| HTTP 200 Status | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpResponse`)`` |
| HTTP 4XX / 5XX Status | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/ErrorResponse`)`` |
| End of mutually exclusive fields. ||

## SendOtpResponse

Response object for the `sendotp` method.

| JSON representation |
|---|
| ``` { "responseHeader": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/ResponseHeader`) }, "result": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpResult`) } } ``` |

| Fields ||
|---|---|
| `responseHeader` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/ResponseHeader`)`` **REQUIRED**: Common header for all responses. |
| `result` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpResult`)`` **REQUIRED**: Contains the result of the request. |

## SendOtpResult

Details corresponding to the result.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "success": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpSuccessResult`) }, "challengeOptionExpired": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "sendLimitExceeded": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "accountLocked": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) }, "riskDeclined": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| **REQUIRED**: Contains the possible result types. Exactly one must be set. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `success` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/sendOtp#SendOtpSuccessResult`)`` The request to `sendOtp` was successful. |
| `challengeOptionExpired` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined because the challenge option has expired. |
| `sendLimitExceeded` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined because the maximum number of times the OTP can be sent has been exceeded. |
| `accountLocked` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined because the user's account has been locked. |
| `riskDeclined` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Empty`)`` Declined due to risk. |
| End of mutually exclusive fields. ||

## SendOtpSuccessResult

Details about the success result.

| JSON representation |
|---|
| ``` { "maxVerificationAttempts": string, "maxSendAttempts": string, "expirationTimestamp": { object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Timestamp`) } } ``` |

| Fields ||
|---|---|
| `maxVerificationAttempts` | `string (https://developers.google.com/discovery/v1/type-format format)` **REQUIRED** The maximum amount of times the OTP can be verified. |
| `maxSendAttempts` | `string (https://developers.google.com/discovery/v1/type-format format)` **REQUIRED** The maximum amount of times the sending the OTP can be requested for this particular challenge option. |
| `expirationTimestamp` | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/Timestamp`)`` **REQUIRED** The expiration timestamp after which the OTP will no longer be accepted. |