Skip to main content

Revoke Entitlement by SKU

Overview​

The Tenant Entitlement Revoke by SKU API allows a tenant administrator to revoke a user's NFT-based entitlement for one or more SKUs in a single call.

To end a subscription, use Update Subscription (for example status: expired or status: refunded) rather than this API. This API removes the token but leaves the subscription active, so a later renewal would succeed for a user who no longer holds the token.


Endpoint​

POST /tnt/:tid/entitlement/revoke_by_sku

Authentication​

This API requires TenantAuth authorization -- a Tenant or Content admin CSAT.

Include the bearer token in the request header:

Authorization: Bearer <token>

Path Parameters​

NameTypeRequiredDescription
tidstringYesYour tenant identifier

Required Headers​

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

Request Body​

Provide either sku (single SKU) or skus (one or more SKUs). If both are present, skus takes precedence.

FieldTypeRequiredDescription
skustringNo*Single product SKU (use skus for multiple)
skusarray of stringNo*One or more product SKUs to revoke
from_addrstringYesCurrent owner address (must be the actual owner)

* One of sku or skus is required.


Curl Examples​

Single SKU​

curl -X POST "https://<fabric-authority-url>/tnt/<tenantId>/entitlement/revoke_by_sku" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"sku": "<sku-1>",
"from_addr": "0xowner123..."
}'

Multiple SKUs​

curl -X POST "https://<fabric-authority-url>/tnt/<tenantId>/entitlement/revoke_by_sku" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"skus": ["<sku-1>", "<sku-2>"],
"from_addr": "0xowner123..."
}'

Response​

Success Response​

Returned when all requested SKUs are successfully processed.

FieldTypeDescription
wallet_addrstringWallet address from which the NFT(s) were revoked
skusarray of stringSKUs that were processed
revokedarrayList of successfully revoked NFT tokens
revoked[].skustringSKU associated with this token
revoked[].contract_addrstringContract address of the revoked NFT
revoked[].token_idstringToken ID of the revoked NFT

Example Success Response​

{
"wallet_addr": "0xowner123...",
"skus": ["<sku-1>"],
"revoked": [
{
"sku": "<sku-1>",
"contract_addr": "0xcontract123...",
"token_id": "484"
}
]
}

Example Multi-SKU Success Response​

{
"wallet_addr": "0xowner123...",
"skus": ["<sku-1>", "<sku-2>"],
"revoked": [
{
"sku": "<sku-1>",
"contract_addr": "0xcontract123...",
"token_id": "484"
},
{
"sku": "<sku-2>",
"contract_addr": "0xcontract456...",
"token_id": "12"
}
]
}

Error / Partial Failure Response​

Returned when one or more NFT revocations fail.

FieldTypeDescription
wallet_addrstringWallet address from which the revoke was attempted
skusarray of stringSKUs that were processed
revokedarrayList of tokens successfully revoked (may be empty)
failedarrayList of tokens that failed to revoke
failed[].skustringSKU associated with this token
failed[].contract_addrstringContract address of the NFT that failed
failed[].token_idstringToken ID of the NFT that failed
failed[].errorstringError message explaining why the revoke failed

Example Failure Response​

{
"wallet_addr": "0xowner123...",
"skus": ["<sku-1>"],
"revoked": [],
"failed": [
{
"sku": "<sku-1>",
"contract_addr": "0xcontract123...",
"token_id": "484",
"error": "failed to process NFT Transfer from, err: op [error in ExecWaitTrans] kind [unclassified error] nonce [257] cause [execution reverted]"
}
]
}