/v1/paymentsPayment Status
Check the status of a payment after a QR code has been scanned. Payments are created automatically when you generate a QR code, and their status updates when the customer completes the payment.
Overview
When you generate a QR code, a payment record is automatically created with status "pending". After the customer scans the QR code and completes payment through their banking app, the payment status updates to "succeeded" or "failed". Use this endpoint to check payment status or list all payments.
Payment Status Flow:
pending- QR code generated, waiting for customer to scan and paysucceeded- Customer completed payment via PromptPayfailed- Payment failed or QR code expiredexpired- QR code expired before payment
How Payments Work
When you call POST /v1/qr-codes, a payment record is automatically created with the same amount and reference. The payment starts in "pending" status and updates when the customer completes payment.
You don't need to create payments manually - they're created automatically with each QR code.
Code Examples
Check Payment Status
Get details for a specific payment by ID
curl -X GET "https://api.altafinex.com/v1/payments/pay_1234567890abcdef" \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
List All Payments
List payments with optional filters (status, limit, offset)
curl -X GET "https://api.altafinex.com/v1/payments?limit=20&status=pending" \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
Response
Status Codes
{
"payment_id": "pay_1234567890abcdef",
"qr_code_id": "qr_1234567890abcdef",
"status": "succeeded",
"amount": 10000,
"currency": "THB",
"reference": "ORDER-12345",
"created_at": "2024-01-15T10:30:00Z",
"completed_at": "2024-01-15T10:32:15Z"
}{
"error": {
"code": "insufficient_funds",
"message": "The payment could not be processed",
"type": "payment_error"
}
}