AsyncAPI for entitlement service 0.0.1 documentation
In this document, PUB
means "publish" and SUB
means "subscribe". This refers to the "publish/subscribe" (pub/sub) messaging framework, where "publish" means that the service sends data to Kafka topics, and "subscribe" means the service acts as a consumer that subscribes to specific Kafka topics to receive data.
- Specification ID:
urn:net:accelbyte:platform:entitlement
- Protobuf File Spec: entitlement.proto
- Default content type: application/json
Table of Contents
Operations
PUB entitlementManagement
Operation
Accepts one of the following messages:
Message entitlementGranted
message is sent when user is granted with entitlement
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.grants | array<object> | - | - | - | - |
payload.grants.id | string | entitlement id | - | - | - |
payload.grants.namespace | string | entitlement namespace | - | - | - |
payload.grants.clazz | string | entitlement class | - | - | - |
payload.grants.type | string | entitlement type | - | - | - |
payload.grants.status | string | entitlement status | - | - | - |
payload.grants.appId | string | appId if entitlement is an app | - | - | - |
payload.grants.appType | string | appType if entitlement is an app | - | - | - |
payload.grants.sku | string | sku for purchased item | - | - | - |
payload.grants.userId | string | userId for this entitlement | - | - | - |
payload.grants.itemId | string | itemId of the entitlement | - | - | - |
payload.grants.itemNamespace | string | itemNamespace for the purchased item | - | - | - |
payload.grants.name | string | entitlement name | - | - | - |
payload.grants.useCount | integer | useCount for entitlement | - | format (int32 ) | - |
payload.grants.source | string | entitlement source | - | - | - |
payload.grants.startDate | string | entitlement start date | - | format (date-time ) | - |
payload.grants.endDate | string | entitlement end date | - | format (date-time ) | - |
payload.grants.grantedAt | string | entitlement granted at | - | format (date-time ) | - |
payload.grants.createdAt | string | entitlement created at | - | format (date-time ) | - |
payload.grants.updatedAt | string | entitlement updated at | - | format (date-time ) | - |
payload.grants.stackable | boolean | whether the entitlement is stackable | - | - | - |
payload.grants.stackedUseCount | integer | the stacked use count in the entitlement | - | format (int32 ) | - |
payload.grants.origin | string | entitlement origin | - | - | - |
payload.grants.collectionId | string | entitlement collection id | - | - | - |
payload.metadata | object | - | - | - | additional properties are allowed |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | event id | - | - | - |
version | integer | - | - | - | - |
name | string | event name | - | - | - |
namespace | string | event namespace | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | client id | - | - | - |
userId | string | the operator id | - | - | - |
traceId | string | trace id | - | - | - |
sessionId | string | session id | - | - | - |
Examples of payload (generated)
{
"payload": {
"grants": [
{
"id": "string",
"namespace": "string",
"clazz": "string",
"type": "string",
"status": "string",
"appId": "string",
"appType": "string",
"sku": "string",
"userId": "string",
"itemId": "string",
"itemNamespace": "string",
"name": "string",
"useCount": 0,
"source": "string",
"startDate": "2019-08-24T14:15:22Z",
"endDate": "2019-08-24T14:15:22Z",
"grantedAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"stackable": true,
"stackedUseCount": 0,
"origin": "string",
"collectionId": "string"
}
],
"metadata": {}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
Message entitlementUpdated
message is sent when entitlement is updated
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.entitlement | object | - | - | - | additional properties are allowed |
payload.entitlement.id | string | entitlement id | - | - | - |
payload.entitlement.namespace | string | entitlement namespace | - | - | - |
payload.entitlement.clazz | string | entitlement class | - | - | - |
payload.entitlement.type | string | entitlement type | - | - | - |
payload.entitlement.status | string | entitlement status | - | - | - |
payload.entitlement.appId | string | appId if entitlement is an app | - | - | - |
payload.entitlement.appType | string | appType if entitlement is an app | - | - | - |
payload.entitlement.sku | string | sku for purchased item | - | - | - |
payload.entitlement.userId | string | userId for this entitlement | - | - | - |
payload.entitlement.itemId | string | itemId of the entitlement | - | - | - |
payload.entitlement.itemNamespace | string | itemNamespace for the purchased item | - | - | - |
payload.entitlement.name | string | entitlement name | - | - | - |
payload.entitlement.useCount | integer | useCount for entitlement | - | format (int32 ) | - |
payload.entitlement.source | string | entitlement source | - | - | - |
payload.entitlement.startDate | string | entitlement start date | - | format (date-time ) | - |
payload.entitlement.endDate | string | entitlement end date | - | format (date-time ) | - |
payload.entitlement.grantedAt | string | entitlement granted at | - | format (date-time ) | - |
payload.entitlement.createdAt | string | entitlement created at | - | format (date-time ) | - |
payload.entitlement.updatedAt | string | entitlement updated at | - | format (date-time ) | - |
payload.entitlement.origin | string | - | - | - | - |
payload.entitlement.collectionId | string | - | - | - | - |
payload.oldEntitlement | object | - | - | - | additional properties are allowed |
payload.oldEntitlement.id | string | entitlement id | - | - | - |
payload.oldEntitlement.namespace | string | entitlement namespace | - | - | - |
payload.oldEntitlement.clazz | string | entitlement class | - | - | - |
payload.oldEntitlement.type | string | entitlement type | - | - | - |
payload.oldEntitlement.status | string | entitlement status | - | - | - |
payload.oldEntitlement.appId | string | appId if entitlement is an app | - | - | - |
payload.oldEntitlement.appType | string | appType if entitlement is an app | - | - | - |
payload.oldEntitlement.sku | string | sku for purchased item | - | - | - |
payload.oldEntitlement.userId | string | userId for this entitlement | - | - | - |
payload.oldEntitlement.itemId | string | itemId of the entitlement | - | - | - |
payload.oldEntitlement.itemNamespace | string | itemNamespace for the purchased item | - | - | - |
payload.oldEntitlement.name | string | entitlement name | - | - | - |
payload.oldEntitlement.useCount | integer | useCount for entitlement | - | format (int32 ) | - |
payload.oldEntitlement.source | string | entitlement source | - | - | - |
payload.oldEntitlement.startDate | string | entitlement start date | - | format (date-time ) | - |
payload.oldEntitlement.endDate | string | entitlement end date | - | format (date-time ) | - |
payload.oldEntitlement.grantedAt | string | entitlement granted at | - | format (date-time ) | - |
payload.oldEntitlement.createdAt | string | entitlement created at | - | format (date-time ) | - |
payload.oldEntitlement.updatedAt | string | entitlement updated at | - | format (date-time ) | - |
payload.oldEntitlement.origin | string | - | - | - | - |
payload.oldEntitlement.collectionId | string | - | - | - | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | event id | - | - | - |
version | integer | - | - | - | - |
name | string | event name | - | - | - |
namespace | string | event namespace | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | client id | - | - | - |
userId | string | the operator id | - | - | - |
traceId | string | trace id | - | - | - |
sessionId | string | session id | - | - | - |
Examples of payload (generated)
{
"payload": {
"entitlement": {
"id": "string",
"namespace": "string",
"clazz": "string",
"type": "string",
"status": "string",
"appId": "string",
"appType": "string",
"sku": "string",
"userId": "string",
"itemId": "string",
"itemNamespace": "string",
"name": "string",
"useCount": 0,
"source": "string",
"startDate": "2019-08-24T14:15:22Z",
"endDate": "2019-08-24T14:15:22Z",
"grantedAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"origin": "string",
"collectionId": "string"
},
"oldEntitlement": {
"id": "string",
"namespace": "string",
"clazz": "string",
"type": "string",
"status": "string",
"appId": "string",
"appType": "string",
"sku": "string",
"userId": "string",
"itemId": "string",
"itemNamespace": "string",
"name": "string",
"useCount": 0,
"source": "string",
"startDate": "2019-08-24T14:15:22Z",
"endDate": "2019-08-24T14:15:22Z",
"grantedAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"origin": "string",
"collectionId": "string"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
Message entitlementRevoked
message is sent when entitlement is revoked
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.entitlementRevocation | object | - | - | - | additional properties are allowed |
payload.entitlementRevocation.entitlementIds | array<string> | entitlement ids | - | - | - |
payload.entitlementRevocation.entitlementIds (single item) | string | - | - | - | - |
payload.entitlementRevocation.userId | string | user id | - | - | - |
payload.metadata | object | - | - | - | additional properties are allowed |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | event id | - | - | - |
version | integer | - | - | - | - |
name | string | event name | - | - | - |
namespace | string | event namespace | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | client id | - | - | - |
userId | string | the operator id | - | - | - |
traceId | string | trace id | - | - | - |
sessionId | string | session id | - | - | - |
Examples of payload (generated)
{
"payload": {
"entitlementRevocation": {
"entitlementIds": [
"string"
],
"userId": "string"
},
"metadata": {}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
Message entitlementDisabled
message is sent when entitlement is disabled
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.entitlementStatusChange | object | - | - | - | additional properties are allowed |
payload.entitlementStatusChange.entitlementId | string | entitlement id | - | - | - |
payload.entitlementStatusChange.entitlementName | string | entitlement name | - | - | - |
payload.entitlementStatusChange.userId | string | user id | - | - | - |
payload.entitlementStatusChange.status | string | entitlement status | allowed ("ACTIVE" , "INACTIVE" , "CONSUMED" , "REVOKED" , "SOLD" ) | - | - |
payload.entitlementStatusChange.previousStatus | string | entitlement status before change | allowed ("ACTIVE" , "INACTIVE" , "CONSUMED" , "REVOKED" , "SOLD" ) | - | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | event id | - | - | - |
version | integer | - | - | - | - |
name | string | event name | - | - | - |
namespace | string | event namespace | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | client id | - | - | - |
userId | string | the operator id | - | - | - |
traceId | string | trace id | - | - | - |
sessionId | string | session id | - | - | - |
Examples of payload (generated)
{
"payload": {
"entitlementStatusChange": {
"entitlementId": "string",
"entitlementName": "string",
"userId": "string",
"status": "ACTIVE",
"previousStatus": "ACTIVE"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
Message entitlementEnabled
message is sent when entitlement is enabled
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.entitlementStatusChange | object | - | - | - | additional properties are allowed |
payload.entitlementStatusChange.entitlementId | string | entitlement id | - | - | - |
payload.entitlementStatusChange.entitlementName | string | entitlement name | - | - | - |
payload.entitlementStatusChange.userId | string | user id | - | - | - |
payload.entitlementStatusChange.status | string | entitlement status | allowed ("ACTIVE" , "INACTIVE" , "CONSUMED" , "REVOKED" , "SOLD" ) | - | - |
payload.entitlementStatusChange.previousStatus | string | entitlement status before change | allowed ("ACTIVE" , "INACTIVE" , "CONSUMED" , "REVOKED" , "SOLD" ) | - | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | event id | - | - | - |
version | integer | - | - | - | - |
name | string | event name | - | - | - |
namespace | string | event namespace | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | client id | - | - | - |
userId | string | the operator id | - | - | - |
traceId | string | trace id | - | - | - |
sessionId | string | session id | - | - | - |
Examples of payload (generated)
{
"payload": {
"entitlementStatusChange": {
"entitlementId": "string",
"entitlementName": "string",
"userId": "string",
"status": "ACTIVE",
"previousStatus": "ACTIVE"
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
Message entitlementUseCountRevoked
message is sent when entitlement use count is revoked, only for consumable entitlement
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.entitlementUseCountRevocation | object | - | - | - | additional properties are allowed |
payload.entitlementUseCountRevocation.entitlementId | string | entitlement id | - | - | - |
payload.entitlementUseCountRevocation.entitlementName | string | entitlement name | - | - | - |
payload.entitlementUseCountRevocation.userId | string | user id | - | - | - |
payload.entitlementUseCountRevocation.useCount | integer | the useCount after entitlement was revoked | - | - | - |
payload.entitlementUseCountRevocation.count | integer | the count be revoked | - | - | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | event id | - | - | - |
version | integer | - | - | - | - |
name | string | event name | - | - | - |
namespace | string | event namespace | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | client id | - | - | - |
userId | string | the operator id | - | - | - |
traceId | string | trace id | - | - | - |
sessionId | string | session id | - | - | - |
Examples of payload (generated)
{
"payload": {
"entitlementUseCountRevocation": {
"entitlementId": "string",
"entitlementName": "string",
"userId": "string",
"useCount": 0,
"count": 0
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
PUB entitlementConsumption
Operation
Message entitlementConsumed
message is sent when user entitlement is consumed
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.entitlementConsumption | object | - | - | - | additional properties are allowed |
payload.entitlementConsumption.entitlementId | string | entitlement id | - | - | - |
payload.entitlementConsumption.entitlementName | string | entitlement name | - | - | - |
payload.entitlementConsumption.userId | string | user id | - | - | - |
payload.entitlementConsumption.useCount | integer | the useCount after entitlement was consumed | - | - | - |
payload.entitlementConsumption.count | integer | the count be consumed | - | - | - |
payload.metadata | object | - | - | - | additional properties are allowed |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | event id | - | - | - |
version | integer | - | - | - | - |
name | string | event name | - | - | - |
namespace | string | event namespace | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | client id | - | - | - |
userId | string | the operator id | - | - | - |
traceId | string | trace id | - | - | - |
sessionId | string | session id | - | - | - |
Examples of payload (generated)
{
"payload": {
"entitlementConsumption": {
"entitlementId": "string",
"entitlementName": "string",
"userId": "string",
"useCount": 0,
"count": 0
},
"metadata": {}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}
PUB entitlementSale
Operation
Message entitlementSellback
message is sent when user sell entitlement
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.entitlementSale | object | - | - | - | additional properties are allowed |
payload.entitlementSale.entitlementId | string | entitlement id | - | - | - |
payload.entitlementSale.entitlementName | string | entitlement name | - | - | - |
payload.entitlementSale.entitlementType | string | entitlement type | allowed ("DURABLE" , "CONSUMABLE" ) | - | - |
payload.entitlementSale.clazz | string | entitlement clazz | - | - | - |
payload.entitlementSale.userId | string | user id | - | - | - |
payload.entitlementSale.useCount | integer | the useCount after entitlement was consumed | - | - | - |
payload.entitlementSale.count | integer | the count be sold | - | - | - |
payload.entitlementSale.creditSummaries | array<object> | credit granted | - | - | - |
payload.entitlementSale.creditSummaries.walletId | string | wallet id | - | - | - |
payload.entitlementSale.creditSummaries.namespace | string | namespace | - | - | - |
payload.entitlementSale.creditSummaries.userId | string | user id | - | - | - |
payload.entitlementSale.creditSummaries.amount | integer | amount need to be paid | - | format (int64 ) | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | event id | - | - | - |
version | integer | - | - | - | - |
name | string | event name | - | - | - |
namespace | string | event namespace | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | client id | - | - | - |
userId | string | the operator id | - | - | - |
traceId | string | trace id | - | - | - |
sessionId | string | session id | - | - | - |
Examples of payload (generated)
{
"payload": {
"entitlementSale": {
"entitlementId": "string",
"entitlementName": "string",
"entitlementType": "DURABLE",
"clazz": "string",
"userId": "string",
"useCount": 0,
"count": 0,
"creditSummaries": [
{
"walletId": "string",
"namespace": "string",
"userId": "string",
"amount": 0
}
]
}
},
"id": "string",
"version": 0,
"name": "string",
"namespace": "string",
"parentNamespace": "string",
"timestamp": "2019-08-24T14:15:22Z",
"clientId": "string",
"userId": "string",
"traceId": "string",
"sessionId": "string"
}