> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notte.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Managed Checkout Run Start

> Start a guest checkout on one of Notte's merchant functions, up to the store's payment choice. Nothing is paid
and no order is placed.

Answers 202 with the run's id at once; read the run with `GET /managed-checkout/runs/{run_id}`. Notte starts the
run's browser session under your key with the store's own session settings, runs the store's checkout function
on it and stops it afterwards. The session and the run are your workspace's: they are billed to it and count
against its limits.

An unknown `store` is a 404.



## OpenAPI

````yaml https://api.notte.cc/openapi.json post /managed-checkout/runs
openapi: 3.1.0
info:
  title: Notte API
  description: >-
    Notte API is a REST API that allows you to interact with Notte. It is used
    to create cloud browser sessions, scrape webpages, and run web ai agents to
    act on your behalf on the internet.
  version: 1.10.23
  x-logo:
    url: https://www.notte.cc/images/logo/logo-white.png
servers: []
security: []
tags:
  - name: agents
    description: Web AI agents (start, stop, status, replay, etc.)
  - name: sessions
    description: Session management (start, stop, status, etc.)
  - name: debug
    description: Session debugging tools (replay,logs, recording, etc.)
  - name: page
    description: Page operations withing a session (observe, step, scrape, etc.)
  - name: storage
    description: File storage interface (upload, download, list, etc.)
  - name: network
    description: Network requests/responses withing a session (intercept, etc.)
  - name: vaults
    description: >-
      Vault & Credentials management (create/delete vaults, create/delete
      credentials, etc.)
  - name: personas
    description: Persona management (create, delete, list emails, list sms, etc.)
  - name: scrape
    description: >-
      Webpage scraping (scrape, screenshot, etc.) with automatic session
      management.
  - name: health
    description: Health check endpoint.
  - name: usage
    description: Usage logs (usage, logs, etc.)
  - name: audit
    description: Audit trail of account and workspace changes.
  - name: functions
    description: Functions management (create, delete, list, etc.)
paths:
  /managed-checkout/runs:
    post:
      tags:
        - Managed checkout
      summary: Managed Checkout Run Start
      description: >-
        Start a guest checkout on one of Notte's merchant functions, up to the
        store's payment choice. Nothing is paid

        and no order is placed.


        Answers 202 with the run's id at once; read the run with `GET
        /managed-checkout/runs/{run_id}`. Notte starts the

        run's browser session under your key with the store's own session
        settings, runs the store's checkout function

        on it and stops it afterwards. The session and the run are your
        workspace's: they are billed to it and count

        against its limits.


        An unknown `store` is a 404.
      operationId: managed_checkout_run_start
      parameters:
        - name: x-notte-request-origin
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Notte-Request-Origin
        - name: x-notte-sdk-version
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Notte-Sdk-Version
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManagedCheckoutRunRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedCheckoutRunResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
      x-codeSamples:
        - lang: Python
          source: |-
            import os

            import httpx

            response = httpx.post(
                "https://api.notte.cc/managed-checkout/runs",
                headers={"Authorization": f"Bearer {os.environ['NOTTE_API_KEY']}"},
                # `product_url` (a product page of the store) and `buyer` are optional.
                json={"store": "gymshark-us"},
            ).raise_for_status()
            run_id = response.json()["run_id"]
            print(run_id)
          label: python
        - lang: TypeScript
          source: >-
            const response = await
            fetch("https://api.notte.cc/managed-checkout/runs", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.NOTTE_API_KEY}`,
                "Content-Type": "application/json",
              },
              // `product_url` (a product page of the store) and `buyer` are optional.
              body: JSON.stringify({ store: "gymshark-us" }),
            });

            const { run_id } = await response.json();

            console.log(run_id);
          label: node
        - lang: Curl
          source: |-
            curl -X POST "https://api.notte.cc/managed-checkout/runs" \
              -H "Authorization: Bearer $NOTTE_API_KEY" \
              -H "Content-Type: application/json" \
              --data '{
                "store": "gymshark-us"
              }'
          label: curl
components:
  schemas:
    ManagedCheckoutRunRequest:
      properties:
        store:
          type: string
          title: Store
          description: >-
            Required. The store, as its checkout function names it: "zara-uk",
            "gymshark-us".
        product_url:
          anyOf:
            - type: string
              maxLength: 2048
              minLength: 1
              pattern: ^https?://
            - type: 'null'
          title: Product Url
          description: >-
            Optional. An http(s) product page of the store. Without it the run
            buys the store's default product.
        buyer:
          anyOf:
            - $ref: '#/components/schemas/ManagedCheckoutBuyer'
            - type: 'null'
          description: >-
            Optional. The buyer typed into the checkout. Without it a synthetic
            buyer of the store's country.
      additionalProperties: false
      type: object
      required:
        - store
      title: ManagedCheckoutRunRequest
    ManagedCheckoutRunResponse:
      properties:
        run_id:
          type: string
          title: Run Id
          description: 'The run''s id: a function run of the store''s checkout function.'
        store:
          type: string
          title: Store
        status:
          type: string
          enum:
            - running
            - completed
            - failed
          title: Status
          description: >-
            `running`, then `completed` (see `result`) or `failed` (see
            `error`).
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
          description: The browser session the run used, once started.
        result:
          anyOf:
            - $ref: '#/components/schemas/ManagedCheckoutResult'
            - type: 'null'
          description: 'For a completed run: the checkout outcome.'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: 'For a failed run: why it failed.'
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - run_id
        - store
        - status
        - created_at
      title: ManagedCheckoutRunResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ManagedCheckoutBuyer:
      properties:
        first_name:
          type: string
          title: First Name
        last_name:
          type: string
          title: Last Name
        email:
          type: string
          title: Email
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
          description: National ("07700 900123") or international digits.
        address_line1:
          type: string
          title: Address Line1
          description: 'House number and street: "14 Oakfield Road".'
        house_number:
          anyOf:
            - type: string
            - type: 'null'
          title: House Number
        street:
          anyOf:
            - type: string
            - type: 'null'
          title: Street
        city:
          type: string
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: 'US: the state code, e.g. "CA" (required). Optional elsewhere.'
        postcode:
          type: string
          title: Postcode
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: ISO 3166-1 alpha-2 code of the store's country.
        id_document:
          anyOf:
            - type: string
            - type: 'null'
          title: Id Document
          description: >-
            National identity document number, for the few stores that ask for
            one.
      additionalProperties: false
      type: object
      required:
        - first_name
        - last_name
        - email
        - address_line1
        - city
        - postcode
      title: ManagedCheckoutBuyer
    ManagedCheckoutResult:
      properties:
        outcome:
          type: string
          title: Outcome
          description: >-
            `reached_payment` (the checkout showed its payment choice; nothing
            was paid), `out_of_stock`, `not_deliverable`, `blocked` (the store's
            bot protection refused the run), `buyer_rejected` (the store refused
            the given buyer) or `failed`.
        reached_payment:
          type: boolean
          title: Reached Payment
          description: Whether the checkout showed its payment choice.
        stage:
          anyOf:
            - type: string
            - type: 'null'
          title: Stage
          description: >-
            The furthest stage reached: `home`, `product`, `added_to_cart`,
            `cart`, `checkout` or `checkout_details`.
        product_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Url
          description: 'The product bought: yours, else null.'
        final_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Final Url
          description: The page the run ended on.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Why the checkout stopped short of payment, when it did.
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
          description: How long the checkout took.
      type: object
      required:
        - outcome
        - reached_payment
      title: ManagedCheckoutResult
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.