Skip to content
Go To Dashboard

Create Transaction

Create a new transaction for payment authorization and tracking.

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"service": "openai",
"action": "completion",
"resource": "gpt-4",
"qualifiers": {
"model": "gpt-4",
"maxTokens": 1000
},
"paymentData": {
"amount": 0.05,
"currency": "USD",
"description": "GPT-4 API call"
},
"metadata": {
"userId": "user_123"
}
}
{
"data": {
"id": "txn_123abc",
"status": "authorized",
"service": "openai",
"action": "completion",
"resource": "gpt-4",
"createdAt": "2025-01-15T10:30:00Z"
},
"status": "success"
}
Terminal window
curl -X POST \
https://api.sapiom.com/v1/transactions \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"service": "openai",
"action": "completion",
"resource": "gpt-4"
}'