--- title: "Checkout Workflow Page" slug: "checkout-workflow-page" updated: 2026-07-09T05:17:31Z published: 2026-07-09T05:17:31Z canonical: "help.frisbii.com/checkout-workflow-page" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.frisbii.com/llms.txt > Use this file to discover all available pages before exploring further. # Checkout Workflow Page A checkout workflow page is a dedicated URL on your website that handles the complete checkout process — receiving the offer ID via query parameter, preparing the purchase server-side, and rendering the checkout iframe. This pattern keeps checkout logic in one place and makes it easy to link to a specific offer from any article paywall, email campaign, or marketing page. --- ## URL pattern ```plaintext https://www.example.com/checkout?offer=O_6E487EBURRY35FOD0J ``` The offer ID is passed as a query parameter. Your checkout page reads it, calls `preparePurchase`, and renders the checkout. --- ## Server-side: validate and prepare ```php // checkout.php $offerId = $_GET['offer'] ?? null; if (empty($offerId)) {    // No offer ID — redirect to your products overview    header('Location: /products/');    exit; } // Retrieve or create the customer // (See Customer Management or Sessions & Transfer Tokens, depending on your SSO setup) $customerId = $_SESSION['plenigo_customer_id'] ?? null; if (empty($customerId)) {    // Not logged in — redirect to login with returnTo    $returnTo = '/checkout?offer=' . urlencode($offerId);    header('Location: /login?returnTo=' . urlencode($returnTo));    exit; } // Detect IP if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {    $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else {    $ip = $_SERVER['REMOTE_ADDR']; } // Prepare the purchase $payload = [    'debugMode'         => false,    'customerIpAddress' => $ip,    'customerId'        => $customerId,    'items'             => [        ['plenigoOfferId' => $offerId, 'quantity' => 1],    ], ]; $response = json_decode($client->request('POST', '/checkout/preparePurchase', [    'headers' => ['X-plenigo-token' => eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9],    'json'    => $payload, ])->getBody()->getContents()); $purchaseId = $response->purchaseId; ``` --- ## Frontend: render the checkout iframe ```xml        Checkout    
        ``` --- ## Per-offer custom CSS If different offers need different checkout styling (e.g. a premium offer with a distinct look), pass a custom CSS URL that includes the offer ID: ```javascript new plenigo.Checkout("", {    elementId: "plenigoCheckout",    customCSS: "https://www.example.com/assets/checkout/.css" }).start(); ``` Each offer gets its own CSS file. If no per-offer file exists, fall back to a default. See [Custom CSS](/frisbii-media/docs/custom-css#cors-requirements) for CORS requirements. --- ## Linking to the checkout page from a paywall On any article page, the paywall "Subscribe" button simply links to the checkout page with the relevant offer ID: ```plaintext    Subscribe now ``` From email campaigns, you can link directly: ```plaintext https://www.example.com/checkout?offer=O_6E487EBURRY35FOD0J ``` --- ## Success page After a successful purchase, redirect to a dedicated success page. At minimum, re-check access and show a confirmation. If the offer grants access to a specific article, redirect there: ```php // /checkout/success/ $offerId = $_GET['offer'] ?? null; $orderId = $_GET['order'] ?? null; // Optionally: look up the order to find the article URL // For now, show a generic success message echo "Thank you! Your subscription is now active."; ``` ---