Events

The RIPE ecosystem includes an ESB (Enterprise Service Bus), named RIPE Bus, that gives you access to some events that reflect some of the things that might have happened in the system, such as orders that were created or rules that were edited.

This document includes the specification of those events, separated by their domain. Events are divided into channels called topics that groups their messages by context. For example, the topic order contains events related to orders.

Common fields

All the events share a common structure:

{
  "name" : "order.created",
  "origin": "service-1",
  "hostname": "hostname.com",
  "datatype": "json",
  "timestamp": 1612431932598,
  "payload": {
      ...
  }
}

FieldTypeDescription
namestrIdentifies the event that originated the message.
originstrIdentifies the service or instance that created the event.
hostnamestrThe domain where the service that created the event is running.
datatypestrSpecifies the datatype of the payload field.
timestampfloatMarks the time where the event was created, measured in milliseconds since Unix epoch.
payloaddatatypeIt's the only field is the only one that is specific to each type of event. Each event has its own payload, typically displaying the data being created/updated/deleted.

Core events

These events are central to RIPE's functioning.

NameTopicDescription
order.pendingorderTriggered when any of the orders in the RIPE instance is marked as pending.
order.pending.<brand>orderTriggered when an order from the requested brand is marked as pending.
order.createdorderTriggered when any of the orders in the RIPE instance is set to created.
order.created.<brand>orderTriggered when an order from the requested brand is set to created.
order.productionorderTriggered when any of the orders in the RIPE instance is marked as in production.
order.production.<brand>orderTriggered when an order from the requested brand is marked as in production.
order.readyorderTriggered when any of the orders in the RIPE instance is marked as ready.
order.ready.<brand>orderTriggered when an order from the requested brand is marked as ready.
order.sentorderTriggered when any of the orders in the RIPE instance is marked as sent.
order.sent.<brand>orderTriggered when an order from the requested brand is marked as sent.
order.receivedorderTriggered when any of the orders in the RIPE instance is marked as received.
order.received.<brand>orderTriggered when an order from the requested brand is marked as received.
order.returnedorderTriggered when any of the orders in the RIPE instance is marked as returned.
order.returned.<brand>orderTriggered when an order from the requested brand is marked as returned.
order.canceledorderTriggered when any of the orders in the RIPE instance is marked as canceled.
order.canceled.<brand>orderTriggered when an order from the requested brand is marked as canceled.
availability_rule.createdavailability_ruleTriggered when a new availability rule entry is created.
availability_rule.updatedavailability_ruleTriggered when an availability rule entry is updated.
availability_rule.savedavailability_ruleTriggered when an availability rule entry is saved (either created or updated).
availability_rule.deletedavailability_ruleTriggered when an availability rule entry is deleted from the data source.
cites_rule.createdcites_ruleTriggered when a new cites rule entry is created.
cites_rule.updatedcites_ruleTriggered when a cites rule entry is updated.
cites_rule.savedcites_ruleTriggered when a cites rule entry is saved (either created or updated).
cites_rule.deletedcites_ruleTriggered when a cites rule entry is deleted from the data source.
code_rule.createdcode_ruleTriggered when a new code rule entry is created.
code_rule.updatedcode_ruleTriggered when a code rule entry is updated.
code_rule.savedcode_ruleTriggered when a code rule entry is saved (either created or updated).
code_rule.deletedcode_ruleTriggered when a code rule entry is deleted from the data source.
config_rule.createdconfig_ruleTriggered when a new config rule entry is created.
config_rule.updatedconfig_ruleTriggered when a config rule entry is updated.
config_rule.savedconfig_ruleTriggered when a config rule entry is saved (either created or updated).
config_rule.deletedconfig_ruleTriggered when a config rule entry is deleted from the data source.
ddp_rule.createdddp_ruleTriggered when a new ddp rule entry is created.
ddp_rule.updatedddp_ruleTriggered when a ddp rule entry is updated.
ddp_rule.savedddp_ruleTriggered when a ddp rule entry is saved (either created or updated).
ddp_rule.deletedddp_ruleTriggered when a ddp rule entry is deleted from the data source.
extra_duty_rule.createdextra_duty_ruleTriggered when a new extra duty rule entry is created.
extra_duty_rule.updatedextra_duty_ruleTriggered when an extra duty rule entry is updated.
extra_duty_rule.savedextra_duty_ruleTriggered when an extra duty rule entry is saved (either created or updated).
extra_duty_rule.deletedextra_duty_ruleTriggered when an extra duty rule entry is deleted from the data source.
factory_rule.createdfactory_ruleTriggered when a new factory rule entry is created.
factory_rule.updatedfactory_ruleTriggered when a factory rule entry is updated.
factory_rule.savedfactory_ruleTriggered when a factory rule entry is saved (either created or updated).
factory_rule.deletedfactory_ruleTriggered when a factory rule entry is deleted from the data source.
hs_code_map.createdhs_code_mapTriggered when a new hs code map rule entry is created.
hs_code_map.updatedhs_code_mapTriggered when a hs code map rule entry is updated.
hs_code_map.savedhs_code_mapTriggered when a hs code map rule entry is saved (either created or updated).
hs_code_map.deletedhs_code_mapTriggered when a hs code map rule entry is deleted from the data source.
hs_code_map.createdhs_code_mapTriggered when a new hs code map entry is created.
hs_code_map.updatedhs_code_mapTriggered when a hs code map entry is updated.
hs_code_map.savedhs_code_mapTriggered when a hs code map entry is saved (either created or updated).
hs_code_map.deletedhs_code_mapTriggered when a hs code map entry is deleted from the data source.
hs_code_rule.createdhs_code_ruleTriggered when a new hs code rule entry is created.
hs_code_rule.updatedhs_code_ruleTriggered when a hs code rule entry is updated.
hs_code_rule.savedhs_code_ruleTriggered when a hs code rule entry is saved (either created or updated).
hs_code_rule.deletedhs_code_ruleTriggered when a hs code rule entry is deleted from the data source.
inventory_rule.createdinventory_ruleTriggered when a new inventory rule entry is created.
inventory_rule.updatedinventory_ruleTriggered when an inventory rule entry is updated.
inventory_rule.savedinventory_ruleTriggered when an inventory rule entry is saved (either created or updated).
inventory_rule.deletedinventory_ruleTriggered when an inventory rule entry is deleted from the data source.
letter_rule.createdletter_ruleTriggered when a new letter rule entry is created.
letter_rule.updatedletter_ruleTriggered when a letter rule entry is updated.
letter_rule.savedletter_ruleTriggered when a letter rule entry is saved (either created or updated).
letter_rule.deletedletter_ruleTriggered when a letter rule entry is deleted from the data source.
note_rule.creatednote_ruleTriggered when a new note rule entry is created.
note_rule.updatednote_ruleTriggered when a note rule entry is updated.
note_rule.savednote_ruleTriggered when a note rule entry is saved (either created or updated).
note_rule.deletednote_ruleTriggered when a note rule entry is deleted from the data source.
price_rule.createdprice_ruleTriggered when a new price rule entry is created.
price_rule.updatedprice_ruleTriggered when a price rule entry is updated.
price_rule.savedprice_ruleTriggered when a price rule entry is saved (either created or updated).
price_rule.deletedprice_ruleTriggered when a price rule entry is deleted from the data source.
shipping_rule.createdshipping_ruleTriggered when a new shipping rule entry is created.
shipping_rule.updatedshipping_ruleTriggered when a shipping rule entry is updated.
shipping_rule.savedshipping_ruleTriggered when a shipping rule entry is saved (either created or updated).
shipping_rule.deletedshipping_ruleTriggered when a shipping rule entry is deleted from the data source.

Payloads

{
  "url": "https://webhook.site/88998fc4-e09d-4519-9d39-7ecffbd916a1",
  "params": {
    "payload": {
      "_id": "5c800503a3a4ff004ef8f785",
      "id": 4993,
      "number": 4993,
      "enabled": true,
      "description": null,
      "created": 1551893763,
      "modified": 1551893763,
      "meta": {
        "timestamp": "2019-03-06T17:36:03.482Z"
      },
      "key": "95970f5244d37375be56aeadba27c992c00041a7",
      "status": "created",
      "production_status": "unset",
      "production": "produce",
      "gender": "male",
      "currency": "EUR",
      "country": "PT",
      "price": null,
      "prices": null,
      "brand": "dummy",
      "shoe": "dummy",
      "shoe_query": "model=dummy&brand=dummy&p=piping:leather_dmy:black&p=side:leather_dmy:black&p=top0_bottom:leather_dmy:black&p=shadow:default:default",
      "shoe_url": "/config/customization?model=dummy&brand=dummy&p=piping:leather_dmy:black&p=side:leather_dmy:black&p=top0_bottom:leather_dmy:black&p=shadow:default:default",
      "image_url": "/compose?model=dummy&brand=dummy&p=piping:leather_dmy:black&p=side:leather_dmy:black&p=top0_bottom:leather_dmy:black&p=shadow:default:default",
      "minify_hash": "NDIwNDI",
      "image_hash": "NDIwNDM",
      "image_o_hash": "NDIwNDQ",
      "top_hash": "NDIwNDU",
      "top_o_hash": "NDIwNDY",
      "bottom_hash": "NDIwNDc",
      "bottom_o_hash": "NDIwNDg",
      "back_hash": "NDIwNDk",
      "side_hash": "NDIwNTA",
      "structure": "{\"brand\": \"dummy\", \"model\": \"dummy\", \"variant\": \"\", \"parts\": [{\"color\": \"black\", \"material\": \"leather_dmy\", \"face\": \"side\", \"name\": \"piping\", \"hidden\": false, \"optional\": false}, {\"color\": \"black\", \"material\": \"leather_dmy\", \"face\": \"side\", \"name\": \"side\", \"hidden\": false, \"optional\": false}, {\"color\": \"black\", \"material\": \"leather_dmy\", \"face\": \"top\", \"name\": \"top0_bottom\", \"hidden\": false, \"optional\": false}, {\"color\": \"default\", \"hidden\": true, \"material\": \"default\", \"name\": \"shadow\", \"optional\": false}], \"parts_m\": {\"piping\": {\"color\": \"black\", \"material\": \"leather_dmy\", \"face\": \"side\"}, \"side\": {\"color\": \"black\", \"material\": \"leather_dmy\", \"face\": \"side\"}, \"top0_bottom\": {\"color\": \"black\", \"material\": \"leather_dmy\", \"face\": \"top\"}, \"shadow\": {\"color\": \"default\", \"hidden\": true, \"material\": \"default\"}}, \"gender\": \"male\", \"size\": 24, \"query\": \"model=dummy&brand=dummy&p=piping:leather_dmy:black&p=side:leather_dmy:black&p=top0_bottom:leather_dmy:black&p=shadow:default:default\", \"url\": \"/config/customization?model=dummy&brand=dummy&p=piping:leather_dmy:black&p=side:leather_dmy:black&p=top0_bottom:leather_dmy:black&p=shadow:default:default\", \"image\": \"/compose?model=dummy&brand=dummy&p=piping:leather_dmy:black&p=side:leather_dmy:black&p=top0_bottom:leather_dmy:black&p=shadow:default:default\", \"extras\": 0}",
      "ff_id": null,
      "ff_shoe_id": null,
      "ff_order_id": "00df7665-a218-4514-896e-1d6e5f192fd7",
      "delivery_time": null,
      "tracking_number": null,
      "tracking_url": null,
      "states": [],
      "attachments": [],
      "account": "root@root.com",
      "customer": "root@root.com",
      "ambassador": "root@root.com",
      "store": null,
      "number_s": "#004993",
      "delivery_d": 1554312963,
      "details": {
        "brand": "dummy",
        "model": "dummy",
        "variant": "",
        "parts": [
          {
            "color": "black",
            "material": "leather_dmy",
            "face": "side",
            "name": "piping",
            "hidden": false,
            "optional": false
          },
          {
            "color": "black",
            "material": "leather_dmy",
            "face": "side",
            "name": "side",
            "hidden": false,
            "optional": false
          },
          {
            "color": "black",
            "material": "leather_dmy",
            "face": "top",
            "name": "top0_bottom",
            "hidden": false,
            "optional": false
          },
          {
            "color": "default",
            "hidden": true,
            "material": "default",
            "name": "shadow",
            "optional": false
          }
        ],
        "parts_m": {
          "piping": {
            "color": "black",
            "material": "leather_dmy",
            "face": "side"
          },
          "side": {
            "color": "black",
            "material": "leather_dmy",
            "face": "side"
          },
          "top0_bottom": {
            "color": "black",
            "material": "leather_dmy",
            "face": "top"
          },
          "shadow": {
            "color": "default",
            "hidden": true,
            "material": "default"
          }
        },
        "gender": "male",
        "size": 24,
        "query": "model=dummy&brand=dummy&p=piping:leather_dmy:black&p=side:leather_dmy:black&p=top0_bottom:leather_dmy:black&p=shadow:default:default",
        "url": "/config/customization?model=dummy&brand=dummy&p=piping:leather_dmy:black&p=side:leather_dmy:black&p=top0_bottom:leather_dmy:black&p=shadow:default:default",
        "image": "/compose?model=dummy&brand=dummy&p=piping:leather_dmy:black&p=side:leather_dmy:black&p=top0_bottom:leather_dmy:black&p=shadow:default:default",
        "extras": 0
      }
    },
    (...)
  },
  "event": "order.created",
  "handler": "http"
}

{
  "url": "https://webhook.site/88998fc4-e09d-4519-9d39-7ecffbd916a1",
  "payload": {
    "enabled": true,
    "description": "",
    "created": 1551894521,
    "modified": 1551894521,
    "meta": {},
    "name": "",
    "priority": null,
    "brand": "swear",
    "shoe": "vyner",
    "variant": "",
    "part": "side",
    "material": "python",
    "color": "",
    "vat_included": false,
    "ddp_included": false,
    "fixed_price": false,
    "round_price": true,
    "pivot": "",
    "price_eur": 100,
    "price_usd": 110,
    "price_gbp": 90,
    "price_geo": {},
    "_id": "5c8007f9a3a4ff0052f8f766",
    "id": 21628
  },
  "event": "price_rule.created",
  "handler": "http"
}

RIPE Twitch events

These are the events that are triggered specifically by ripe-twitch.

NameTopicDescription
ripe_twitch:order.paidripe_twitch:orderTriggered when a sales order is paid for.

Payloads

Order paid

{
    "id": "1",
    "user": "user1",
    "email": "email1@email.com",
    "shippingAddress": {
        "firstName": "First Name1",
        "lastName": "Last Name1",
        "address": "Name1 Shipping Address",
        "postcode": "1111",
        "country": "country",
        "state": "state"
    },
    "billingAddress": {
        "firstName": "First Name1",
        "lastName": "Last Name1",
        "address": "Name1 Billing Address",
        "postcode": "1111",
        "country": "country",
        "state": "state"
    },
    "currency": "USD",
    "amount": 100,
    "productQuery": "brand=dummy&model=dummy&p=side:leather_dmy:black&p=piping:leather_dmy:black&p=top0_bottom:leather_dmy:black&p=shadow:default:default"
}

PERI Email events

These are the events that are triggered specifically by peri-email.

NameTopicDescription
email.successemailTriggered when an email is successfully sent.
email.erroremailTriggered when there is a failure sending the email.

Payloads

The payload of the success or error events is the same as the message who originated the event.

For example, a ripe_twitch:order.paid event is consumed by PERI Email to send an e-mail notification. The payload of the original event is the RIPE Twitch order. For that reason, the success and error events have as payload the twitch order.