Skip to main content
POST
/
subscriptions
/
{id}
/
credits
/
grant
Grant credits to a subscription
curl --request POST \
  --url https://api.alguna.io/subscriptions/{id}/credits/grant \
  --header 'Alguna-Version: <alguna-version>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": "100.00",
  "reason": "API promotional credit",
  "credit_type": "monetary",
  "expires_at": "2027-01-01T00:00:00Z"
}
'
{
  "amount": "100.00",
  "created_at": "2023-11-07T05:31:56Z",
  "customer_id": "<string>",
  "grant_type": "api",
  "id": "cg_abc123",
  "expires_at": "2023-11-07T05:31:56Z",
  "reason": "<string>",
  "subscription_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://alguna.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Headers

Alguna-Version
enum<string>
required
Available options:
2026-04-01
Idempotency-Key
string

A unique string used to ensure the request is processed exactly once. If you retry a request with the same idempotency key within 24 hours, the original response is returned without re-executing the operation.

Maximum string length: 255
Example:

"ik_a1b2c3d4e5f6"

Path Parameters

id
string
required

Unique identifier for the subscription

Body

application/json
amount
string
required

Credit amount to grant

Example:

"100.00"

reason
string
required

Reason for the credit grant

Example:

"API promotional credit"

credit_type
enum<string>

Type of credit

Available options:
monetary
Example:

"monetary"

expires_at
string<date-time> | null

When the credit grant expires

Example:

"2027-01-01T00:00:00Z"

Response

Success

amount
string
required

Grant amount

Example:

"100.00"

created_at
string<date-time>
required

When the grant was created

customer_id
string
required

Customer ID

grant_type
string
required

How the grant was created

Example:

"api"

id
string
required

Credit grant ID

Example:

"cg_abc123"

expires_at
string<date-time> | null

Expiration date

reason
string | null

Reason for the grant

subscription_id
string | null

Subscription ID