Skip to main content
POST
https://api.alguna.io
/
credit-grants
curl -X POST https://api.alguna.io/credit-grants \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "wallet_id": "wal_def456",
    "amount": "500.00",
    "description": "Annual credit allocation",
    "expires_at": "2024-12-31T23:59:59Z"
  }'
{
  "id": "grant_abc123",
  "wallet_id": "wal_def456",
  "amount": "500.00",
  "description": "Annual credit allocation",
  "expires_at": "2024-12-31T23:59:59Z",
  "payment_id": null,
  "status": "active",
  "created_at": "2024-01-20T10:00:00Z",
  "updated_at": "2024-01-20T10:00:00Z"
}
Create a new credit grant for a wallet. Credit grants represent individual credit additions with optional expiration.
wallet_id
string
required
The wallet ID to grant credits to.
amount
string
required
Amount to grant as a decimal string (e.g., “100.00”).
description
string
Optional description of the credit grant.
expires_at
string
Optional ISO 8601 expiration date. Credits expire and become unavailable after this date.
payment_id
string
Optional payment ID if the grant is tied to a payment.
curl -X POST https://api.alguna.io/credit-grants \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "wallet_id": "wal_def456",
    "amount": "500.00",
    "description": "Annual credit allocation",
    "expires_at": "2024-12-31T23:59:59Z"
  }'
{
  "id": "grant_abc123",
  "wallet_id": "wal_def456",
  "amount": "500.00",
  "description": "Annual credit allocation",
  "expires_at": "2024-12-31T23:59:59Z",
  "payment_id": null,
  "status": "active",
  "created_at": "2024-01-20T10:00:00Z",
  "updated_at": "2024-01-20T10:00:00Z"
}
id
string
Unique identifier for the credit grant.
wallet_id
string
The wallet this grant belongs to.
amount
string
Grant amount as a decimal string.
description
string
Description of the grant.
expires_at
string
ISO 8601 expiration date, if set.
payment_id
string
Associated payment ID, if any.
status
string
Grant status: active, approved, pending, exhausted, expired, or voided.
created_at
string
ISO 8601 timestamp of creation.
updated_at
string
ISO 8601 timestamp of last update.