Overview
The Commerce Insights Events service accepts your e-commerce platform events for generating Commerce Insights reports and insights.
You can use these APIs to send:
- Cart create, update, and delete events
- Product create, update, and delete events
- Order create, update, and delete events
- Customer create, update, and delete events
- Batch create, update, and delete events
- Heartbeat events
- Test events
For more information about Commerce Insights, see:
- Commerce Insights Provisioning API about the API for managing your sites
- Commerce Insights SSO API about the API for viewing your Commerce Insights reports
API Reference
/{partner_site_id}/site_check
For new clients, use this endpoint to test your events. It is a NOOP (No Operation command) and no side effects occur when sending this.
/{partner_site_id}/site_check
Send NOOP(s).
post /{partner_site_id}/site_check
Send NOOP(s).
URI Parameters
- partner_site_id: required (string)
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
HTTP status code 200
Body
Type: application/json
Schema:
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
Example:
{
"success": true
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
/{partner_site_id}/heartbeat
Send your site's heartbeats to Commerce Insights.
/{partner_site_id}/heartbeat
Send your site's heartbeats to Commerce Insights.
post /{partner_site_id}/heartbeat
Send your site's heartbeats to Commerce Insights.
URI Parameters
- partner_site_id: required (string)
Body
Type: application/json
Schema:
{
"title": "Heartbeat Schema",
"type": "object",
"properties": {
"instance_id": {
"description": "An ID, unique per server instance running Commerce Insights as part of your solution. In Linux, use uname.",
"type": "string"
},
"is_enabled": {
"description": "Bool as to whether or not the plugin is enabled",
"type": "bool"
},
"version": {
"description": "Version of the built Commerce Insights plugin, NOT the version of the respective commerce software platform being used",
"type": "string"
}
}
}
Example:
{
"instance_id": "1",
"is_enabled": false,
"version": "1"
}
HTTP status code 200
Body
Type: application/json
Schema:
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
Example:
{
"success": true
}
/{partner_site_id}/batch
Send more than one cart, order, product, customer, category event to Commerce Insight.
/{partner_site_id}/batch
Send more than one cart, order, product, customer, category event to Commerce Insight.
post /{partner_site_id}/batch
Send more than one cart, order, product, customer, category event to Commerce Insight.
URI Parameters
- partner_site_id: required (string)
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"type": "object",
"additionalProperties": false,
"properties": {
"cart": {
"type": "array",
"items": {
"title": "Cart Schema",
"type": "object",
"required": [
"id",
"create_date",
"change_date",
"subtotal",
"total",
"total_tax",
"total_shipping",
"total_payment_cost",
"total_discounts",
"currency",
"customer",
"items"
],
"properties": {
"id": {
"type": "string"
},
"cart_id": {
"type": "string"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"subtotal": {
"type": "number"
},
"total": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"total_tax": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"total_shipping": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"total_payment_cost": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"total_discounts": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"currency": {
"type": "string"
},
"cookies": {
"type": "object"
},
"items": {
"type": "array",
"items": {
"title": "Cart Item Schema",
"type": "object",
"required": [
"id",
"create_date",
"change_date",
"cart_item_number",
"quantity",
"price",
"discount_price",
"product"
],
"properties": {
"id": {
"type": "string"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"cart_item_number": {
"type": "string"
},
"quantity": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740992
},
"price": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"discount_price": {
"type": "number",
"minimum": 0
},
"maximum": 9007199254740992,
"product": {
"title": "Product Schema",
"type": "object",
"required": [
"id",
"is_product",
"is_sku",
"code",
"create_date",
"change_date"
],
"properties": {
"id": {
"type": "string"
},
"is_product": {
"type": "boolean"
},
"is_sku": {
"type": "boolean"
},
"catalog": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"version_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"name": {
"type": "string"
},
"code": {
"type": "string"
},
"ancestors": {
"type": "array",
"items": {
"type": "string"
}
},
"base_product": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"vendors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"brand": {
"type": "string"
},
"rating": {
"type": "number"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"urls": {
"type": "object",
"properties": {
"admin": {
"type": "string",
"format": "uri"
},
"store": {
"type": "string",
"format": "uri"
}
}
},
"images": {
"type": "array",
"items": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"categories": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"attributes": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name",
"value"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
}
}
},
"previous_items": {
"type": "array",
"items": {
"title": "Cart Item Schema",
"type": "object",
"required": [
"id",
"create_date",
"change_date",
"cart_item_number",
"quantity",
"price",
"discount_price",
"product"
],
"properties": {
"id": {
"type": "string"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"cart_item_number": {
"type": "string"
},
"quantity": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740992
},
"price": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"discount_price": {
"type": "number",
"minimum": 0
},
"maximum": 9007199254740992,
"product": {
"title": "Product Schema",
"type": "object",
"required": [
"id",
"is_product",
"is_sku",
"code",
"create_date",
"change_date"
],
"properties": {
"id": {
"type": "string"
},
"is_product": {
"type": "boolean"
},
"is_sku": {
"type": "boolean"
},
"catalog": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"version_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"name": {
"type": "string"
},
"code": {
"type": "string"
},
"ancestors": {
"type": "array",
"items": {
"type": "string"
}
},
"base_product": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"vendors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"brand": {
"type": "string"
},
"rating": {
"type": "number"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"urls": {
"type": "object",
"properties": {
"admin": {
"type": "string",
"format": "uri"
},
"store": {
"type": "string",
"format": "uri"
}
}
},
"images": {
"type": "array",
"items": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"categories": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"attributes": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name",
"value"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
}
}
},
"customer": {
"title": "Customer Schema",
"type": "object",
"required": [
"create_date",
"change_date",
"id"
],
"properties": {
"cookies": {
"type": "object"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"active_flag": {
"type": "boolean",
"default": true
},
"company": {
"type": "string"
},
"department": {
"type": "string"
},
"position": {
"type": "string"
},
"marketing_opt_in": {
"type": "boolean",
"default": false
}
}
},
"visit": {
"type": "object",
"required": [
"visit_id",
"visitor_id",
"pageview_id",
"last_pageview_id"
],
"properties": {
"visit_id": {
"type": "string"
},
"visitor_id": {
"type": "string"
},
"pageview_id": {
"type": "string"
},
"last_pageview_id": {
"type": "string"
}
}
}
}
}
},
"category": {
"type": "array",
"items": {
"title": "Category Schema",
"type": "object",
"required": [
"id",
"name",
"change_date",
"create_date"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"parent_categories": {
"type": "array",
"items": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
}
}
}
}
}
}
},
"customer": {
"type": "array",
"items": {
"title": "Customer Schema",
"type": "object",
"required": [
"create_date",
"change_date",
"id"
],
"properties": {
"cookies": {
"type": "object"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"active_flag": {
"type": "boolean",
"default": true
},
"company": {
"type": "string"
},
"department": {
"type": "string"
},
"position": {
"type": "string"
},
"marketing_opt_in": {
"type": "boolean",
"default": false
}
}
}
},
"employee": {
"type": "array",
"items": {
"title": "Employee Schema",
"type": "object",
"required": [
"create_date",
"change_date",
"id",
"email"
],
"properties": {
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"active_flag": {
"type": "boolean",
"default": true
},
"company": {
"type": "string"
},
"department": {
"type": "string"
},
"position": {
"type": "string"
},
"marketing_opt_in": {
"type": "boolean",
"default": false
}
}
}
},
"order": {
"type": "array",
"items": {
"oneOf": [
{
"title": "Order Placed Schema",
"type": "object",
"required": [
"order_number",
"customer",
"status",
"order_date"
],
"properties": {
"visit": {
"type": "object",
"required": [
"visit_id",
"visitor_id",
"pageview_id",
"last_pageview_id"
],
"properties": {
"visit_id": {
"type": "string"
},
"visitor_id": {
"type": "string"
},
"pageview_id": {
"type": "string"
},
"last_pageview_id": {
"type": "string"
}
}
},
"order_number": {
"type": "string"
},
"cart_id": {
"type": "string"
},
"customer": {
"title": "Customer Schema",
"type": "object",
"required": [
"create_date",
"change_date",
"id"
],
"properties": {
"cookies": {
"type": "object"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"active_flag": {
"type": "boolean",
"default": true
},
"company": {
"type": "string"
},
"department": {
"type": "string"
},
"position": {
"type": "string"
},
"marketing_opt_in": {
"type": "boolean",
"default": false
}
}
},
"status": {
"enum": [
"placed"
]
},
"order_date": {
"type": "string",
"format": "date-time"
}
}
},
{
"title": "Order Accepted Schema",
"type": "object",
"required": [
"order_number",
"customer",
"order_date",
"create_date",
"change_date",
"status",
"subtotal",
"total",
"total_tax",
"total_shipping",
"total_payment_cost",
"total_discounts",
"currency",
"items"
],
"properties": {
"order_number": {
"type": "string"
},
"cart_id": {
"type": "string"
},
"customer": {
"title": "Customer Schema",
"type": "object",
"required": [
"create_date",
"change_date",
"id"
],
"properties": {
"cookies": {
"type": "object"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"active_flag": {
"type": "boolean",
"default": true
},
"company": {
"type": "string"
},
"department": {
"type": "string"
},
"position": {
"type": "string"
},
"marketing_opt_in": {
"type": "boolean",
"default": false
}
}
},
"order_date": {
"type": "string",
"format": "date-time"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"status": {
"enum": [
"accepted"
]
},
"subtotal": {
"type": "number"
},
"total": {
"type": "number"
},
"total_tax": {
"type": "number"
},
"total_shipping": {
"type": "number"
},
"total_payment_cost": {
"type": "number"
},
"total_discounts": {
"type": "number"
},
"currency": {
"type": "string"
},
"items": {
"type": "array",
"minimum": 1,
"items": {
"title": "Order Item Schema",
"type": "object",
"required": [
"id",
"create_date",
"change_date",
"order_item_number",
"quantity",
"status",
"price",
"discount_price",
"product"
],
"properties": {
"id": {
"type": "string"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"order_item_number": {
"type": "string"
},
"quantity": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740992
},
"status": {
"enum": [
"accepted"
]
},
"price": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"discount_price": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"product": {
"title": "Product Schema",
"type": "object",
"required": [
"id",
"is_product",
"is_sku",
"code",
"create_date",
"change_date"
],
"properties": {
"id": {
"type": "string"
},
"is_product": {
"type": "boolean"
},
"is_sku": {
"type": "boolean"
},
"catalog": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"version_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"name": {
"type": "string"
},
"code": {
"type": "string"
},
"ancestors": {
"type": "array",
"items": {
"type": "string"
}
},
"base_product": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"vendors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"brand": {
"type": "string"
},
"rating": {
"type": "number"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"urls": {
"type": "object",
"properties": {
"admin": {
"type": "string",
"format": "uri"
},
"store": {
"type": "string",
"format": "uri"
}
}
},
"images": {
"type": "array",
"items": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"categories": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"attributes": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name",
"value"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
}
}
},
"previous_items": {
"type": "array",
"items": {
"title": "Order Item Schema",
"type": "object",
"required": [
"id",
"create_date",
"change_date",
"order_item_number",
"quantity",
"status",
"price",
"discount_price",
"product"
],
"properties": {
"id": {
"type": "string"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"order_item_number": {
"type": "string"
},
"quantity": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740992
},
"status": {
"enum": [
"accepted"
]
},
"price": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"discount_price": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"product": {
"title": "Product Schema",
"type": "object",
"required": [
"id",
"is_product",
"is_sku",
"code",
"create_date",
"change_date"
],
"properties": {
"id": {
"type": "string"
},
"is_product": {
"type": "boolean"
},
"is_sku": {
"type": "boolean"
},
"catalog": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"version_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"name": {
"type": "string"
},
"code": {
"type": "string"
},
"ancestors": {
"type": "array",
"items": {
"type": "string"
}
},
"base_product": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"vendors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"brand": {
"type": "string"
},
"rating": {
"type": "number"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"urls": {
"type": "object",
"properties": {
"admin": {
"type": "string",
"format": "uri"
},
"store": {
"type": "string",
"format": "uri"
}
}
},
"images": {
"type": "array",
"items": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"categories": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"attributes": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name",
"value"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
},
{
"title": "Order Cancelled Schema",
"type": "object",
"required": [
"order_number",
"status",
"cancel_date"
],
"properties": {
"order_number": {
"type": "string"
},
"status": {
"enum": [
"cancelled"
]
},
"cancel_date": {
"type": "string",
"format": "date-time"
}
}
}
]
}
},
"product": {
"type": "array",
"items": {
"title": "Product Schema",
"type": "object",
"required": [
"id",
"is_product",
"is_sku",
"code",
"create_date",
"change_date"
],
"properties": {
"id": {
"type": "string"
},
"is_product": {
"type": "boolean"
},
"is_sku": {
"type": "boolean"
},
"catalog": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"version_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"name": {
"type": "string"
},
"code": {
"type": "string"
},
"ancestors": {
"type": "array",
"items": {
"type": "string"
}
},
"base_product": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"vendors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"brand": {
"type": "string"
},
"rating": {
"type": "number"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"urls": {
"type": "object",
"properties": {
"admin": {
"type": "string",
"format": "uri"
},
"store": {
"type": "string",
"format": "uri"
}
}
},
"images": {
"type": "array",
"items": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"categories": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"attributes": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name",
"value"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
},
"product.merchandise_category": {
"type": "array",
"items": {
"title": "Merchandise Category Schema",
"type": "object",
"required": [
"timestamp",
"product_code",
"merchandise_category"
],
"properties": {
"timestamp": {
"type": "string",
"format": "date-time"
},
"product_code": {
"type": "string"
},
"merchandise_category": {
"type": "string"
}
}
}
}
}
}
Example:
{
"category": [
{
"id": "8796094234766",
"name": "Category 1",
"change_date": "2013-03-28T19:44:11.000Z",
"create_date": "2013-03-28T19:38:09.000Z"
},
{
"id": "8796097654766",
"name": "Category 2",
"change_date": "2013-03-28T19:44:11.000Z",
"create_date": "2013-03-28T19:38:09.000Z"
}
],
"employee": [
{
"id": "532sdfg",
"active_flag": true,
"change_date": "2013-03-28T19:38:03.000Z",
"create_date": "2013-03-28T19:38:03.000Z",
"first_name": "Product",
"last_name": "Manager",
"email": "product_manager@example.com"
}
]
}
HTTP status code 200
Body
Type: application/json
Schema:
{
"type": "object",
"properties": {
"product": {
"type": "array",
"items": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
Example:
{
"product": [
{
"success": true
}
]
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
/{partner_site_id}/cart
Send a cart event to Commerce Insights.
/{partner_site_id}/cart
Send a cart event to Commerce Insights.
post /{partner_site_id}/cart
Send a cart event to Commerce Insights.
URI Parameters
- partner_site_id: required (string)
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"title": "Cart Schema",
"type": "object",
"required": [
"id",
"create_date",
"change_date",
"subtotal",
"total",
"total_tax",
"total_shipping",
"total_payment_cost",
"total_discounts",
"currency",
"customer",
"items"
],
"properties": {
"id": {
"type": "string"
},
"cart_id": {
"type": "string"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"subtotal": {
"type": "number"
},
"total": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"total_tax": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"total_shipping": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"total_payment_cost": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"total_discounts": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"currency": {
"type": "string"
},
"cookies": {
"type": "object"
},
"items": {
"type": "array",
"items": {
"title": "Cart Item Schema",
"type": "object",
"required": [
"id",
"create_date",
"change_date",
"cart_item_number",
"quantity",
"price",
"discount_price",
"product"
],
"properties": {
"id": {
"type": "string"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"cart_item_number": {
"type": "string"
},
"quantity": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740992
},
"price": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"discount_price": {
"type": "number",
"minimum": 0
},
"maximum": 9007199254740992,
"product": {
"title": "Product Schema",
"type": "object",
"required": [
"id",
"is_product",
"is_sku",
"code",
"create_date",
"change_date"
],
"properties": {
"id": {
"type": "string"
},
"is_product": {
"type": "boolean"
},
"is_sku": {
"type": "boolean"
},
"catalog": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"version_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"name": {
"type": "string"
},
"code": {
"type": "string"
},
"ancestors": {
"type": "array",
"items": {
"type": "string"
}
},
"base_product": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"vendors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"brand": {
"type": "string"
},
"rating": {
"type": "number"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"urls": {
"type": "object",
"properties": {
"admin": {
"type": "string",
"format": "uri"
},
"store": {
"type": "string",
"format": "uri"
}
}
},
"images": {
"type": "array",
"items": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"categories": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"attributes": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name",
"value"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
}
}
},
"previous_items": {
"type": "array",
"items": {
"title": "Cart Item Schema",
"type": "object",
"required": [
"id",
"create_date",
"change_date",
"cart_item_number",
"quantity",
"price",
"discount_price",
"product"
],
"properties": {
"id": {
"type": "string"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"cart_item_number": {
"type": "string"
},
"quantity": {
"type": "integer",
"minimum": -9007199254740992,
"maximum": 9007199254740992
},
"price": {
"type": "number",
"minimum": 0,
"maximum": 9007199254740992
},
"discount_price": {
"type": "number",
"minimum": 0
},
"maximum": 9007199254740992,
"product": {
"title": "Product Schema",
"type": "object",
"required": [
"id",
"is_product",
"is_sku",
"code",
"create_date",
"change_date"
],
"properties": {
"id": {
"type": "string"
},
"is_product": {
"type": "boolean"
},
"is_sku": {
"type": "boolean"
},
"catalog": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"version_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"name": {
"type": "string"
},
"code": {
"type": "string"
},
"ancestors": {
"type": "array",
"items": {
"type": "string"
}
},
"base_product": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"vendors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"brand": {
"type": "string"
},
"rating": {
"type": "number"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"urls": {
"type": "object",
"properties": {
"admin": {
"type": "string",
"format": "uri"
},
"store": {
"type": "string",
"format": "uri"
}
}
},
"images": {
"type": "array",
"items": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"categories": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"attributes": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name",
"value"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
}
}
},
"customer": {
"title": "Customer Schema",
"type": "object",
"required": [
"create_date",
"change_date",
"id"
],
"properties": {
"cookies": {
"type": "object"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"active_flag": {
"type": "boolean",
"default": true
},
"company": {
"type": "string"
},
"department": {
"type": "string"
},
"position": {
"type": "string"
},
"marketing_opt_in": {
"type": "boolean",
"default": false
}
}
},
"visit": {
"type": "object",
"required": [
"visit_id",
"visitor_id",
"pageview_id",
"last_pageview_id"
],
"properties": {
"visit_id": {
"type": "string"
},
"visitor_id": {
"type": "string"
},
"pageview_id": {
"type": "string"
},
"last_pageview_id": {
"type": "string"
}
}
}
}
}
Example:
{
"id": "8797436543019",
"create_date": "2013-06-17T15:16:10.000Z",
"change_date": "2013-06-17T15:16:15.000Z",
"subtotal": 99.85,
"total": 99.85,
"total_tax": 4.75,
"total_shipping": 0,
"total_payment_cost": 0,
"total_discounts": 0,
"currency": "USD",
"cookies": {},
"items": [
{
"id": "8797371007020",
"create_date": "2013-06-17T15:16:11.000Z",
"change_date": "2013-06-17T15:16:11.000Z",
"cart_item_number": "1",
"quantity": 1,
"price": 99.85,
"discount_price": 0,
"product": {
"id": "8796107014145",
"create_date": "2013-03-28T19:46:39.000Z",
"change_date": "2013-03-28T19:50:58.000Z",
"is_product": true,
"is_sku": true,
"catalog": {
"id": "electronicsProductCatalog",
"name": "Electronics Product Catalog"
},
"name": "PowerShot A480",
"code": "1934793",
"brand": "Canon",
"categories": [
{
"id": "8796098461838",
"name": "Digital Compacts"
},
{
"id": "8796099248270",
"name": "Canon"
}
],
"images": [
{
"url": "http://yourstore.com/images/the_photo.jpg"
}
]
}
}
],
"previous_items": [],
"customer": {
"id": "abc123",
"create_date": "2013-06-17T15:16:11.000Z",
"change_date": "2013-06-17T15:16:11.000Z",
"email": "foo@example.com",
"first_name": "Jane",
"last_name": "Doe"
},
"visit": {
"visit_id": "1234",
"visitor_id": "4321",
"pageview_id": "5678",
"last_pageview_id": "8765"
}
}
HTTP status code 200
Body
Type: application/json
Schema:
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
Example:
{
"success": true
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
/{partner_site_id}/order
Send a order event to Commerce Insights.
/{partner_site_id}/order
Send a order event to Commerce Insights.
post /{partner_site_id}/order
Send a order event to Commerce Insights.
URI Parameters
- partner_site_id: required (string)
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"title": "Order Schema",
"type": "object",
"required": [
"status"
],
"properties": {
"status": {
"enum": [
"accepted",
"cancelled",
"placed"
]
}
}
}
Example:
{
"status": "accepted"
}
HTTP status code 200
Body
Type: application/json
Schema:
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
Example:
{
"success": true
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
/{partner_site_id}/product
Send a product event to Commerce Insights.
/{partner_site_id}/product
Send a product event to Commerce Insights.
post /{partner_site_id}/product
Send a product event to Commerce Insights.
URI Parameters
- partner_site_id: required (string)
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"title": "Product Schema",
"type": "object",
"required": [
"id",
"is_product",
"is_sku",
"code",
"create_date",
"change_date"
],
"properties": {
"id": {
"type": "string"
},
"is_product": {
"type": "boolean"
},
"is_sku": {
"type": "boolean"
},
"catalog": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"version_id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"name": {
"type": "string"
},
"code": {
"type": "string"
},
"ancestors": {
"type": "array",
"items": {
"type": "string"
}
},
"base_product": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"code": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"vendors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"brand": {
"type": "string"
},
"rating": {
"type": "number"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"urls": {
"type": "object",
"properties": {
"admin": {
"type": "string",
"format": "uri"
},
"store": {
"type": "string",
"format": "uri"
}
}
},
"images": {
"type": "array",
"items": {
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"categories": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"attributes": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "object",
"required": [
"id",
"name",
"value"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
Example:
{
"id": "8796107014145",
"create_date": "2013-03-28T19:46:39.000Z",
"change_date": "2013-03-28T19:50:58.000Z",
"is_product": true,
"is_sku": true,
"catalog": {
"id": "electronicsProductCatalog",
"name": "Electronics Product Catalog"
},
"name": "PowerShot A480",
"code": "1934793",
"brand": "Canon",
"categories": [
{
"id": "8796098461838",
"name": "Digital Compacts"
},
{
"id": "8796099248270",
"name": "Canon"
}
],
"images": [
{
"url": "http://yourstore.com/images/the_photo.jpg"
}
]
}
HTTP status code 200
Body
Type: application/json
Schema:
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
Example:
{
"success": true
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
/{partner_site_id}/customer
Send a customer event to Commerce Insights.
/{partner_site_id}/customer
Send a customer event to Commerce Insights.
post /{partner_site_id}/customer
Send a customer event to Commerce Insights.
URI Parameters
- partner_site_id: required (string)
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"title": "Customer Schema",
"type": "object",
"required": [
"create_date",
"change_date",
"id"
],
"properties": {
"cookies": {
"type": "object"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"active_flag": {
"type": "boolean",
"default": true
},
"company": {
"type": "string"
},
"department": {
"type": "string"
},
"position": {
"type": "string"
},
"marketing_opt_in": {
"type": "boolean",
"default": false
}
}
}
Example:
{
"id": "1234abc",
"active_flag": true,
"change_date": "2013-06-17T15:15:53.000Z",
"create_date": "2013-06-17T15:15:53.000Z",
"email": "john.doe@gmail.com",
"first_name": "John",
"last_name": "Doe",
"name": "John Doe"
}
HTTP status code 200
Body
Type: application/json
Schema:
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
Example:
{
"success": true
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
/{partner_site_id}/category
Add, update, and delete the merchandise categories for your product catalog.
/{partner_site_id}/category
Send a category event to Commerce Insights
post /{partner_site_id}/category
Send a category event to Commerce Insights
URI Parameters
- partner_site_id: required (string)
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
Body
Type: application/json
Schema:
{
"title": "Category Schema",
"type": "object",
"required": [
"id",
"name",
"change_date",
"create_date"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"change_date": {
"type": "string",
"format": "date-time"
},
"create_date": {
"type": "string",
"format": "date-time"
},
"parent_categories": {
"type": "array",
"items": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
}
}
}
}
}
}
Example:
{
"id": "8796094234766",
"name": "Lens system",
"change_date": "2013-03-28T19:44:11.000Z",
"create_date": "2013-03-28T19:38:09.000Z"
}
HTTP status code 200
Body
Type: application/json
Schema:
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
Example:
{
"success": true
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
/{partner_site_id}/config
Retrieve your site's tracker URL
/{partner_site_id}/config
Retrieve your site's tracker URL
get /{partner_site_id}/config
Retrieve your site's tracker URL
URI Parameters
- partner_site_id: required (string)
Headers
- Authorization: required (string)
Used to send a valid OAuth2 access token.
Example:
Bearer access_token
HTTP status code 200
Body
Type: application/json
Schema:
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
Example:
{
"site_id": "666",
"success": true,
"tracker_url": "http://test-example.whatareyouwating.for/beacon_api.js"
}
HTTP status code 401
Given request is unauthorized. Bad or expired token. Reauthenticate the user. Any details will be provided within the response payload.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 401,
"message": "Authorization: Unauthorized. Bearer TOKEN is invalid",
"type": "insufficient_credentials",
"moreInfo": "https://api.yaas.io/patterns/errortypes.html"
}
HTTP status code 403
Evaluated request scopes in access token are not sufficient and do not match required scopes.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "error",
"description": "Schema for API specified errors.",
"type": "object",
"properties": {
"status": {
"type": "integer",
"description": "original HTTP error code, should be consistent with the response HTTP code",
"minimum": 100,
"maximum": 599
},
"type": {
"type": "string",
"description": "classification of the error type, lower case with underscore eg validation_failure",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support"
},
"details": {
"type": "array",
"description": "list of problems causing this error",
"items": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "errorDetail",
"description": "schema for specific error cause",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "a bean notation expression specifying the element in request data causing the error, eg product.variants[3].name, this can be empty if violation was not field specific"
},
"type": {
"type": "string",
"description": "classification of the error detail type, lower case with underscore eg missing_value, this value must be always interpreted in context of the general error type.",
"pattern": "[a-z]+[a-z_]*[a-z]+"
},
"message": {
"type": "string",
"description": "descriptive error detail message for debugging"
},
"moreInfo": {
"type": "string",
"format": "uri",
"description": "link to documentation to investigate further and finding support for error detail"
}
},
"required": [
"type"
]
}
}
},
"required": [
"status",
"type"
]
}
Example:
{
"status": 403,
"message": "Given request does not have required scopes in access token. It is not authorized to perform this operation.",
"type": "insufficient_permissions"
}
Scopes
Scopes are strings that let you specify exactly what type of access you need to resources and operations in the Commerce Insights Event service.
The Commerce Insights Event service does not use scopes.
Heartbeat Events
The Commerce Insights API supports a /heartbeat
endpoint that allows you to ping the Commerce Insights platform at a specified interval, ensuring that your module is running and able to reach the Commerce Insights platform. This is a good practice to manage uptime and is helpful in case of low transaction volumes. Your application should ping the endpoint every 30 minutes. Do not configure the ping operation in a system-level cron, as that will only tell the service that the box is up.
Product Events
For every product event, such as add, edit, and delete, send a product event to the Commerce Insights platform.
Because merchants have various degrees of product and merchandise set-ups ranging from standard products, parent products, to SKUs and configurable products, the Commerce Insights product object is built flexibly to account for the set-up that makes the most sense for your business.
Simple product - In many cases, you might need a simple product, for example, if you sell a stand-alone product such as a CD player. In this case, set the product object to
is_product=True
andis_SKU=True
. There is no base product.Base product - If you have configurable or variant products, use a base product that represents most of the parent group products. For example, if you sell red, blue, and green shirts, the shirt itself is the base product. In this case, set the base product to
is_product=True
andis_SKU=False
.Configurable or variant product - For each of these product types, reference the base product per the schema, setting
is_product=False
andis_SKU=True
. For each, include the respective attributes, such asred
,blue
, andgreen
, to provide the SKU-level attribute detail.In certain cases, your system might support the ability to have multiple levels of variant inheritance. In that case, provide the correct product and SKU mapping.
Cart Events
Your e-commerce platform should send events whenever a customer adds, removes, or alters the cart. Do not push old or historical cart data because carts are analyzed only on a forward-going basis.
For Commerce Insights to process your cart events push both current cart items as well as previous cart items. See the examples below.
Examples
Scenario 1: Add one item to cart. For example, one pair of socks.
items:[
{prod:'socks', qty:1}
]
Scenario 2: Add two more items to an existing cart. For example, add two pairs of shoes.
items:[
{prod: 'socks', qty: 1},
{prod: 'shoes', qty: 2}
],
previous_items[
{prod:'socks', qty: 1}
]
Scenario 3: Remove items from an existing cart. For example, remove one pair of socks and one pair of shoes.
items:[
{prod: 'shoes', qty: 1}
],
previous_items[
{prod: 'socks', qty: 1},
{prod: 'shoes', qty: 2}
]
Order Events
The orders endpoint accepts your past and current order details. The orders endpoint accepts your changes to orders. Be sure to push all of your historical order data. The /batch
endpoint is ideal for pushing this information efficiently.
There are three types of order events:
- Order placed
- Order accepted
- Order cancelled
Order placed event
This event ties the web visitor ID to your orders. To create the order-placed event:
- Set the status key to
placed
. - Connect website visitors' behavior to order events by adding the JSON key visit and object with the following schema:
visit: {
"visit_id" : 'vid',
"visitor_id" : 'vis',
"pageview_id" : 'pvid',
"last_pageview_id" : 'lpvid'
}
Example order placed event:
{
"order_number": "123456789",
"cart_id": "123456789",
"status": "placed",
"order_date": "2013-06-17T15:16:10.000Z",
"customer": {
"id": "abc123",
"create_date": "2013-06-17T15:16:11.000Z",
"change_date": "2013-06-17T15:16:11.000Z",
"email": "foo@example.com",
"first_name": "Jane",
"last_name": "Doe"
},
"visit": {
"visit_id": "1234",
"visitor_id": "4321",
"pageview_id": "5678",
"last_pageview_id": "8765"
}
}
See the Order event usage tutorial for instructions on how to set the values for this object.
Order accepted event
This event describes the order details including:
- line items
- products
- order date, total, taxes, shipping, and more
- product images
- order adjustments
This event also handles order changes. See the Order event usage tutorial for instructions on how to use this event.
Order accepted event example:
{
"order_number": "8797436543019",
"cart_id": "1234asdf",
"status": "accepted",
"order_date": "2013-06-17T15:16:10.000Z",
"create_date": "2013-06-17T15:16:10.000Z",
"change_date": "2013-06-17T15:16:15.000Z",
"subtotal": 99.85,
"total": 99.85,
"total_tax": 4.75,
"total_shipping": 0.0,
"total_payment_cost": 0.0,
"total_discounts": 0.0,
"currency": "USD",
"delivery_address": {
"postalcode": "12345",
"address1": "123 Main St.",
"country": "US",
"state": "New York",
"id": "8797680173079",
"city": "Anytown"
},
"payment_address": {
"postalcode": "12345",
"address1": "123 Main St.",
"country": "US",
"state": "New York",
"id": "8797680238615",
"city": "Anytown"
},
"items": [
{
"id": "8797371007020",
"create_date": "2013-06-17T15:16:11.000Z",
"change_date": "2013-06-17T15:16:11.000Z",
"status": "accepted",
"order_item_number": "1",
"quantity": 1,
"price": 99.85,
"discount_price": 0.0,
"status": "accepted",
"product": {
"id": "8796107014145",
"create_date": "2013-03-28T19:46:39.000Z",
"change_date": "2013-03-28T19:50:58.000Z",
"is_product": true,
"is_sku": true,
"catalog": {
"id": "electronicsProductCatalog",
"name": "Electronics Product Catalog"
},
"name": "PowerShot A480",
"code": "1934793",
"brand": "Canon",
"categories": [
{
"id": "8796098461838",
"name": "Digital Compacts"
},
{
"id": "8796099248270",
"name": "Canon"
}
],
"images": [
{
"url": "http://yourstore.com/images/the_photo.jpg"
}
]
}
}
],
"previous_items": [
],
"customer": {
"id": "abc123",
"create_date": "2013-06-17T15:16:11.000Z",
"change_date": "2013-06-17T15:16:11.000Z",
"email": "foo@example.com",
"first_name": "Jane",
"last_name": "Doe"
}
}
Order cancelled event
This event sets an order status to canceled
.
Order canceled example:
{
"order_number": "123456789",
"cancel_date": "2013-06-17T15:16:10.000Z",
"status": "cancelled"
}
Usage
For Commerce Insights to process your order events, do the following:
- Send the order-placed event first.
- Send the order-accepted event next, with all of the information about the order after the customer authorizes the order and pays.
- Anytime the order items change, send the order-accepted event again, with the items contained in the new order, and the previous_items parameter that shows the items in the previous order.
- Send the order-cancelled event if the customer cancels the entire order.
Example scenarios
Scenario 1: Add one item to a new order. For example, add one pair of socks.
items:[
{prod:'socks',qty:1}
]
Scenario 2: Add two more items to an existing order. For example, add two pairs of shoes.
items:[
{prod:'socks',qty:1},
{prod:'shoes',qty:2}
],
previous_items[
{prod:'socks',qty:1}
]
Scenario 3: Remove items from an existing order. For example, remove one pair of socks and one pair of shoes.
items:[
{prod:'shoes',qty:1}
],
previous_items[
{prod:'socks',qty:1},
{prod:'shoes',qty:2}
]
Customer Events
You can use these properties to add, update, and delete customer data in the Commerce Insight Events service.
- Cookies
- Name
- Phone
- Active flag
- Company
- Department
- Position
- Marketing opt-in
Batch Events
Use this endpoint to send more than one Cart, Product, Order, or Customer service event in one request.
Setting visitor JSON object
The Commerce Insights tracker stores visitor and visit identifiers in cookies. To connect web visitors and activity to your e-commerce platform events, link the data stored by the Commerce Insights tracker with your e-commerce platform event by setting the visitor JSON object. Only the cart and order placed events require setting the visit JSON object. The following table describes the mapping to make for generating the visit object for those two events:
Commerce Insights cookie | visit JSON object |
---|---|
_vid | visit_id |
_vis | visitor_id |
Glossary
Term | Description |
---|---|
attribution | An assignment of credit for sales in conversion paths. |
Commerce Insights | The e-commerce analytics and insights application/platform |
conversion rate | The rate at which your visitors convert to purchase. |
insights | A high-level analysis of your data with calls to action. |
pageview | Count of web pages viewed including all text and images. |
sku | Stock Keeping Unit |
visit | An individual visitor who arrives at your site. A visitor browsing multiple pages counts as one visit. |
If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.
Use our private help channel. Receive updates over email and contact our specialists directly.
If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.