v1

latestOpenAPI 3.0.12026-07-243266138.0 KB
Endpoints

Create a new event

This endpoint creates a new eTrusted event.

NB: In compliance with GDPR, customers should be given the option to opt-in to receive review invitations from you. Therefore, create events using data of only customers who have opted-in.

post/events

Headers

Authorizationstring required

An OAuth2 authorization header with an access token, see OAuth2

Request body

typestring required

The event type. It represents the touchpoint that triggered the event. You can only use an event type that exists in your eTrusted configuration.<br> Learn more about event types from our help centre<br> Also, check out the event type documentation to learn more about the event type API.<br> In any case please avoid setting the type to "checkout" as this is a reserved type.

defaultLocalestring

The default locale for this event. If set, the default locale determines the language of the invite and the questionnaire that are triggered by the event. If not set, the channel locale will be used instead.

estimatedDeliveryDatestring date

The estimated date of the delivery. It is a date in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd. Check the glossary for examples of valid datetime formats.

systemstring required

This is the system that issues the events API call. This way you can identify the source system that called the events API.

systemVersionstring required

This is the version of the source system.

metadataobject

Add more information to your event via the metadata object. This may be anything that you want to track or evaluate.

createdAtstring date-time

The date and time when the event was created, in the ISO 8601 and RFC3339 compliant format yyyy-MM-dd’T’HH:mm:ss.SSSZ. Check the glossary for examples of valid datetime formats.

Example request

{
  "type": "delivery",
  "defaultLocale": "de_DE",
  "customer": {
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com",
    "address": "Anystr. 17, 12345, Anycity, Anystate 12345",
    "mobile": "+49123456789",
    "reference": "cus-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx"
  },
  "channel": {
    "id": "chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx",
    "type": "etrusted"
  },
  "transaction": {
    "reference": "order-12345"
  },
  "estimatedDeliveryDate": "2017-01-07",
  "products": [
    {
      "gtin": "1234567890123",
      "imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg",
      "name": "Specialbrand T-Shirt White M",
      "mpn": "23687778",
      "sku": "1234-TS-WH-M",
      "brand": "specialbrand",
      "url": "https://www.specialbrandshop.com/article123-TS-WH-M/"
    }
  ],
  "system": "customer_system_name",
  "systemVersion": "1.0",
  "metadata": {
    "metaKey1": "metaValue1",
    "metaKey2": "metaValue2"
  },
  "createdAt": "2018-02-01T17:09:41.790Z"
}

Response

Accepted

Messagestring

The response message: "Your event (evt-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx) was accepted for processing".

EventRefstring

The event reference UUID.

Example response

{
  "Message": "Your event (`evt-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx`) was accepted for processing.",
  "EventRef": "evt-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx"
}