- [HTTP request](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#body.request_body)
  - [JSON representation](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#body.response_body)
- [GenerateRedirectPaymentUrlResponse](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#GenerateRedirectPaymentUrlResponse)
  - [JSON representation](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#GenerateRedirectPaymentUrlResponse.SCHEMA_REPRESENTATION)
- [GenerateRedirectPaymentUrlResult](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#GenerateRedirectPaymentUrlResult)
  - [JSON representation](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#GenerateRedirectPaymentUrlResult.SCHEMA_REPRESENTATION)
- [SuccessDetails](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#SuccessDetails)
  - [JSON representation](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#SuccessDetails.SCHEMA_REPRESENTATION)
- [RedirectDetails](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#RedirectDetails)
  - [JSON representation](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#RedirectDetails.SCHEMA_REPRESENTATION)
- [GetRequest](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#GetRequest)
  - [JSON representation](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#GetRequest.SCHEMA_REPRESENTATION)
- [PostFormRequest](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#PostFormRequest)
  - [JSON representation](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#PostFormRequest.SCHEMA_REPRESENTATION)
- [BodyPair](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#BodyPair)
  - [JSON representation](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#BodyPair.SCHEMA_REPRESENTATION)
- [BodyEncoding](https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#BodyEncoding)

Provides basic information about this transaction to allow the integrator to create a redirect URL. The URL returned from a successful request will be sent to the user and the user's browser/device will be redirected to that URL.

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

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1
        },
        "requestId": "cmVxdWVzdDE",
        "requestTimestamp": {
          "epochMillis": "1481899949606"
        },
        "paymentIntegratorAccountId": "InvisiRedirectPaymentUSA_USD"
      },
      "transactionAmount": {
        "amountMicros": "109900000",
        "currencyCode": "INR"
      },
      "transactionDescription": "Play Movies",
      "formOfPayment": {
        "issuerId": {
          "value": "123ABC"
        }
      },
      "callbackUrl": "https://example.google.com/return/url/"
    }

An example response looks like:


    {
      "responseHeader": {
        "responseTimestamp": {
          "epochMillis": "1481899949611"
        }
      },
      "result": {
        "success": {
          "redirectDetails": {
            "getMethod": {
              "url": "https://example.com/target/redirect/url/"
            }
          }
        }
      }
    }

### HTTP request

`POST https://www.integratorhost.example.com/integrator-base-path/v1/payment-integrator-redirect/generateRedirectPaymentUrl`

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requestHeader": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/RequestHeader`) }, "transactionAmount": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Amount`) }, "transactionDescription": string, "formOfPayment": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/FormOfPayment`) }, "callbackUrl": string, "installmentPayment": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/InstallmentPayment`) } } ``` |

| Fields ||
|---|---|
| `requestHeader` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/RequestHeader`)`` **REQUIRED**: Common header for all requests. |
| `transactionAmount` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Amount`)`` **REQUIRED**: The amount of the transaction. |
| `transactionDescription` | `string` **REQUIRED**: A description of the transaction that can be shown to the user. |
| `formOfPayment` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/FormOfPayment`)`` **REQUIRED** : The form of payment that the user already selected for this payment. If the user made no choice or it does not apply, this will be set to `noneChosen`. In the `noneChosen` case, the user should be redirected to the integrator's website to allow the user to select a form of payment. |
| `callbackUrl` | `string` **REQUIRED**: The URL the user should be redirected to when the redirect payment is complete. The URL has a max length of 512 characters. |
| `installmentPayment` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/InstallmentPayment`)`` **OPTIONAL**: The installment payment details to be used for this payment. |

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

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

## GenerateRedirectPaymentUrlResponse

Response object for the `redirect-fop-v1.generateRedirectPaymentUrl` method.

| JSON representation |
|---|
| ``` { "responseHeader": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/ResponseHeader`) }, "result": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#GenerateRedirectPaymentUrlResult`) } } ``` |

| Fields ||
|---|---|
| `responseHeader` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/ResponseHeader`)`` **REQUIRED**: Common header for all responses. |
| `result` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#GenerateRedirectPaymentUrlResult`)`` **REQUIRED** : Result details of the `redirect-fop-v1.generateRedirectPaymentUrl` request. |

## GenerateRedirectPaymentUrlResult

Result details of the `redirect-fop-v1.generateRedirectPaymentUrl` request.

| JSON representation |
|---|
| ``` { // 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/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#SuccessDetails`) }, "invalidIssuerId": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "cardNotActivated": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "cardNumberInvalid": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "cardExpired": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "cardExpirationDateInvalid": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "cardIssuanceDateInvalid": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "cardHolderNameInvalid": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "restrictedCard": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "invalidCardDetails": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "insufficientFunds": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/InsufficientFunds`) }, "notSupportedByIssuer": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "networkTimeout": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`) }, "declinedByIssuer": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/DeclinedByIssuer`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| **REQUIRED**: The result of the generate request. The message specifies if this request was successful or rejected. 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/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#SuccessDetails`)`` The integrator successfully generated a redirect URL. Details about the results are within this message. |
| `invalidIssuerId` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` The `https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/FormOfPayment#FIELDS.issuer_id` in the request was not valid for this integrator. This should only be used in cases where this form of payment is not valid in the integrator's system. It should not be used to communicate outages or other minor issues with an otherwise valid form of payment. |
| `cardNotActivated` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` The card has not been activated. |
| `cardNumberInvalid` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` The card number is invalid. |
| `cardExpired` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` The card has expired. |
| `cardExpirationDateInvalid` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` The expiration date on the card was invalid. |
| `cardIssuanceDateInvalid` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` The issuance date on the card was invalid. |
| `cardHolderNameInvalid` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` The card holder name on the card was invalid. |
| `restrictedCard` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` The card is restricted from making this type of purchase. |
| `invalidCardDetails` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` This decline code should never be used in steady-state. It is meant as a temporary code to use when the integrator encounters a generic invalid card information decline code from the underlying issuer of the user's instrument. This result code can be used while the integrator determines a more appropriate result code to use or negotiates the addition of a new result code to this specification. Declined because the card details, while formatted correctly, were invalid. (e.g. The card holder name was invalid). |
| `insufficientFunds` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/InsufficientFunds`)`` This account does not have sufficient funds to guarantee this redirect payment. |
| `notSupportedByIssuer` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` The issuer can not support a redirect payment for this request. |
| `networkTimeout` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/Empty`)`` There was a network timeout while attempting to process the `formOfPayment` (eg: card). This request can be retried. |
| `declinedByIssuer` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/DeclinedByIssuer`)`` This decline code should never be used in steady-state. It is meant as a temporary catch-all code to use when the integrator encounters an unknown decline code from the underlying issuer of the user's instrument. This result code can be used while the integrator determines a more appropriate result code to use or negotiates the addition of a new result code to this specification. <br /> > [!NOTE] > **Note:** even after the integrator maps the unknown issuer decline code to an appropriate result code going forward, it is important that they still return `DECLINED_BY_ISSUER` idempotently for any capture request that was originally declined with a `DECLINED_BY_ISSUER` result. > <br /> |
| End of mutually exclusive fields. ||

## SuccessDetails

The integrator successfully generated a redirect URL. Details about the results are within this message.

| JSON representation |
|---|
| ``` { "redirectDetails": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#RedirectDetails`) } } ``` |

| Fields ||
|---|---|
| `redirectDetails` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#RedirectDetails`)`` **REQUIRED**: Details about the redirect parameters to pass on to the user's browser/device. |

## RedirectDetails

This contains the result of the `redirectUrl` request when it is supported.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "getMethod": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#GetRequest`) }, "postFormMethod": { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#PostFormRequest`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| **REQUIRED**: Specifies the type of redirect that will be used. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `getMethod` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#GetRequest`)`` The user's browser should be redirected using an HTTPS GET. |
| `postFormMethod` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#PostFormRequest`)`` The user's browser should be redirected using an HTTPS POST with content time `x-www-form-urlencoded`. |
| End of mutually exclusive fields. ||

## GetRequest

This contains details for redirecting the user's browser using an HTTPS GET.

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

| Fields ||
|---|---|
| `url` | `string` **REQUIRED**: The URL that the user's browser should be redirected to with a GET request. Should not exceed 2048 characters in length. |

## PostFormRequest

This contains details for redirecting the user's browser using an HTTPS POST.

| JSON representation |
|---|
| ``` { "url": string, "body": [ { object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#BodyPair`) } ], "bodyEncoding": enum (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#BodyEncoding`) } ``` |

| Fields ||
|---|---|
| `url` | `string` **REQUIRED**: The url the user will be redirected to. Should not exceed 2048 characters in length. |
| `body[]` | ``object (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#BodyPair`)`` **REQUIRED**: Data for the body of the POST for the redirect. This list represents the HTTPS POST body. For example: `[ "myParammy": "Val", "otherParam": "otherVal", "repeatedParam": "val1", "repeatedParam": "val2" ]` Would be formatted as this in the POST body: `myParam=myVal&otherParam=otherVal&repeatedParam=val1&repeatedParam= val2`. <br /> > [!NOTE] > **Note:** When redirecting the user's browser, the content type will be set to `x-www-form-urlencoded` <br /> |
| `bodyEncoding` | ``enum (`https://developers.google.com/pay/redirect-fop-v1/payment-integrator-redirect-fop-api/generateRedirectPaymentUrl#BodyEncoding`)`` **REQUIRED**: The character set used for the body. UTF-8 is recommended. |

## BodyPair

Data for the body of the POST for the redirect.

| JSON representation |
|---|
| ``` { "name": string, "value": string } ``` |

| Fields ||
|---|---|
| `name` | `string` **REQUIRED**: Name of the parameter. |
| `value` | `string` **REQUIRED**: Value of the parameter. |

## BodyEncoding

The character set used for the body. UTF-8 is recommended.

| Enums ||
|---|---|
| `BODY_ENCODING_UNSPECIFIED` | DO NOT USE |
| `BODY_ENCODING_ISO_8859_1` | ISO-8859-1 character set for the POST body |
| `BODY_ENCODING_UTF_8` | UTF-8 character set for the POST body |
| `BODY_ENCODING_US_ASCII` | US-ASCII character set for the POST body |