TopUpRedirectResponse
Stay organized with collections
Save and categorize content based on your preferences.
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,
// Union field redirectResult can be only one of the following:
"success": {
object (TopUpSuccess )
},
"abandoned": {
object (Empty)
},
"errorResponse": {
object (CompleteRedirectErrorResponse )
}
// End of list of possible types for union field redirectResult .
} |
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 "_".
|
Union field redirectResult . REQUIRED: The result of the top-up redirect. redirectResult can be only one of the following: |
success |
object (TopUpSuccess )
Indicates the redirect completed successfully and the user added at least some amount of money to their balance.
|
abandoned |
object (Empty)
Indicates the user abandoned the top-up flow without adding any funds.
|
errorResponse |
object (CompleteRedirectErrorResponse )
Details if the redirect failed because of an error.
|
TopUpSuccess
Details about a successful top-up.
JSON representation |
{
"currentBalance": {
object (Amount)
}
} |
Fields |
currentBalance |
object (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.
|
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-29 UTC."],[[["\u003cp\u003e\u003ccode\u003eTopUpRedirectResponse\u003c/code\u003e is the response object for the Top-Up Redirect flow and is encrypted and signed using PGP or JWE+JWS.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes a \u003ccode\u003eredirectRequestId\u003c/code\u003e and a \u003ccode\u003eredirectResult\u003c/code\u003e indicating success, abandonment, or error.\u003c/p\u003e\n"],["\u003cp\u003eOn success, the response may optionally include the user's \u003ccode\u003ecurrentBalance\u003c/code\u003e after the top-up.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTopUpRedirectResponse\u003c/code\u003e is base64 URL encoded after encryption and signing for secure transmission.\u003c/p\u003e\n"]]],["The core content details the `TopUpRedirectResponse` object, which handles the result of a top-up action. This response, encrypted and encoded with `Base64UrlEncode`, includes a `redirectRequestId` and one of three possible outcomes within the `redirectResult`: `success` (with a `currentBalance`), `abandoned` or `errorResponse`. The `TopUpSuccess` object provides details about successful top-ups, including the user's new `currentBalance`. The response data is structured in JSON format, and the object types are strictly defined.\n"],null,["# TopUpRedirectResponse\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [TopUpSuccess](#TopUpSuccess)\n - [JSON representation](#TopUpSuccess.SCHEMA_REPRESENTATION)\n\nResponse object for the Top-Up Redirect flow.\n\nHere's an example of a clear text JSON request: \n\n\n {\n \"redirectRequestId\": \"cmVxdWVzdDE\",\n \"success\": {\n \"currentBalance\": {\n \"amountMicros\": \"51000000\",\n \"currencyCode\": \"USD\"\n }\n }\n }\n\nThe `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: \n\n Base64UrlEncode(\n PGPSignAndEncrypt(\n {\n \"redirectRequestId\": \"cmVxdWVzdDE\",\n \"success\": {\n \"currentBalance\": {\n \"amountMicros\": \"51000000\",\n \"currencyCode\": \"USD\"\n }\n }\n }\n )\n )\n\nor \n\n Base64UrlEncode(\n JWSignAndEncrypt(\n {\n \"redirectRequestId\": \"cmVxdWVzdDE\",\n \"success\": {\n \"currentBalance\": {\n \"amountMicros\": \"51000000\",\n \"currencyCode\": \"USD\"\n }\n }\n }\n )\n )\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"redirectRequestId\": string, // Union field `redirectResult` can be only one of the following: \"success\": { object (/pay/e-wallets-v1/google-e-wallets-api/TopUpRedirectResponse#TopUpSuccess) }, \"abandoned\": { object (/pay/e-wallets-v1/payment-integrator-e-wallets-api/Empty) }, \"errorResponse\": { object (/pay/e-wallets-v1/google-e-wallets-api/CompleteRedirectErrorResponse) } // End of list of possible types for union field `redirectResult`. } ``` |\n\n| Fields ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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 \"_\". |\n| Union field `redirectResult`. **REQUIRED** : The result of the top-up redirect. `redirectResult` can be only one of the following: ||\n| `success` | `object (`[TopUpSuccess](/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. |\n| `abandoned` | `object (`[Empty](/pay/e-wallets-v1/payment-integrator-e-wallets-api/Empty)`)` Indicates the user abandoned the top-up flow without adding any funds. |\n| `errorResponse` | `object (`[CompleteRedirectErrorResponse](/pay/e-wallets-v1/google-e-wallets-api/CompleteRedirectErrorResponse)`)` Details if the redirect failed because of an error. |\n\nTopUpSuccess\n------------\n\nDetails about a successful top-up.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------|\n| ``` { \"currentBalance\": { object (/pay/e-wallets-v1/payment-integrator-e-wallets-api/Amount) } } ``` |\n\n| Fields ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `currentBalance` | `object (`[Amount](/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. |"]]