LogoLogo
WebsiteLoginStatus
API Reference
API Reference
  • Introduction
  • Introduction to GraphQL
    • What is GraphQL?
      • GraphQL Schema
      • Example Using GraphQL
    • Authentication
    • Queries
      • Example Query
    • Mutations
      • Example Mutation
    • Variables
    • Fields
  • Develop With inabit API
    • Getting Started
      • Authentication
      • inabit Postman Collection
    • Organizations
      • Organization Info
      • Organization ID
      • Organization Users
      • Organization Contacts
      • Organization Transactions
    • Wallets
      • Wallets Info
      • Create inabit Wallet
      • Edit Wallet Name
      • Generate Deposit Address
      • Fetch Deposit Address
      • Save Address to Whitelist
      • Archive / Unarchive Wallet
      • Disconnect Exchange Wallet
    • Contacts
      • Contact Info
      • Create New Contact
      • Update Contact
    • Transactions
      • Transaction Info
      • Create Transfer Request
      • Create Off Ramp Request
      • Create On Ramp Request
      • Create Exchange Swap
      • Create inabit Wallet Swap
      • Edit Transaction Note
    • Utilities
      • Fetch Financial Asset
      • Fetch Blockchains
  • Remote Approver App
    • Setup and Configuration
    • API Wallets Generation
    • Automate Signing Transactions
    • Webhooks
      • Notification Types
  • WHAT WE SUPPORT
    • Assets & Tokens
    • Blockchains
    • Exchanges
      • Binance
      • Kucoin
      • Kraken
  • Changelog
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Introduction to GraphQL
  2. Queries

Example Query

A breakdown of an example GraphQL query in inabit

GraphQL Query: Retrieve Transaction Details

In GraphQL, queries are used to fetch data from the server. This example demonstrates how to retrieve detailed information about a transaction.

Let's walk through a more complex query and put this information in context.

Operation Name:

The operation is named Transaction.

Query:

query Transaction($where: TransactionWhereUniqueInput!) {
  transaction: transaction(where: $where) {
    id
    transactionType
    createdAt
    createdBy {
      fullName
      firstName
      lastName
      id
      profileFile {
        id
      }
    }
    txId
    contactCryptoAccount {
      address
      name
      contact {
        name
      }
    }
    kyt
    wallet {
      id
      name
      externalId
      organization {
        id
      }
      organizationExchange {
        exchange {
          code
          id
        }
        id
      }
    }
    financialAsset {
      id
      code
      name
      precision
    }
    blockchain {
      id
      name
      code
      contractType
      networkScannerUrl
    }
    amount
    rateEUR
    rateUSD
    status {
      category
      status
      exchangeStatuses {
        status
      }
      transactionSubStatuses {
        subStatus
      }
    }
    fee
    note
    swapAssetTo {
      code
      precision
    }
    swapToAmount
    metaData {
      value
      transactionMetaDataField {
        id
        name
      }
    }
  }
}

Variables:

{
  "where": {
    "id": "clk10q8he002kk660o1ed8ud4"
  }
}

Explanation:

This query retrieves detailed information about a transaction identified by its unique ID ($where). Here's a breakdown of the fields being requested:

  • id: The unique identifier of the transaction.

  • transactionType: The type of the transaction.

  • createdAt: The timestamp indicating when the transaction was created.

  • createdBy: Information about the user who created the transaction, including their full name, first name, last name, user ID, and profile file ID.

  • txId: The transaction ID.

  • contactCryptoAccount: Details about the contact's crypto account, including the address, name, and contact's name.

  • kyt: KYT (Know Your Transaction) status.

  • wallet: Information about the wallet associated with the transaction, including its ID, name, external ID, associated organization ID, and exchange details.

  • financialAsset: Details about the financial asset involved in the transaction, such as its ID, code, name, and precision.

  • blockchain: Information about the blockchain associated with the transaction, including its ID, name, code, contract type, and network scanner URL.

  • amount: The amount involved in the transaction.

  • rateEUR and rateUSD: Exchange rates for EUR and USD.

  • status: The status of the transaction, including its category, status, exchange statuses, and transaction sub-statuses.

  • fee: The fee associated with the transaction.

  • note: Any additional notes or comments about the transaction.

  • swapAssetTo: Details about the asset swapped to, including its code and precision.

  • swapToAmount: The amount swapped to.

  • metaData: Additional metadata associated with the transaction, including its value and metadata field details.

Response:

Upon successful execution, the response contains detailed information about the requested transaction.

PreviousQueriesNextMutations

Was this helpful?