Skip to main content

Create Entitlement API

Overview​

The Create Entitlement API allows your application to submit externally processed payments (such as Stripe, Google Pay, Apple Pay, Roku, etc.) into the Eluvio Content Fabric.

This endpoint is used when:

  • Payment is completed outside of the Eluvio no-code "Wallet Client" marketplaces
  • You want Fabric to create the correct entitlement for the user, by assigning a token to their address
  • You want the transaction recorded for reporting and tracking

Supported Entitlement Types​

  • Purchase (Electronic Sell-Through, EST)
  • Rental (Transactional Video on Demand, TVOD)
  • Subscription (Subscription Video on Demand, SVOD)

Async Mode​

By default, entitlement/add does not respond until the NFT has been minted and the token has been confirmed to appear in the user's wallet. This can take anywhere from a few seconds up to about a minute. If your integration would rather not wait for this, set the set_async flag to true in the request. In Async Mode, the call will respond immediately with an HTTP 202 and a poll_id. Use this poll_id from the response with Poll Entitlement Status to check the mint and wallet-confirm progress.

Note: If this exact transaction was already fully processed (e.g. a retried request), it simply returns HTTP 200.

Optimistic Access to Media​

In asynchronous mode, the user can't play the purchased media until the purchase is confirmed. To let them play right away, set asset_claimer on this call to get a refreshed user token back, or refresh the user's token afterward. See Optimistic Access to Media.


Endpoint​

POST /tnt/:tid/entitlement/add

Authentication​

This API requires tenant admin authorization.

Include the bearer token in the request header:

Authorization: Bearer <token>

Path Parameters​

NameTypeRequiredDescription
tidstringYesTenant ID

Required Headers​

HeaderValue
Content-Typeapplication/json
Acceptapplication/json
AuthorizationBearer <token>

Request Body​

Required Fields​

FieldDescription
transaction.idUnique payment ID from your payment provider
transaction_typepurchase, rental, subscription, est, tvod, or svod
elv_addrUser wallet address
skus or skuskus: array of one or more product SKUs; or sku: a single SKU*

* Send exactly one of skus or sku, not both. A subscription takes exactly one SKU.

transaction_type est is an alias for purchase, tvod an alias for rental, svod an alias for subscription:

  • EST: Electronic Sell-Through
  • TVOD: Transactional Video On Demand
  • SVOD: Subscription Video On Demand

An alias has exactly the same requirements as the type it stands for: tvod takes rental_duration, and svod requires subscription_details with end_timestamp.

Optional Fields​

FieldDescription
set_asyncIf true, do not wait for the mint
include_pending_claimsWith set_async: if true, include asset_claims in the response
asset_claimerWith set_async: if set, refreshes the given session inline
rental_durationRental timing; see Rental Duration
subscription_detailsRequired for subscriptions; see Subscription Details
metadataYour own fields, kept for reporting; see Metadata
search_indexiq__ ID of a title catalog search index to use instead of the tenant's configured one

See Async Mode and Optimistic Access to Media for details.

search_index may also be passed as a query parameter (?search_index=iq__...), which takes precedence over the body field.

asset_claimer object​

FieldDescription
nonceThe device_id/nonce originally bound to refresh_token
refresh_tokenAn existing CSAT refresh token for the user in elv_addr

Transaction Object​

FieldRequiredDescription
idYesPayment identifier (must be globally unique)
customer_idNoCustomer ID from your payment provider
totalNoTotal amount paid (if omitted, payment will not be recorded)
taxNoTax amount
currencyYesCurrency code (example: USD)
country_codeYesCountry code (example: US)

Transaction Types​

ValueDescription
purchasePermanent entitlement
rentalTime-limited entitlement
subscriptionEntitlement for a subscription period, kept up to date by you
estAlias for purchase
tvodAlias for rental
svodAlias for subscription

Each SKU's offer type must match: an SVOD SKU (by title catalog offer or marketplace tag) requires subscription, and subscription requires an SVOD SKU. Likewise, TVOD requires rental and EST requires purchase.


Rental Duration (Required for Rentals)​

If transaction_type is rental (or its alias tvod), include a rental_duration object with these optional fields:

FieldTypeDescription
start_timestampstringISO8601 timestamp: when the rental window opens. Default is now
start_watchintegerSeconds after start_timestamp the user has to begin watching. Default 2592000 = 30 days
active_forintegerSeconds of playback access after the user starts watching. Default 172800 = 2 days

Example: start_timestamp = "2026-03-11T21:10:00Z", start_watch = 2592000 (30 days), active_for = 172800 (2 days) means the user has until April 10 9:10 PM UTC to start watching, and once they begin they have 2 days to finish.

See Rental Timing Model for the Rental Duration and Playback Duration model for rentals


Subscription Details (Required for Subscriptions)​

If transaction_type is subscription (or its alias svod), a subscription_details object is required:

FieldTypeRequiredDescription
end_timestampstringYesISO8601 timestamp: the end of the paid period
start_timestampstringNoISO8601 timestamp: the start of the paid period. Default is now
grace_end_timestampstringNoISO8601 timestamp: when access is removed. Default is end_timestamp + 7 days
  • end_timestamp must be after start_timestamp, and grace_end_timestamp must not be before end_timestamp.
  • A new subscription is always active; status cannot be set here.
  • The user's token is revoked automatically at grace_end_timestamp. The grace period lets a renewal arrive late without the user losing access.
  • Keep the subscription current as your billing system renews, cancels, or refunds it with Update Subscription, using the trans_id from this call.
  • Resending the same request (same transaction.id, elv_addr, and SKU) is safe: it returns the existing subscription rather than creating another. The same transaction.id with a different elv_addr or SKU is rejected with HTTP 409.

Example: end_timestamp = "2026-12-15T00:00:00Z" with no grace_end_timestamp means the subscription is paid through December 15 and, unless renewed, the user keeps access until December 22.


Metadata (Optional)​

You may include arbitrary custom fields for reporting:

{
"metadata": {
"title": "Example Title",
"description": "Example Title rental with promo",
"affiliate": "Example Partner",
"discount_desc": "20% off promo applied via discount code",
"discount_code": "PROMO20"
}
}

Curl Example​

curl -X POST "https://<fabric-authority-url>/tnt/<tenantId>/entitlement/add" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"transaction": {
"id": "pi_3pp_1234",
"customer_id": "cus_3pp_1234",
"total": 3.26,
"tax": 0.27,
"currency": "USD",
"country_code": "US"
},
"transaction_type": "rental",
"rental_duration": {
"start_timestamp": "2026-03-11T21:10:00Z",
"start_watch": 2592000,
"active_for": 172800
},
"elv_addr": "0xabc123...",
"skus": ["<sku-1>"],
"metadata": {
"description": "Example rental"
}
}'

Subscription Example​

curl -X POST "https://<fabric-authority-url>/tnt/<tenantId>/entitlement/add" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"transaction": {
"id": "pi_3pp_sub_5678",
"customer_id": "cus_3pp_1234",
"total": 9.99,
"tax": 0.0,
"currency": "USD",
"country_code": "US"
},
"transaction_type": "subscription",
"subscription_details": {
"end_timestamp": "2026-12-15T00:00:00Z"
},
"elv_addr": "0xabc123...",
"skus": ["<svod-sku>"],
"metadata": {
"description": "Example monthly subscription"
}
}'

Response​

Success Response (HTTP 200, or HTTP 202 with set_async)​

Returned when the payment is accepted and the entitlement is created. Returns HTTP 200, or HTTP 202 when set_async is used and the mint has not already completed.

Fields​

FieldDescription
messageSuccess message
trans_idFull transaction ID - used with watch_start and entitlement/list
opnft-buy for a purchase or subscription, nft-rent for a rental
tenant_revenueRevenue allocated to the tenant
platform_feePlatform fee amount
user_addrUser wallet address
tokensAll tokens minted in this transaction. Absent if set_async was used
poll_idJob identifier for Poll Entitlement Status
asset_claims_tokensUpdated fabric_token and refresh_token, if asset_claimer was set*
asset_claimsOne signed claim per SKU, if include_pending_claims was set*
metadataTitle catalog fields for the SKU(s), if a title catalog is configured
subscriptionSubscriptions only: the subscription record, see below

* Only on an HTTP 202 response, with set_async.

Treat poll_id as opaque: pass it back unchanged to Poll Entitlement Status.

See Optimistic Access to Media for details on asset_claims_tokens and asset_claims.

Subscription Record​

Returned as subscription by this call and by Update Subscription.

FieldDescription
sub_idSubscription ID; the same as trans_id
user_addrUser wallet address
tenantTenant ID
descriptionmetadata.description from the request, or the product name
statusactive, canceled, expired, or refunded
start_timeStart of the paid period
end_timeEnd of the paid period
paid_toSame as end_time
grace_endWhen access is removed
token_addrContract address of the user's token, once minted
token_idToken ID of the user's token, once minted
token_removedWhen the token was revoked, once it has been
attributesDetails such as sku, customer_id, and country
metadataYour metadata from the request, as you sent it
createdWhen the record was created
updatedWhen the record last changed

With set_async, token_addr and token_id are absent until the mint completes.

Example Success Response​

Synchronous, HTTP 200​

{
"message": "3pp payment processed successfully",
"trans_id": "3pp:<tenantId>:pi_3pp_1234",
"op": "nft-rent",
"tenant_revenue": 2.75,
"platform_fee": 0.51,
"user_addr": "0xabc123...",
"tokens": [
{
"contract_addr": "0xcontract123...",
"token_id": "551"
}
],
"poll_id": "0xabc123...:nft-rent:<siteId>:pi_3pp_1234"
}

Asynchronous, HTTP 202​

{
"message": "3pp payment processed successfully",
"trans_id": "3pp:<tenantId>:pi_3pp_1234",
"op": "nft-rent",
"tenant_revenue": 2.75,
"platform_fee": 0.51,
"user_addr": "0xabc123...",
"poll_id": "0xabc123...:nft-rent:<siteId>:pi_3pp_1234"
}

Subscription, HTTP 200​

{
"message": "3pp payment processed successfully",
"trans_id": "3pp:<tenantId>:pi_3pp_sub_5678",
"op": "nft-buy",
"tenant_revenue": 9.38,
"platform_fee": 0.61,
"user_addr": "0xabc123...",
"tokens": [
{
"contract_addr": "0xcontract456...",
"token_id": "62"
}
],
"subscription": {
"sub_id": "3pp:<tenantId>:pi_3pp_sub_5678",
"user_addr": "0xabc123...",
"token_addr": "0xcontract456...",
"token_id": "62",
"tenant": "<tenantId>",
"description": "Example monthly subscription",
"status": "active",
"start_time": "2026-11-15T00:00:00Z",
"end_time": "2026-12-15T00:00:00Z",
"paid_to": "2026-12-15T00:00:00Z",
"grace_end": "2026-12-22T00:00:00Z",
"attributes": {
"sku": ["<svod-sku>"],
"customer_id": ["cus_3pp_1234"],
"country": ["US"]
},
"metadata": {
"description": "Example monthly subscription"
},
"created": "2026-11-15T00:00:01Z",
"updated": "2026-11-15T00:00:01Z"
},
"poll_id": "0xabc123...:nft-buy:<siteId>:pi_3pp_sub_5678"
}

Asynchronous with asset_claimer, HTTP 202​

{
"message": "3pp payment processed successfully",
"trans_id": "3pp:<tenantId>:pi_3pp_1234",
"op": "nft-rent",
"tenant_revenue": 2.75,
"platform_fee": 0.51,
"user_addr": "0xabc123...",
"poll_id": "0xabc123...:nft-rent:<siteId>:pi_3pp_1234",
"asset_claims_tokens": {
"fabric_token": "new-csat-token",
"refresh_token": "new-refresh-token"
}
}

Poll Entitlement Status​

GET /tnt/:tid/entitlement/status/:poll_id

Check on mint and wallet-confirm progress for a job started with set_async.

Authentication​

Tenant admin bearer token.

Path Parameters​

ParameterDescription
tidYour tenant ID
poll_idThe poll_id returned from the create call

Query Parameters​

ParameterRequiredDescription
elv_addrYesThe user's wallet address, as submitted to entitlement/add

Response Fields​

FieldDescription
poll_idPolled job identifier
statusOverall status: "pending", "complete", or "failed"
mint_statusSupplementary detail on "pending"/"failed": "complete" indicates minted, but not yet wallet-confirmed
tokensPresent once status is "complete"
errorPresent when mint_status is "failed", if a reason is available

Status: pending​

{
"poll_id": "0xabc123...:nft-rent:<siteId>:pi_3pp_1234",
"status": "pending",
"mint_status": "pending"
}

Status: complete​

{
"poll_id": "0xabc123...:nft-rent:<siteId>:pi_3pp_1234",
"status": "complete",
"mint_status": "complete",
"tokens": [
{
"contract_addr": "0xcontract123...",
"token_id": "551"
}
]
}

Status: failed​

{
"poll_id": "0xabc123...:nft-rent:<siteId>:pi_3pp_1234",
"status": "failed",
"mint_status": "failed"
}

Poll every 1-2 seconds for up to a minute after entitlement/add returns.


Error Response (HTTP 400, 409, 500)​

Returned when the request is invalid or cannot be processed: HTTP 400 for an invalid request, 409 when a subscription's transaction.id was already used for a different elv_addr or SKU, and 500 for a server failure.

Example Error Response​

{
"message": "3pp submit failed, error normalizing request",
"error": {
"op": "3pp submit failed: invalid user address",
"kind": "unclassified error"
}
}

Common Error Messages​

MessageMeaning
Invalid requestRequest body is malformed
Invalid user addresselv_addr is not a valid wallet address
No marketplace for SKUSKU is not recognized
Marketplace does not match tenantSKU does not belong to your tenant
Refund not supported yetrefund is not a supported transaction_type; see below
Invalid transaction typeMust be purchase, rental, or subscription (or an alias)
Missing or invalid poll_idpoll_id path parameter was omitted or malformed (status API)
Missing or invalid elv_addr query parameterelv_addr query parameter was omitted or invalid (status API)
No SKU providedNeither sku nor skus was sent
Use either 'sku' or 'skus', not bothBoth sku and skus were sent
All SKUs must belong to the same marketplaceThe SKUs span more than one marketplace
SKU ... requires transaction_type ...The SKU's offer type (TVOD, EST, SVOD) needs a different transaction_type
Invalid search_indexsearch_index is not an iq__ ID
asset_claimer.refresh_token / nonce cannot be emptyasset_claimer was sent without both fields
subscription_details.end_timestamp is requiredsubscription was sent without end_timestamp
end_timestamp must be after start_timestampend_timestamp is at or before start_timestamp (default now)
grace_end_timestamp must not be before end_timestampgrace_end_timestamp is earlier than end_timestamp
subscription_details.status cannot be set on createSend status only to Update Subscription
A subscription takes exactly one SKUsubscription was sent with more than one SKU
SKU ... is not SVODsubscription was sent with a SKU that is not SVOD
Transaction id already used for a different elv_addr or skuHTTP 409: a resent subscription doesn't match the original

Refunds are not submitted through entitlement/add, even though some error messages list refund as a type. To refund a subscription, use Update Subscription with status: refunded. To take back a purchase or rental, use Revoke or Revoke by SKU.