# 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
  },
  "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
  },
  "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
  },
  "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"
}

# Order Events

# 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"
}