AsyncAPI for subscription service 0.1.0 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:subscription
- Protobuf File Spec: subscription.proto
Table of Contents
Operations
PUB subscription
Operation
Accepts one of the following messages:
Message subscribed
message is sent when user subscribe a subscription
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.subscription | object | - | - | - | additional properties are allowed |
payload.subscription.id | string | id | - | - | - |
payload.subscription.namespace | string | namespace | - | - | - |
payload.subscription.userId | string | user id | - | - | - |
payload.subscription.itemId | string | item id | - | - | - |
payload.subscription.sku | string | sku | - | - | - |
payload.subscription.title | string | title | - | - | - |
payload.subscription.currency | object | - | - | - | additional properties are allowed |
payload.subscription.currency.currencyCode | string | currency code | - | - | - |
payload.subscription.currency.currencySymbol | string | currency symbol | - | - | - |
payload.subscription.currency.currencyType | string | currency type | allowed ("REAL" , "VIRTUAL" ) | - | - |
payload.subscription.currency.namespace | string | namespace | - | - | - |
payload.subscription.currency.decimals | integer | decimals | - | format (int32 ) | - |
payload.subscription.price | integer | normal price | - | - | - |
payload.subscription.trialPrice | integer | trial price | - | - | - |
payload.subscription.recurring | object | - | - | - | additional properties are allowed |
payload.subscription.recurring.cycle | string | recurring cycle | allowed ("WEEKLY" , "MONTHLY" , "QUARTERLY" , "YEARLY" ) | - | - |
payload.subscription.recurring.fixedFreeDays | integer | fixed free days, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.fixedTrialCycles | integer | fixed trial cycles, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.graceDays | integer | recurring grace days, retry recurring charge within configured days if charge fail, default 7 | default (7 ) | format (int32 ) | - |
payload.subscription.status | string | status | allowed ("INIT" , "ACTIVE" , "CANCELLED" , "EXPIRED" ) | - | - |
payload.subscription.chargeStatus | string | charge status | allowed ("NEVER" , "SETUP" , "RECURRING_CHARGING" , "CHARGED" , "CHARGE_FAILED" ) | - | - |
payload.subscription.nextBillingDate | string | next billing date | - | format (date-time ) | - |
payload.subscription.currentPeriodStart | string | current period start time | - | format (date-time ) | - |
payload.subscription.currentPeriodEnd | string | current period end time | - | format (date-time ) | - |
payload.subscription.start | string | start date, the first time subscribed | - | format (date-time ) | - |
payload.subscription.end | string | end time if exists | - | format (date-time ) | - |
payload.subscription.currentCycle | integer | current cycle | - | - | - |
payload.subscription.chargedCycles | integer | already charged cycles | - | - | - |
payload.subscription.trialedCycles | integer | already trialed cycles if fixedCycleTrial exists | - | - | - |
payload.subscription.inFixedFreeDays | boolean | whether in fixed free days | - | - | - |
payload.subscription.inFixedCycleTrial | boolean | whether in fixed cycle trial | - | - | - |
payload.subscription.firstSubscribe | boolean | indicates whether is first subscribe | - | - | - |
payload.subscription.paid | boolean | whether user paid from the subscription start | - | - | - |
payload.subscription.subscribedBy | string | subscribed by PLATFORM(system granted) or USER(subscribed by user self) | allowed ("USER" , "PLATFORM" ) | - | - |
payload.subscription.subscribedAt | string | time when subscribed | - | format (date-time ) | - |
payload.subscription.unsubscribedAt | string | time when unsubscribed | - | format (date-time ) | - |
payload.subscription.unsubscribeReason | string | reason why unsubscribe | - | - | - |
payload.subscription.source | string | source | - | - | - |
payload.subscription.region | string | created region | - | - | - |
payload.subscription.language | string | created language | - | - | - |
payload.subscription.sandbox | boolean | is sandbox mode | - | - | - |
payload.subscription.createdAt | string | - | - | format (date-time ) | - |
payload.subscription.updateAt | string | - | - | format (date-time ) | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | - | - | - | - |
version | integer | - | - | - | - |
name | string | - | - | - | - |
namespace | string | - | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | - | - | - | - |
userId | string | - | - | - | - |
traceId | string | - | - | - | - |
sessionId | string | - | - | - | - |
Examples of payload (generated)
{
"payload": {
"subscription": {
"id": "string",
"namespace": "string",
"userId": "string",
"itemId": "string",
"sku": "string",
"title": "string",
"currency": {
"currencyCode": "string",
"currencySymbol": "string",
"currencyType": "REAL",
"namespace": "string",
"decimals": 0
},
"price": 0,
"trialPrice": 0,
"recurring": {
"cycle": "WEEKLY",
"fixedFreeDays": 0,
"fixedTrialCycles": 0,
"graceDays": 7
},
"status": "INIT",
"chargeStatus": "NEVER",
"nextBillingDate": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"currentCycle": 0,
"chargedCycles": 0,
"trialedCycles": 0,
"inFixedFreeDays": true,
"inFixedCycleTrial": true,
"firstSubscribe": true,
"paid": true,
"subscribedBy": "USER",
"subscribedAt": "2019-08-24T14:15:22Z",
"unsubscribedAt": "2019-08-24T14:15:22Z",
"unsubscribeReason": "string",
"source": "string",
"region": "string",
"language": "string",
"sandbox": true,
"createdAt": "2019-08-24T14:15:22Z",
"updateAt": "2019-08-24T14:15:22Z"
}
},
"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 cancelled
message is sent when a subscription is cancelled
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.subscription | object | - | - | - | additional properties are allowed |
payload.subscription.id | string | id | - | - | - |
payload.subscription.namespace | string | namespace | - | - | - |
payload.subscription.userId | string | user id | - | - | - |
payload.subscription.itemId | string | item id | - | - | - |
payload.subscription.sku | string | sku | - | - | - |
payload.subscription.title | string | title | - | - | - |
payload.subscription.currency | object | - | - | - | additional properties are allowed |
payload.subscription.currency.currencyCode | string | currency code | - | - | - |
payload.subscription.currency.currencySymbol | string | currency symbol | - | - | - |
payload.subscription.currency.currencyType | string | currency type | allowed ("REAL" , "VIRTUAL" ) | - | - |
payload.subscription.currency.namespace | string | namespace | - | - | - |
payload.subscription.currency.decimals | integer | decimals | - | format (int32 ) | - |
payload.subscription.price | integer | normal price | - | - | - |
payload.subscription.trialPrice | integer | trial price | - | - | - |
payload.subscription.recurring | object | - | - | - | additional properties are allowed |
payload.subscription.recurring.cycle | string | recurring cycle | allowed ("WEEKLY" , "MONTHLY" , "QUARTERLY" , "YEARLY" ) | - | - |
payload.subscription.recurring.fixedFreeDays | integer | fixed free days, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.fixedTrialCycles | integer | fixed trial cycles, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.graceDays | integer | recurring grace days, retry recurring charge within configured days if charge fail, default 7 | default (7 ) | format (int32 ) | - |
payload.subscription.status | string | status | allowed ("INIT" , "ACTIVE" , "CANCELLED" , "EXPIRED" ) | - | - |
payload.subscription.chargeStatus | string | charge status | allowed ("NEVER" , "SETUP" , "RECURRING_CHARGING" , "CHARGED" , "CHARGE_FAILED" ) | - | - |
payload.subscription.nextBillingDate | string | next billing date | - | format (date-time ) | - |
payload.subscription.currentPeriodStart | string | current period start time | - | format (date-time ) | - |
payload.subscription.currentPeriodEnd | string | current period end time | - | format (date-time ) | - |
payload.subscription.start | string | start date, the first time subscribed | - | format (date-time ) | - |
payload.subscription.end | string | end time if exists | - | format (date-time ) | - |
payload.subscription.currentCycle | integer | current cycle | - | - | - |
payload.subscription.chargedCycles | integer | already charged cycles | - | - | - |
payload.subscription.trialedCycles | integer | already trialed cycles if fixedCycleTrial exists | - | - | - |
payload.subscription.inFixedFreeDays | boolean | whether in fixed free days | - | - | - |
payload.subscription.inFixedCycleTrial | boolean | whether in fixed cycle trial | - | - | - |
payload.subscription.firstSubscribe | boolean | indicates whether is first subscribe | - | - | - |
payload.subscription.paid | boolean | whether user paid from the subscription start | - | - | - |
payload.subscription.subscribedBy | string | subscribed by PLATFORM(system granted) or USER(subscribed by user self) | allowed ("USER" , "PLATFORM" ) | - | - |
payload.subscription.subscribedAt | string | time when subscribed | - | format (date-time ) | - |
payload.subscription.unsubscribedAt | string | time when unsubscribed | - | format (date-time ) | - |
payload.subscription.unsubscribeReason | string | reason why unsubscribe | - | - | - |
payload.subscription.source | string | source | - | - | - |
payload.subscription.region | string | created region | - | - | - |
payload.subscription.language | string | created language | - | - | - |
payload.subscription.sandbox | boolean | is sandbox mode | - | - | - |
payload.subscription.createdAt | string | - | - | format (date-time ) | - |
payload.subscription.updateAt | string | - | - | format (date-time ) | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | - | - | - | - |
version | integer | - | - | - | - |
name | string | - | - | - | - |
namespace | string | - | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | - | - | - | - |
userId | string | - | - | - | - |
traceId | string | - | - | - | - |
sessionId | string | - | - | - | - |
Examples of payload (generated)
{
"payload": {
"subscription": {
"id": "string",
"namespace": "string",
"userId": "string",
"itemId": "string",
"sku": "string",
"title": "string",
"currency": {
"currencyCode": "string",
"currencySymbol": "string",
"currencyType": "REAL",
"namespace": "string",
"decimals": 0
},
"price": 0,
"trialPrice": 0,
"recurring": {
"cycle": "WEEKLY",
"fixedFreeDays": 0,
"fixedTrialCycles": 0,
"graceDays": 7
},
"status": "INIT",
"chargeStatus": "NEVER",
"nextBillingDate": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"currentCycle": 0,
"chargedCycles": 0,
"trialedCycles": 0,
"inFixedFreeDays": true,
"inFixedCycleTrial": true,
"firstSubscribe": true,
"paid": true,
"subscribedBy": "USER",
"subscribedAt": "2019-08-24T14:15:22Z",
"unsubscribedAt": "2019-08-24T14:15:22Z",
"unsubscribeReason": "string",
"source": "string",
"region": "string",
"language": "string",
"sandbox": true,
"createdAt": "2019-08-24T14:15:22Z",
"updateAt": "2019-08-24T14:15:22Z"
}
},
"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 immediateCancelled
message is sent when a subscription is cancelled immediately
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.subscription | object | - | - | - | additional properties are allowed |
payload.subscription.id | string | id | - | - | - |
payload.subscription.namespace | string | namespace | - | - | - |
payload.subscription.userId | string | user id | - | - | - |
payload.subscription.itemId | string | item id | - | - | - |
payload.subscription.sku | string | sku | - | - | - |
payload.subscription.title | string | title | - | - | - |
payload.subscription.currency | object | - | - | - | additional properties are allowed |
payload.subscription.currency.currencyCode | string | currency code | - | - | - |
payload.subscription.currency.currencySymbol | string | currency symbol | - | - | - |
payload.subscription.currency.currencyType | string | currency type | allowed ("REAL" , "VIRTUAL" ) | - | - |
payload.subscription.currency.namespace | string | namespace | - | - | - |
payload.subscription.currency.decimals | integer | decimals | - | format (int32 ) | - |
payload.subscription.price | integer | normal price | - | - | - |
payload.subscription.trialPrice | integer | trial price | - | - | - |
payload.subscription.recurring | object | - | - | - | additional properties are allowed |
payload.subscription.recurring.cycle | string | recurring cycle | allowed ("WEEKLY" , "MONTHLY" , "QUARTERLY" , "YEARLY" ) | - | - |
payload.subscription.recurring.fixedFreeDays | integer | fixed free days, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.fixedTrialCycles | integer | fixed trial cycles, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.graceDays | integer | recurring grace days, retry recurring charge within configured days if charge fail, default 7 | default (7 ) | format (int32 ) | - |
payload.subscription.status | string | status | allowed ("INIT" , "ACTIVE" , "CANCELLED" , "EXPIRED" ) | - | - |
payload.subscription.chargeStatus | string | charge status | allowed ("NEVER" , "SETUP" , "RECURRING_CHARGING" , "CHARGED" , "CHARGE_FAILED" ) | - | - |
payload.subscription.nextBillingDate | string | next billing date | - | format (date-time ) | - |
payload.subscription.currentPeriodStart | string | current period start time | - | format (date-time ) | - |
payload.subscription.currentPeriodEnd | string | current period end time | - | format (date-time ) | - |
payload.subscription.start | string | start date, the first time subscribed | - | format (date-time ) | - |
payload.subscription.end | string | end time if exists | - | format (date-time ) | - |
payload.subscription.currentCycle | integer | current cycle | - | - | - |
payload.subscription.chargedCycles | integer | already charged cycles | - | - | - |
payload.subscription.trialedCycles | integer | already trialed cycles if fixedCycleTrial exists | - | - | - |
payload.subscription.inFixedFreeDays | boolean | whether in fixed free days | - | - | - |
payload.subscription.inFixedCycleTrial | boolean | whether in fixed cycle trial | - | - | - |
payload.subscription.firstSubscribe | boolean | indicates whether is first subscribe | - | - | - |
payload.subscription.paid | boolean | whether user paid from the subscription start | - | - | - |
payload.subscription.subscribedBy | string | subscribed by PLATFORM(system granted) or USER(subscribed by user self) | allowed ("USER" , "PLATFORM" ) | - | - |
payload.subscription.subscribedAt | string | time when subscribed | - | format (date-time ) | - |
payload.subscription.unsubscribedAt | string | time when unsubscribed | - | format (date-time ) | - |
payload.subscription.unsubscribeReason | string | reason why unsubscribe | - | - | - |
payload.subscription.source | string | source | - | - | - |
payload.subscription.region | string | created region | - | - | - |
payload.subscription.language | string | created language | - | - | - |
payload.subscription.sandbox | boolean | is sandbox mode | - | - | - |
payload.subscription.createdAt | string | - | - | format (date-time ) | - |
payload.subscription.updateAt | string | - | - | format (date-time ) | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | - | - | - | - |
version | integer | - | - | - | - |
name | string | - | - | - | - |
namespace | string | - | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | - | - | - | - |
userId | string | - | - | - | - |
traceId | string | - | - | - | - |
sessionId | string | - | - | - | - |
Examples of payload (generated)
{
"payload": {
"subscription": {
"id": "string",
"namespace": "string",
"userId": "string",
"itemId": "string",
"sku": "string",
"title": "string",
"currency": {
"currencyCode": "string",
"currencySymbol": "string",
"currencyType": "REAL",
"namespace": "string",
"decimals": 0
},
"price": 0,
"trialPrice": 0,
"recurring": {
"cycle": "WEEKLY",
"fixedFreeDays": 0,
"fixedTrialCycles": 0,
"graceDays": 7
},
"status": "INIT",
"chargeStatus": "NEVER",
"nextBillingDate": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"currentCycle": 0,
"chargedCycles": 0,
"trialedCycles": 0,
"inFixedFreeDays": true,
"inFixedCycleTrial": true,
"firstSubscribe": true,
"paid": true,
"subscribedBy": "USER",
"subscribedAt": "2019-08-24T14:15:22Z",
"unsubscribedAt": "2019-08-24T14:15:22Z",
"unsubscribeReason": "string",
"source": "string",
"region": "string",
"language": "string",
"sandbox": true,
"createdAt": "2019-08-24T14:15:22Z",
"updateAt": "2019-08-24T14:15:22Z"
}
},
"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 resubscribed
message is sent when user resubscribe a subscription
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.subscription | object | - | - | - | additional properties are allowed |
payload.subscription.id | string | id | - | - | - |
payload.subscription.namespace | string | namespace | - | - | - |
payload.subscription.userId | string | user id | - | - | - |
payload.subscription.itemId | string | item id | - | - | - |
payload.subscription.sku | string | sku | - | - | - |
payload.subscription.title | string | title | - | - | - |
payload.subscription.currency | object | - | - | - | additional properties are allowed |
payload.subscription.currency.currencyCode | string | currency code | - | - | - |
payload.subscription.currency.currencySymbol | string | currency symbol | - | - | - |
payload.subscription.currency.currencyType | string | currency type | allowed ("REAL" , "VIRTUAL" ) | - | - |
payload.subscription.currency.namespace | string | namespace | - | - | - |
payload.subscription.currency.decimals | integer | decimals | - | format (int32 ) | - |
payload.subscription.price | integer | normal price | - | - | - |
payload.subscription.trialPrice | integer | trial price | - | - | - |
payload.subscription.recurring | object | - | - | - | additional properties are allowed |
payload.subscription.recurring.cycle | string | recurring cycle | allowed ("WEEKLY" , "MONTHLY" , "QUARTERLY" , "YEARLY" ) | - | - |
payload.subscription.recurring.fixedFreeDays | integer | fixed free days, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.fixedTrialCycles | integer | fixed trial cycles, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.graceDays | integer | recurring grace days, retry recurring charge within configured days if charge fail, default 7 | default (7 ) | format (int32 ) | - |
payload.subscription.status | string | status | allowed ("INIT" , "ACTIVE" , "CANCELLED" , "EXPIRED" ) | - | - |
payload.subscription.chargeStatus | string | charge status | allowed ("NEVER" , "SETUP" , "RECURRING_CHARGING" , "CHARGED" , "CHARGE_FAILED" ) | - | - |
payload.subscription.nextBillingDate | string | next billing date | - | format (date-time ) | - |
payload.subscription.currentPeriodStart | string | current period start time | - | format (date-time ) | - |
payload.subscription.currentPeriodEnd | string | current period end time | - | format (date-time ) | - |
payload.subscription.start | string | start date, the first time subscribed | - | format (date-time ) | - |
payload.subscription.end | string | end time if exists | - | format (date-time ) | - |
payload.subscription.currentCycle | integer | current cycle | - | - | - |
payload.subscription.chargedCycles | integer | already charged cycles | - | - | - |
payload.subscription.trialedCycles | integer | already trialed cycles if fixedCycleTrial exists | - | - | - |
payload.subscription.inFixedFreeDays | boolean | whether in fixed free days | - | - | - |
payload.subscription.inFixedCycleTrial | boolean | whether in fixed cycle trial | - | - | - |
payload.subscription.firstSubscribe | boolean | indicates whether is first subscribe | - | - | - |
payload.subscription.paid | boolean | whether user paid from the subscription start | - | - | - |
payload.subscription.subscribedBy | string | subscribed by PLATFORM(system granted) or USER(subscribed by user self) | allowed ("USER" , "PLATFORM" ) | - | - |
payload.subscription.subscribedAt | string | time when subscribed | - | format (date-time ) | - |
payload.subscription.unsubscribedAt | string | time when unsubscribed | - | format (date-time ) | - |
payload.subscription.unsubscribeReason | string | reason why unsubscribe | - | - | - |
payload.subscription.source | string | source | - | - | - |
payload.subscription.region | string | created region | - | - | - |
payload.subscription.language | string | created language | - | - | - |
payload.subscription.sandbox | boolean | is sandbox mode | - | - | - |
payload.subscription.createdAt | string | - | - | format (date-time ) | - |
payload.subscription.updateAt | string | - | - | format (date-time ) | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | - | - | - | - |
version | integer | - | - | - | - |
name | string | - | - | - | - |
namespace | string | - | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | - | - | - | - |
userId | string | - | - | - | - |
traceId | string | - | - | - | - |
sessionId | string | - | - | - | - |
Examples of payload (generated)
{
"payload": {
"subscription": {
"id": "string",
"namespace": "string",
"userId": "string",
"itemId": "string",
"sku": "string",
"title": "string",
"currency": {
"currencyCode": "string",
"currencySymbol": "string",
"currencyType": "REAL",
"namespace": "string",
"decimals": 0
},
"price": 0,
"trialPrice": 0,
"recurring": {
"cycle": "WEEKLY",
"fixedFreeDays": 0,
"fixedTrialCycles": 0,
"graceDays": 7
},
"status": "INIT",
"chargeStatus": "NEVER",
"nextBillingDate": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"currentCycle": 0,
"chargedCycles": 0,
"trialedCycles": 0,
"inFixedFreeDays": true,
"inFixedCycleTrial": true,
"firstSubscribe": true,
"paid": true,
"subscribedBy": "USER",
"subscribedAt": "2019-08-24T14:15:22Z",
"unsubscribedAt": "2019-08-24T14:15:22Z",
"unsubscribeReason": "string",
"source": "string",
"region": "string",
"language": "string",
"sandbox": true,
"createdAt": "2019-08-24T14:15:22Z",
"updateAt": "2019-08-24T14:15:22Z"
}
},
"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 daysGranted
message is sent when grant days to subscription
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.subscription | object | - | - | - | additional properties are allowed |
payload.subscription.id | string | id | - | - | - |
payload.subscription.namespace | string | namespace | - | - | - |
payload.subscription.userId | string | user id | - | - | - |
payload.subscription.itemId | string | item id | - | - | - |
payload.subscription.sku | string | sku | - | - | - |
payload.subscription.title | string | title | - | - | - |
payload.subscription.currency | object | - | - | - | additional properties are allowed |
payload.subscription.currency.currencyCode | string | currency code | - | - | - |
payload.subscription.currency.currencySymbol | string | currency symbol | - | - | - |
payload.subscription.currency.currencyType | string | currency type | allowed ("REAL" , "VIRTUAL" ) | - | - |
payload.subscription.currency.namespace | string | namespace | - | - | - |
payload.subscription.currency.decimals | integer | decimals | - | format (int32 ) | - |
payload.subscription.price | integer | normal price | - | - | - |
payload.subscription.trialPrice | integer | trial price | - | - | - |
payload.subscription.recurring | object | - | - | - | additional properties are allowed |
payload.subscription.recurring.cycle | string | recurring cycle | allowed ("WEEKLY" , "MONTHLY" , "QUARTERLY" , "YEARLY" ) | - | - |
payload.subscription.recurring.fixedFreeDays | integer | fixed free days, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.fixedTrialCycles | integer | fixed trial cycles, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.graceDays | integer | recurring grace days, retry recurring charge within configured days if charge fail, default 7 | default (7 ) | format (int32 ) | - |
payload.subscription.status | string | status | allowed ("INIT" , "ACTIVE" , "CANCELLED" , "EXPIRED" ) | - | - |
payload.subscription.chargeStatus | string | charge status | allowed ("NEVER" , "SETUP" , "RECURRING_CHARGING" , "CHARGED" , "CHARGE_FAILED" ) | - | - |
payload.subscription.nextBillingDate | string | next billing date | - | format (date-time ) | - |
payload.subscription.currentPeriodStart | string | current period start time | - | format (date-time ) | - |
payload.subscription.currentPeriodEnd | string | current period end time | - | format (date-time ) | - |
payload.subscription.start | string | start date, the first time subscribed | - | format (date-time ) | - |
payload.subscription.end | string | end time if exists | - | format (date-time ) | - |
payload.subscription.currentCycle | integer | current cycle | - | - | - |
payload.subscription.chargedCycles | integer | already charged cycles | - | - | - |
payload.subscription.trialedCycles | integer | already trialed cycles if fixedCycleTrial exists | - | - | - |
payload.subscription.inFixedFreeDays | boolean | whether in fixed free days | - | - | - |
payload.subscription.inFixedCycleTrial | boolean | whether in fixed cycle trial | - | - | - |
payload.subscription.firstSubscribe | boolean | indicates whether is first subscribe | - | - | - |
payload.subscription.paid | boolean | whether user paid from the subscription start | - | - | - |
payload.subscription.subscribedBy | string | subscribed by PLATFORM(system granted) or USER(subscribed by user self) | allowed ("USER" , "PLATFORM" ) | - | - |
payload.subscription.subscribedAt | string | time when subscribed | - | format (date-time ) | - |
payload.subscription.unsubscribedAt | string | time when unsubscribed | - | format (date-time ) | - |
payload.subscription.unsubscribeReason | string | reason why unsubscribe | - | - | - |
payload.subscription.source | string | source | - | - | - |
payload.subscription.region | string | created region | - | - | - |
payload.subscription.language | string | created language | - | - | - |
payload.subscription.sandbox | boolean | is sandbox mode | - | - | - |
payload.subscription.createdAt | string | - | - | format (date-time ) | - |
payload.subscription.updateAt | string | - | - | format (date-time ) | - |
payload.grantDays | integer | - | - | - | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | - | - | - | - |
version | integer | - | - | - | - |
name | string | - | - | - | - |
namespace | string | - | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | - | - | - | - |
userId | string | - | - | - | - |
traceId | string | - | - | - | - |
sessionId | string | - | - | - | - |
Examples of payload (generated)
{
"payload": {
"subscription": {
"id": "string",
"namespace": "string",
"userId": "string",
"itemId": "string",
"sku": "string",
"title": "string",
"currency": {
"currencyCode": "string",
"currencySymbol": "string",
"currencyType": "REAL",
"namespace": "string",
"decimals": 0
},
"price": 0,
"trialPrice": 0,
"recurring": {
"cycle": "WEEKLY",
"fixedFreeDays": 0,
"fixedTrialCycles": 0,
"graceDays": 7
},
"status": "INIT",
"chargeStatus": "NEVER",
"nextBillingDate": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"currentCycle": 0,
"chargedCycles": 0,
"trialedCycles": 0,
"inFixedFreeDays": true,
"inFixedCycleTrial": true,
"firstSubscribe": true,
"paid": true,
"subscribedBy": "USER",
"subscribedAt": "2019-08-24T14:15:22Z",
"unsubscribedAt": "2019-08-24T14:15:22Z",
"unsubscribeReason": "string",
"source": "string",
"region": "string",
"language": "string",
"sandbox": true,
"createdAt": "2019-08-24T14:15:22Z",
"updateAt": "2019-08-24T14:15:22Z"
},
"grantDays": 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"
}
Message charged
message is sent when billing is charged
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.subscription | object | - | - | - | additional properties are allowed |
payload.subscription.id | string | id | - | - | - |
payload.subscription.namespace | string | namespace | - | - | - |
payload.subscription.userId | string | user id | - | - | - |
payload.subscription.itemId | string | item id | - | - | - |
payload.subscription.sku | string | sku | - | - | - |
payload.subscription.title | string | title | - | - | - |
payload.subscription.currency | object | - | - | - | additional properties are allowed |
payload.subscription.currency.currencyCode | string | currency code | - | - | - |
payload.subscription.currency.currencySymbol | string | currency symbol | - | - | - |
payload.subscription.currency.currencyType | string | currency type | allowed ("REAL" , "VIRTUAL" ) | - | - |
payload.subscription.currency.namespace | string | namespace | - | - | - |
payload.subscription.currency.decimals | integer | decimals | - | format (int32 ) | - |
payload.subscription.price | integer | normal price | - | - | - |
payload.subscription.trialPrice | integer | trial price | - | - | - |
payload.subscription.recurring | object | - | - | - | additional properties are allowed |
payload.subscription.recurring.cycle | string | recurring cycle | allowed ("WEEKLY" , "MONTHLY" , "QUARTERLY" , "YEARLY" ) | - | - |
payload.subscription.recurring.fixedFreeDays | integer | fixed free days, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.fixedTrialCycles | integer | fixed trial cycles, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.graceDays | integer | recurring grace days, retry recurring charge within configured days if charge fail, default 7 | default (7 ) | format (int32 ) | - |
payload.subscription.status | string | status | allowed ("INIT" , "ACTIVE" , "CANCELLED" , "EXPIRED" ) | - | - |
payload.subscription.chargeStatus | string | charge status | allowed ("NEVER" , "SETUP" , "RECURRING_CHARGING" , "CHARGED" , "CHARGE_FAILED" ) | - | - |
payload.subscription.nextBillingDate | string | next billing date | - | format (date-time ) | - |
payload.subscription.currentPeriodStart | string | current period start time | - | format (date-time ) | - |
payload.subscription.currentPeriodEnd | string | current period end time | - | format (date-time ) | - |
payload.subscription.start | string | start date, the first time subscribed | - | format (date-time ) | - |
payload.subscription.end | string | end time if exists | - | format (date-time ) | - |
payload.subscription.currentCycle | integer | current cycle | - | - | - |
payload.subscription.chargedCycles | integer | already charged cycles | - | - | - |
payload.subscription.trialedCycles | integer | already trialed cycles if fixedCycleTrial exists | - | - | - |
payload.subscription.inFixedFreeDays | boolean | whether in fixed free days | - | - | - |
payload.subscription.inFixedCycleTrial | boolean | whether in fixed cycle trial | - | - | - |
payload.subscription.firstSubscribe | boolean | indicates whether is first subscribe | - | - | - |
payload.subscription.paid | boolean | whether user paid from the subscription start | - | - | - |
payload.subscription.subscribedBy | string | subscribed by PLATFORM(system granted) or USER(subscribed by user self) | allowed ("USER" , "PLATFORM" ) | - | - |
payload.subscription.subscribedAt | string | time when subscribed | - | format (date-time ) | - |
payload.subscription.unsubscribedAt | string | time when unsubscribed | - | format (date-time ) | - |
payload.subscription.unsubscribeReason | string | reason why unsubscribe | - | - | - |
payload.subscription.source | string | source | - | - | - |
payload.subscription.region | string | created region | - | - | - |
payload.subscription.language | string | created language | - | - | - |
payload.subscription.sandbox | boolean | is sandbox mode | - | - | - |
payload.subscription.createdAt | string | - | - | format (date-time ) | - |
payload.subscription.updateAt | string | - | - | format (date-time ) | - |
payload.billing | object | - | - | - | additional properties are allowed |
payload.billing.paymentProvider | object | payment provider | allowed ("WALLET" , "XSOLLA" , "ADYEN" , "STRIPE" , "ALIPAY" , "WXPAY" , "PAYPAL" ) | - | additional properties are allowed |
payload.billing.paymentMethod | string | payment method | - | - | - |
payload.billing.amount | integer | charge amount | - | - | - |
payload.billing.totalTax | integer | total tax | - | - | - |
payload.billing.totalPrice | integer | total price | - | - | - |
payload.billing.subtotalPrice | integer | subtotal price | - | - | - |
payload.billing.recurringOrderNo | string | recurring order no for this billing | - | - | - |
payload.billing.paymentOrderNo | string | payment order no | - | - | - |
payload.billing.txEndTime | string | transaction end time | - | format (date-time ) | - |
payload.billing.extTxId | string | external transaction id | - | - | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | - | - | - | - |
version | integer | - | - | - | - |
name | string | - | - | - | - |
namespace | string | - | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | - | - | - | - |
userId | string | - | - | - | - |
traceId | string | - | - | - | - |
sessionId | string | - | - | - | - |
Examples of payload (generated)
{
"payload": {
"subscription": {
"id": "string",
"namespace": "string",
"userId": "string",
"itemId": "string",
"sku": "string",
"title": "string",
"currency": {
"currencyCode": "string",
"currencySymbol": "string",
"currencyType": "REAL",
"namespace": "string",
"decimals": 0
},
"price": 0,
"trialPrice": 0,
"recurring": {
"cycle": "WEEKLY",
"fixedFreeDays": 0,
"fixedTrialCycles": 0,
"graceDays": 7
},
"status": "INIT",
"chargeStatus": "NEVER",
"nextBillingDate": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"currentCycle": 0,
"chargedCycles": 0,
"trialedCycles": 0,
"inFixedFreeDays": true,
"inFixedCycleTrial": true,
"firstSubscribe": true,
"paid": true,
"subscribedBy": "USER",
"subscribedAt": "2019-08-24T14:15:22Z",
"unsubscribedAt": "2019-08-24T14:15:22Z",
"unsubscribeReason": "string",
"source": "string",
"region": "string",
"language": "string",
"sandbox": true,
"createdAt": "2019-08-24T14:15:22Z",
"updateAt": "2019-08-24T14:15:22Z"
},
"billing": {
"paymentProvider": "WALLET",
"paymentMethod": "string",
"amount": 0,
"totalTax": 0,
"totalPrice": 0,
"subtotalPrice": 0,
"recurringOrderNo": "string",
"paymentOrderNo": "string",
"txEndTime": "2019-08-24T14:15:22Z",
"extTxId": "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 chargeFailed
message is sent when billing is charge failed
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.subscription | object | - | - | - | additional properties are allowed |
payload.subscription.id | string | id | - | - | - |
payload.subscription.namespace | string | namespace | - | - | - |
payload.subscription.userId | string | user id | - | - | - |
payload.subscription.itemId | string | item id | - | - | - |
payload.subscription.sku | string | sku | - | - | - |
payload.subscription.title | string | title | - | - | - |
payload.subscription.currency | object | - | - | - | additional properties are allowed |
payload.subscription.currency.currencyCode | string | currency code | - | - | - |
payload.subscription.currency.currencySymbol | string | currency symbol | - | - | - |
payload.subscription.currency.currencyType | string | currency type | allowed ("REAL" , "VIRTUAL" ) | - | - |
payload.subscription.currency.namespace | string | namespace | - | - | - |
payload.subscription.currency.decimals | integer | decimals | - | format (int32 ) | - |
payload.subscription.price | integer | normal price | - | - | - |
payload.subscription.trialPrice | integer | trial price | - | - | - |
payload.subscription.recurring | object | - | - | - | additional properties are allowed |
payload.subscription.recurring.cycle | string | recurring cycle | allowed ("WEEKLY" , "MONTHLY" , "QUARTERLY" , "YEARLY" ) | - | - |
payload.subscription.recurring.fixedFreeDays | integer | fixed free days, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.fixedTrialCycles | integer | fixed trial cycles, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.graceDays | integer | recurring grace days, retry recurring charge within configured days if charge fail, default 7 | default (7 ) | format (int32 ) | - |
payload.subscription.status | string | status | allowed ("INIT" , "ACTIVE" , "CANCELLED" , "EXPIRED" ) | - | - |
payload.subscription.chargeStatus | string | charge status | allowed ("NEVER" , "SETUP" , "RECURRING_CHARGING" , "CHARGED" , "CHARGE_FAILED" ) | - | - |
payload.subscription.nextBillingDate | string | next billing date | - | format (date-time ) | - |
payload.subscription.currentPeriodStart | string | current period start time | - | format (date-time ) | - |
payload.subscription.currentPeriodEnd | string | current period end time | - | format (date-time ) | - |
payload.subscription.start | string | start date, the first time subscribed | - | format (date-time ) | - |
payload.subscription.end | string | end time if exists | - | format (date-time ) | - |
payload.subscription.currentCycle | integer | current cycle | - | - | - |
payload.subscription.chargedCycles | integer | already charged cycles | - | - | - |
payload.subscription.trialedCycles | integer | already trialed cycles if fixedCycleTrial exists | - | - | - |
payload.subscription.inFixedFreeDays | boolean | whether in fixed free days | - | - | - |
payload.subscription.inFixedCycleTrial | boolean | whether in fixed cycle trial | - | - | - |
payload.subscription.firstSubscribe | boolean | indicates whether is first subscribe | - | - | - |
payload.subscription.paid | boolean | whether user paid from the subscription start | - | - | - |
payload.subscription.subscribedBy | string | subscribed by PLATFORM(system granted) or USER(subscribed by user self) | allowed ("USER" , "PLATFORM" ) | - | - |
payload.subscription.subscribedAt | string | time when subscribed | - | format (date-time ) | - |
payload.subscription.unsubscribedAt | string | time when unsubscribed | - | format (date-time ) | - |
payload.subscription.unsubscribeReason | string | reason why unsubscribe | - | - | - |
payload.subscription.source | string | source | - | - | - |
payload.subscription.region | string | created region | - | - | - |
payload.subscription.language | string | created language | - | - | - |
payload.subscription.sandbox | boolean | is sandbox mode | - | - | - |
payload.subscription.createdAt | string | - | - | format (date-time ) | - |
payload.subscription.updateAt | string | - | - | format (date-time ) | - |
payload.billing | object | - | - | - | additional properties are allowed |
payload.billing.paymentProvider | object | payment provider | allowed ("WALLET" , "XSOLLA" , "ADYEN" , "STRIPE" , "ALIPAY" , "WXPAY" , "PAYPAL" ) | - | additional properties are allowed |
payload.billing.paymentMethod | string | payment method | - | - | - |
payload.billing.amount | integer | charge amount | - | - | - |
payload.billing.totalTax | integer | total tax | - | - | - |
payload.billing.totalPrice | integer | total price | - | - | - |
payload.billing.subtotalPrice | integer | subtotal price | - | - | - |
payload.billing.recurringOrderNo | string | recurring order no for this billing | - | - | - |
payload.billing.paymentOrderNo | string | payment order no | - | - | - |
payload.billing.txEndTime | string | transaction end time | - | format (date-time ) | - |
payload.billing.extTxId | string | external transaction id | - | - | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | - | - | - | - |
version | integer | - | - | - | - |
name | string | - | - | - | - |
namespace | string | - | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | - | - | - | - |
userId | string | - | - | - | - |
traceId | string | - | - | - | - |
sessionId | string | - | - | - | - |
Examples of payload (generated)
{
"payload": {
"subscription": {
"id": "string",
"namespace": "string",
"userId": "string",
"itemId": "string",
"sku": "string",
"title": "string",
"currency": {
"currencyCode": "string",
"currencySymbol": "string",
"currencyType": "REAL",
"namespace": "string",
"decimals": 0
},
"price": 0,
"trialPrice": 0,
"recurring": {
"cycle": "WEEKLY",
"fixedFreeDays": 0,
"fixedTrialCycles": 0,
"graceDays": 7
},
"status": "INIT",
"chargeStatus": "NEVER",
"nextBillingDate": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"currentCycle": 0,
"chargedCycles": 0,
"trialedCycles": 0,
"inFixedFreeDays": true,
"inFixedCycleTrial": true,
"firstSubscribe": true,
"paid": true,
"subscribedBy": "USER",
"subscribedAt": "2019-08-24T14:15:22Z",
"unsubscribedAt": "2019-08-24T14:15:22Z",
"unsubscribeReason": "string",
"source": "string",
"region": "string",
"language": "string",
"sandbox": true,
"createdAt": "2019-08-24T14:15:22Z",
"updateAt": "2019-08-24T14:15:22Z"
},
"billing": {
"paymentProvider": "WALLET",
"paymentMethod": "string",
"amount": 0,
"totalTax": 0,
"totalPrice": 0,
"subtotalPrice": 0,
"recurringOrderNo": "string",
"paymentOrderNo": "string",
"txEndTime": "2019-08-24T14:15:22Z",
"extTxId": "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 expired
message is sent when subscription is expired
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.subscription | object | - | - | - | additional properties are allowed |
payload.subscription.id | string | id | - | - | - |
payload.subscription.namespace | string | namespace | - | - | - |
payload.subscription.userId | string | user id | - | - | - |
payload.subscription.itemId | string | item id | - | - | - |
payload.subscription.sku | string | sku | - | - | - |
payload.subscription.title | string | title | - | - | - |
payload.subscription.currency | object | - | - | - | additional properties are allowed |
payload.subscription.currency.currencyCode | string | currency code | - | - | - |
payload.subscription.currency.currencySymbol | string | currency symbol | - | - | - |
payload.subscription.currency.currencyType | string | currency type | allowed ("REAL" , "VIRTUAL" ) | - | - |
payload.subscription.currency.namespace | string | namespace | - | - | - |
payload.subscription.currency.decimals | integer | decimals | - | format (int32 ) | - |
payload.subscription.price | integer | normal price | - | - | - |
payload.subscription.trialPrice | integer | trial price | - | - | - |
payload.subscription.recurring | object | - | - | - | additional properties are allowed |
payload.subscription.recurring.cycle | string | recurring cycle | allowed ("WEEKLY" , "MONTHLY" , "QUARTERLY" , "YEARLY" ) | - | - |
payload.subscription.recurring.fixedFreeDays | integer | fixed free days, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.fixedTrialCycles | integer | fixed trial cycles, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.graceDays | integer | recurring grace days, retry recurring charge within configured days if charge fail, default 7 | default (7 ) | format (int32 ) | - |
payload.subscription.status | string | status | allowed ("INIT" , "ACTIVE" , "CANCELLED" , "EXPIRED" ) | - | - |
payload.subscription.chargeStatus | string | charge status | allowed ("NEVER" , "SETUP" , "RECURRING_CHARGING" , "CHARGED" , "CHARGE_FAILED" ) | - | - |
payload.subscription.nextBillingDate | string | next billing date | - | format (date-time ) | - |
payload.subscription.currentPeriodStart | string | current period start time | - | format (date-time ) | - |
payload.subscription.currentPeriodEnd | string | current period end time | - | format (date-time ) | - |
payload.subscription.start | string | start date, the first time subscribed | - | format (date-time ) | - |
payload.subscription.end | string | end time if exists | - | format (date-time ) | - |
payload.subscription.currentCycle | integer | current cycle | - | - | - |
payload.subscription.chargedCycles | integer | already charged cycles | - | - | - |
payload.subscription.trialedCycles | integer | already trialed cycles if fixedCycleTrial exists | - | - | - |
payload.subscription.inFixedFreeDays | boolean | whether in fixed free days | - | - | - |
payload.subscription.inFixedCycleTrial | boolean | whether in fixed cycle trial | - | - | - |
payload.subscription.firstSubscribe | boolean | indicates whether is first subscribe | - | - | - |
payload.subscription.paid | boolean | whether user paid from the subscription start | - | - | - |
payload.subscription.subscribedBy | string | subscribed by PLATFORM(system granted) or USER(subscribed by user self) | allowed ("USER" , "PLATFORM" ) | - | - |
payload.subscription.subscribedAt | string | time when subscribed | - | format (date-time ) | - |
payload.subscription.unsubscribedAt | string | time when unsubscribed | - | format (date-time ) | - |
payload.subscription.unsubscribeReason | string | reason why unsubscribe | - | - | - |
payload.subscription.source | string | source | - | - | - |
payload.subscription.region | string | created region | - | - | - |
payload.subscription.language | string | created language | - | - | - |
payload.subscription.sandbox | boolean | is sandbox mode | - | - | - |
payload.subscription.createdAt | string | - | - | format (date-time ) | - |
payload.subscription.updateAt | string | - | - | format (date-time ) | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | - | - | - | - |
version | integer | - | - | - | - |
name | string | - | - | - | - |
namespace | string | - | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | - | - | - | - |
userId | string | - | - | - | - |
traceId | string | - | - | - | - |
sessionId | string | - | - | - | - |
Examples of payload (generated)
{
"payload": {
"subscription": {
"id": "string",
"namespace": "string",
"userId": "string",
"itemId": "string",
"sku": "string",
"title": "string",
"currency": {
"currencyCode": "string",
"currencySymbol": "string",
"currencyType": "REAL",
"namespace": "string",
"decimals": 0
},
"price": 0,
"trialPrice": 0,
"recurring": {
"cycle": "WEEKLY",
"fixedFreeDays": 0,
"fixedTrialCycles": 0,
"graceDays": 7
},
"status": "INIT",
"chargeStatus": "NEVER",
"nextBillingDate": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"currentCycle": 0,
"chargedCycles": 0,
"trialedCycles": 0,
"inFixedFreeDays": true,
"inFixedCycleTrial": true,
"firstSubscribe": true,
"paid": true,
"subscribedBy": "USER",
"subscribedAt": "2019-08-24T14:15:22Z",
"unsubscribedAt": "2019-08-24T14:15:22Z",
"unsubscribeReason": "string",
"source": "string",
"region": "string",
"language": "string",
"sandbox": true,
"createdAt": "2019-08-24T14:15:22Z",
"updateAt": "2019-08-24T14:15:22Z"
}
},
"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 billingAccountChanged
message is sent when billing account is changed
Payload
Name | Type | Description | Value | Constraints | Notes |
---|---|---|---|---|---|
(root) | object allOf | - | - | - | additional properties are allowed |
payload | object | - | - | - | additional properties are allowed |
payload.subscription | object | - | - | - | additional properties are allowed |
payload.subscription.id | string | id | - | - | - |
payload.subscription.namespace | string | namespace | - | - | - |
payload.subscription.userId | string | user id | - | - | - |
payload.subscription.itemId | string | item id | - | - | - |
payload.subscription.sku | string | sku | - | - | - |
payload.subscription.title | string | title | - | - | - |
payload.subscription.currency | object | - | - | - | additional properties are allowed |
payload.subscription.currency.currencyCode | string | currency code | - | - | - |
payload.subscription.currency.currencySymbol | string | currency symbol | - | - | - |
payload.subscription.currency.currencyType | string | currency type | allowed ("REAL" , "VIRTUAL" ) | - | - |
payload.subscription.currency.namespace | string | namespace | - | - | - |
payload.subscription.currency.decimals | integer | decimals | - | format (int32 ) | - |
payload.subscription.price | integer | normal price | - | - | - |
payload.subscription.trialPrice | integer | trial price | - | - | - |
payload.subscription.recurring | object | - | - | - | additional properties are allowed |
payload.subscription.recurring.cycle | string | recurring cycle | allowed ("WEEKLY" , "MONTHLY" , "QUARTERLY" , "YEARLY" ) | - | - |
payload.subscription.recurring.fixedFreeDays | integer | fixed free days, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.fixedTrialCycles | integer | fixed trial cycles, 0 means not set | - | format (int32 ) | - |
payload.subscription.recurring.graceDays | integer | recurring grace days, retry recurring charge within configured days if charge fail, default 7 | default (7 ) | format (int32 ) | - |
payload.subscription.status | string | status | allowed ("INIT" , "ACTIVE" , "CANCELLED" , "EXPIRED" ) | - | - |
payload.subscription.chargeStatus | string | charge status | allowed ("NEVER" , "SETUP" , "RECURRING_CHARGING" , "CHARGED" , "CHARGE_FAILED" ) | - | - |
payload.subscription.nextBillingDate | string | next billing date | - | format (date-time ) | - |
payload.subscription.currentPeriodStart | string | current period start time | - | format (date-time ) | - |
payload.subscription.currentPeriodEnd | string | current period end time | - | format (date-time ) | - |
payload.subscription.start | string | start date, the first time subscribed | - | format (date-time ) | - |
payload.subscription.end | string | end time if exists | - | format (date-time ) | - |
payload.subscription.currentCycle | integer | current cycle | - | - | - |
payload.subscription.chargedCycles | integer | already charged cycles | - | - | - |
payload.subscription.trialedCycles | integer | already trialed cycles if fixedCycleTrial exists | - | - | - |
payload.subscription.inFixedFreeDays | boolean | whether in fixed free days | - | - | - |
payload.subscription.inFixedCycleTrial | boolean | whether in fixed cycle trial | - | - | - |
payload.subscription.firstSubscribe | boolean | indicates whether is first subscribe | - | - | - |
payload.subscription.paid | boolean | whether user paid from the subscription start | - | - | - |
payload.subscription.subscribedBy | string | subscribed by PLATFORM(system granted) or USER(subscribed by user self) | allowed ("USER" , "PLATFORM" ) | - | - |
payload.subscription.subscribedAt | string | time when subscribed | - | format (date-time ) | - |
payload.subscription.unsubscribedAt | string | time when unsubscribed | - | format (date-time ) | - |
payload.subscription.unsubscribeReason | string | reason why unsubscribe | - | - | - |
payload.subscription.source | string | source | - | - | - |
payload.subscription.region | string | created region | - | - | - |
payload.subscription.language | string | created language | - | - | - |
payload.subscription.sandbox | boolean | is sandbox mode | - | - | - |
payload.subscription.createdAt | string | - | - | format (date-time ) | - |
payload.subscription.updateAt | string | - | - | format (date-time ) | - |
payload.billing | object | - | - | - | additional properties are allowed |
payload.billing.paymentProvider | object | payment provider | allowed ("WALLET" , "XSOLLA" , "ADYEN" , "STRIPE" , "ALIPAY" , "WXPAY" , "PAYPAL" ) | - | additional properties are allowed |
payload.billing.paymentMethod | string | payment method | - | - | - |
payload.billing.amount | integer | charge amount | - | - | - |
payload.billing.totalTax | integer | total tax | - | - | - |
payload.billing.totalPrice | integer | total price | - | - | - |
payload.billing.subtotalPrice | integer | subtotal price | - | - | - |
payload.billing.recurringOrderNo | string | recurring order no for this billing | - | - | - |
payload.billing.paymentOrderNo | string | payment order no | - | - | - |
payload.billing.txEndTime | string | transaction end time | - | format (date-time ) | - |
payload.billing.extTxId | string | external transaction id | - | - | - |
0 (allOf item) | object | - | - | - | additional properties are allowed |
id | string | - | - | - | - |
version | integer | - | - | - | - |
name | string | - | - | - | - |
namespace | string | - | - | - | - |
parentNamespace | string | - | - | - | - |
timestamp | string | - | - | format (date-time ) | - |
clientId | string | - | - | - | - |
userId | string | - | - | - | - |
traceId | string | - | - | - | - |
sessionId | string | - | - | - | - |
Examples of payload (generated)
{
"payload": {
"subscription": {
"id": "string",
"namespace": "string",
"userId": "string",
"itemId": "string",
"sku": "string",
"title": "string",
"currency": {
"currencyCode": "string",
"currencySymbol": "string",
"currencyType": "REAL",
"namespace": "string",
"decimals": 0
},
"price": 0,
"trialPrice": 0,
"recurring": {
"cycle": "WEEKLY",
"fixedFreeDays": 0,
"fixedTrialCycles": 0,
"graceDays": 7
},
"status": "INIT",
"chargeStatus": "NEVER",
"nextBillingDate": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"start": "2019-08-24T14:15:22Z",
"end": "2019-08-24T14:15:22Z",
"currentCycle": 0,
"chargedCycles": 0,
"trialedCycles": 0,
"inFixedFreeDays": true,
"inFixedCycleTrial": true,
"firstSubscribe": true,
"paid": true,
"subscribedBy": "USER",
"subscribedAt": "2019-08-24T14:15:22Z",
"unsubscribedAt": "2019-08-24T14:15:22Z",
"unsubscribeReason": "string",
"source": "string",
"region": "string",
"language": "string",
"sandbox": true,
"createdAt": "2019-08-24T14:15:22Z",
"updateAt": "2019-08-24T14:15:22Z"
},
"billing": {
"paymentProvider": "WALLET",
"paymentMethod": "string",
"amount": 0,
"totalTax": 0,
"totalPrice": 0,
"subtotalPrice": 0,
"recurringOrderNo": "string",
"paymentOrderNo": "string",
"txEndTime": "2019-08-24T14:15:22Z",
"extTxId": "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"
}