Skip to content

Latest commit

 

History

History
55 lines (48 loc) · 6.91 KB

CustomerSessionV2.md

File metadata and controls

55 lines (48 loc) · 6.91 KB

TalonOne::CustomerSessionV2

Properties

Name Type Description Notes
id Integer Internal ID of this entity.
created DateTime The time this entity was created. The time this entity was created.
integration_id String The integration ID set by your integration layer.
application_id Integer The ID of the application that owns this entity.
profile_id String 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`.
store_integration_id String The integration ID of the store. You choose this ID when you create a store. [optional]
evaluable_campaign_ids Array<Integer> 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. [optional]
coupon_codes Array<String> Any coupon codes entered. Important - for requests only: - If you create a coupon budget 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, provide `&quot;couponCodes&quot;: null` or omit the parameter entirely. [optional]
referral_code String Any referral code entered. Important - for requests only: - If you create a referral budget 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, provide `&quot;referralCode&quot;: null` or omit the parameter entirely. [optional]
loyalty_cards Array<String> Identifier of a loyalty card. [optional]
state String 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) or - `closed` → `partially_returned` (only via Return cart items) - `closed` → `open` (only via Reopen customer session) 4. `partially_returned` → `cancelled` For more information, see Customer session states. [default to 'open']
cart_items Array<CartItem> 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.
additional_costs Hash<String, AdditionalCost> 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. [optional]
identifiers Array<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. Important: Ensure the session contains an identifier by the time you close it if: - You create a unique identifier budget for your campaign. - Your campaign has coupons. [optional]
attributes Object 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 or custom ones. Custom attributes must be created in the Campaign Manager before you set them with this property.
first_session Boolean Indicates whether this is the first session for the customer's profile. Will always be true for anonymous sessions.
total Float The total value of cart items and additional costs in the session, before any discounts are applied.
cart_item_total Float The total value of cart items, before any discounts are applied.
additional_cost_total Float The total value of additional costs, before any discounts are applied.
updated DateTime Timestamp of the most recent event received on this session.

Code Sample

require 'TalonOne'

instance = TalonOne::CustomerSessionV2.new(id: 6,
                                 created: null,
                                 integration_id: URNGV8294NV,
                                 application_id: 322,
                                 profile_id: URNGV8294NV,
                                 store_integration_id: STORE-001,
                                 evaluable_campaign_ids: [10, 12],
                                 coupon_codes: [XMAS-20-2021],
                                 referral_code: NT2K54D9,
                                 loyalty_cards: [loyalty-card-1],
                                 state: open,
                                 cart_items: null,
                                 additional_costs: {&quot;shipping&quot;:{&quot;price&quot;:9}},
                                 identifiers: [91.11.156.141],
                                 attributes: {&quot;ShippingCity&quot;:&quot;Berlin&quot;},
                                 first_session: true,
                                 total: 119.99,
                                 cart_item_total: 99.99,
                                 additional_cost_total: 20.0,
                                 updated: 2020-02-08T14:15:22Z)