commerce/customer/visits

Use the Visits resource to manage all visits a customer makes to a tenant's sites and measure the level of transactions a customer performs during a unique visit for customer account analytics. Clients can track customer visits by site (including online and in-person interactions), the transactions a customer performs during the visit, and the device type associated with the visit, if any.

JSON Example

Visit Properties

Property Description
accountId

type: int

Unique identifier of the customer account generated by the system. Account IDs are generated at account creation.

browserLocationCode

type: string

If the customer visit is made online, the location code associated with the website visited.

date

type: DateTime

The date and time recording for a customer action including a transaction and storefront visit.

id

type: string

Unique identifier of the source property, such as a catalog, discount, order, or email template.

For a product field it will be the name of the field.

For a category ID, must be a positive integer not greater than 2000000. By default, Kibo eCommerce auto-generates a category ID when categories are created. If you want to specify an ID during creation (which preserves category link relationships when migrating tenant data from one sandbox to another), you must also include the useProvidedId query string in the endpoint. For example, api/commerce/catalog/admin/categories/?useProvidedId=true. Then, use the id property to specify the desired category ID.

For a product attribute it will be the Attribute FQN.

For a document, the ID must be specified as a 32 character, case-insensitive, alphanumeric string. You can specify the ID as 32 sequential characters or as groups separated by dashes in the format 8-4-4-4-12. For example, bba0a1a885e2413bb097ceacf7bac366
or
bba0a1a8-85e2-413b-b097-ceacf7bac366.

For email templates, the ID must be one of the following values:
BackInStock
OrderChanged
OrderShipped
OrderFulfillmentDetailsChanged
ShopperLoginCreated
ShopperPasswordReset
ReturnCreated
ReturnAuthorized
ReturnUpdated
ReturnRejected
ReturnCancelled
ReturnClosed
RefundCreated
StoreCreditCreated
StoreCreditUpdated
GiftCardCreated

locationCode

type: string

The unique, user-defined code that identifies a location. This location can be the location where the order was entered, location for newly in-stock products, and where products are returned.

transactions

type: list of transaction

Array list of transactions the customer performed during the visit. A customer can perform multiple transactions in a single visit, or the visit can have no associated transactions.

transaction.amount

type: decimal

The amount of the order-level adjustment, which can be a positive or negative amount.

transaction.currencyCode

type: string

The localized currency code for the monetary amount.

transaction.date

type: DateTime

The date and time recording for a customer action including a transaction and storefront visit.

transaction.interactionType

type: string

The type of payment interaction. The payment can be Capture or CheckReceived. The value also includes customer payment interactions such as Website, Call, Store, or Unknown.

transaction.transactionId

type: string

The unique identifier of the transaction.

transaction.transactionType

type: string

Specifies the type of transaction, including customer transactions and credit transactions.

Valid values for credit transactions are the following:

  • Debit—decreases the credit amount
  • Credit—updates the credit amount

Valid values for customer transaction types are the following:

  • Order
  • Return
  • OrderPickup
  • Wishlist

transaction.visitId

type: string

Unique identifier of the customer visit in which the cart was created or last modified.

type

type: string

The type of scope, which is a developer account or production tenant.

userId

type: string

Unique identifier of the customer account (shopper or system user). System-supplied and read-only. If the shopper user is anonymous, the user ID represents a system-generated user ID string.

webReferrer

type: string

The HTTP_Referrer that initiatied the visit started. If the shopper was not referred from another source, this value is null.

webSessionId

type: string

Unique identifier of the web session in which the cart, order, return, or wish list was created or last modified.

webSiteId

type: int

Unique identifier for the web site visited by a user.

webUserAgent

type: string

The user agent string for the browser.

Operations

Operation Name Request URI Description
AddVisit POST %3fresponseFields%3d%7bresponseFields%7d

Creates a new visit for the customer account specified in the request.

GetVisit GET %7bvisitId%7d%3fresponseFields%3d%7bresponseFields%7d

Retrieves the details of the customer visit specified in the request.

GetVisits GET %3fstartIndex%3d%7bstartIndex%7d%26pageSize%3d%7bpageSize%7d%26sortBy%3d%7bsortBy%7d%26filter%3d%7bfilter%7d%26responseFields%3d%7bresponseFields%7d

Retrieves a list of customer visits according to any filter or sort criteria specified in the request.

UpdateVisit PUT %7bvisitId%7d%3fresponseFields%3d%7bresponseFields%7d

Updates one or more properties of a defined customer visit.