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

# Update intent

> Updates a Payment Intent (e.g. to attach a fulfiller). The caller must supply the current `updatedAt` timestamp; stale writes return `409`.



## OpenAPI

````yaml PATCH /intents/{id}
openapi: 3.1.0
info:
  title: Crycket API
  description: >-
    Payment infrastructure API enabling peer-to-peer and merchant-to-consumer
    stablecoin payments on Solana, Base, and Tempo.
  version: 1.0.0
servers:
  - url: https://api.crycketpay.com/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /intents/{id}:
    patch:
      summary: Update a payment intent
      description: >-
        Updates a Payment Intent (e.g. to attach a fulfiller). The caller must
        supply the current `updatedAt` timestamp; stale writes return `409`.
      operationId: updateIntent
      parameters:
        - name: id
          in: path
          required: true
          description: The Payment Intent ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateIntentRequest'
      responses:
        '200':
          description: Updated Payment Intent
          content:
            application/json:
              schema:
                type: object
                properties:
                  intent:
                    $ref: '#/components/schemas/PaymentIntent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Intent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict — stale `updatedAt`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    UpdateIntentRequest:
      type: object
      required:
        - updatedAt
      properties:
        fulfiller:
          type: string
          description: Wallet address to attach as fulfiller
        updatedAt:
          type: string
          format: date-time
          description: Current `updatedAt` value for optimistic concurrency
    PaymentIntent:
      type: object
      required:
        - id
        - chain
        - token
        - amount
        - requestor
        - state
        - direction
        - reference
        - createdAt
        - updatedAt
        - expiresAt
        - livemode
      properties:
        id:
          type: string
          description: Unique identifier, prefixed with `pi_`
          example: pi_abc123def456ghij
        idempotencyKey:
          type: string
          description: Caller-supplied key, unique per account per 24h
        chain:
          type: string
          description: CAIP-2 chain identifier
          example: solana:5eykt4UsFv8P8NJdTREpY1vzqKq2Kvdp
        token:
          type: string
          description: Canonical symbol (e.g. `USDC`) or chain-specific address
          example: USDC
        tokenAddress:
          type: string
          description: Resolved chain-specific contract address
        amount:
          type: string
          description: Decimal string amount
          example: '10.50'
        amountBaseUnits:
          type: string
          description: Resolved to lamports/wei/TIP-20 units
        requestor:
          type: string
          description: Wallet address of the party requesting payment
        fulfiller:
          type:
            - string
            - 'null'
          description: Wallet address of the party fulfilling payment
        direction:
          type: string
          enum:
            - request
            - send
          description: >-
            `request` = requestor created, fulfiller pays. `send` = fulfiller
            created, pushes payment.
        state:
          $ref: '#/components/schemas/IntentState'
        retryRequired:
          type: boolean
          description: True if tx was dropped and fulfiller must re-sign
        pendingAtExpiry:
          type: boolean
          description: True if tx was in mempool when TTL expired
        reference:
          type: string
          description: 'Correlation reference. Solana: base58 pubkey. EVM: bytes32 hex.'
        txSignature:
          type:
            - string
            - 'null'
          description: Solana tx signature or EVM tx hash after submission
        detectedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the audio receipt was acknowledged
        ataRentLamports:
          type:
            - number
            - 'null'
          description: ATA rent cost in lamports (Solana only)
        ttlSeconds:
          type: number
          description: Time-to-live in seconds
          default: 86400
        expiresAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        confirmedAt:
          type:
            - string
            - 'null'
          format: date-time
        finalizedAt:
          type:
            - string
            - 'null'
          format: date-time
        metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
          description: Integrator key-value bag, max 20 keys
        refundedBy:
          type:
            - string
            - 'null'
          description: Intent ID of the refund intent, if any
        refundOf:
          type:
            - string
            - 'null'
          description: Intent ID this is a refund of, if any
        livemode:
          type: boolean
          description: Whether this intent was created with a live API key
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                Machine-readable error code in `resource.error_type` dot
                notation
              example: intent.already_fulfilled
            message:
              type: string
              description: Human-readable error message
            param:
              type:
                - string
                - 'null'
              description: Field name if this is a validation error
            details:
              type:
                - object
                - 'null'
              description: Additional context about the error
    IntentState:
      type: string
      enum:
        - created
        - pending
        - confirmed
        - finalized
        - failed
        - expired
        - cancelled
      description: Current state of the Payment Intent
  responses:
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key. Use `pk_live_*` for production or `pk_test_*` for test mode.

````