openapi: 3.1.0
info:
  title: "NEAR Protocol RPC: Get receipt by ID"
  description: Fetch a single receipt by Base58 ID — the cross-shard execution unit a transaction produces.
  version: 1.0.0
servers:
  - url: https://rpc.mainnet.fastnear.com
    description: Mainnet
  - url: https://rpc.testnet.fastnear.com
    description: Testnet
  - url: https://archival-rpc.mainnet.fastnear.com
    description: Mainnet Archival
  - url: https://archival-rpc.testnet.fastnear.com
    description: Testnet Archival
paths:
  /:
    post:
      operationId: EXPERIMENTAL_receipt
      summary: Get receipt by ID
      description: Fetch a single receipt by Base58 ID — the cross-shard execution unit a transaction produces.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - "2.0"
                id:
                  type: string
                  example: fastnear
                method:
                  type: string
                  enum:
                    - EXPERIMENTAL_receipt
                params:
                  type: object
                  properties:
                    receipt_id:
                      type: string
                      description: Base58-encoded hash
                  required:
                    - receipt_id
            examples:
              mainnet:
                summary: Get receipt by ID (Mainnet)
                value:
                  jsonrpc: "2.0"
                  id: fastnear
                  method: EXPERIMENTAL_receipt
                  params:
                    receipt_id: ETMK9HmPsAYcNxfSXBejMWQs57W4Ph5HDYoYhDMpotQn
              testnet:
                summary: Get receipt by ID (Testnet)
                value:
                  jsonrpc: "2.0"
                  id: fastnear
                  method: EXPERIMENTAL_receipt
                  params:
                    receipt_id: 9uJmhNCLRgsFncH3anffPLE1YsZCPTyAZrBdekc3vTaZ
      responses:
        "200":
          description: Successful response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/JsonRpcResponse"
        "403":
          description: The supplied API key was not recognized.
          content:
            text/plain:
              schema:
                type: string
              example: Invalid API key
security:
  - {}
  - BearerAuth: []
  - ApiKeyAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: "FastNEAR API key as an `Authorization: Bearer` header. Preferred for backends, workers, and proxies because it keeps the key out of URLs and logs."
    ApiKeyAuth:
      type: apiKey
      in: query
      name: apiKey
      description: FastNEAR API key as the `apiKey` query parameter. Handy for curl or clients that cannot set headers, but the key can end up in URLs, logs, and shell history.
  schemas:
    JsonRpcResponse:
      type: object
      required:
        - jsonrpc
        - id
      properties:
        jsonrpc:
          type: string
          enum:
            - "2.0"
        id:
          oneOf:
            - type: string
            - type: number
        result:
          type: object
          properties:
            predecessor_id:
              type: string
              description: NEAR account ID
            priority:
              type: integer
              description: Deprecated, retained for backward compatibility.
              format: uint64
              default: 0
              minimum: 0
            receipt:
              type: object
              description: One of multiple possible types
            receipt_id:
              type: string
              description: Base58-encoded hash
            receiver_id:
              type: string
              description: NEAR account ID
          required:
            - predecessor_id
            - receiver_id
            - receipt_id
            - receipt
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            data:
              type: object
