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

# 检查产品访问权

> 检查一位客户当前是否拥有某个产品的访问权。

请使用属于目标组织的 API 密钥进行认证。


## OpenAPI

````yaml api-reference/openapi.json GET /v1/entitlements/check
openapi: 3.0.3
info:
  description: >-
    Stable, organization-scoped read API for merchant backends. Generated from
    the Merchant API implementation.
  title: Anyway Merchant API
  contact: {}
  version: '1.0'
  x-source: anyway-backend-go
servers:
  - url: https://merchant-api-prod.anyway.sh
security: []
paths:
  /v1/entitlements/check:
    get:
      tags:
        - entitlements
      summary: Check entitlement
      description: >-
        Checks if a customer is entitled to a product. Accepts identification by
        email, wallet address, or customer_id. At least one identifier is
        required. If product_id is provided, returns a boolean check for that
        specific product. If omitted, returns a list of all entitled products.
      parameters:
        - description: Customer email address
          name: email
          in: query
          schema:
            type: string
        - description: Buyer wallet address (matches order.from_address)
          name: wallet
          in: query
          schema:
            type: string
        - description: Customer ID (CUS_xxx)
          name: customer_id
          in: query
          schema:
            type: string
        - description: Product ID (if omitted, returns all entitled products)
          name: product_id
          in: query
          schema:
            type: string
        - description: Refresh payment data for an email lookup
          name: refresh
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/response.ApiResponse-merchantapi_EntitlementCheckResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ApiResponse-any'
      security:
        - APIKeyAuth: []
components:
  schemas:
    response.ApiResponse-merchantapi_EntitlementCheckResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/merchantapi.EntitlementCheckResponse'
        error:
          $ref: '#/components/schemas/response.ErrorDetail'
        message:
          type: string
        success:
          type: boolean
    response.ApiResponse-any:
      type: object
      properties:
        data: {}
        error:
          $ref: '#/components/schemas/response.ErrorDetail'
        message:
          type: string
        success:
          type: boolean
    merchantapi.EntitlementCheckResponse:
      type: object
      properties:
        customerId:
          type: string
        email:
          type: string
        entitled:
          type: boolean
        productId:
          type: string
        productName:
          type: string
        products:
          type: array
          items:
            $ref: '#/components/schemas/merchantapi.EntitledProduct'
        type:
          type: string
        wallet:
          type: string
    response.ErrorDetail:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    merchantapi.EntitledProduct:
      type: object
      properties:
        productId:
          type: string
        productName:
          type: string
        type:
          type: string
  securitySchemes:
    APIKeyAuth:
      description: 'Merchant API key (format: ak_BASE64)'
      type: apiKey
      name: X-API-Key
      in: header

````