Transactions
The Transactions API allows you to create payment requests, monitor their status, and handle cancellations.
Create Transaction
Section titled “Create Transaction”POST /create_transaction
Section titled “POST /create_transaction”Create a new payment transaction.
Request:
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
access_token | string | Yes | Your API access token |
email | string | No | Customer’s email for receipt |
amount | string | Yes | Amount in USD |
crypto_selected | string | Yes | Cryptocurrency code (BTC, LTC, etc.) |
label | string | No | Reference 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 Transaction Status
Section titled “Check Transaction Status”POST /check_transaction
Section titled “POST /check_transaction”Check the current status of a transaction.
Request:
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 Transaction
Section titled “Cancel Transaction”POST /cancel_transaction
Section titled “POST /cancel_transaction”Cancel a pending transaction.
Request:
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"}Transaction Statuses
Section titled “Transaction Statuses”| Status | Description |
|---|---|
started | Transaction created, awaiting payment |
pending | Payment received, awaiting blockchain confirmation |
confirmed | Payment confirmed on the blockchain |
succeeded | Transaction completed successfully |
timedout | 15-minute payment window expired |
cancelled | Transaction was cancelled |
declined | Incorrect amount received |
review | Discrepancy detected, under review |
reimbursed | Crypto returned to customer |
settled | Funds settled to merchant account |
timedout_checked | 24 hours elapsed with no payment |
Transaction Flow
Section titled “Transaction Flow”┌─────────┐ ┌─────────┐ ┌───────────┐ ┌───────────┐│ started │ -> │ pending │ -> │ confirmed │ -> │ succeeded │└─────────┘ └─────────┘ └───────────┘ └───────────┘ │ │ v v┌──────────┐ ┌──────────┐│ timedout │ │ declined │└──────────┘ └──────────┘Code Examples
Section titled “Code Examples”Python
Section titled “Python”import requestsimport time
# Create transactionresponse = 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 statuswhile 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 secondsNode.js
Section titled “Node.js”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;}