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

# Record an outbound shop click

> Logs a click for a consumer offer — a lead_gen click returns a redirectUrl (the provider URL with Offergrid attribution merged on); a checkout-mode click is fire-and-forget funnel logging with no redirect. Unauthenticated, lightly rate-limited per IP.



## OpenAPI

````yaml /openapi/openapi-public.json post /public/shop/clicks
openapi: 3.0.0
info:
  title: OfferGrid API
  description: >-
    **Public API** - Unauthenticated endpoints with no API key required.


    These power two public, no-login surfaces:

    - **Shareable links** (`/public/links/*`) - a reseller-branded landing page
    for a specific set of offers, used to collect an order from an end customer.

    - **Consumer shop** (`/public/shop/*`) - the offergrid.io/shop storefront,
    where consumers browse real offers by ZIP code and either check out directly
    or are redirected to a provider's own site.


    All endpoints here are rate-limited and validate/re-check coverage
    server-side; none require the `x-api-key` header used by the Provider and
    Reseller APIs.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.offergrid.io
    description: Production
security: []
tags:
  - name: public
    description: >-
      Public: Unauthenticated endpoints for shareable links and the /shop
      storefront
paths:
  /public/shop/clicks:
    post:
      tags:
        - public
      summary: Record an outbound shop click
      description: >-
        Logs a click for a consumer offer — a lead_gen click returns a
        redirectUrl (the provider URL with Offergrid attribution merged on); a
        checkout-mode click is fire-and-forget funnel logging with no redirect.
        Unauthenticated, lightly rate-limited per IP.
      operationId: PublicShopController_createClick
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateShopClickDto'
      responses:
        '201':
          description: Click recorded
        '404':
          description: Offer not found or not consumer-enabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Unexpected server error. Safe to retry idempotent requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateShopClickDto:
      type: object
      properties:
        offerId:
          type: string
          description: The offer this click is for
        zip:
          type: string
          example: '78701'
        city:
          type: string
          example: Austin
        state:
          type: string
          example: TX
        sessionId:
          type: string
          description: >-
            Anonymous client-generated UUID grouping clicks within one shopper
            session
          example: a1b2c3d4-shopper-session
        referrer:
          type: string
          example: https://www.google.com/
        utm:
          type: object
          example:
            utm_source: google
            utm_campaign: internet-austin
        contact:
          description: >-
            Optional contact capture before a lead_gen redirect — always
            skippable. When present, creates a provider lead (Customer +
            TeamCustomer).
          allOf:
            - $ref: '#/components/schemas/ShopClickContactDto'
        serviceAddress:
          description: >-
            Full service address, when the handoff was reached through the
            checkout wizard. Its city/state/zipCode fill in for any top-level
            zip/city/state left unset.
          allOf:
            - $ref: '#/components/schemas/ShopClickServiceAddressDto'
        enrollment:
          description: >-
            Optional electricity enrollment details collected before a lead_gen
            handoff — used to fill the offer's URL template (ESIID, start date,
            move vs switch) so the partner prefills its signup flow.
          allOf:
            - $ref: '#/components/schemas/ShopClickEnrollmentDto'
      required:
        - offerId
        - sessionId
      title: Create Shop Click
    ErrorResponse:
      type: object
      title: Error
      description: Standard error envelope returned by every 4xx and 5xx response.
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          description: HTTP status code, repeated in the body.
          example: 404
        message:
          type: string
          description: Human-readable explanation of what went wrong.
          example: Offer not found
        error:
          type: string
          description: Short, stable name for the status code.
          example: Not Found
    ShopClickContactDto:
      type: object
      properties:
        firstName:
          type: string
          example: Jane
        lastName:
          type: string
          example: Doe
        fullName:
          type: string
          example: Jane Doe
          description: >-
            Legacy single-field name — prefer firstName + lastName. Required
            only when both are absent; split on the last space when used.
        email:
          type: string
          example: jane@example.com
        phone:
          type: string
          example: 555-123-4567
      required:
        - email
      title: Shop Click Contact
    ShopClickServiceAddressDto:
      type: object
      properties:
        street:
          type: string
          example: 123 Main Street
        unit:
          type: string
          example: Apt 4B
        city:
          type: string
          example: Austin
        state:
          type: string
          example: TX
        zipCode:
          type: string
          example: '78701'
      required:
        - street
      title: Shop Click Service Address
    ShopClickEnrollmentDto:
      type: object
      properties:
        enrollmentType:
          type: string
          example: move_in
          description: switch (existing meter stays on) or move_in (new occupancy)
        esid:
          type: string
          example: '10443720005941666'
        requestedStartDate:
          type: string
          example: '2026-09-01'
      title: Shop Click Enrollment

````