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

# Verify Payment

> Submit an on-chain transaction hash to verify x402 USDC payment on Base and receive a time-limited bearer access token for gated content.

<RequestExample>
  ```bash theme={null}
  curl -X POST https://xenarch.dev/v1/gates/7f3a1b2c.../verify \
    -H "Content-Type: application/json" \
    -d '{"tx_hash": "0xdef456...abc789"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "access_token": "eyJhbGciOiJIUzI1NiJ9...",
    "expires_at": "2026-04-10T15:05:00Z"
  }
  ```
</ResponseExample>

## Verification process

1. Fetches the transaction receipt from Base RPC
2. Confirms the transaction was sent to the splitter contract and succeeded
3. Parses the `Split` event logs
4. Verifies the collector matches the publisher's registered wallet
5. Verifies the amount meets or exceeds the gate price
6. Creates a `VerifiedPayment` record
7. Returns an HMAC-SHA256 access token

## Notes

* **Idempotent**: submitting the same `tx_hash` again returns the cached token
* **Replay-safe**: a `tx_hash` used for one gate cannot be reused for another
* Gate must be `pending` and not expired
* Access tokens expire after 30 minutes by default


## OpenAPI

````yaml POST /v1/gates/{gate_id}/verify
openapi: 3.1.0
info:
  title: Xenarch Platform
  version: 0.1.0
servers: []
security: []
paths:
  /v1/gates/{gate_id}/verify:
    post:
      tags:
        - gates
      summary: Verify Gate Payment
      description: Verify an on-chain payment for a gate and return an access token.
      operationId: verify_gate_payment_v1_gates__gate_id__verify_post
      parameters:
        - name: gate_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Gate Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GateVerifyRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GateVerifyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GateVerifyRequest:
      properties:
        tx_hash:
          type: string
          pattern: ^0x[0-9a-fA-F]{64}$
          title: Tx Hash
      type: object
      required:
        - tx_hash
      title: GateVerifyRequest
    GateVerifyResponse:
      properties:
        access_token:
          type: string
          title: Access Token
        expires_at:
          type: string
          format: date-time
          title: Expires At
      type: object
      required:
        - access_token
        - expires_at
      title: GateVerifyResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````