API Integration
Get Transaction
Retrieve transaction details
Get Transaction
Query transaction status and details by ID or vendor reference.
Get by Transaction ID
GET /api/v1/public/partner/transactions/{transactionId}Example
curl -X GET "https://api.alyapay.com/api/v1/public/partner/transactions/550e8400-e29b-41d4-a716-446655440000" \
-H "X-Api-Key: sk_live_xxx.yyy"Get by Vendor Reference
GET /api/v1/public/partner/transactions/vendor/{vendorReference}Example
curl -X GET "https://api.alyapay.com/api/v1/public/partner/transactions/vendor/ORDER-2024-001" \
-H "X-Api-Key: sk_live_xxx.yyy"Response (200 OK)
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"orderReference": "AB12345",
"vendorReference": "ORDER-2024-001",
"status": "APPROVED",
"totalAmount": 500.00,
"currency": "MAD",
"customerPhone": "212612345678",
"merchantName": "My Store",
"storeName": "Downtown Branch",
"items": [...],
"createdAt": "2024-12-08T10:30:00Z",
"updatedAt": "2024-12-08T10:32:15Z"
}Error Response (404)
{
"error": {
"code": "TRANSACTION_NOT_FOUND",
"message": "Transaction not found or does not belong to your merchant account"
}
}Use Cases
- Check transaction status after creation
- Reconcile orders with your system
- Display payment status to staff
- Fallback when webhook delivery fails
Tip: Use webhooks for real-time updates instead of polling.