Extension Bits Transaction Create
The extension.bits_transaction.create subscription type sends a notification when a new transaction is created for a Twitch Extension.
This subscription cannot be created with the WebSocket transport. Through a conduit, notifications are delivered to the conduit's shards, including WebSocket shards.
Subscription
- Type
extension.bits_transaction.create- Version
1
Authorization
Requires one of the following:
- An app access token.The OAuth token Client ID must match the Extension Client ID.
Subscription Request Body
typeStringRequiredThe subscription type name:extension.bits_transaction.create.versionStringRequiredThe subscription type version:1.conditionObjectRequiredSubscription-specific parameters. Pass in the Extension client ID you want to receive Bits transaction notifications for.Hide child attributesShow child attributes
condition.extension_client_idStringRequiredThe client ID of the extension.
transportObjectRequiredTransport-specific parameters.Hide child attributesShow child attributes
transport.methodStringRequiredThe transport method for EventSub.Possible values
webhookwebsocketconduit
transport.callbackStringThe callback URL where notifications are sent. The URL must use the HTTPS protocol and port 443, and its host must resolve to a public IPv4 address. Hosts that resolve only to IPv6 addresses aren't supported. See Processing an Event.
Required if method is webhook. Don't specify it for other methods.
NOTE: Redirects are not followed.
transport.secretStringThe secret used to verify the signature. The secret must be an ASCII string that's a minimum of 10 characters long and a maximum of 100 characters long. For information about how the secret is used, see Verifying the event message.
Required if method is webhook. Don't specify it for other methods.
transport.session_idStringAn ID that identifies the WebSocket to send notifications to. When you connect to EventSub using WebSockets, the server returns the ID in the Welcome message.
Required if method is websocket. Don't specify it for other methods.
transport.conduit_idStringAn ID that identifies the conduit to send this notification to. When you create a conduit, the server returns the ID in the API response.
Required if method is conduit. Don't specify it for other methods.
Event Payload
subscriptionObjectMetadata about the subscription.Hide child attributesShow child attributes
subscription.idStringThe Subscription ID of the subscription.subscription.typeStringThe notification's subscription type.subscription.versionStringThe version of the subscription.subscription.statusStringThe status of the subscription.subscription.costIntegerHow much the subscription counts against your limit. See Subscription Limits for more information.subscription.conditionObjectSubscription-specific parameters.Hide child attributesShow child attributes
subscription.condition.extension_client_idStringThe client ID of the extension.
subscription.created_atStringThe UTC date and time (in RFC3339 format) of when the subscription was created.subscription.transportObjectThe transport that the notification was sent over.Hide child attributesShow child attributes
subscription.transport.methodStringThe transport method.Possible values
webhookwebsocketconduit
subscription.transport.callbackStringThe callback URL where notifications are sent. Included only ifmethodis webhook.subscription.transport.session_idStringThe ID of the WebSocket session that notifications are sent to. Included only ifmethodis websocket.subscription.transport.conduit_idStringThe ID of the conduit that notifications are sent to. Included only ifmethodis conduit.
eventObjectThe event information.Hide child attributesShow child attributes
event.extension_client_idStringClient ID of the extension.event.idStringTransaction ID.event.broadcaster_user_idStringThe transaction's broadcaster ID.event.broadcaster_user_loginStringThe transaction's broadcaster login.event.broadcaster_user_nameStringThe transaction's broadcaster display name.event.user_idStringThe transaction's user ID.event.user_loginStringThe transaction's user login.event.user_nameStringThe transaction's user display name.event.productObjectAdditional extension product information.Hide child attributesShow child attributes
event.product.nameStringProduct name.event.product.bitsIntegerBits involved in the transaction.event.product.skuStringUnique identifier for the product acquired.event.product.in_developmentBooleanA Boolean value that indicates whether this was a test transaction in which no Bits were used. Is true if the product is in development, or if the broadcaster used the product in their own channel while the extension version installed there is still being tested or reviewed. Ifin_developmentis true,bitsis 0.
{
"type": "extension.bits_transaction.create",
"version": "1",
"condition": {
"extension_client_id": "deadbeef"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback",
"secret": "s3cRe7"
}
}{
"type": "extension.bits_transaction.create",
"version": "1",
"condition": {
"extension_client_id": "deadbeef"
},
"transport": {
"method": "conduit",
"conduit_id": "bfcfc993-26b1-b876-44d9-afe75a379dac"
}
}{
"subscription": {
"id": "f1c2a387-161a-49f9-a165-0f21d7a4e1c4",
"type": "extension.bits_transaction.create",
"version": "1",
"status": "enabled",
"cost": 1,
"condition": {
"extension_client_id": "deadbeef"
},
"transport": {
"method": "webhook",
"callback": "https://example.com/webhooks/callback"
},
"created_at": "2019-11-16T10:11:12.634234626Z"
},
"event": {
"id": "bits-tx-id",
"extension_client_id": "deadbeef",
"broadcaster_user_id": "1337",
"broadcaster_user_login": "cool_user",
"broadcaster_user_name": "Cool_User",
"user_name": "Coolest_User",
"user_login": "coolest_user",
"user_id": "1236",
"product": {
"name": "great_product",
"sku": "skuskusku",
"bits": 1234,
"in_development": false
}
}
}