REST API

The Da Vinci Signal API exposes a set of core resources that let you create a variety of events in a RESTful manner. All requests require authentication.

Batches

Submit multiple events in a single request. The umbrella endpoint for all event ingestion.

Overview

Use the batch endpoint when sending more than a handful of events. A single batch request carries mixed event types — page views, identities, orders, and more — in one round trip, reducing network overhead compared to calling each per-event endpoint individually.

Every event type accepted by the per-event endpoints — /v1/websites/*, /v1/collections/*, /v1/orders/*, /v1/products/*, /v1/carts/* — is also supported by /v1/batches. The payload shape for each inner event is identical to the body the corresponding standalone endpoint accepts.

The batch processes on a best-effort basis: inner requests succeed or fail independently, and the batch HTTP status doesn't reflect per-event outcomes. See Per-request result.

Request

  • Method: POST
  • Path: /v1/batches
  • Required — pass your tracking token as a Bearer token in the Authorization header: Authorization: Bearer <YOUR_TOKEN>. Find your token in Da Vinci under Setup > Settings > Tracking > Tracking Token.
  • Content-Type: application/json

Body schema

The request body is {"batch": {"requests": [...]}}, where each item in requests is an inner-request object.

Batch envelope

FieldTypeRequiredDescription
batchobjectyesWrapper for the batch payload.
batch.requestsarray of objectsyesThe inner requests to dispatch. Order is preserved in the response. An empty array is valid and returns an empty requests array.

Inner request object

FieldTypeRequiredDescription
resourcestringyesThe event type to record. Must be one of the values in the supported resources table below.
actionstringyesThe action to perform on the resource. Always "create".
paramsobjectyesThe payload for the event. The shape matches the body schema of the corresponding standalone endpoint.

params is limited to 200 top-level keys.

If resource or action is missing or unknown, or if params exceeds 200 keys, the entire batch is rejected with 422 Unprocessable Entity and no inner requests are processed. Per-event validation errors inside params don't reject the batch — they're reported per request. See Per-request result.

Supported resources and their payload schemas

The params field for each resource matches the request body of the corresponding standalone endpoint. Refer to the linked endpoint page for the full payload schema.

resourceactionparams schemaCorresponding endpoint
tracking_website_browsercreateBrowser payloadPOST /v1/websites/browsers
tracking_website_identitycreateIdentity payloadPOST /v1/websites/identities
tracking_website_sessioncreateSession payloadPOST /v1/websites/sessions
tracking_website_page_viewcreatePage view payloadPOST /v1/websites/page_views
tracking_commerce_collection_page_viewcreateCollection page view payloadPOST /v1/collections/page_views
tracking_commerce_product_page_viewcreateProduct page view payloadPOST /v1/products/page_views
tracking_commerce_product_searchcreateProduct search payloadPOST /v1/products/searches
tracking_commerce_cart_additioncreateCart addition payloadPOST /v1/carts/additions
tracking_commerce_cart_removalcreateCart removal payloadPOST /v1/carts/removals
tracking_commerce_order_completioncreateOrder completion payloadPOST /v1/orders/completions
tracking_commerce_order_cancelationcreateOrder cancelation payloadPOST /v1/orders/cancelations
tracking_commerce_order_refundcreateOrder refund payloadPOST /v1/orders/refunds

Minimal example

A batch with a single page view:

{
  "batch": {
    "requests": [
      {
        "resource": "tracking_website_page_view",
        "action": "create",
        "params": {
          "browser_id": "00000000-0000-4000-8000-000000000001",
          "session_id": "00000000-0000-4000-8000-000000000002",
          "url": "<https://example.com/home>",
          "title": "Home"
        }
      }
    ]
  }
}

Full example

A batch mixing a website page view and a commerce collection page view:

{
  "batch": {
    "requests": [
      {
        "resource": "tracking_website_page_view",
        "action": "create",
        "params": {
          "browser_id": "00000000-0000-4000-8000-000000000001",
          "session_id": "00000000-0000-4000-8000-000000000002",
          "url": "<https://example.com/home>",
          "title": "Home"
        }
      },
      {
        "resource": "tracking_commerce_collection_page_view",
        "action": "create",
        "params": {
          "browser_id": "00000000-0000-4000-8000-000000000001",
          "session_id": "00000000-0000-4000-8000-000000000002",
          "url": "<https://example.com/sale>",
          "title": "Sale",
          "collection": [
            {"reference_id": "SALE-COLLECTION", "name": "Sale"}
          ]
        }
      }
    ]
  }
}

Cart events example

A batch containing one cart addition and one cart removal. In batch requests, params is flat. Don't nest it under the cart_addition or cart_removal wrapper that the standalone endpoints use.

{
  "batch": {
    "requests": [
      {
        "resource": "tracking_commerce_cart_addition",
        "action": "create",
        "params": {
          "browser_id": "00000000-0000-4000-8000-000000000001",
          "session_id": "00000000-0000-4000-8000-000000000002",
          "cart_id": "cart-456",
          "product": {
            "reference_id": "SHIRT-100",
            "variants": [
              {
                "reference_id": "SHIRT-100-BLUE-M",
                "price": {
                  "amount": 1999,
                  "currency": "USD"
                }
              }
            ]
          },
          "quantity": 2,
          "value": {
            "amount": 3998,
            "currency": "USD"
          }
        }
      },
      {
        "resource": "tracking_commerce_cart_removal",
        "action": "create",
        "params": {
          "browser_id": "00000000-0000-4000-8000-000000000001",
          "session_id": "00000000-0000-4000-8000-000000000002",
          "cart_id": "cart-456",
          "product": {
            "reference_id": "SHIRT-100",
            "variants": [
              {
                "reference_id": "SHIRT-100-BLUE-M",
                "price": {
                  "amount": 1999,
                  "currency": "USD"
                }
              }
            ]
          },
          "quantity": 1,
          "value": {
            "amount": 1999,
            "currency": "USD"
          }
        }
      }
    ]
  }
}

For cart events, each entry's result contains the event fields directly, without the cart_addition or cart_removal wrapper.

{
  "batch": {
    "requests": [
      {
        "resource": "tracking_commerce_cart_addition",
        "action": "create",
        "status": "ok",
        "result": {
          "id": "5d1c0f9e-6a2b-4f7d-9c1e-2b7e8a3f4d10",
          "browser_id": "00000000-0000-4000-8000-000000000001",
          "session_id": "00000000-0000-4000-8000-000000000002",
          "identity_id": null,
          "created_at": 1614029380,
          "cart_id": "cart-456",
          "product": {
            "reference_id": "SHIRT-100",
            "variants": [
              {
                "reference_id": "SHIRT-100-BLUE-M",
                "price": {
                  "amount": 1999,
                  "currency": "USD"
                }
              }
            ]
          },
          "quantity": 2,
          "value": {
            "amount": 3998,
            "currency": "USD"
          }
        }
      },
      {
        "resource": "tracking_commerce_cart_removal",
        "action": "create",
        "status": "ok",
        "result": {
          "id": "e7a94b12-0c3d-4d58-8f6a-91b2c3d4e5f6",
          "browser_id": "00000000-0000-4000-8000-000000000001",
          "session_id": "00000000-0000-4000-8000-000000000002",
          "identity_id": null,
          "created_at": 1614029381,
          "cart_id": "cart-456",
          "product": {
            "reference_id": "SHIRT-100",
            "variants": [
              {
                "reference_id": "SHIRT-100-BLUE-M",
                "price": {
                  "amount": 1999,
                  "currency": "USD"
                }
              }
            ]
          },
          "quantity": 1,
          "value": {
            "amount": 1999,
            "currency": "USD"
          }
        }
      }
    ]
  }
}

Response

  • Status: 202 Accepted — the batch envelope is valid, even if every inner request fails.
  • Content-Type: application/json
  • Body:
{
  "batch": {
    "requests": [
      {
        "resource": "<string>",
        "action": "<string>",
        "status": "ok" | "error",
        "result": { ... }
      }
    ]
  }
}
FieldTypeDescription
batch.requestsarrayOne entry per inner request, in the same order as the request.
batch.requests[].resourcestringEcho of the inner request's resource.
batch.requests[].actionstringEcho of the inner request's action.
batch.requests[].statusstring"ok" if the inner request succeeded; "error" if it failed.
batch.requests[].resultobjectOn success, the same JSON body the corresponding standalone endpoint returns (without its top-level wrapper key). On error, an error object — see Per-request result.

Per-request result

Inner requests are processed independently. The result field is one of:

Success. The per-event output — the same JSON the corresponding standalone endpoint returns, minus the outer wrapper key. For a successful tracking_website_page_view:

{
  "resource": "tracking_website_page_view",
  "action": "create",
  "status": "ok",
  "result": {
    "browser_id": "00000000-0000-4000-8000-000000000001",
    "session_id": "00000000-0000-4000-8000-000000000002",
    "url": "<https://example.com/home>",
    "title": "Home"
  }
}

Validation error. When params fails validation, result is the same code/title/detail object that a standalone 422 response carries inside its error envelope:

{
  "resource": "tracking_commerce_collection_page_view",
  "action": "create",
  "status": "error",
  "result": {
    "code": 422,
    "title": "Unprocessable Entity",
    "detail": {
      "browser_id": ["can't be blank"],
      "session_id": ["can't be blank"]
    }
  }
}

Forbidden. When the authenticated token isn't permitted to record this event type:

{
  "resource": "tracking_website_page_view",
  "action": "create",
  "status": "error",
  "result": {
    "code": 403,
    "title": "Forbidden",
    "detail": {}
  }
}

Per-request error objects are not wrapped in an outer "error" key, unlike standalone-endpoint error responses. The result field already identifies the value as the request's outcome.

Example response

The request from Full example above, with the second inner request mutated to omit required fields:

{
  "batch": {
    "requests": [
      {
        "resource": "tracking_website_page_view",
        "action": "create",
        "status": "ok",
        "result": {
          "browser_id": "00000000-0000-4000-8000-000000000001",
          "session_id": "00000000-0000-4000-8000-000000000002",
          "url": "<https://example.com/home>",
          "title": "Home"
        }
      },
      {
        "resource": "tracking_commerce_collection_page_view",
        "action": "create",
        "status": "error",
        "result": {
          "code": 422,
          "title": "Unprocessable Entity",
          "detail": {
            "browser_id": ["can't be blank"]
          }
        }
      }
    ]
  }
}

Errors

The batch as a whole returns a non-202 only when the batch envelope itself is rejected — never for inner-request failures.

StatusWhen
401The token is missing, malformed, or unknown. See authentication.
422The request body is missing batch.requests, or one or more inner requests has a missing/unknown resource, a missing/unknown action, or a params object with more than 200 top-level keys. No inner requests are processed in this case.
429Rate limit exceeded. See authentication.

See errors for the shared envelope.

Notes

  • The batch returns 202 when the envelope is valid, even if every inner request fails. Always check each request's status before treating events as accepted.
  • Inner request order is preserved one-to-one in the response, so you can correlate results positionally.
  • Inner requests are dispatched sequentially. There's no partial-failure rollback: if request N fails, requests 1 through N-1 are still recorded and N+1 onward are still attempted.
  • Each inner request's params is limited to 200 top-level keys. This is a guard against malformed payloads; it isn't the per-event field count limit, which each per-event endpoint enforces separately.
  • A bad resource or action value in any inner request rejects the whole batch with 422 before any event is recorded. This differs from paramslevel validation errors, which are isolated to the offending request.

Browsing

A set of resources and events related to the general browsing of a website. Many of these form the foundation for triggering more complex events.

Browser

A browser represents a unique web browser on your website. This would be created the first time a user visits. A browser may or may not span multiple unique sessions. Browsers are used by Da Vinci to relate groups of session events together over a long period of time.

POST https://track.coherentpath.com/v1/websites/browsers

Browser parameters

NameTypeDescription
*user_agentStringThe user agent of the web browser.
*languageStringThe language of the web browser.

* If a user_agent or language is not provided - their values will be taken from request headers.

Request example

{
  "browser": {
    "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
    "language": "en-US"
  }
}

Response example

{
  "browser": {
    "id": "68fd79a2-b414-4c04-9554-76ea150011ee",
    "created_at": 1614029380,
    "expires_at": 1616621380,
    "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
    "language": "en-US"
  }
}

Session

A session represents a timeboxed visit on your website. This would be created anytime a user visits assuming their last session has expired. Sessions are used by Da Vinci to relate a set of events together over a short period of time.

POST https://track.coherentpath.com/v1/websites/sessions

Session parameters

NameTypeDescription
browser_idStringA unique identifier of the web browser.
*remote_ipStringAn IP address of the session.

* If a remote_ip is not provided - the IP of the requester will be used.

Request example

{
  "session": {
    "browser_id": "20343c80-722d-4bb5-b67d-e5d8f1dfe523",
    "remote_ip": "192.158.1.38"
  }
}

Response example

{
  "session": {
    "id": "be6c9e1f-fcf0-494d-8ee7-5ea629db78ad",
    "browser_id": "20343c80-722d-4bb5-b67d-e5d8f1dfe523",
    "created_at": 1614029380,
    "expires_at": 1614030280,
    "remote_ip": "192.158.1.38"
  }
}

Identity

An identity represents a known user visiting your website. An identity can be created for a Da Vinci contact or a previous customer. A user performing an event such as login or registration can also create an identity. Identities are used by Da Vinci to relate a set of known user events together over a short period of time.

POST https://track.coherentpath.com/v1/websites/identities

Identity parameters

NameTypeDescription
browser_idStringA unique identifier of the web browser.
session_idStringA unique identifier of the session.
*contact_idStringA unique identifier of Da Vinci contact.
*email_addressStringAn email address of the user.
sourceStringThe way in which the identification occurred.
tagsArray<String>Additional list of attributes that can be assigned to the identity.
attributesObjectAdditional key-value attributes that can be assigned to the identity.

* One of contact_idor email_address must be provided when creating an identity.

Request example

{
  "identity": {
    "browser_id": "df8e2d68-b6db-47eb-9650-37b672797ec1",
    "session_id": "a5b2c77d-9328-4550-8fa4-ad049a690c51",
    "source": "login",
    "tags": ["identity-tag1", "identity-tag2"],
    "attributes": {
      "identity-key1": "identity-value1",
      "identity-key2": "identity-value2"
    }
  }
}

Response example

{
  "identity": {
    "id": "e18009cf-c346-4143-9ce8-6d233a765030",
    "browser_id": "df8e2d68-b6db-47eb-9650-37b672797ec1",
    "session_id": "a5b2c77d-9328-4550-8fa4-ad049a690c51",
    "created_at": 1614029380,
    "contact_id": null,
    "email": null,
    "source": "login",
    "tags": ["identity-tag1", "identity-tag2"],
    "attributes": {
      "identity-key1": "identity-value1",
      "identity-key2": "identity-value2"
    }
  }
}

Page View

A page view represents a single page visit on your website. Page views are used by Da Vinci to provide insight into the navigation and interests of known as well as unknown users.

POST https://track.coherentpath.com/v1/websites/page_views
Page View Parameters
NameTypeDescription
browser_idStringA unique identifier of the web browser.
session_idStringA unique identifier of the session.
urlStringThe full url of the page visited.
titleStringThe title of the page visited.
identity_idStringA unique identifier of a known user.
referrerStringThe referrer url of the page visited.
sourceStringThe source of the user arrival.
tagsArray<String>Additional list of attributes that can be assigned to the page view.
attributesObjectAdditional key-value attributes that can be assigned to the page view.

Request example

{
  "page_view": {
    "browser_id": "cafd51b1-2adb-4d18-9f80-713c7f5efccf",
    "session_id": "140ec1f2-5839-4cf8-95dd-20170b7390fd",
    "url": "https://myshop.com/blog",
    "title": "Blog",
    "tags": ["page-view-tag1", "page-view-tag2"],
    "attributes": {
      "page-view-key1": "page-view-value1",
      "page-view-key2": "page-view-value2"
    }
  }
}

Response example

{
  "page_view": {
    "id": "5824b626-a941-4782-9124-f79fbfab8393",
    "browser_id": "cafd51b1-2adb-4d18-9f80-713c7f5efccf",
    "session_id": "140ec1f2-5839-4cf8-95dd-20170b7390fd",
    "identity_id": null,
    "created_at": 1614029380,
    "url": "https://myshop.com/blog",
    "title": "Blog",
    "tags": ["page-view-tag1", "page-view-tag2"],
    "attributes": {
      "page-view-key1": "page-view-value1",
      "page-view-key2": "page-view-value2"
    }
  }
}

Products

A set of resources and events related to products on a website.

Product

A product represents an individual item or service for sale in the store.

Product parameters

NameTypeDescription
reference_idStringRequired. Your identifier for the product. Must be nonblank and at least two characters. Send numeric catalog keys as quoted strings (for example, "20001").
nameStringThe name of the product.
variantsArray<Variant>A list of variants associated with the product.
tagsArray<String>Additional list of attributes that can be assigned to the product.
attributesObjectAdditional key-value attributes that can be assigned to the product.

Product variant parameters

NameTypeDescription
reference_idStringRequired on each variant you include. Your identifier for the variant, such as a SKU. Must be nonblank and at least two characters. Send numeric catalog keys as quoted strings.
nameStringThe name of the product variant.
priceMoneyThe price of the product variant.
tagsArray<String>Additional list of attributes that can be assigned to the product.
attributesObjectAdditional key-value attributes that can be assigned to the product.

About reference_id: reference_id is your own identifier for a product, variant, or order. Signal stores the value as you send it. It does not generate it, derive it from the event's id, or check it against your product catalog. To join events with your product catalog, use the matching catalog key. A product page view can identify the parent product, while variants carry SKU-level identifiers.

Product page view

A product page view represents a single page visit on your website for a specific product. Product page views are used by Da Vinci to provide deeper insight into the specific interests of known as well as unknown users.

POST https://track.coherentpath.com/v1/products/page_views

Product page view parameters

NameTypeDescription
browser_idStringA unique identifier of the web browser.
session_idStringA unique identifier of the session.
urlStringThe full url of the product page visited.
titleStringThe title of the product page visited.
productProductInformation about the product.
identity_idStringA unique identifier of a known user.
referrerStringThe referrer url of the product page visited.
sourceStringThe source of the user arrival.
tagsArray<String>Additional list of attributes that can be assigned to the product view.
attributesObjectAdditional key-value attributes that can be assigned to the product view.

Request example

{
  "page_view": {
    "browser_id": "f1c89cc9-228f-42bc-a203-0c84dce5ddab",
    "session_id": "ae5f5797-d010-4f36-bbf8-9b9ab5997f8b",
    "url": "https://myshop.com/product",
    "title": "Product",
    "product": {
      "reference_id": "20001",
      "name": "T-Shirt",
      "variants": [
        {
          "reference_id": "20001-WHT",
          "name": "White",
          "price": {
            "amount": 1000,
            "currency": "USD"
          }
        }
      ]
    },
    "tags": ["page-view-tag1", "page-view-tag2"],
    "attributes": {
      "page-view-key1": "page-view-value1",
      "page-view-key2": "page-view-value2"
    }
  }
}

Response example

{
  "page_view": {
    "id": "1c83eb01-34b9-4e25-bc94-e7d939b8d321",
    "browser_id": "f1c89cc9-228f-42bc-a203-0c84dce5ddab",
    "session_id": "ae5f5797-d010-4f36-bbf8-9b9ab5997f8b",
    "identity_id": null,
    "created_at": 1614029380,
    "url": "https://myshop.com/product",
    "title": "Product",
    "referrer": null,
    "source": null,
    "product": {
      "reference_id": "20001",
      "name": "T-Shirt",
      "variants": [
        {
          "reference_id": "20001-WHT",
          "name": "White",
          "price": {
            "amount": 1000,
            "currency": "USD"
          },
          "tags": [],
          "attributes": {}
        }
      ]
    },
    "tags": ["page-view-tag1", "page-view-tag2"],
    "attributes": {
      "page-view-key1": "page-view-value1",
      "page-view-key2": "page-view-value2"
    }
  }
}

Product search

A product search represents a single search on your website using a specific query. Product searches are used by Da Vinci to provide deeper insight into the specific interests of known as well as unknown users.

POST https://track.coherentpath.com/v1/products/searches

Product search parameters

NameTypeDescription
browser_idStringA unique identifier of the web browser.
session_idStringA unique identifier of the session.
queryStringThe search query term used.
identity_idStringA unique identifier of a known user.
productsArrayProductA list of products returned by the search. This can be limited to a subset of the total list.
tagsArray<String>Additional list of attributes that can be assigned to the search.
attributesObjectAdditional key-value attributes that can be assigned to the search.

Request example

{
  "search": {
    "browser_id": "aadd0167-7b4b-4e94-a081-5272f4b6b407",
    "session_id": "dcfd9ff6-7fab-4956-858a-52a57cfc534e",
    "identity_id": "6e2fd87b-2383-46bb-a67e-1b4c0d2a0d2a",
    "query": "t shirts",
    "tags": ["search-tag1", "search-tag2"],
    "attributes": {
      "search-key1": "search-value1",
      "search-key2": "search-value2"
    },
    "products": [
      {
        "reference_id": "20001",
        "name": "Men's T-Shirt"
      },
      {
        "reference_id": "20002",
        "name": "Women's T-Shirt"
      }
    ]
  }
}

Response example

{
  "search": {
    "id": "c6bf5cad-63a0-418d-9c7b-d5b8d3db73b3",
    "browser_id": "aadd0167-7b4b-4e94-a081-5272f4b6b407",
    "session_id": "dcfd9ff6-7fab-4956-858a-52a57cfc534e",
    "identity_id": "6e2fd87b-2383-46bb-a67e-1b4c0d2a0d2a",
    "query": "t shirts",
    "created_at": 1614029380,
    "tags": ["search-tag1", "search-tag2"],
    "attributes": {
      "search-key1": "search-value1",
      "search-key2": "search-value2"
    },
    "products": [
      {
        "reference_id": "20001",
        "name": "Men's T-Shirt",
        "variants": [],
        "tags": [],
        "attributes": {}
      },
      {
        "reference_id": "20002",
        "name": "Women's T-Shirt",
        "variants": [],
        "tags": [],
        "attributes": {}
      }
    ]
  }
}

Cart

A set of resources and events related to a shopper's cart on a website. Each event represents one product or selected variant action. It isn't a snapshot of the whole cart.

Cart addition

A cart addition represents a shopper adding a product to a cart. Use it to send Da Vinci the products shoppers add to their carts, for known as well as unknown users.

POST https://track.coherentpath.com/v1/carts/additions

The endpoint returns 202 Accepted.

Cart addition parameters

NameTypeDescription
browser_idStringA unique identifier of the web browser.
session_idStringA unique identifier of the session.
identity_idStringA unique identifier of a known user.
productProductRequired. The product added to the cart.
product.reference_idStringRequired. Your identifier for the product. Must be nonblank and at least two characters. Send numeric catalog keys as quoted strings (for example, "20001").
product.variants[].reference_idStringRequired on each variant you include. Your identifier for the variant, such as a SKU. Must be nonblank and at least two characters. Send numeric catalog keys as quoted strings.
product.variants[].priceMoneyThe unit price of the selected variant at the time of the action. Required when you include a variant and use its price to calculate value.
quantityIntegerRequired. A positive integer. The number of units added by this action, not the resulting quantity in the cart.
valueMoneyRequired. The total value of the units added by this action: the selected unit price multiplied by quantity at the time of the action.
cart_idStringRecommended. An identifier that correlates the add, remove, checkout, and promotion actions that belong to one cart.
tagsArray<String>Additional list of attributes that can be assigned to the cart addition.
attributesObjectAdditional key-value attributes that can be assigned to the cart addition.

Money values use the Money object: amount is an integer in minor units (for example, 3998 represents $39.98) and currency is the currency code.

Request example

{
  "cart_addition": {
    "browser_id": "9a1f0b5e-3c2d-4e8a-b7f1-6d0c2e9a4b31",
    "session_id": "3b7d6c1a-5e4f-4a0b-8c92-1f2d3e4a5b60",
    "cart_id": "cart-456",
    "product": {
      "reference_id": "SHIRT-100",
      "name": "Classic Oxford Shirt",
      "variants": [
        {
          "reference_id": "SHIRT-100-BLUE-M",
          "name": "Blue / Medium",
          "price": {
            "amount": 1999,
            "currency": "USD"
          }
        }
      ],
      "tags": [
        "mens",
        "shirts"
      ],
      "attributes": {
        "brand": "Example Brand"
      }
    },
    "quantity": 2,
    "value": {
      "amount": 3998,
      "currency": "USD"
    }
  }
}

Response example

{
  "cart_addition": {
    "id": "5d1c0f9e-6a2b-4f7d-9c1e-2b7e8a3f4d10",
    "browser_id": "9a1f0b5e-3c2d-4e8a-b7f1-6d0c2e9a4b31",
    "session_id": "3b7d6c1a-5e4f-4a0b-8c92-1f2d3e4a5b60",
    "identity_id": null,
    "created_at": 1614029380,
    "cart_id": "cart-456",
    "product": {
      "reference_id": "SHIRT-100",
      "name": "Classic Oxford Shirt",
      "variants": [
        {
          "reference_id": "SHIRT-100-BLUE-M",
          "name": "Blue / Medium",
          "price": {
            "amount": 1999,
            "currency": "USD"
          },
          "tags": [],
          "attributes": {}
        }
      ],
      "tags": [
        "mens",
        "shirts"
      ],
      "attributes": {
        "brand": "Example Brand"
      }
    },
    "quantity": 2,
    "value": {
      "amount": 3998,
      "currency": "USD"
    },
    "tags": [],
    "attributes": {}
  }
}

Cart removal

A cart removal represents a shopper removing a product from a cart. Cart removals use the same payload as cart additions, but Da Vinci records them as a distinct event type, so adds and removes stay separate.

POST https://track.coherentpath.com/v1/carts/removals

The endpoint returns 202 Accepted.

Cart removal parameters

Cart removal accepts the same parameters as Cart addition, with two differences in meaning:

NameTypeDescription
quantityIntegerRequired. A positive integer. The number of units removed by this action.
valueMoneyRequired. The total value of the units removed by this action: the selected unit price multiplied by quantity at the time of the action.

Request example

{
  "cart_removal": {
    "browser_id": "9a1f0b5e-3c2d-4e8a-b7f1-6d0c2e9a4b31",
    "session_id": "3b7d6c1a-5e4f-4a0b-8c92-1f2d3e4a5b60",
    "cart_id": "cart-456",
    "product": {
      "reference_id": "SHIRT-100",
      "variants": [
        {
          "reference_id": "SHIRT-100-BLUE-M",
          "price": {
            "amount": 1999,
            "currency": "USD"
          }
        }
      ]
    },
    "quantity": 1,
    "value": {
      "amount": 1999,
      "currency": "USD"
    }
  }
}

Response example

{
  "cart_removal": {
    "id": "e7a94b12-0c3d-4d58-8f6a-91b2c3d4e5f6",
    "browser_id": "9a1f0b5e-3c2d-4e8a-b7f1-6d0c2e9a4b31",
    "session_id": "3b7d6c1a-5e4f-4a0b-8c92-1f2d3e4a5b60",
    "identity_id": null,
    "created_at": 1614029380,
    "cart_id": "cart-456",
    "product": {
      "reference_id": "SHIRT-100",
      "variants": [
        {
          "reference_id": "SHIRT-100-BLUE-M",
          "price": {
            "amount": 1999,
            "currency": "USD"
          },
          "tags": [],
          "attributes": {}
        }
      ],
      "tags": [],
      "attributes": {}
    },
    "quantity": 1,
    "value": {
      "amount": 1999,
      "currency": "USD"
    },
    "tags": [],
    "attributes": {}
  }
}

Orders

Order

An order is a customer's completed request to purchase one or more products from a shop.

Order parameters

NameTypeDescription 
reference_idStringRequired on the order for order completions, cancelations, and refunds. Your identifier for the order, not for a product. Must be nonblank and at least two characters. 
tagsArray<String>Additional list of attributes that can be assigned to the order. 
attributesObjectAdditional key-value attributes that can be assigned to the order. 
processed_atIntegerThe timestamp when the order was processed by an ecommerce system. 
discountMoneyThe sum of all discounts. 
subtotalMoneyThe sum of all line item product prices after discounts but before shipping, and taxes. 
itemsArray<Order Item>A list of line items associated with the order. 

Order item parameters

NameTypeDescription
reference_idStringRequired on each line item you include. Identifies the product or variant the line item represents. Must be nonblank and at least two characters. Send numeric catalog keys as quoted strings.
tagsArray<String>Additional list of attributes that can be assigned to the line item.
attributesObjectAdditional key-value attributes that can be assigned to the line item.
nameStringThe name of the product variant.
quantityIntegerThe total number of items.
discountMoneyThe sum of all discounts applied to the line item.
priceMoneyThe price of the product variant.

Order vs. item identifiers: order.reference_id identifies the order. order.items[].reference_id identifies the product or variant each line item represents. Neither is the same as the generated event id returned in responses.

Order completion

An order completion is an event created at the final step of an order. It should represent the final transaction - once all previous steps are completed.

POST https://track.coherentpath.com/v1/orders/completions

Order completion parameters

NameTypeDescription
browser_idStringA unique identifier of the web browser.
session_idStringA unique identifier of the session.
identity_idStringA unique identifier of a known user.
orderOrderDetailed information about the order.
tagsArray<String>Additional list of attributes that can be assigned to the order completion.
attributesObjectAdditional key-value attributes that can be assigned to the order completion.

Request example

{
  "completion": {
    "browser_id": "e56c9d3a-505d-4245-8809-150941a12970",
    "session_id": "624070e1-a694-4e67-a550-087795ab55d8",
    "identity_id": "0e0ce0ce-058d-44d8-b811-1b6d5f6794d2",
    "order": {
      "reference_id": "ORDER-10043",
      "source": "web",
      "tags": ["order-tag1", "order-tag2"],
      "attributes": {
        "order-key1": "order-value1",
        "order-key2": "order-value2"
      },
      "processed_at": 1614029375,
      "discount": {
        "amount": 100,
        "currency": "USD"
      },
      "subtotal": {
        "amount": 1000,
        "currency": "USD"
      },
      "items": [
        {
          "reference_id": "20001-WHT",
          "tags": ["product-tag1", "product-tag2"],
          "attributes": {
            "product-key1": "product-value1",
            "product-key2": "product-value2"
          },
          "quantity": 1,
          "discount": {
            "amount": 100,
            "currency": "USD"
          },
          "price": {
            "amount": 1000,
            "currency": "USD"
          }
        }
      ]
    }
  }
}

Response example

{
  "completion": {
    "id": "2977a200-b749-483a-a91e-a9ce71939eae",
    "browser_id": "e56c9d3a-505d-4245-8809-150941a12970",
    "session_id": "624070e1-a694-4e67-a550-087795ab55d8",
    "identity_id": "0e0ce0ce-058d-44d8-b811-1b6d5f6794d2",
    "created_at": 1614029380,
    "tags": [],
    "attributes": {},
    "order": {
      "reference_id": "ORDER-10043",
      "source": "web",
      "tags": ["order-tag1", "order-tag2"],
      "attributes": {
        "order-key1": "order-value1",
        "order-key2": "order-value2"
      },
      "processed_at": 1614029375,
      "discount": {
        "amount": 100,
        "currency": "USD"
      },
      "subtotal": {
        "amount": 1000,
        "currency": "USD"
      },
      "items": [
        {
          "reference_id": "20001-WHT",
          "tags": ["product-tag1", "product-tag2"],
          "attributes": {
            "product-key1": "product-value1",
            "product-key2": "product-value2"
          },
          "quantity": 1,
          "discount": {
            "amount": 100,
            "currency": "USD"
          },
          "price": {
            "amount": 1000,
            "currency": "USD"
          }
        }
      ]
    }
  }
}

Order cancelation

An order cancelation is an event created whenever a user chooses to cancel an existing order. A cancelation should only be triggered before the order has shipped. A full representation of the existing order should be included in the request if possible.

POST https://track.coherentpath.com/v1/orders/cancelations

Order cancelation parameters

NameTypeDescription
browser_idStringA unique identifier of the web browser.
session_idStringA unique identifier of the session.
identity_idStringA unique identifier of a known user.
orderOrderDetailed information about the order.
tagsArray<String>Additional list of attributes that can be assigned to the order completion.
attributesObjectAdditional key-value attributes that can be assigned to the order completion.

Request example

{
  "cancelation": {
    "browser_id": "c6a29bec-5a53-4736-b892-8641373b0d52",
    "session_id": "dce206f0-99f2-4f04-b3e1-b90ba3bc2f08",
    "identity_id": "e4557154-34be-4c05-aefa-fb5afaae3a02",
    "order": {
      "reference_id": "ORDER-10043",
      "source": "web",
      "tags": ["order-tag1", "order-tag2"],
      "attributes": {
        "order-key1": "order-value1",
        "order-key2": "order-value2"
      },
      "processed_at": 1614029375,
      "discount": {
        "amount": 100,
        "currency": "USD"
      },
      "subtotal": {
        "amount": 1000,
        "currency": "USD"
      },
      "items": [
        {
          "reference_id": "20001-WHT",
          "tags": ["product-tag1", "product-tag2"],
          "attributes": {
            "product-key1": "product-value1",
            "product-key2": "product-value2"
          },
          "quantity": 1,
          "discount": {
            "amount": 100,
            "currency": "USD"
          },
          "price": {
            "amount": 1000,
            "currency": "USD"
          }
        }
      ]
    }
  }
}

Response example

{
  "cancelation": {
    "id": "ece22bc7-2267-4e2e-9d78-12fa34b9f3ed",
    "browser_id": "c6a29bec-5a53-4736-b892-8641373b0d52",
    "session_id": "dce206f0-99f2-4f04-b3e1-b90ba3bc2f08",
    "identity_id": "e4557154-34be-4c05-aefa-fb5afaae3a02",
    "created_at": 1614029380,
    "tags": [],
    "attributes": {},
    "order": {
      "reference_id": "ORDER-10043",
      "source": "web",
      "tags": ["order-tag1", "order-tag2"],
      "attributes": {
        "order-key1": "order-value1",
        "order-key2": "order-value2"
      },
      "processed_at": 1614029375,
      "discount": {
        "amount": 100,
        "currency": "USD"
      },
      "subtotal": {
        "amount": 1000,
        "currency": "USD"
      },
      "items": [
        {
          "reference_id": "20001-WHT",
          "tags": ["product-tag1", "product-tag2"],
          "attributes": {
            "product-key1": "product-value1",
            "product-key2": "product-value2"
          },
          "quantity": 1,
          "discount": {
            "amount": 100,
            "currency": "USD"
          },
          "price": {
            "amount": 1000,
            "currency": "USD"
          }
        }
      ]
    }
  }
}

Order refund

An order refund is an event created whenever a user receives a refund for an existing order. A refund should only be triggered after the order has shipped. A full representation of the existing order should be included in the request if possible.

POST https://track.coherentpath.com/v1/orders/refunds

Order refund parameters

NameTypeDescription
browser_idStringA unique identifier of the web browser.
session_idStringA unique identifier of the session.
identity_idStringA unique identifier of a known user.
orderOrderDetailed information about the order.
tagsArray<String>Additional list of attributes that can be assigned to the order completion.
attributesObjectAdditional key-value attributes that can be assigned to the order completion.

Request example

{
  "refund": {
    "browser_id": "386836c1-4b77-4d59-99cb-8cd3e3a894d3",
    "session_id": "24615e38-b8e1-4524-a6f5-79a86368ca26",
    "identity_id": "3ededc74-99de-40ac-95c5-6587a8771f6d",
    "order": {
      "reference_id": "ORDER-10043",
      "source": "web",
      "tags": ["order-tag1", "order-tag2"],
      "attributes": {
        "order-key1": "order-value1",
        "order-key2": "order-value2"
      },
      "processed_at": 1614029375,
      "discount": {
        "amount": 100,
        "currency": "USD"
      },
      "subtotal": {
        "amount": 1000,
        "currency": "USD"
      },
      "items": [
        {
          "reference_id": "20001-WHT",
          "tags": ["product-tag1", "product-tag2"],
          "attributes": {
            "product-key1": "product-value1",
            "product-key2": "product-value2"
          },
          "quantity": 1,
          "discount": {
            "amount": 100,
            "currency": "USD"
          },
          "price": {
            "amount": 1000,
            "currency": "USD"
          }
        }
      ]
    }
  }
}

Response example

{
  "refund": {
    "id": "d12814d2-0310-40a3-812a-a7760309c3bd",
    "browser_id": "386836c1-4b77-4d59-99cb-8cd3e3a894d3",
    "session_id": "24615e38-b8e1-4524-a6f5-79a86368ca26",
    "identity_id": "3ededc74-99de-40ac-95c5-6587a8771f6d",
    "created_at": 1614029380,
    "tags": [],
    "attributes": {},
    "order": {
      "reference_id": "ORDER-10043",
      "source": "web",
      "tags": ["order-tag1", "order-tag2"],
      "attributes": {
        "order-key1": "order-value1",
        "order-key2": "order-value2"
      },
      "processed_at": 1614029375,
      "discount": {
        "amount": 100,
        "currency": "USD"
      },
      "subtotal": {
        "amount": 1000,
        "currency": "USD"
      },
      "items": [
        {
          "reference_id": "20001-WHT",
          "tags": ["product-tag1", "product-tag2"],
          "attributes": {
            "product-key1": "product-value1",
            "product-key2": "product-value2"
          },
          "quantity": 1,
          "discount": {
            "amount": 100,
            "currency": "USD"
          },
          "price": {
            "amount": 1000,
            "currency": "USD"
          }
        }
      ]
    }
  }
}

Money

Money is represented as it own object when used in things like orders and products.

Money parameters

NameTypeDescription
amountIntegerA positive integer representing a monetary value (e.g., 100 represents $1.00)
currencyStringThe currency of the money amount.