API Documentation
English
English
  • Authorization
  • Request signing
  • List of error codes
  • Webhooks
  • IFrame order
  • Payment acceptance widget
  • Telegram MiniApp
  • API Reference
    • Base actions
      • Check x-api-signature
      • Fetch available currencies
      • Current price request
      • Search for operations by TX hash
      • Check address format
      • Get transaction history
    • Advanced account
      • Get advanced balances of user
      • Get advanced balance by id
      • Get payment address for advanced balance top-up
    • Blockchain addresses
      • Search by id
      • Transactions tracking
      • Search by address
      • Meta-data
      • Address Transactions
      • Last transaction of the address
      • Getting a list of PayIn addresses
      • Getting a list of business addresses
      • Get recurrent addresses
      • Getting a list of PayOut addresses
      • Creating a new business wallet address
      • Creating a new PayOut wallet address
    • Personal addresses
      • User creation
      • Getting an address
      • Getting a list of addresses
      • Get user
      • Adding a trusted address
      • Getting a list of trusted addresses
      • Deleting a trusted address
    • Orders
      • Creating an order
      • Getting information about an order
      • Getting a list of orders
    • Withdraws
      • Getting a commission for making a withdrawal
      • Sync withdraw
      • Async withdrawal
      • Receiving withdrawal information
    • Invoices
      • Create an invoice for payment
      • Invoice information request
      • Getting a list of invoices
    • Auto swaps
      • Create auto-swap
      • Find auto-swap by ID
    • Withdrawals 2.0
      • Create auto-withdrawal
      • Find auto-withdrawal by ID
      • Additional confirmation of the withdrawal
    • Bridge
      • Getting limits for cross-chain transfer
      • Getting information about cross-chain transfer
      • Commission token formation
      • Creating a cross-chain translation
    • Swaps
      • Getting limits for cross-chain exchange
      • Getting information about cross-chain exchange
      • Commission token formation
      • Creation of a cross-chain exchange
    • Recurring payments
      • Creating a payment link
      • Get a payment link
      • Get payment links by user
      • Disabling the payment link
      • Create a subscription
      • Getting a subscription
      • Cancel Subscription
      • Creating a payment
    • KYT
      • Check transaction risks
      • Check withdrawal risks
      • Check withdrawal risks for provided address
    • Partners API
      • Create user
      • Get user
      • Get all users
      • Creating an organization
      • Getting a list of organizations
      • Getting the user's advance balances
      • Replenishment of the user's advance balance
      • Get general tariffs
      • Create/update individual tariff
      • Get individual tariffs
      • Create API key
      • Get API keys
      • Delete API key
    • Webhooks
      • Get webhook
      • Get webhook (extended)
    • Orphan transactions
      • Get a transaction
      • Get a list of transactions
      • Get a commission token
      • Withdrawal
    • Address book
      • Add an address
      • Delete an address
      • Update the address
      • Get a list of addresses
Powered by GitBook
On this page
  1. API Reference
  2. Base actions

Search for operations by TX hash

The method allows you to find an operation in the system by the address of the transaction in the blockchain

The response will indicate the type of operation, the direction of the transaction, the address that was used for the operation and the body of the operation in the record from the type

Available types of operations:

Type
Description

ORDER

The transaction address was found in the incoming transactions of the order

INVOICE

The transaction address was found in the incoming transactions of the order created for the execution of the account

ORPHAN_TRANSACTION

The transaction address was in the incoming transaction address created for a different coin or network

WITHDRAWAL

Transaction address was found among output operations

DEPOSIT

The transaction address was found in the incoming transaction address as "free replenishment"

PERSONAL_DEPOSIT

The transaction address was found in incoming transactions at the system address "personal user addresses"

Available transaction directions:

Direction
Description

IN

Incoming transaction

OUT

Outgoing transaction

Address body example:

{
   "id": "cf95ea41-20c5-4528-b689-c21f4da6359f", // address identifier
   "type": "PAY_IN" // address type: PAY_IN, PERSONAL, PAY_OUT, BUSINESS, RECURRENT
}

There can be multiple entries in the result body, so the result is represented as an array:

Response body example:

{
   "success": true,
   "response": [
     {
       "type": "OUT",
       "source": "WITHDRAWAL",
       "address": {
         ... // address body
       },
       "result": {
         ... // body for WITHDRAWAL
       }
     },
     {
       "type": "IN",
       "source": "DEPOSIT",
       "address": {
         ... // address body
       },
       "result": {
         ... // body for DEPOSIT
       }
     }
   ]
}

An example of the body of the PERSONAL_DEPOSIT operation:

{ // body is identical to the body sent in the webhook
   "id": "2fa68ddf-2479-47cb-9e66-ae91139c3063", // personal deposit identifier
   "addressId": "dcb1a9fe-4b8d-40f6-baf6-241dc88436d9", // recipient address identifier
   "userId": "6196a1f2-b6b5-40a5-a672-f1ffd70fdd7d", // user ID in the system for which the address was created
   "amount": "0.005", // deposit amount
   "currency": "USDT", // deposit coin
  "addressFrom": ["0x....", "0x...."],                  // array of senders
  "addressTo": "0x....",                                // recipient address
   "network": "bsc", // deposit networks
   "status": "PROCESSED", // status, available values: PROCESSED
   "tx": "0x5b9b3b55b366266025e...", // blockchain transaction address
   "createdAt": "2023-03-02T06:58:00.365Z",
   "updatedAt": "2023-03-02T07:01:50.693Z"
}

An example of a DEPOSIT operation body:

{ // body is identical to the body sent in the webhook
   "id": "2fa68ddf-2479-47cb-9e66-ae91139c3063", // record ID
   "status": "processed", // status, available values: processed, error, rejected, pending
   "addressType": "BUSINESS", // address type: PAY_IN, PERSONAL, PAY_OUT, BUSINESS, RECURRENT
   "addressFrom": "0x5b9b3b55b366266025e...", // sender address in blockchain
   "addressTo": "0x3f4e3d79a244189e25e...", // address of the recipient in the blockchain
   "type": "deposit", // operation type: withdrawal, deposit
   "amount": "0.005", // deposit amount
   "currency": "USDT", // deposit coin
   "network": "bsc", // deposit networks
   "txId": "0x5b9b3b55b366266025e...", // blockchain transaction address
   "alias": "My address", // address name specified when creating
   "comment": null, // operation comment
   "createdAt": "2023-03-02T06:58:00.365Z",
   "updatedAt": "2023-03-02T07:01:50.693Z"
}

An example of a WITHDRAWAL operation body:

{ // response body is identical to the response body when receiving output data
   "id": "2a2d464b-231a-baf3-6f8a-7b9dc0f8cef7", // output identifier in the system
   "advancedBalanceId": "017f444f-a6ce-487f-0f80-9777199a6ff5", // advance balance identifier
   "addressId": "5bcb11d2-cfe8-3a09-0c51-dd7be7243c5d", // sender address identifier
   "currency": "ETH", // sending coin
   "network": "ethereum", // sending network
   "tx": "0x00000000000000000000c8950e52aa3...", // blockchain transaction address
   "status": "processed", // output status: init, error, pending, processed, rejected
   "address": "0x000000000c8950e52aa315030efedc861da658e2", // address of the recipient in the blockchain
   "tag": null,
   "amount": "2.12345", // withdrawal amount
   "feeAmount": "0.005", // fee amount
   "createdAt": "2023-03-02T07:01:50.693Z"
}

An example of the body of the ORDER operation:

{ // response body is identical to the response body of the request for obtaining information about the order
   "id": "d01d03e2-15dc-b03a-b34e-46cad2345b92", // order id
   "advancedBalanceId": "c6e7d8dc-ce10-637d-147b-2dda3015b8a4", // advance balance id
   "currency": "ETH", // payment coin
   "network": "etehereum", // payment network
   "link": "https://payment.domain/...", // payment link
   "status": "processed", // status: init, error, processed, pending, expired, partial
   "order": "#123456789",
   "description": "Order #123456789",
   "address": "0x000000000c8950e52aa315030efedc861da658e2", // address for receiving payment
   "addressId": "8eae79cf-1db2-4858-9023-aca473d805e2", // system address id
   "tag": null, // address tag
   "amount": "0.84", // payment amount
   "received": "0.86", // amount received
   "transactions": [
     {
       "id": "f0b22f11-007c-4f65-bb9b-265432ab64c3",
       "status": "processed",
       "currency": "BNB",
       "network": "bsc",
       "amount": "0.0001",
       "tx": "0x8fb0d40678d1bb4b6c0b2095c18d9280aa8ccf966e778e6b209f4f71c7f1e835",
       "confirmations": "15",
       "sender": "0xcD62a4E08513f16F86C1c0AF0860DD6b3De1B83d",
       "priceUSD": "212.90000000",
       "amountUSD": "0.02129"
     },
     {
       "id": "a2a7ed3b-a8af-42c4-900c-d21e1d9eda3c",
       "status": "processed",
       "currency": "BNB",
       "network": "bsc",
       "amount": "0.0006",
       "tx": "0x60032c394fcc7a103bc2826f9b81e5086be90628331e1ce163e1c576c64baf06",
       "confirmations": "15",
       "sender": "0x54936CE809bBccC7f1378c7ec88F5504cE49605C",
       "priceUSD": "212.70000000",
       "amountUSD": "0.12762"
     }
   ],
   "orphanDeposits": [
     {
       "id": "7cd20ea9-0e2c-46c5-8e12-82b0485d5ba1",
       "organizationId": "1f07eb01-5fd8-4e05-89b5-bebcd1d1fc39",
       "orderId": "d01d03e2-15dc-b03a-b34e-46cad2345b92",
       "stage": "WITHDRAWAL",
       "status": "PROCESSED",
       "message": null,
       "currency": "BNB",
       "network": "bsc",
       "amount": "0.00000001",
       "canWithdrawal": true,
       "inTransaction": {
         "addressType": "PAY_IN",
         "addressId": "8519ba89-68d5-4914-9a0f-d99e77dc88ea",
         "address": "0x68f8a74b5fD0b687369536607214acfA3b1572Ff",
         "txId": "0x6751285829e38b1bb53d1df887dde750182f08e230b58a5a2d3e867ba7327362",
         "amount": "0.00000001",
         "status": "processed",
         "createdAt": "2023-05-30T14:10:27.276Z"
       },
       "outTransaction": {
         "withdrawalId": "4429ba89-68d5-4914-9a0f-d99e77dc88ea",
         "address": "0x68f8a74b5fD0b687369536607214acfA3b1572Ff",
         "txId": "0x5511285829e38b1bb53d1df887dde750182f08e230b58a5a2d3e867ba7327362",
         "amount": "0.00000001",
         "status": "processed",
         "createdAt": "2023-05-30T14:10:27.276Z"
       },
       "createdAt": "2023-05-30T14:10:27.283Z"
     }
   ],
   "successWebhook": "https://example.com/success-webhook-url",
   "errorWebhook": "https://example.com/error-webhook-url",
   "returnUrl": "null",
   "expiresAt": "2021-05-23T15:00:00Z",
   "createdAt": "2021-05-23T15:00:00Z",
   "updatedAt": "2021-05-23T15:00:00Z"
}

An example of the body of the INVOICE operation:

{ // response body is identical to the response body of the request for obtaining account data
   "id": "fe31e1f3-bd23-4c89-bced-7fecc60cbb34", // Account ID
   "advancedBalanceId": "1cabe6ba-52b8-42bf-88a4-b3c953c3fd36", // advance balance ID
   "orderId": "ae31e1f3-bd23-4c89-bced-7fecc60cbb31", //Order ID (before the INIT status will be null)
   "orderLink": "https://payment.domain/...", // order link (before INIT status will be null)
   "invoiceLink": "https://invoices.domain/...", // invoice link
   "status": "PENDING", // account status (CREATED - created, INIT - coin selected for payment, PENDING - user made a transaction, PROCESSED - paid, PARTIAL - partial payment, ERROR - error, EXPIRED - account has expired)
   "order": "Order #1234",
   "description": "Buy 1 Bitcoin",
   "currency": "USD",
   "amount": "3000",
   "receivedCurrency": "USDT", // selected coin for payment (before INIT status will be null)
   "receivedAmount": "123", // amount received
   "includeFee": true,
   "insurancePercent": "2",
   "slippagePercent": "3.5",
   "webhookURL": "https://my-shop.com/api/webhooks",
   "returnURL": "https://my-shop.com/",
   "currencies": [
     {
       "currency": "USDT",
       "networks": [
         {
           "name": "tron",
           "amount": "3030.123" // final amount payable for USDT on the tron network
         },
         {
           "name": "bsc",
           "amount": "3030.123"
         }
       ]
     }
   ],
   "expiresAt": "2022-12-16T08:36:38.130Z",
   "createdAt": "2022-12-16T07:36:38.130Z"
}

An example of the body of the ORPHAN_DEPOSIT operation:

{ // response body is identical to the response body of the request to receive deposit data
   "id": "7cd20ea9-0e2c-46c5-8e12-82b0485d5ba1",
   "organizationId": "1f07eb01-5fd8-4e05-89b5-bebcd1d1fc39",
   "orderId": "4db8ba00-20f8-4e3f-8292-301dd66618af",
   "stage": "WITHDRAWAL",
   "status": "PROCESSED",
   "message": null,
   "currency": "BNB",
   "network": "bsc",
   "amount": "0.00000001",
   "canWithdrawal": true,
   "inTransaction": {
     "addressType": "PAY_IN",
     "addressId": "8519ba89-68d5-4914-9a0f-d99e77dc88ea",
     "address": "0x68f8a74b5fD0b687369536607214acfA3b1572Ff",
     "txId": "0x6751285829e38b1bb53d1df887dde750182f08e230b58a5a2d3e867ba7327362",
     "amount": "0.00000001",
     "status": "processed",
     "createdAt": "2023-05-30T14:10:27.276Z"
   },
   "outTransaction": {
     "withdrawalId": "4429ba89-68d5-4914-9a0f-d99e77dc88ea",
     "address": "0x68f8a74b5fD0b687369536607214acfA3b1572Ff",
     "txId": "0x5511285829e38b1bb53d1df887dde750182f08e230b58a5a2d3e867ba7327362",
     "amount": "0.00000001",
     "status": "processed",
     "createdAt": "2023-05-30T14:10:27.276Z"
   },
   "createdAt": "2023-05-30T14:10:27.283Z"
}
PreviousCurrent price requestNextCheck address format

Last updated 1 year ago

Search for operations by TX hash

post
Header parameters
x-api-public-keystringOptional

Public API-key

x-api-signaturestringOptional

Signing the request body with a private API-key

Content-typestringOptional

Request content type

Example: application/json
Body

The body of the request to search for operations on the tx hash

txstringOptional

Transaction ID in the blockchain

Responses
200Success
application/json
post
POST /api-gateway/find-tx HTTP/1.1
Host: ocp.onchainpay.io
Content-Type: application/json
Accept: */*
Content-Length: 9

{
  "tx": ""
}
200Success
{
  "success": true,
  "response": [
    {
      "type": "IN",
      "source": "ORDER",
      "address": "",
      "result": {
        "id": "9c261884-0200-45c1-8c7a-f3b37a3f4942",
        "advancedBalanceId": "2db11a99-a1cb-44f1-ba3b-ee41d80f53be",
        "addressId": "e5b79674-72aa-46c5-9bc0-6c71176bbd61",
        "currency": "USDT",
        "network": "ethereum",
        "tx": "0xb502e6ba8745a99f3484d75c027c55cacc26d6342b3a129f97d802899435ef12",
        "status": "pending",
        "address": "0x00000005707bf50efa35a2db020ede9ac08ae226",
        "tag": null,
        "amount": "123.12",
        "feeCurrency": "0x00000005707Bf50EfA35a2db020eDe9Ac0780b9f",
        "feeSource": "advanced_balance",
        "feeAmount": "1.12",
        "createdAt": "2025-05-14T13:39:50.463Z"
      }
    }
  ]
}