Step-by-step guide to processing payments using the Aurion REST API
This guide walks you through the complete payment processing flow using Aurion's REST API. The process consists of three main steps:
sk_...)https://api.aurion.finance (or your environment URL)/v1/users endpoint)/v1/tokens endpoint)sk_...) for authentication.Create a new payment transaction with specified recipients and USD amount.
POST /v1/payments/initializeContent-Type: application/json
Authorization: Bearer sk_your-secret-key| Field | Type | Required | Description |
|---|---|---|---|
amountUSD | number | Required | Payment amount in USD (must be positive) |
recipients | array | Required | Array of recipient objects with userId and percentage |
recipients[].userId | string | Required | User ID from Create User response |
recipients[].percentage | number | Required | Percentage allocation (total must equal 100) |
metadata | object | Optional | Custom metadata for the transaction |
callbackUrl | string | Optional | Webhook URL for payment notifications |
curl -X POST https://api.aurion.finance/v1/payments/initialize \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your-secret-key" \
-d '{
"amountUSD": 100,
"recipients": [
{
"userId": "user-uuid-1",
"percentage": 60
},
{
"userId": "user-uuid-2",
"percentage": 40
}
],
"metadata": {
"orderId": "order-123",
"description": "Payment for services"
},
"callbackUrl": "https://yourapp.com/webhooks/payment"
}'{
"success": true,
"message": "Payment initialized successfully",
"data": {
"transactionId": "5b0cb826-0bcc-483f-984f-268a0e0a757c",
"paymentLink": "https://pay.aurion.finance/5b0cb826-0bcc-483f-984f-268a0e0a757c",
"expiresAt": null,
"status": "PENDING"
}
}transactionId from the response. You'll need it for the next steps.Select the cryptocurrency token for payment and get payment details including wallet address.
POST /v1/payments/update-tokenContent-Type: application/json
Authorization: Bearer sk_your-secret-key| Field | Type | Required | Description |
|---|---|---|---|
transactionId | string | Required | Transaction ID from Step 1 (Initialize Payment) |
tokenId | string | Required | Token ID (get from /v1/tokens endpoint) |
GET /v1/tokens to get a list of available tokens and their IDs. Common tokens include:So11111111111111111111111111111111111111112 - SOL (Solana)EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v - USDCEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB - USDTcurl -X POST https://api.aurion.finance/v1/payments/update-token \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your-secret-key" \
-d '{
"transactionId": "5b0cb826-0bcc-483f-984f-268a0e0a757c",
"tokenId": "So11111111111111111111111111111111111111112"
}'{
"success": true,
"data": {
"transaction": {
"id": "5b0cb826-0bcc-483f-984f-268a0e0a757c",
"tokenId": "So11111111111111111111111111111111111111112",
"expectedAmount": 0.5,
"status": "PENDING",
"expiresAt": "2024-01-15T11:30:00.000Z"
},
"paymentDetails": {
"recipientAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"expectedAmount": 0.5,
"token": {
"symbol": "SOL",
"decimals": 9
}
}
}
}recipientAddress where the customer should send paymentPENDING staterecipientAddress to provide payment instructions to your customerexpectedAmount is calculated based on current exchange ratesVerify that payment has been received on-chain and trigger the distribution process.
POST /v1/payments/verifyContent-Type: application/json
Authorization: Bearer sk_your-secret-key| Field | Type | Required | Description |
|---|---|---|---|
transactionId | string | Required | Transaction ID from Step 1 |
curl -X POST https://api.aurion.finance/v1/payments/verify \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your-secret-key" \
-d '{
"transactionId": "5b0cb826-0bcc-483f-984f-268a0e0a757c"
}'{
"success": true,
"message": "Transaction verified successfully",
"data": {
"transactionId": "5b0cb826-0bcc-483f-984f-268a0e0a757c",
"transactionHash": "5KKsW8Y9n8rTBrDHvdxJ6YQZfJ2rxxvChaZZoGKk8RKFc3xs4TSK1kSv7NgZy6jm478",
"status": "PLATFORM_RECEIVED",
"amountReceived": 0.5,
"expectedAmount": 0.5,
"tokenSymbol": "SOL",
"walletAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
}
}PLATFORM_RECEIVED