- [HTTP request](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/upcomingTransactionNotification#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/upcomingTransactionNotification#body.request_body)
  - [JSON representation](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/upcomingTransactionNotification#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/upcomingTransactionNotification#body.response_body)
- [UpcomingTransactionNotificationResponse](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/upcomingTransactionNotification#UpcomingTransactionNotificationResponse)
  - [JSON representation](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/upcomingTransactionNotification#UpcomingTransactionNotificationResponse.SCHEMA_REPRESENTATION)
- [UpcomingTransactionNotificationResultCode](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/upcomingTransactionNotification#UpcomingTransactionNotificationResultCode)

Requests the integrator notify the user of an upcoming transaction for a recurring mandate.

If the integrator returns `success`, then Google expects the user to be notified that an upcoming mandate transaction is impending. The notification may be delivered with some delay from the payment integrator, but this means that Google has notified the payment integrator. This notification must not have any monetary impact on the customer's account.

There is no guarantee that a charge will be executed after a prenotification and one mandate may have multiple notifications.

The `requestId` within the header is the idempotency key, which uniquely identifies this prenotification request.

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/e-wallets-v1/payment-integrator-e-wallets-api/ErrorResponse`.

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1,
          "minor": 0,
          "revision": 0
        },
        "requestId": "G112YZH4XPDV88J",
        "requestTimestamp": "1502220196077"
      },
      "paymentIntegratorAccountId": "InvisiCashUSA_USD",
      "mandateId": "MA061B00045154",
      "upcomingTransactionNotBeforeTimestamp": {
        "epochMillis": "1521855969203"
      },
      "transactionAmount": {
        "amountMicros": "728000000",
        "currencyCode": "INR"
      },
      "transactionDescription": "Google TV subscription"
    }

An example response looks like:


    {
      "responseHeader": {
        "responseTimestamp": "1481900013178"
      },
      "result": "SUCCESS"
    }

### HTTP request

`POST https://www.integratorhost.example.com/integrator-base-path/e-wallets-v1/upcomingTransactionNotification`

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requestHeader": { object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RequestHeader`) }, "paymentIntegratorAccountId": string, "mandateId": string, "upcomingTransactionNotBeforeTimestamp": { object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/Timestamp`) }, "transactionAmount": { object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/Amount`) }, "transactionDescription": string } ``` |

| Fields ||
|---|---|
| `requestHeader` | ``object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RequestHeader`)`` **REQUIRED**: Common header for all requests. |
| `paymentIntegratorAccountId` | `string` **REQUIRED**: This is the payment integrator account identifier that identifies contractual constraints around this transaction. |
| `mandateId` | `string` **REQUIRED** : The Google generated ID that uniquely identifies the mandate for this recurring payment. This is provided in the `CreateMandateRequest` by Google during the `createMandate` method. |
| `upcomingTransactionNotBeforeTimestamp` | ``object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/Timestamp`)`` **REQUIRED**: Timestamp of when the upcoming transaction will be excecuted. The timestamp represents the exact time before which a transaction should not occur, but delay in the transaction beyond the timestamp should be expected. |
| `transactionAmount` | ``object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/Amount`)`` **REQUIRED**: The amount of the upcoming transaction. |
| `transactionDescription` | `string` **REQUIRED**: A brief description of the upcoming transaction. This format can be changed without notice and must never be parsed. |

### 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/e-wallets-v1/guides/connectivity/protocol-standards#http_status_codes).

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

## UpcomingTransactionNotificationResponse

Response object for the `upcomingTransactionNotification` method.

| JSON representation |
|---|
| ``` { "responseHeader": { object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ResponseHeader`) }, "result": enum (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/upcomingTransactionNotification#UpcomingTransactionNotificationResultCode`), "rawResult": { object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RawResult`) } } ``` |

| Fields ||
|---|---|
| `responseHeader` | ``object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ResponseHeader`)`` **REQUIRED**: Common header for all responses. |
| `result` | ``enum (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/upcomingTransactionNotification#UpcomingTransactionNotificationResultCode`)`` **REQUIRED** : Result of this `e-wallets-v1.upcomingTransactionNotification` call. |
| `rawResult` | ``object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RawResult`)`` **OPTIONAL** : Raw result of this transaction. Used to help inform Google's risk engine and analytics. In decline code--mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the `scope` would be "visa" and the `rawCode` would be whatever the VISA network returned. This value is **required** if the `result` is not `SUCCESS`. |

## UpcomingTransactionNotificationResultCode

The result of the UpcomingTransactionNotificationResponse.

| Enums ||
|---|---|
| `UPCOMING_TRANSACTION_NOTIFICATION_RESULT_CODE_UNSPECIFIED` | Do not ever set this default value! |
| `SUCCESS` | The user was or will be notified and the scheduled transaction can occur. |
| `MANDATE_NOT_ACTIVE` | The specified mandate is not currently active and cannot be used for payments. |
| `MANDATE_PAUSED` | The specified mandate is currently paused and cannot be used for payments. |
| `CHARGE_EXCEEDS_TRANSACTION_LIMIT` | Amount for the upcoming transaction exceeds the integrator's maximum per-transaction limit. If this code is used, populate the `transactionMaxLimit` field with the transaction limit for user messaging purposes. |
| `ACCOUNT_ON_HOLD` | User's account is on hold. |