# GeneratePaymentTokenRedirectRequest

- [JSON representation](https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/GeneratePaymentTokenRedirectRequest#SCHEMA_REPRESENTATION)
- [GoogleAccountDetails](https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/GeneratePaymentTokenRedirectRequest#GoogleAccountDetails)
  - [JSON representation](https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/GeneratePaymentTokenRedirectRequest#GoogleAccountDetails.SCHEMA_REPRESENTATION)

Request object for the Generate Payment Token Redirect flow.

Here's an example of a clear text JSON request:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1,
          "minor": 1,
          "revision": 0
        },
        "requestId": "G112YZH4XPDV88J",
        "requestTimestamp": "1481907920000"
      },
      "paymentIntegratorAccountId": "InvisiCashUSA_USD",
      "transactionAmount": {
        "amountMicros": "109900000",
        "currencyCode": "INR"
      },
      "transactionDescription": "Google Store Purchase",
      "shippingAddress": {
        "name": "Example Customer",
        "addressLine": ["123 Main St"],
        "localityName": "Springfield",
        "administrativeAreaName": "CO",
        "postalCodeNumber": "80309",
        "countryCode": "US"
      },
      "shippingAddressType": "STORE",
      "googleAccountDetails": {
        "emailAddress": "example@gmail.com"
      },
      "customerPaymentHistorySignal": {
        "positivePaymentHistory": {}
      }
    }

The `GeneratePaymentTokenRedirectRequest` is encrypted and signed using PGP or JWE+JWS. Further, this value is web-safe `base64` encoded. This encoding is referred to below as `Base64UrlEncode`. In other words, the clear text JSON version of the `GeneratePaymentTokenRedirectRequest` must be passed through the following functions:

    Base64UrlEncode(
      PGPSignAndEncrypt(
    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1,
          "minor": 1,
          "revision": 0
        },
        "requestId": "G112YZH4XPDV88J",
        "requestTimestamp": "1481907920000"
      },
      "paymentIntegratorAccountId": "InvisiCashUSA_USD",
      "transactionAmount": {
        "amountMicros": "109900000",
        "currencyCode": "INR"
      },
      "transactionDescription": "Google Store Purchase",
      "shippingAddress": {
        "name": "Example Customer",
        "addressLine": ["123 Main St"],
        "localityName": "Springfield",
        "administrativeAreaName": "CO",
        "postalCodeNumber": "80309",
        "countryCode": "US"
      },
      "shippingAddressType": "STORE",
      "googleAccountDetails": {
        "emailAddress": "example@gmail.com"
      },
      "customerPaymentHistorySignal": {
        "positivePaymentHistory": {}
      }
    }
      )
    )

or

    Base64UrlEncode(
      JWSignAndEncrypt(
    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1,
          "minor": 1,
          "revision": 0
        },
        "requestId": "G112YZH4XPDV88J",
        "requestTimestamp": "1481907920000"
      },
      "paymentIntegratorAccountId": "InvisiCashUSA_USD",
      "transactionAmount": {
        "amountMicros": "109900000",
        "currencyCode": "INR"
      },
      "transactionDescription": "Google Store Purchase",
      "shippingAddress": {
        "name": "Example Customer",
        "addressLine": ["123 Main St"],
        "localityName": "Springfield",
        "administrativeAreaName": "CO",
        "postalCodeNumber": "80309",
        "countryCode": "US"
      },
      "shippingAddressType": "STORE",
      "googleAccountDetails": {
        "emailAddress": "example@gmail.com"
      },
      "customerPaymentHistorySignal": {
        "positivePaymentHistory": {}
      }
    }
      )
    )

| JSON representation |
|---|
| ``` { "requestHeader": { object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/RequestHeader`) }, "paymentIntegratorAccountId": string, "transactionAmount": { object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/remittanceStatementNotification#Amount`) }, "transactionDescription": string, "shippingAddress": { object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/reserveFunds#Address`) }, "shippingAddressType": enum (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/ShippingAddressType`), "googleAccountDetails": { object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/GeneratePaymentTokenRedirectRequest#GoogleAccountDetails`) }, "enableAdditionalPaymentOptions": { object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/getGeneratePaymentTokenRedirectStatus#Empty`) }, "customerPaymentHistorySignal": { object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/CustomerPaymentHistorySignal`) } } ``` |

| Fields ||
|---|---|
| `requestHeader` | ``object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-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. |
| `transactionAmount` | ``object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/remittanceStatementNotification#Amount`)`` **REQUIRED**: The amount of the transaction. |
| `transactionDescription` | `string` **REQUIRED**: A description of the transaction that can be shown to the user. |
| `shippingAddress` | ``object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/reserveFunds#Address`)`` **OPTIONAL**: The shipping address of the customer/store. This is used when there are physical goods being shipped to the user/store. |
| `shippingAddressType` | ``enum (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/ShippingAddressType`)`` **OPTIONAL**: Indicates the type of the shipping address. Should not be provided if shippingAddress is not provided. |
| `googleAccountDetails` | ``object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/GeneratePaymentTokenRedirectRequest#GoogleAccountDetails`)`` **OPTIONAL**: This is information about the user's Google account that Google has verified. |
| `enableAdditionalPaymentOptions (deprecated)` | ``object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/getGeneratePaymentTokenRedirectStatus#Empty`)`` > [!WARNING] > This is deprecated because additional payment options are now enabled regardless of the value of this field. This field should not be read and will be removed very soon. **DEPRECATED**: If present, additional payment options may be presented to the user. |
| `customerPaymentHistorySignal` | ``object (`https://developers.google.com/pay/redirect-payment-token-v1/payment-integrator-redirect-payment-token-api/CustomerPaymentHistorySignal`)`` **OPTIONAL**: Carries signals about a customer's payment history, which can be used by payment integrators to inform risk decisions. Note: This signal is best-effort and may not always be present. |

## GoogleAccountDetails

Details about the user's Google account.

| JSON representation |
|---|
| ``` { "emailAddress": string } ``` |

| Fields ||
|---|---|
| `emailAddress` | `string` **OPTIONAL**: The email address associated with the customer. |