v1

latestOpenAPI 3.1.02026-07-24111290748.0 KB
Widgets

Create a widget

post/api/widgets

Request body

context'ticket' | 'customer' | 'user'

The context to display this widget in.

Supported values are: ticket, customer, user.

The value <span style={{color: 'red'}}>user has been deprecated</span>, please use customer instead.

deactivated_datetimestring date-time nullable

When the widget was deactivated.

integration_idinteger nullable

ID of the integration that the widget's data is attached to. Only used for widgets attached to HTTP integrations. Widgets are the same for all Shopify integrations, but each HTTP integration needs a specific widget.

app_idstring nullable

The ID of the 3rd party app that the widget's data is attached to. Used for customer external data widgets.

orderinteger

Order of precedence of the widget. Widgets with lower order are shown first.

templateobject required

Template to render the data of the widget.

type'bigcommerce' | 'custom' | 'customer_external_data' | 'http' | 'magento2' | 'recharge' | 'shopify' | 'smile' | 'standalone' | 'yotpo' | 'klaviyo' | 'stripe' | 'woocommerce' required

Type of data the widget is attached to.

Example request

{
  "context": "ticket",
  "deactivated_datetime": "2020-12-03T13:00:00.123456",
  "app_id": "60b9f144096cf92533e0a14d",
  "order": 3,
  "template": {
    "type": "wrapper",
    "widgets": [
      {
        "path": "account_info",
        "type": "card",
        "title": "account  info",
        "widgets": [
          {
            "path": "account_id",
            "type": "text",
            "title": "account id"
          }
        ]
      }
    ]
  },
  "type": "http"
}

Response

The created widget.

idinteger

ID of the widget.

context'ticket' | 'customer' | 'user'

The context to display this widget in.

Supported values are: ticket, customer, user.

The value <span style={{color: 'red'}}>user has been deprecated</span>, please use customer instead.

created_datetimestring date-time

When the widget was created.

deactivated_datetimestring date-time nullable

When the widget was deactivated.

integration_idinteger nullable

ID of the integration that the widget's data is attached to. Only used for widgets attached to HTTP integrations. Widgets are the same for all Shopify integrations, but each HTTP integration needs a specific widget.

app_idstring nullable

The ID of the 3rd party app that the widget's data is attached to. Used for customer external data widgets.

orderinteger

Order of precedence of the widget. Widgets with lower order are shown first.

templateobject

Template to render the data of the widget.

type'bigcommerce' | 'custom' | 'customer_external_data' | 'http' | 'magento2' | 'recharge' | 'shopify' | 'smile' | 'standalone' | 'yotpo' | 'klaviyo' | 'stripe' | 'woocommerce'

Type of data the widget is attached to.

updated_datetimestring date-time

When the widget was updated.

uristring

URI of the widget.

Example response

{
  "id": 123,
  "context": "ticket",
  "created_datetime": "2020-12-01T13:00:00.123456",
  "deactivated_datetime": "2020-12-03T13:00:00.123456",
  "app_id": "60b9f144096cf92533e0a14d",
  "order": 3,
  "template": {
    "type": "wrapper",
    "widgets": [
      {
        "path": "account_info",
        "type": "card",
        "title": "account  info",
        "widgets": [
          {
            "path": "account_id",
            "type": "text",
            "title": "account id"
          }
        ]
      }
    ]
  },
  "type": "http",
  "updated_datetime": "2020-12-02T13:00:00.123456"
}