younifyd
Menu

Get Customer Session

Get customer session

GET/v2/customer_sessions/{customerSessionId}

Use it in a workflow

  1. Add a step and choose the Talon.One connector.
  2. Pick the Get Customer Session action (under integration).
  3. Fill in the fields below, then reference the result from later steps as {{getCustomerSession.response.data}}.

Request

Path parameters

customerSessionIdstringrequired

The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint.

Response

Returns 200 with an object. Read it in later steps with {{getCustomerSession.response.data.<field>}}.

customerSessionobject

The representation of the customer session.

idinteger (int64)required

The internal ID of this entity.

createdstring (date-time)required

The time this entity was created.

integrationIdstring (string)required

The integration ID set by your integration layer.

applicationIdinteger (int64)required

The ID of the Application that owns this entity.

profileIdstringrequired

ID of the customer profile set by your integration layer. **Note:** If the customer does not yet have a known `profileId`, we recommend you use a guest `profileId`.

storeIntegrationIdstring

The integration ID of the store. You choose this ID when you create a store.

evaluableCampaignIdsarray<integer (int64)>

When using the `dry` query parameter, use this property to list the campaign to be evaluated by the Rule Engine. These campaigns will be evaluated, even if they are disabled, allowing you to test specific campaigns before activating them.

couponCodesarray<string>

Any coupon codes entered. **Important - for requests only**: - If you [create a coupon budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a coupon code by the time you close it. - In requests where `dry=false`, providing an empty array discards any previous coupons. To avoid this, omit the parameter entirely.

referralCodestring

Any referral code entered. **Important - for requests only**: - If you [create a referral budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign, ensure the session contains a referral code by the time you close it. - In requests where `dry=false`, providing an empty value discards the previous referral code. To avoid this, omit the parameter entirely.

loyaltyCardsarray<string>

Identifier of a loyalty card.

statestringrequired

Indicates the current state of the session. Sessions can be created as `open` or `closed`. The state transitions are: 1. `open` → `closed` 2. `open` → `cancelled` 3. Either: - `closed` → `cancelled` (**only** via [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2)) or - `closed` → `partially_returned` (**only** via [Return cart items](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/returnCartItems)) - `closed` → `open` (**only** via [Reopen customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/reopenCustomerSession)) 4. `partially_returned` → `cancelled` For more information, see [Customer session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions).

One ofopenclosedpartially_returnedcancelledDefault "open"

cartItemsarray<object>required21 fields

The items to add to this session. **Do not exceed 1000 items** and ensure the sum of all cart item's `quantity` **does not exceed 10.000** per request.

experimentVariantAllocationsarray<object>2 fields

The experiment variant allocations to add to this session.

additionalCostsobject

Use this property to set a value for the additional costs of this session, such as a shipping cost. They must be created in the Campaign Manager before you set them with this property. See [Managing additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs).

identifiersarray<string>

Session custom identifiers that you can set limits on or use inside your rules. For example, you can use IP addresses as identifiers to potentially identify devices and limit discounts abuse in case of customers creating multiple accounts. See the [tutorial](https://docs.talon.one/docs/dev/tutorials/using-identifiers). **Important**: Ensure the session contains an identifier by the time you close it if: - You [create a unique identifier budget](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets/#budget-types) for your campaign. - Your campaign has [coupons](https://docs.talon.one/docs/product/campaigns/coupons/coupon-page-overview). - We recommend passing an anonymized (hashed) version of the identifier value.

attributesobjectrequired

Use this property to set a value for the attributes of your choice. Attributes represent any information to attach to your session, like the shipping city. You can use [built-in attributes](https://docs.talon.one/docs/dev/concepts/attributes#built-in-attributes) or [custom ones](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes). Custom attributes must be created in the Campaign Manager before you set them with this property.

firstSessionbooleanrequired

Indicates whether this is the first session for the customer's profile. It's always `true` for anonymous sessions.

updateCountinteger (int64)required

The number of times the session was updated. When the session is created, this value is initialized to `1`.

totalnumberrequired

The total value of cart items and additional costs in the session, before any discounts are applied.

cartItemTotalnumberrequired

The total value of cart items, before any discounts are applied.

additionalCostTotalnumberrequired

The total value of additional costs, before any discounts are applied.

updatedstring (date-time)required

Timestamp of the most recent event received on this session.

effectsarray<object>

The returned effects. **Note:** This endpoint returns only the effects that are valid after any rollback effects and their corresponding non-rollback effects are removed.

experimentIdinteger (int64)

The ID of the experiment that campaign belongs to.

campaignIdinteger (int64)required

The ID of the campaign that triggered this effect.

rulesetIdinteger (int64)required

The ID of the ruleset that was active in the campaign when this effect was triggered.

ruleIndexinteger (int64)required

The position of the rule that triggered this effect within the ruleset.

ruleNamestringrequired

The name of the rule that triggered this effect.

effectTypestringrequired

The type of effect that was triggered. See [API effects](https://docs.talon.one/docs/dev/integration-api/api-effects).

triggeredByCouponinteger (int64)

The ID of the coupon that was being evaluated when this effect was triggered.

triggeredForCatalogIteminteger (int64)

The ID of the catalog item that was being evaluated when this effect was triggered.

conditionIndexinteger (int64)

The index of the condition that was triggered.

evaluationGroupIDinteger (int64)

The ID of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).

evaluationGroupModestring

The evaluation mode of the evaluation group. For more information, see [Managing campaign evaluation](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation).

campaignRevisionIdinteger (int64)

The revision ID of the campaign that was used when triggering the effect.

campaignRevisionVersionIdinteger (int64)

The revision version ID of the campaign that was used when triggering the effect.

selectedPriceTypestring

The selected price type for the SKU targeted by this effect.

selectedPricenumber

The value of the selected price type to apply to the SKU targeted by this effect, before any discounts are applied.

adjustmentReferenceIdstring (uuid)

The reference identifier of the selected price adjustment for this SKU. This is only returned if the `selectedPrice` resulted from a price adjustment.

propsobjectrequired
json
{
  "customerSession": {
    "couponCodes": [
      "XMAS-20-2021"
    ],
    "updateCount": 3,
    "created": {},
    "identifiers": [
      "d41306257915f83fe01e54092ae470f631161ea16fcf4415842eed41470386ea"
    ],
    "integrationId": "URNGV8294NV",
    "experimentVariantAllocations": [
      {
        "experimentID": 1,
        "variantID": 2
      },
      {
        "experimentID": 1,
        "variantID": 2
      }
    ],
    "total": 119.99,
    "loyaltyCards": [
      "loyalty-card-1"
    ],
    "additionalCosts": {
      "shipping": {
        "price": 9
      }
    },
    "additionalCostTotal": 20,
    "storeIntegrationId": "STORE-001",
    "profileId": "URNGV8294NV",
    "evaluableCampaignIds": [
      10,
      12
    ],
    "referralCode": "NT2K54D9",
    "attributes": {
      "ShippingCity": "Berlin"
    },
    "id": 6,
    "state": "open",
    "applicationId": 322,
    "cartItems": [
      {
        "remainingQuantity": 1,
        "product": {
          "name": "sample_product"
        },
        "quantity": 1,
        "returnedQuantity": 1,
        "length": 1.4658129805029452,
        "weight": 1130,
        "adjustmentReferenceId": "68851723-e6fa-488f-ace9-112581e6c19b",
        "adjustmentEffectiveFrom": {},
        "catalogItemID": 5,
        "additionalCosts": {
          "shipping": {
            "price": 9
          }
        },
        "price": 99.99,
        "selectedPriceType": "member",
        "name": "Air Glide",
        "width": 6.027456183070403,
        "attributes": {
          "image": "11.jpeg",
          "material": "leather"
        },
        "adjustmentEffectiveUntil": {},
        "position": 5.962133916683182,
        "sku": "SKU1241028",
        "category": "shoes",
        "prices": {
          "member": {
            "price": 90,
            "adjustmentReferenceId": "68851723-e6fa-488f-ace9-112581e6c19b",
            "effectiveFrom": {},
            "effectiveUntil": {}
          },
          "base": {
            "price": 100
          }
        },
        "height": 0.8008281904610115
      },
      {
        "remainingQuantity": 1,
        "product": {
          "name": "sample_product"
        },
        "quantity": 1,
        "returnedQuantity": 1,
        "length": 1.4658129805029452,
        "weight": 1130,
        "adjustmentReferenceId": "68851723-e6fa-488f-ace9-112581e6c19b",
        "adjustmentEffectiveFrom": {},
        "catalogItemID": 5,
        "additionalCosts": {
          "shipping": {
            "price": 9
          }
        },
        "price": 99.99,
        "selectedPriceType": "member",
        "name": "Air Glide",
        "width": 6.027456183070403,
        "attributes": {
          "image": "11.jpeg",
          "material": "leather"
        },
        "adjustmentEffectiveUntil": {},
        "position": 5.962133916683182,
        "sku": "SKU1241028",
        "category": "shoes",
        "prices": {
          "member": {
            "price": 90,
            "adjustmentReferenceId": "68851723-e6fa-488f-ace9-112581e6c19b",
            "effectiveFrom": {},
            "effectiveUntil": {}
          },
          "base": {
            "price": 100
          }
        },
        "height": 0.8008281904610115
      }
    ],
    "updated": {},
    "firstSession": true,
    "cartItemTotal": 99.99
  },
  "effects": [
    {
      "rulesetId": 73,
      "ruleIndex": 2,
      "campaignRevisionVersionId": 5,
      "campaignId": 244,
      "conditionIndex": 786,
      "evaluationGroupMode": "stackable",
      "effectType": "rejectCoupon",
      "adjustmentReferenceId": "68851723-e6fa-488f-ace9-112581e6c19b",
      "props": "{}",
      "selectedPrice": 100,
      "evaluationGroupID": 3,
      "triggeredForCatalogItem": 786,
      "selectedPriceType": "member",
      "campaignRevisionId": 1,
      "ruleName": "Give 20% discount",
      "experimentId": 12,
      "triggeredByCoupon": 4928
    }
  ]
}

Need more? See the Talon.One guide for connection setup and behaviour shared by every action.