{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://api.game-alligator.com/schemas/promo-event-v1.schema.json","title":"promo.event.v1","description":"A gameplay or server event sent to GA Promo: one event object, or a batch {\"events\": [...]}. Rules the schema cannot express (the scale of the currency, the minor amount fitting a signed 64-bit integer, byte limits, which connection may carry brand) are in the integration guide.","oneOf":[{"$ref":"#/$defs/event"},{"$ref":"#/$defs/batch"}],"$defs":{"event":{"type":"object","required":["spec","event_id","player_ref","kind","occurred_at"],"not":{"required":["events"]},"allOf":[{"if":{"required":["kind"],"properties":{"kind":{"enum":["bet","win","settled","refund"]}}},"then":{"required":["round_id","amount","currency"]}},{"if":{"required":["kind"],"properties":{"kind":{"enum":["deposit","withdrawal"]}}},"then":{"required":["amount","currency"]}}],"properties":{"spec":{"const":"promo.event.v1"},"event_id":{"type":"string","minLength":1},"brand":{"type":"string","maxLength":255,"description":"At most 255 bytes of UTF-8. maxLength counts characters and GA Promo counts bytes, so a multi-byte code under 255 characters can still be refused."},"player_ref":{"type":"string","minLength":1,"maxLength":255,"description":"At most 255 bytes of UTF-8. maxLength counts characters and GA Promo counts bytes, so a multi-byte id under 255 characters can still be refused."},"kind":{"enum":["bet","win","settled","refund","deposit","withdrawal","login"],"description":"bet, win, settled and refund are operations of a round. deposit, withdrawal and login are server events: they name no round and no game."},"round_id":{"type":"string","minLength":1,"description":"Required for bet, win, settled and refund. Not read for deposit, withdrawal and login."},"game":{"type":"object","description":"Not read for deposit, withdrawal and login.","properties":{"id":{"type":"string"}}},"amount":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Required for every kind except login, which does not read it."},"currency":{"type":"string","description":"Required for every kind except login, which does not read it."},"occurred_at":{"type":"string","format":"date-time"}}},"batch":{"type":"object","required":["events"],"properties":{"events":{"type":"array","items":{"$ref":"#/$defs/event"}}}}}}