- [HTTP request](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/unenroll#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/unenroll#body.request_body)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/unenroll#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/unenroll#body.response_body)
- [UnenrollResponse](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/unenroll#UnenrollResponse)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/unenroll#UnenrollResponse.SCHEMA_REPRESENTATION)
- [UnenrollResult](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/unenroll#UnenrollResult)
  - [JSON representation](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/unenroll#UnenrollResult.SCHEMA_REPRESENTATION)
- [UnenrollSuccessResult](https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/unenroll#UnenrollSuccessResult)

Informs the integrator that an enrollment is over. This means that the given `enrollmentRequestId` is no longer valid and will not be used again to retrieve a virtual card number.

Calls to `unenroll` with an `enrollmentRequestId` that has been seen previously should always return success to respect idempotency.

In the event a future `retrieveVirtualCardNumber` uses this unenrolled `enrollmentRequestId` it should be declined.

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1
        },
        "requestId": "DWSW4Q689HT93PJ",
        "requestTimestamp": {
          "epochMillis": "1481899949854"
        },
        "paymentIntegratorAccountId": "abcdef123456"
      },
      "enrollmentRequestId": "G1MQ0YERJ0Q7LPM"
    }

An example success response looks like:


    {
      "responseHeader": {
        "responseTimestamp": {
          "epochMillis": "1481899949868"
        }
      },
      "result": {
        "success" :{}
      }
    }

### HTTP request

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

### 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 } ``` |

| 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. |

### 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/unenroll#UnenrollResponse`)`` |
| HTTP 4XX / 5XX Status | ``object (`https://developers.google.com/pay/virtual-cards-v1/payment-integrator-virtual-cards-api/ErrorResponse`)`` |
| End of mutually exclusive fields. ||

## UnenrollResponse

Response object for the `unenroll` 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/unenroll#UnenrollResult`) } } ``` |

| 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/unenroll#UnenrollResult`)`` **REQUIRED**: Contains the result of the request. |

## UnenrollResult

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/unenroll#UnenrollSuccessResult`) } // 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/unenroll#UnenrollSuccessResult`)`` The request to `unenroll` was successful. |
| End of mutually exclusive fields. ||

## UnenrollSuccessResult

This type has no fields.
Details about the success result.