Skip to main content
GET
https://api.keywordsai.co
/
api
/
credit-transactions
/
{id}
import requests

transaction_id = "ct_1a2b3c4d5e6f7g8h"
url = f"https://api.keywordsai.co/api/credit-transactions/{transaction_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
print(response.json())
{
  "id": "ct_1a2b3c4d5e6f7g8h",
  "organization_subscription": 42,
  "unique_organization_id": "8264a3f4-40c7-476a-97d1-96908127ea21",
  "amount": 100.0,
  "transaction_type": "grant",
  "created_at": "2025-12-27T10:30:00.000Z",
  "expires_at": null,
  "description": "Welcome bonus for new customer",
  "stripe_payment_intent_id": "",
  "metadata": {
    "contract_id": "ENT-2025-001",
    "sales_rep": "[email protected]"
  }
}
Retrieves detailed information about a specific credit transaction. All users can view transactions for their organization.

Path parameters

id
string
required
The unique identifier of the transaction to retrieve (e.g., ct_1a2b3c4d5e6f7g8h)

Response fields

id
string
Unique transaction identifier
organization_subscription
integer
Subscription ID for the organization
unique_organization_id
string
Organization’s unique identifier (UUID format)
amount
float
Transaction amount in USD
  • Positive: Adds credits (purchase, grant, bonus)
  • Negative: Removes credits (adjustment, refund)
transaction_type
string
Type of transaction:
  • purchase - Customer purchased credits
  • grant - Admin granted free credits
  • adjustment - Admin adjustment (positive or negative)
  • refund - Refund issued
  • bonus - Promotional or bonus credits
created_at
datetime
When transaction was created (ISO 8601 format)
expires_at
datetime
Expiration date for time-limited credits (nullable)
description
string
Human-readable description of the transaction
stripe_payment_intent_id
string
Stripe payment intent ID (for purchases)
metadata
object
Additional JSON metadata

Response

{
  "id": "ct_1a2b3c4d5e6f7g8h",
  "organization_subscription": 42,
  "unique_organization_id": "8264a3f4-40c7-476a-97d1-96908127ea21",
  "amount": 100.0,
  "transaction_type": "grant",
  "created_at": "2025-12-27T10:30:00.000Z",
  "expires_at": null,
  "description": "Welcome bonus for new customer",
  "stripe_payment_intent_id": "",
  "metadata": {
    "contract_id": "ENT-2025-001",
    "sales_rep": "[email protected]"
  }
}
import requests

transaction_id = "ct_1a2b3c4d5e6f7g8h"
url = f"https://api.keywordsai.co/api/credit-transactions/{transaction_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
print(response.json())