--- title: "Quick Start: Your First Checkout" slug: "quick-start-your-first-checkout" updated: 2026-07-09T05:13:35Z published: 2026-07-09T05:13:35Z canonical: "help.frisbii.com/quick-start-your-first-checkout" --- > ## 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. # Quick Start: Your First Checkout This guide walks you through the minimum steps to get a working Frisbii Media checkout on your page. It uses PHP for the server-side part and the Frisbii Media JavaScript SDK for the frontend. --- ## Prerequisites - A Frisbii Media **stage account** (use stage for all development and testing) - Your **Company ID** and **API Access Token** from the merchant backend under **Settings → Developer** - A configured **Offer** in the merchant backend with a known `plenigoOfferId` - [Guzzle](http://docs.guzzlephp.org/en/stable/overview.html#installation) installed in your PHP project (or any HTTP client) --- ## Step 1 – Create or retrieve the customer Every checkout requires a customer. If you manage users externally, create or retrieve the customer in Frisbii Media first. ```php $client = new GuzzleHttp\Client(['base_uri' => 'https://api.frisbii-media.com/api/v3.0/']); $user = [    'customerId' => "4711",               // your internal user ID    'email'      => "user@example.com",    'language'   => 'de', ]; $response = $client->request('POST', 'customers', [    'headers' => ['X-plenigo-token' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'],    'json'    => $user, ]); $customer = json_decode($response->getBody()->getContents()); ``` > [!NOTE] > This call is idempotent — if the customer already exists it is returned without being recreated. --- ## Step 2 – Prepare the purchase ```php $ip = $_SERVER['REMOTE_ADDR']; // use a proper IP detection in production $payload = [    'debugMode'         => true, // disable in production!    'customerIpAddress' => $ip,    'customerId'        => $customer->customerId,    'items'             => [        [            'plenigoOfferId' => 'O_YOUR_OFFER_ID',            'quantity'       => 1,        ],    ], ]; $response = json_decode($client->request('POST', '/checkout/preparePurchase', [    'headers' => ['X-plenigo-token' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'],    'json'    => $payload, ])->getBody()->getContents()); $purchaseId = $response->purchaseId; ``` --- ## Step 3 – Render the checkout on your page Add the following HTML where you want the checkout iframe to appear. Replace `{YourCompanyId}` with your actual Company ID. ```xml        Checkout        
            ``` > [!NOTE] > `orderId` **special values:** > > - `-1` — customer already owns this product > - `-2` — product cannot be purchased based on configured rules --- ## Step 4 – Verify access after purchase Once the customer has bought a product, check access on your server before displaying protected content. ```php try {    $response = json_decode($client->request('GET',        "accessRights/{$customer->customerId}/hasAccess?accessRightUniqueIds=YOUR_ACCESS_RIGHT_ID",        ['headers' => ['X-plenigo-token' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9']]    )->getBody()->getContents());    $hasAccess = $response->accessGranted; } catch (\GuzzleHttp\Exception\ClientException $e) {    // 404: customer not found in Frisbii Media — treat as no access    $hasAccess = false; } ``` ---