Get Payment Details

On this page, you can find information on how to instantly retrieve the details and information of a created payment.

Fetching the created payment

The following information must be sent correctly and mandatorily. If any information is incorrect or all fields are sent empty, the system will return an error. You can see the possible errors at the bottom of the page.

ValueTypeDescription

merchant_id

string

Your Merchant ID

merchant_key

string

Your Merchant Key

merchant_salt

string

Your Merchant Salt

merhcant_oid

string

Your payment Order ID

https://app.coinpays.io/api/get-payment?merchant_id=&merchant_key=&merchant_salt=&merchant_oid=

The response to the request is in JSON format:

ValueTypeDescription

payment_status

string

Payment status. Expected values: completed - not_started - pending

callback_status

string

Callback status: Expected values: comleted - null

created_at

string

Indicates when the payment was created

expired_at

string

Indicates when the payment will expire. Payments that are not completed after this period will be marked as expired. Payments must be made within this timeframe.

transaction[token]

string

Unique transaction token.

transaction[test_mode]

integer

Payment test mode status. 1 or 0

transaction[merchant_oid]

string

Unique merchant order ID

transaction[wallet][wallet_currency]

string

Crypto token for transaction

transaction[wallet][network]

string

Crypto token network for transaction

transaction[wallet][wallet_amount]

float

Transaction amount in cryptocurrency token amount

transaction[wallet][wallet_remaining_amount]

float

Total amount to be paid

transaction[wallet][wallet_address]

string

Cryptocurrency wallet to which the payment will be made

transaction[transfer][hash]

string

Unique id in coinpays

transaction[transfer][value]

float

Formatted transfer amount

transaction[transfer][remaining_amount]

float

Remaining amount to be paid after the transfer

transaction[transfer][created_at]

string

Created At

transaction[transfer][data][hash]

string

Transaction number on the cryptocurrency network. TXID

transaction[transfer][data][value]

string

Unformatted payment amount

transaction[transfer][data][formatted_value]

float

Formatted payment amount

transaction[transfer][data][timeStamp]

integer

Unix timestamp of when the payment was confirmed

transaction[transfer][data][from]

string

Wallet from which the payment was sent

transaction[transfer][data][to]

string

Wallet to which the payment was made

transaction[transfer][data][tokenSymbol]

string

Coin symbol of the payment. This symbol may be empty in some special cases, such as fee coins in certain crypto networks like ETH on ERC20 or TRX on TRC20.

transaction[transfer][data][]

string

Information on how many decimal places the cryptocurrency token has

transaction[transfer][data][confirmations]

integer

Information on how many validators have confirmed the payment. This may come as 0 in some networks, which does not mean the payment has not been made. Do not take this as proof of payment.

transaction[currency][symbol]

string

Indicates the currency in which the payment was created.

transaction[currency][payment_amount]

string

Indicates the unit amount in which the payment was created.

transaction[user_info][user_name]

string

Contains the customer name provided by the store.

transaction[user_info][user_address]

string

Contains the customer address provided by the store.

transaction[user_info][user_phone]

string

Contains the customer phone provided by the store.

transaction[user_info][user_ip]

string

Contains the customer ip provided by the store.

Example response for completed transaction:

{
  "status": "success",
  "data": {
    "payment_status": "completed",
    "callback_status": "completed",
    "transaction": {
      "token": "WmpqT2tCbzdMN3dzbW0yN0dTcTJxYUduV2JweWhBYVM4cU5aK0p6cXduUT0=",
      "test_mode": 0,
      "merchant_oid": "1719055151",
      "wallet": {
        "wallet_currency": "USDT",
        "network": "TRC-20",
        "wallet_amount": 1.00008627,
        "wallet_remaining_amount": 0,
        "wallet_address": "TFTzxg1PJg3J9v6wx3SaWE7XcZDCCxMbT7"
      },
      "transfers": [
        {
          "hash": "11ca8f76755d42d774d88e36d48fa17c52404bdb22cd5981b1cab5572223a52a",
          "value": 1.00009,
          "remaining_amount": 0,
          "data": {
            "hash": "11ca8f76755d42d774d88e36d48fa17c52404bdb22cd5981b1cab5572223a52a",
            "value": "1000090",
            "formatted_value": 1.00009,
            "timeStamp": 1719057702000,
            "from": "TCdfA1NntneWLPqzuKad14QRHevmumenhN",
            "to": "TFTzxg1PJg3J9v6wx3SaWE7XcZDCCxMbT7",
            "tokenSymbol": "USDT",
            "tokenDecimal": "6",
            "confirmations": 62804454
          },
          "created_at": "2024-06-22 15:05:03"
        }
      ],
      "currency": {
        "symbol": "USD",
        "payment_amount": "1"
      },
      "user_info": {
        "user_name": "test user",
        "user_address": "test user address",
        "user_phone": "014124124",
        "user_ip": "92.45.22.139"
      },
      "created_at": "2024-06-22 14:19:11",
      "expired_at": "2024-06-22 15:05:03"
    }
  }
}

Example response for pending transaction [new created]:

{
  "status": "success",
  "data": {
    "payment_status": "pending",
    "callback_status": null,
    "transaction": {
      "token": "MnZuRGdISVBLODBIaDE5bHVFRTRVODlMOHdCdEJVRnlpWHlpaGF3RTJlRT0=",
      "test_mode": 0,
      "merchant_oid": "1719248600",
      "wallet": {
        "wallet_currency": "USDT",
        "network": "SOL",
        "wallet_amount": 100.15132866,
        "wallet_remaining_amount": 100.15132866,
        "wallet_address": "Gu7hHbjtbxBvPddAKFosV5rzKBDKSb12VJuHd3WcK6eM"
      },
      "transfers": [
        
      ],
      "currency": {
        "symbol": "USD",
        "payment_amount": "100"
      },
      "user_info": {
        "user_name": "test user",
        "user_address": "test user address",
        "user_phone": "014124124",
        "user_ip": "92.45.22.139"
      },
      "created_at": "2024-06-24 20:03:21",
      "expired_at": "2024-06-24 21:03:32"
    }
  }
}

Example response for pending transaction [partial payment]:

{
  "status": "success",
  "data": {
    "payment_status": "pending",
    "callback_status": null,
    "transaction": {
      "token": "MnZuRGdISVBLODBIaDE5bHVFRTRVODlMOHdCdEJVRnlpWHlpaGF3RTJlRT0=",
      "test_mode": 0,
      "merchant_oid": "1719248600",
      "wallet": {
        "wallet_currency": "USDT",
        "network": "TRC-20",
        "wallet_amount": 100.000000,
        "wallet_remaining_amount": 97.000000,
        "wallet_address": "Gu7hHbjtbxBvPddAKFosV5rzKBDKSb12VJuHd3WcK6eM"
      },
      "transfers": [
        {
          "hash": "11ca8f76755d42d774d88e36d48fa17c52404bdb22cd5981b1cab5572223a52a",
          "value": 4.00000,
          "remaining_amount": 97.0000,
          "data": {
            "hash": "11ca8f76755d42d774d88e36d48fa17c52404bdb22cd5981b1cab5572223a52a",
            "value": "1000090",
            "formatted_value": 4.00000,
            "timeStamp": 1719057702000,
            "from": "TCdfA1NntneWLPqzuKad14QRHevmumenhN",
            "to": "TFTzxg1PJg3J9v6wx3SaWE7XcZDCCxMbT7",
            "tokenSymbol": "USDT",
            "tokenDecimal": "6",
            "confirmations": 62804454
          },
          "created_at": "2024-06-22 15:05:03"
        }
      ],
      "currency": {
        "symbol": "USD",
        "payment_amount": "100"
      },
      "user_info": {
        "user_name": "test user",
        "user_address": "test user address",
        "user_phone": "014124124",
        "user_ip": "92.45.22.139"
      },
      "created_at": "2024-06-24 20:03:21",
      "expired_at": "2024-06-24 21:03:32"
    }
  }
}

Errors

Error that will occur in case of missing data submission

{
  "status": "error",
  "errors": {
    "merchant_id": [
      "The merchant id field is required."
    ],
    "merchant_key": [
      "The merchant key field is required."
    ],
    "merchant_salt": [
      "The merchant salt field is required."
    ],
    "merchant_oid": [
      "The merchant oid field is required."
    ]
  }
}

Error that will occur when store information is incorrect

{
  "status": "error",
  "reason": "Merchant not found"
}

Error that occurs when the store order number is incorrect or does not exist

{
  "status": "error",
  "reason": "Transaction not found"
}

The error that will occur if the transaction status is "not_started". To access the details of the transaction, the transaction status must be "pending" or "completed".

{
  "status": "error",
  "reason": "Transaction not started. Please create a payment first."
}

Last updated