> ## Documentation Index
> Fetch the complete documentation index at: https://walletconnect-pay-docs-tomiir-buyer-checkout-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch an action

> Resolve build actions into executable wallet RPC actions.



## OpenAPI

````yaml POST /v1/gateway/payment/{id}/fetch
openapi: 3.0.3
info:
  title: WalletConnect Pay API (Gateway)
  description: >-
    Gateway API for wallets to fulfill WalletConnect Pay payments (API-first /
    non-SDK flow).
  version: 0.0.0
servers:
  - url: https://api.pay.walletconnect.com
security:
  - API Key: []
paths:
  /v1/gateway/payment/{id}/fetch:
    post:
      tags:
        - Gateway
      summary: Fetch an action
      description: This endpoint fetches an action for a payment.
      operationId: fetch_handler
      parameters:
        - name: Api-Key
          in: header
          required: true
          schema:
            type: string
        - name: App-Id
          in: header
          required: false
          schema:
            type: string
        - name: id
          in: path
          description: Payment ID
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FetchRequest'
            example:
              data: ...
              optionId: opt_123
      responses:
        '200':
          description: Action built successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FetchResponse'
              example:
                actions:
                  - data:
                      chain_id: eip155:8453
                      method: eth_signTypedData_v4
                      params:
                        - '0x0000000000000000000000000000000000000000'
                        - >-
                          {"domain":{"name":"USD
                          Coin","version":"2","chainId":"0x2105","verifyingContract":"0x0000000000000000000000000000000000000000"},"types":{"EIP712Domain":[{"type":"string","name":"name"},{"type":"string","name":"version"},{"type":"uint256","name":"chainId"},{"type":"address","name":"verifyingContract"}],"TransferWithAuthorization":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"value"},{"type":"uint256","name":"validAfter"},{"type":"uint256","name":"validBefore"},{"type":"bytes32","name":"nonce"}]},"primaryType":"TransferWithAuthorization","message":{"from":"0x0000000000000000000000000000000000000000","nonce":"0x0000000000000000000000000000000000000000000000000000000000000000","to":"0x0000000000000000000000000000000000000000","validAfter":"0x0","validBefore":"0x0","value":"0x0"}}
                    type: walletRpc
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Payment not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    FetchRequest:
      type: object
      required:
        - optionId
        - data
      properties:
        data:
          type: string
          description: Extra data to be passed
        optionId:
          type: string
          description: ID of the option to build an action for
    FetchResponse:
      type: object
      required:
        - actions
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/Action'
    ErrorResponse:
      type: object
      description: Standard error response structure for API errors.
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
    Action:
      oneOf:
        - type: object
          description: An action that requires a wallet RPC call to complete
          required:
            - data
            - type
          properties:
            data:
              $ref: '#/components/schemas/WalletRpcAction'
              description: An action that requires a wallet RPC call to complete
            type:
              type: string
              enum:
                - walletRpc
        - type: object
          description: An action that requires building to complete
          required:
            - data
            - type
          properties:
            data:
              $ref: '#/components/schemas/Build'
              description: An action that requires building to complete
            type:
              type: string
              enum:
                - build
    ErrorCode:
      type: string
      description: Standard error codes for API responses.
      enum:
        - rate_limited
        - invalid_params
        - params_validation
        - payment_not_found
        - internal_error
        - invalid_api_key
        - unauthorized
        - forbidden
        - invalid_state
        - missing_api_key
        - missing_merchant_api_key
        - missing_merchant_id
        - header_not_ascii
        - not_sandbox_api_key
        - merchant_not_found
        - merchant_exists
        - api_key_not_found
    WalletRpcAction:
      type: object
      required:
        - chain_id
        - method
        - params
      properties:
        chain_id:
          type: string
        method:
          type: string
        params:
          type: array
          items: {}
    Build:
      type: object
      required:
        - data
      properties:
        data:
          type: string
  securitySchemes:
    API Key:
      type: apiKey
      in: header
      name: Api-Key

````