Skip to main content

GET - Get Invoice

Retrieve the current status and details of an invoice by trans_id. Returns payment status, amount, token/network information (if selected), and transaction details (if completed). Only returns invoices belonging to the Store associated with the API Key.

Endpoint

GET https://api.payerscan.com/invoice/:trans_id

Example: GET https://api.payerscan.com/invoice/TID-ABC123DEF4567890

Headers

HeaderRequiredDescription
x-api-keyYesStore's API Key

Response

Success (HTTP 200)

Base response (always included):

{
"status": "success",
"data": {
"trans_id": "TID-ABC123DEF4567890",
"request_id": "ORDER_123456",
"status": "waiting",
"amount": "100",
"name": "Top-up balance",
"description": "Top-up the balance for username: JohnDoe",
"created_at": 1738742400,
"expires_at": 1738746000
}
}

When the customer selects a token/network on the checkout page, data includes additional fields:

{
"token_symbol": "USDT",
"network_symbol": "BSC",
"token_amount": "100.0026",
"token_price": "1",
"to_address": "0xc221460115e2CfCa5bF089A7e647b11cb9631efE"
}

When status = "completed", data includes additional fields:

{
"transaction_hash": "0xd346b32b83b35376d42a2464598fbf565fffb39e...",
"from_address": "0x8894e0a0c962cb723c1976a4421c95949be2d4e3",
"fee_amount": "0.2",
"callback_status": "success"
}

Field Descriptions

FieldDescription
trans_idUnique invoice code.
request_idYour order ID (if provided when creating).
statuswaiting | processing | completed | expired.
amountUSD amount (string).
nameInvoice name/title (if provided when creating).
descriptionInvoice description (if provided when creating).
created_atCreation time (Unix timestamp, seconds).
expires_atExpiration time (Unix timestamp, seconds).
token_symbolSelected token (e.g., USDT, BNB). Only after customer selects.
network_symbolNetwork (e.g., BSC, TRC20, ETH, BINANCE_PAY). Only after customer selects.
token_amountAmount of crypto to transfer. Only after customer selects.
token_priceExchange rate at time of selection. Only after customer selects.
to_addressReceiving wallet address. Only after customer selects.
transaction_hashBlockchain transaction hash. Only when status = "completed".
from_addressSender's wallet address. Only when status = "completed".
fee_amountFee deducted (USD). Only when status = "completed".
callback_statusWebhook delivery status: success | failed | null. Only when status = "completed".

Errors (4xx / 5xx)

HTTPerror_codeDescription
400MISSING_TRANS_IDMissing trans_id in URL path.
400INVALID_TRANS_ID_FORMATInvalid trans_id format. Expected: TID-XXXXXXXXXXXXXXXX (16 uppercase alphanumeric characters). details has trans_id and expected_format.
401MISSING_API_KEYNo x-api-key header provided.
401INVALID_API_KEYThe API key is invalid or does not exist.
403ACCOUNT_INACTIVEThe account associated with this API key is disabled.
403STORE_INACTIVEThe store associated with this API key is disabled.
404INVOICE_NOT_FOUNDInvoice not found or doesn't belong to this Store's API Key. details.trans_id contains the sent value.
429RATE_LIMIT_EXCEEDEDExceeded rate limit.
500INTERNAL_ERRORServer error.

Error body format:

{
"status": "error",
"message": "Invoice not found.",
"error_code": "INVOICE_NOT_FOUND",
"details": { "trans_id": "TID-ABC123DEF4567890" }
}

Rate Limit

  • Burst: 20 requests/second (per API Key or IP).
  • Sustained: 200 requests/minute (per API Key or IP).

Use Cases

  • Polling: Periodically call GET https://api.payerscan.com/invoice/:trans_id to update the UI status (when not using webhook as the primary source).
  • Reconciliation: Look up invoices by trans_id from emails, tickets, etc.
  • Status display page: After customer payment, display information from this API.