Skip to content

Transactions

The Transactions API allows you to create payment requests, monitor their status, and handle cancellations.

Create a new payment transaction.

Request:

Terminal window
curl -X POST https://quinix.byteconnect.us/create_transaction \
-H "Content-Type: application/json" \
-d '{
"access_token": "your_access_token",
"email": "customer@example.com",
"amount": "25.00",
"crypto_selected": "BTC",
"label": "Order #1234"
}'

Parameters:

ParameterTypeRequiredDescription
access_tokenstringYesYour API access token
emailstringNoCustomer’s email for receipt
amountstringYesAmount in USD
crypto_selectedstringYesCryptocurrency code (BTC, LTC, etc.)
labelstringNoReference label for tracking

Response:

{
"transaction_id": "txn_abc123def456",
"wallet_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"crypto_amount": "0.00042351",
"usd_amount": "25.00",
"exchange_rate": "59032.15",
"expires_at": "2024-01-15T12:15:00Z",
"status": "started"
}

Check the current status of a transaction.

Request:

Terminal window
curl -X POST https://quinix.byteconnect.us/check_transaction \
-H "Content-Type: application/json" \
-d '{
"access_token": "your_access_token",
"transaction_id": "txn_abc123def456"
}'

Response:

{
"transaction_id": "txn_abc123def456",
"status": "confirmed",
"crypto_amount": "0.00042351",
"crypto_received": "0.00042351",
"confirmations": 3,
"usd_amount": "25.00",
"created_at": "2024-01-15T12:00:00Z",
"confirmed_at": "2024-01-15T12:08:32Z"
}

Cancel a pending transaction.

Request:

Terminal window
curl -X POST https://quinix.byteconnect.us/cancel_transaction \
-H "Content-Type: application/json" \
-d '{
"access_token": "your_access_token",
"transaction_id": "txn_abc123def456"
}'

Response:

{
"transaction_id": "txn_abc123def456",
"status": "cancelled",
"message": "Transaction cancelled successfully"
}
StatusDescription
startedTransaction created, awaiting payment
pendingPayment received, awaiting blockchain confirmation
confirmedPayment confirmed on the blockchain
succeededTransaction completed successfully
timedout15-minute payment window expired
cancelledTransaction was cancelled
declinedIncorrect amount received
reviewDiscrepancy detected, under review
reimbursedCrypto returned to customer
settledFunds settled to merchant account
timedout_checked24 hours elapsed with no payment
┌─────────┐ ┌─────────┐ ┌───────────┐ ┌───────────┐
│ started │ -> │ pending │ -> │ confirmed │ -> │ succeeded │
└─────────┘ └─────────┘ └───────────┘ └───────────┘
│ │
v v
┌──────────┐ ┌──────────┐
│ timedout │ │ declined │
└──────────┘ └──────────┘
import requests
import time
# Create transaction
response = requests.post(
"https://quinix.byteconnect.us/create_transaction",
json={
"access_token": access_token,
"amount": "25.00",
"crypto_selected": "BTC",
"label": "Order #1234"
}
)
transaction = response.json()
# Poll for status
while True:
status_response = requests.post(
"https://quinix.byteconnect.us/check_transaction",
json={
"access_token": access_token,
"transaction_id": transaction["transaction_id"]
}
)
status = status_response.json()
if status["status"] in ["succeeded", "timedout", "cancelled"]:
break
time.sleep(10) # Poll every 10 seconds
const axios = require('axios');
async function createTransaction(accessToken, amount, crypto) {
const response = await axios.post(
'https://quinix.byteconnect.us/create_transaction',
{
access_token: accessToken,
amount: amount,
crypto_selected: crypto,
label: 'Order #1234'
}
);
return response.data;
}
async function pollStatus(accessToken, transactionId) {
const response = await axios.post(
'https://quinix.byteconnect.us/check_transaction',
{
access_token: accessToken,
transaction_id: transactionId
}
);
return response.data;
}