# Loom Events

Here you will find a list of the Loom Events provided by the Procurement application.

# Contract Events

# procurement_consumer.new_contract

This event will be triggered when a new contract with a supplier has been established.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.new_contract",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "contract_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742",   // The Contract that was created
    "supplier_id": "37135ebe-eba0-484e-9ab7-081dbc989ff0"    // The supplier for which the contract was created
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.customer_number_changed

This event will be triggered when the customer number of a contract has changed.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.customer_number_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "contract_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742",  // The Contract that changed
    "supplier_id": "37135ebe-eba0-484e-9ab7-081dbc989ff0"   // The supplier of the contract that was changed
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.contract_deleted

This event will be triggered when a contract with a supplier was deleted.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.contract_deleted",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "contract_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742",  // The Contract that was deleted
    "supplier_id": "37135ebe-eba0-484e-9ab7-081dbc989ff0"   // The supplier for which the contract was deleted
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# Contract Request Events

# procurement_consumer.contract_request_accepted

This event will be triggered when a contract request was accepted by the supplier.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.contract_request_accepted",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "contract_request_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Contract Request that was accepted
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.contract_request_declined

This event will be triggered when a contract request was declined by the supplier.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.contract_request_declined",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "contract_request_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Contract that was declined
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# Material Requirement Events

# procurement_consumer.material_requirement_conditions_verified

❗️ This event is not relevant for users of the V1 of the API!

This event will be triggered when a supplier verified the conditions (e.g. pricing, stock or delivery information) of a material requirement.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.material_requirement_conditions_verified",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "material_requirement_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The MaterialRequirement whose conditions have been verified
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# Order Events

# procurement_consumer.order_conditions_verified

❗️ This event is not relevant for users of the V1 of the API!

This event will be triggered when a supplier verified the order conditions (e.g. pricing, stock or delivery information).

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_conditions_verified",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Order whose conditions have been verified
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.order_placed

This event will be triggered when an order was placed by a consumer.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_placed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Order that was placed
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.order_transferred

This event will be triggered when an order was transferred to the supplier.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_transferred",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Order that was transferred
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.order_transfer_failed

This event will be triggered when the transfer of an order to the supplier failed. You might want to check the order's state_reason to understand the reason why it failed.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_transfer_failed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Order whose transfer failed
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.order_confirmed

This event will be triggered when an order was transferred to the supplier and the supplier confirmed it.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_confirmed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Order that was confirmed
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.order_cancelation_requested

This event will be triggered when the consumer requested an order to be canceled.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_cancelation_requested",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Order that should be canceled
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.order_production_started

This event will be triggered when the production of an order started or when the order is prepared to be shipped.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_production_started",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Order that is in production
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.order_canceled

This event will be triggered when an order was canceled – no matter if it was canceled by the supplier or the consumer and no matter if the full order was canceled or if it was partially shipped. Check the order's state for details.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_canceled",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Order that was canceled
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.order_shipped

This event will be triggered when an order was partially or fully shipped. Check the order's state for details.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_shipped",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Order that was shipped
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# Order Line Item Events

# procurement_consumer.order_line_item_removed

This event will be triggered when an order line item gets automatically removed. This can happen due to deletion of the associated SKU or Prices becoming invalid.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_line_item_removed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_line_item_id": "72cf38f1-7b6e-4731-b730-795c127398d3", // The OrderLineItem that was removed
    "order_id": "b1a2eaa9-11ba-4cab-8580-40f091e37742" // The Order that was affected
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# procurement_consumer.order_line_item_changed

This event will be triggered when an order line item has been automatically changed. This can happen when associated entities change.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "procurement_consumer.order_line_item_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "order_line_item_id": "72cf38f1-7b6e-4731-b730-795c127398d3" // The OrderLineItem that was changed
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}