# Record paywall view

> Adapty can help you measure the conversion of your paywalls. However, to do so, 
> it is required for you to log when a paywall gets shown — without that we'd only 
> know about the users who made a purchase and we'd miss those who did not. 
> Use this request to log a paywall view.

## OpenAPI

```yaml
/api-specs/web-api.yaml post /api/v2/web-api/paywall/visit/
openapi: 3.1.0
info:
  title: Adapty Web API
  version: 1.0.0
  description: |
    The Adapty Web API allows you to integrate Adapty's subscription management platform 
    into your web applications. This API provides endpoints for retrieving paywalls, 
    recording paywall views, and adding attribution data.
servers:
  - url: https://api.adapty.io
    description: Production server
security:
  - apikeyAuth: []
paths:
  /api/v2/web-api/paywall/visit/:
    post:
      summary: Record paywall view
      description: |
        Adapty can help you measure the conversion of your paywalls. However, to do so, 
        it is required for you to log when a paywall gets shown — without that we'd only 
        know about the users who made a purchase and we'd miss those who did not. 
        Use this request to log a paywall view.
      operationId: recordPaywallView
      security:
        - apikeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RecordPaywallViewRequest"
            examples:
              basic:
                summary: Basic paywall view recording
                value:
                  visited_at: "2024-08-24T14:15:22Z"
                  store: app_store
                  variation_id: 00000000-0000-0000-0000-000000000000
                  customer_user_id: user123
      responses:
        "201":
          description: The paywall view is recorded successfully.
          content:
            application/json:
              schema:
                type: object
                description: Empty response body
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvalidDateFormatError"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UnauthorizedError"
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProfileNotFoundError"
components:
  schemas:
    RecordPaywallViewRequest:
      type: object
      required:
        - store
        - variation_id
      properties:
        customer_user_id:
          type: string
          description: An identifier of a user in your system. Either `customer_user_id` or `profile_id` is required.
          example: user123
        profile_id:
          type: string
          description: An identifier of a user in Adapty. Either `customer_user_id` or `profile_id` is required.
          example: 3286abd3-48b0-4e9c-a5f6-ac0a006804a6
        visited_at:
          type: string
          format: date-time
          description: The datetime when the user opened the paywall.
          example: "2024-08-24T14:15:22Z"
        store:
          type: string
          description: |
            Store where the product was bought. Possible values: `app_store`, `play_store`, `stripe`, or the `Store ID` of your custom store.
          example: app_store
        variation_id:
          type: string
          format: uuid
          description: The variation ID used to trace purchases to the specific paywall they were made from.
          example: 00000000-0000-0000-0000-000000000000
    InvalidDateFormatError:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              errors:
                type: array
                items:
                  type: string
        error_code:
          type: string
        status_code:
          type: integer
    UnauthorizedError:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              errors:
                type: array
                items:
                  type: string
        error_code:
          type: string
        status_code:
          type: integer
    ProfileNotFoundError:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              errors:
                type: array
                items:
                  type: string
        error_code:
          type: string
        status_code:
          type: integer
  securitySchemes:
    apikeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: |
        API requests must be authenticated by your public API key as the **Authorization** 
        header with the value `Api-Key {your_public_api_key}`, for example, 
        `Api-Key public_live_...`. Find this key in the Adapty Dashboard -> 
        **App Settings** -> **General** tab -> **API keys** section.
```
