# TopUpRedirectRequest

- [JSON representation](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/TopUpRedirectRequest#SCHEMA_REPRESENTATION)

Request object for the Top-Up Redirect flow.

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


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1,
          "minor": 1,
          "revision": 0
        },
        "requestId": "G112YZH4XPDV88J",
        "requestTimestamp": "1481907920000"
      },
      "associationId": "LmddbXBsZSByZWZlcmVuY2UgdG9rZW4gdmFsdWU_"
    }

The `TopUpRedirectRequest` 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 `TopUpRedirectRequest` must be passed through the following functions:

    Base64UrlEncode(
      PGPSignAndEncrypt(
    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1,
          "minor": 1,
          "revision": 0
        },
        "requestId": "G112YZH4XPDV88J",
        "requestTimestamp": "1481907920000"
      },
      "associationId": "LmddbXBsZSByZWZlcmVuY2UgdG9rZW4gdmFsdWU_"
    }
      )
    )

or

    Base64UrlEncode(
      JWSignAndEncrypt(
    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1,
          "minor": 1,
          "revision": 0
        },
        "requestId": "G112YZH4XPDV88J",
        "requestTimestamp": "1481907920000"
      },
      "associationId": "LmddbXBsZSByZWZlcmVuY2UgdG9rZW4gdmFsdWU_"
    }
      )
    )

| JSON representation |
|---|
| ``` { "requestHeader": { object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RequestHeader`) }, "associationId": string, "targetBalance": { object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/Amount`) } } ``` |

| Fields ||
|---|---|
| `requestHeader` | ``object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RequestHeader`)`` **REQUIRED**: Common header for all requests. |
| `associationId` | `string` **REQUIRED** : The `associationId` that represents the user's account. This is public-facing ID for the user's account that was provided by Google during the `associateAccount` call. |
| `targetBalance` | ``object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/Amount`)`` **OPTIONAL**: The target balance to reach, in micros. |