Sitecore OrderCloud Documentation

docs

Portal Login

Delivery Configuration

Published by Marc Bednar on June 28, 2023

Overview

Delivery configuration allows you to determine where messages are to be delivered.  Two types of delivery configurations exists: Custom and Known integrations.

Custom integrations allow you to have 100% control over the integration and allows you to deliver these messages to:

  • A Kafka instance

  • An EventHub instance

  • An Http endpoint

To leverage out-of-the-box integrations, you make use of the following Known integrations.

  • The Discover Event API

  • The Send Event API

Known integrations can only be used with specific OrderCloud integrations points.  For example:

  • The Discover and Send Event API can only be used with the TrackingEvent feature.

All Custom integrations can be used with any of the above integrations.

When defining a delivery configuration you can send messages to multiple Custom Integrations with a single known integration.  For example, you could send the Send Event message to the Send collector API and also decide to send it to none, all or any of the custom integration endpoints.

The delivery configuration will be expanded in the future to support other known OrderCloud integrations.

Delivery Configuration Endpoints

Models

DeliveryConfig

{ 
  "ID": "", 
  "Name":"", 
  "Enabled": true | false, 
  "DeliveryTargets": { } 
}

 DeliveryTargets

{ 
  "Kafka": { }, 
  "Http": { }, 
  "EventHub": { }, 
  "SendEvent": { }, 
  "DiscoverEvent": { } 
}

Kafka

{ 
  "BootstrapServers" : "", 
  "SaslUsername" : "", 
  "SaslPassword" : "", 
  "Topic" : "" 
}

Http

{ 
  "Endpoint": "",
  "Secret": ""
}

The Secret enables the same functionality as defined for Webhooks.

EventHub

{ 
  "ConnectionString": "", 
  "EventHubName": "" 
}

 SendEvent

{ 
  "SiteID" : "", 
  "ServiceEndpoint": "" 
}

 DiscoverEvent

{ 
  "ClientID": "", 
  "ServiceEndpoint":  "" 
}

New Endpoints

  • GET integrations/deliveryconfig

  • GET integrations/deliveryconfig/{deliveryConfigId}

  • POST integrations/deliveryconfig

  • PUT integrations/deliveryconfig/{deliveryConfigId}

  • PATCH integrations/deliveryconfig/{deliveryConfigId}

  • DELETE integrations/deliveryconfig/{deliveryConfigId}

Custom Implementation Payloads and Models

If you decide to handle the integration, you will need to know what you will be receiving from OrderCloud. Each of the custom configurations used to trigger custom integrations will be composed of protocol specific information along with Common Models depending on the operation that triggered the event.

The event type is also transmitted as part of the data. This tells you what operation triggered the event and is also key to determine the type of model that is included in the payload. In OrderCloud the event type is represented as a namespace with the following values:

Namespace

Description

sitecore.ordercloud.messages.product.updated

Sent when a product has been created or updated.

sitecore.ordercloud.messages.product.deleted

Sent when a product is deleted.

sitecore.ordercloud.messages.orders.lines.added

Sent when a line item is added to an order.

sitecore.ordercloud.messages.orders.lines.updated

Sent when a line item is updated in an order.

sitecore.ordercloud.messages.orders.submitted

Sent when an order is submitted.

sitecore.ordercloud.messages.sessions.identified

Sent when a user logs in and has been identified.

Delivery Target Payloads Structure

Http

{ 
  "Headers": {"type":"<value>"}, 
  "ConfigData": {},
  "Payload": {} 
}

This configuration will transmit the payload and models to your implementation via a HTTP(s) post.

The ‘type’ can be found in the Header section of the body of the message.

The “ConfigData” represents any additional information you provided when you enabled the event to be published.

The Payload is dependent on the given ‘type’ as per the table described before.

The http header will contain the following:

  • X-oc-hash - computed hash value using the provided secret as described for Webhooks.

EventHub

Enabling the EventHub config will transmit the payload via an EventData structure defined by Microsoft.

The ‘Properties’ collection contains the following information:

  • type

  • sitecoreorg

  • marketplace

  • tenant

The Payload is dependent on the given ‘type’ and is found in the EventBody of the EventData.

Kafka

Enabling the Kafka config will transmit the payload via a Kafka structure.

The libraries will prefix the extended properties with “ce_” and are the following:

  • ce_type

  • ce_sitecoreorg

  • ce_marketplace

  • ce_tenant

The Payload is dependent on the given ‘type’ and the name of the property is base on the Kafka library you use.


Was this page helpful? Give it a bravo!

Still have questions?
Ask in our Community Channel

Content Powered By
Sitecore Logo

© Copyright 2023, Sitecore OrderCloud®. All rights reserved.

Contact Us
Privacy Policy
Sitecore