> For the complete documentation index, see [llms.txt](https://plexo.gitbook.io/rest-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://plexo.gitbook.io/rest-api/wallets/google-pay/google-pay-web.md).

# Plexo Checkout

Apple Pay and Google Pay availability comes from current Visa/Mastercard routing on every channel. See [ownership and payment-method eligibility](/rest-api/api-reference/wallet-integrations.md#wallet-ownership-and-availability) before following this guide. Use only eligible methods in `allowedCardNetworks` or `supportedNetworks`; examples listing both assume both are eligible. With `managedBy: "handy"`, Handy owns configuration and native provider setup; request changes through Handy. References to your provider credentials mean the resolved owner's credentials. Your team still validates its app/device, and the original Plexo merchant remains the recipient and Google `gatewayMerchantId`.

Use this flow when you want Plexo Hosted Checkout to render Google Pay inside the checkout experience.

In this model:

* You create a checkout session with Plexo
* You redirect the payer to the hosted checkout URL returned by Plexo
* Plexo renders the Google Pay button when the merchant has an active Google Pay integration
* You do not submit the Google Pay token to Plexo yourself

## When To Use This Flow

Choose Hosted Checkout when you want:

* Faster implementation with less client-side wallet logic
* Plexo to handle the hosted Google Pay experience
* A redirect checkout page instead of building your own wallet UI

## Prerequisites

1. [Request Google Pay activation](/rest-api/wallets/google-pay.md#request-google-pay-activation) for the `hosted` channel in Plexo Dashboard
2. Create checkout sessions with `POST /v1/sessions`
3. Redirect the payer to the checkout session URL returned by Plexo

## Step 1: Create a Checkout Session

Hosted Google Pay availability is based on the merchant's active wallet configuration.

At session level:

* Merchant wallet configuration is the source of truth
* `settings.checkout.walletIntegrations.googlePay.enabled = false` opts out of Google Pay for that session
* Plexo resolves the `hosted` channel for the validated checkout session
* `dynamicShipping = true` enables Google Pay shipping callbacks for the hosted flow

If you send a `googlePay` object and want Google Pay available for that session, set `enabled` to `true`.

**Endpoint:** `POST /v1/sessions`

```bash
curl -X POST "https://api.plexo.com.uy/v1/sessions" \
  -u "username:password" \
  -H "Content-Type: application/json" \
  -d '{
    "merchantId": 12345,
    "referenceId": "order-123",
    "type": "checkout",
    "paymentRequest": {
      "referenceId": "payment-order-123",
      "invoiceNumber": "INV-123",
      "amount": {
        "total": 100.00,
        "currency": "UYU"
      }
    },
    "settings": {
      "checkout": {
        "walletIntegrations": {
          "googlePay": {
            "enabled": true,
            "dynamicShipping": true
          }
        }
      },
      "redirects": {
        "defaultUrl": "https://example.com/success",
        "cancelUrl": "https://example.com/cancel"
      }
    }
  }'
```

### Example Response

```json
{
  "id": "ses_abc123",
  "referenceId": "order-123",
  "type": "checkout",
  "status": "pending",
  "actions": [
    {
      "rel": "self",
      "method": "REDIRECT",
      "href": "https://checkout.plexo.com.uy/1c4f6f2f9d834f69a1b2c3d4e5f6a7b8?t=..."
    }
  ],
  "settings": {
    "checkout": {
      "walletIntegrations": {
        "googlePay": {
          "enabled": true,
          "channels": [{ "channel": "hosted", "enabled": true, "approved": true, "ready": true, "available": true, "status": "active" }],
          "dynamicShipping": true
        }
      }
    }
  }
}
```

## Step 2: Open Plexo Hosted Checkout

Use the `REDIRECT` action returned by the session to open hosted checkout as a full-page flow or embed it directly in your top-level merchant page using the supported [checkout session integration](/rest-api/sessions/checkout-session.md). Both use the `hosted` channel.

Google Pay appears in hosted checkout only when:

* The merchant has an enabled, approved, ready `hosted` channel
* The session has not opted out of Google Pay
* The hosted page is opened through the active session URL returned by Plexo

## Optional: Dynamic Shipping

If you set `settings.checkout.walletIntegrations.googlePay.dynamicShipping = true`, the hosted flow can refresh the active session when the payer changes shipping details during the Google Pay flow.

Plexo handles the hosted Google Pay shipping callback internally inside the authenticated hosted web-session context. You do not call a separate public endpoint for this flow.

## CSP

If your frontend sets a restrictive Content Security Policy, allow navigation to the checkout host returned by Plexo.

**Example CSP Header:**

```http
Content-Security-Policy: default-src 'self'; form-action 'self' https://checkout.plexo.com.uy; navigate-to 'self' https://checkout.plexo.com.uy;
```

## Next Steps

* [Google Pay Integration Guide](/rest-api/wallets/google-pay.md)
* [API Integration](/rest-api/wallets/google-pay/google-pay-api.md)
* [Wallet Integrations API Reference](/rest-api/api-reference/wallet-integrations.md)
* [Payment Processing Guide](/rest-api/payments/payment-processing.md)
