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

Response object for the Top-Up Redirect flow.

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


    {
      "redirectRequestId": "cmVxdWVzdDE",
      "success": {
        "currentBalance": {
          "amountMicros": "51000000",
          "currencyCode": "USD"
        }
      }
    }

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

    Base64UrlEncode(
      PGPSignAndEncrypt(
    {
      "redirectRequestId": "cmVxdWVzdDE",
      "success": {
        "currentBalance": {
          "amountMicros": "51000000",
          "currencyCode": "USD"
        }
      }
    }
      )
    )

or

    Base64UrlEncode(
      JWSignAndEncrypt(
    {
      "redirectRequestId": "cmVxdWVzdDE",
      "success": {
        "currentBalance": {
          "amountMicros": "51000000",
          "currencyCode": "USD"
        }
      }
    }
      )
    )

| JSON representation |
|---|
| ``` { "redirectRequestId": string, // 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/e-wallets-v1/google-e-wallets-api/TopUpRedirectResponse#TopUpSuccess`) }, "abandoned": { object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/Empty) }, "errorResponse": { object (`https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/CompleteRedirectErrorResponse`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `redirectRequestId` | `string` **REQUIRED**: Unique identifier of the initiating redirect request. This is a string that has a max length of 100 characters, and contains only the characters "a-z", "A-Z", "0-9", ":", "-", and "_". |
| **REQUIRED**: The result of the top-up redirect. 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/e-wallets-v1/google-e-wallets-api/TopUpRedirectResponse#TopUpSuccess`)`` Indicates the redirect completed successfully and the user added at least some amount of money to their balance. |
| `abandoned` | `object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/Empty)` Indicates the user abandoned the top-up flow without adding any funds. |
| `errorResponse` | ``object (`https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/CompleteRedirectErrorResponse`)`` Details if the redirect failed because of an error. |
| End of mutually exclusive fields. ||

## TopUpSuccess

Details about a successful top-up.

| JSON representation |
|---|
| ``` { "currentBalance": { object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/Amount) } } ``` |

| Fields ||
|---|---|
| `currentBalance` | `object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/Amount)` **OPTIONAL**: The user's new current balance after topping up. Providing this value allows Google to determine whether the user can proceed with the current purchase or if another top-up is necessary. |