Complete API reference for integrating Aslan payment infrastructure with your AI agents. All endpoints support both REST and SDK-based access.
All API requests require authentication using an API key in the Authorization header.
curl -X POST https://aslanpay.xyz/api/v1/authorize \
-H "Authorization: Bearer ak_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"amount": 2500,
"description": "AWS credits"
}'
ak_live_...
- For production transactionsak_test_...
- For sandbox testing/api/v1/confirm
Confirm and execute a previously authorized payment. This charges the payment method.
{
"authorizationId": "auth_1NirD82eZvKYlo2CjQk6B8XK"
}
{
"id": "pay_1NirD82eZvKYlo2CjQkMBhXe",
"object": "payment",
"amount": 2500,
"currency": "usd",
"description": "AWS credits",
"status": "succeeded",
"authorizationId": "auth_1NirD82eZvKYlo2CjQk6B8XK",
"created": 1640995800,
"receiptUrl": "https://pay.stripe.com/receipts/..."
}
curl -X POST https://aslanpay.xyz/api/v1/confirm \
-H "Authorization: Bearer ak_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"authorizationId": "auth_1NirD82eZvKYlo2CjQk6B8XK"
}'
/api/v1/refund
Refund a completed payment, either partially or in full.
{
"paymentId": "pay_1NirD82eZvKYlo2CjQkMBhXe",
"amount": 1000, // Optional: partial refund amount
"reason": "Customer request" // Optional: refund reason
}
{
"id": "re_1NirD82eZvKYlo2CjReFund1",
"object": "refund",
"amount": 1000,
"currency": "usd",
"paymentId": "pay_1NirD82eZvKYlo2CjQkMBhXe",
"reason": "Customer request",
"status": "succeeded",
"created": 1640996400
}
/api/status
Get the current system status and health of all components.
{
"service": "Aslan Payment Infrastructure",
"status": "operational",
"timestamp": "2024-05-29T17:55:12.746Z",
"version": "1.0.0",
"environment": "production",
"uptime": 124.777585657,
"components": {
"database": {
"status": "operational",
"responseTime": "15ms"
},
"stripe": {
"status": "operational"
},
"authentication": {
"status": "operational"
},
"api": {
"status": "operational"
}
}
}
curl -X GET https://aslanpay.xyz/api/status
200
OK - Request succeeded
400
Bad Request - Invalid parameters
401
Unauthorized - Invalid API key
403
Forbidden - Insufficient permissions
404
Not Found - Resource doesn't exist
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error
{
"error": {
"type": "invalid_request_error",
"code": "amount_too_small",
"message": "Amount must be at least $0.50 USD",
"param": "amount"
}
}
Use our official SDKs for easier integration with your AI frameworks.
npm install @aslanpay/sdk
pip install aslanpay
curl -X POST https://api.aslanpay.xyz/v1/purchase \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 2500,
"description": "AWS credits",
"agent_id": "gpt-4-assistant"
}'
{
"success": true,
"transaction_id": "txn_1abc234def",
"status": "authorized",
"amount": 2500,
"description": "AWS credits",
"latency_ms": 127,
"timestamp": "2024-01-15T10:30:00Z"
}