Skip to main content
POST
/
v1
/
entitlements
/
{entitlementId}
/
grants
curl --request POST \
  --url https://api.paygentic.io/v1/entitlements/{entitlementId}/grants \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 100,
  "idempotencyKey": "grant-initial-100"
}
'
{
  "object": "grant",
  "id": "<string>",
  "entitlementId": "<string>",
  "amount": 123,
  "effectiveAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "recurrencePeriod": "<string>",
  "idempotencyKey": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z",
  "voidedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key authentication

Path Parameters

entitlementId
string
required

The unique identifier of the entitlement

Pattern: ^ent_[a-zA-Z0-9]+$

Body

application/json
amount
number
required

The number of credits to grant.

idempotencyKey
string
required

Idempotency key to prevent duplicate grants. Must be unique per entitlement.

Maximum string length: 255
effectiveAt
string<date-time>

When the grant becomes effective. Defaults to now.

expiresAt
string<date-time> | null

When the grant expires. If omitted, the grant does not expire.

Response

Grant successfully created.

object
enum<string>
default:grant
required
Available options:
grant
id
string
required

Unique identifier for the grant.

Pattern: ^grt_[a-zA-Z0-9]+$
entitlementId
string
required

The entitlement this grant belongs to.

Pattern: ^ent_[a-zA-Z0-9]+$
amount
number
required

The number of credits granted.

effectiveAt
string<date-time>
required

When the grant becomes effective.

createdAt
string<date-time>
required

When the grant was created.

recurrencePeriod
string | null
required

The recurrence interval (ISO 8601 duration) if this is a recurring grant. Null for one-time grants.

idempotencyKey
string | null
required

The idempotency key used when creating this grant. Null if not provided.

expiresAt
string<date-time> | null

When the grant expires. Null means no expiration.

voidedAt
string<date-time> | null

When the grant was voided. Null means the grant is active.