Skip to main content

Create your own entitlement revocation Extend Override app

Last updated on May 21, 2025

Overview

This article explains the API contract (Protobuf) used in the Extend Override app for entitlement revocation.

service Revocation {
/**
Revoke
Currently, only Third-Party DLC Refund and Refund Order will trigger this grpc revocation.
*/
rpc Revoke(RevokeRequest) returns (RevokeResponse);
}

API Contract

Revoke

Revoke allows for the handling of revocation requests triggered by specific events within a gaming or virtual economy system. It is used for implementing the logic to manage entitlements and ensures the proper handling of refunds or revocation orders.

In this example, we will generate some custom responses for the three types of entries that are currently supported: ITEM, ENTITLEMENT, and CURRENCY.

The top-level revoke function gets the revoke entry type from the request and executes the corresponding function.

In the app, the following function can be found in src/AccelByte.PluginArch.Revocation.Demo.Server/Services/RevocationFunctionService.cs.

public override Task<RevokeResponse> Revoke(RevokeRequest request, ServerCallContext context)
{
var response = new RevokeResponse();
response.Status = "SUCCESS";

string revokeType = request.RevokeEntryType.Trim().ToUpper();
if (revokeType == "ITEM")
{
...
}
else if (revokeType == "CURRENCY")
{
...
}
else if (revokeType == "ENTITLEMENT")
{
...
}
else
{
response.Status = "FAIL";
response.Reason = $"Revocation type [{revokeType}] is not supported.";
}

return Task.FromResult(response);
}

If the revoke entry type is ITEM, the following function is executed.

response.CustomRevocation.Add(new Dictionary<string, string>()
{
{ "namespace", request.Namespace },
{ "userId", request.UserId },
{ "quantity", request.Quantity.ToString() },
{ "itemId", request.Item.ItemId },
{ "sku", request.Item.ItemSku },
{ "itemType", request.Item.ItemType },
{ "useCount", request.Item.UseCount.ToString() },
{ "entitlementType", request.Item.EntitlementType }
});

If the revoke entry type is CURRENCY, the following function is executed.

response.CustomRevocation.Add(new Dictionary<string, string>()
{
{ "namespace", request.Namespace },
{ "userId", request.UserId },
{ "quantity", request.Quantity.ToString() },
{ "currencyNamespace", request.Currency.Namespace },
{ "currencyCode", request.Currency.CurrencyCode },
{ "balanceOrigin", request.Currency.BalanceOrigin }
});

If the revoke entry type is ENTITLEMENT, the following function is executed.

response.CustomRevocation.Add(new Dictionary<string, string>()
{
{ "namespace", request.Namespace },
{ "userId", request.UserId },
{ "quantity", request.Quantity.ToString() },
{ "entitlementId", request.Entitlement.EntitlementId },
{ "itemId", request.Entitlement.ItemId },
{ "sku", request.Entitlement.Sku },
});
info

You could find more information about gRPC request handling here.