younifyd
Menu

Get Customer Inventory

List customer data

GET/v1/customer_profiles/{integrationId}/inventory

Use it in a workflow

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

Request

Path parameters

integrationIdstringrequired

The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationCustomers) endpoint.

Query parameters

profileboolean

Set to `true` to include customer profile information in the response.

referralsboolean

Set to `true` to include referral information in the response.

couponsboolean

Set to `true` to include coupon information in the response.

loyaltyboolean

Set to `true` to include loyalty information in the response.

giveawaysboolean

Set to `true` to include giveaways information in the response.

achievementsboolean

Set to `true` to include achievement information in the response.

Response

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

profileobject
idinteger (int64)required

The internal ID of the customer profile.

createdstring (date-time)required

The time this entity was created.

integrationIdstring (string)required

The integration ID set by your integration layer.

attributesobjectrequired

Arbitrary properties associated with this item.

accountIdinteger (int64)required

The ID of the Talon.One account that owns this profile.

closedSessionsinteger (int64)required

The total number of closed sessions. Does not include closed sessions that have been cancelled or reopened. See the [docs](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states).

totalSalesnumberrequired

The total amount of money spent by the customer **before** discounts are applied. The total sales amount excludes the following: - Cancelled or reopened sessions. - Returned items.

loyaltyMembershipsarray<object>2 fields

**DEPRECATED. Always returns `null`.** A list of loyalty programs joined by the customer.

audienceMembershipsarray<object>2 fields

The audiences the customer belongs to.

lastActivitystring (date-time)required

Timestamp of the most recent event received from this customer. This field is updated on calls that trigger the Rule Engine and that are not [dry requests](https://docs.talon.one/docs/dev/integration-api/dry-requests/#overlay). For example, [reserving a coupon](https://docs.talon.one/integration-api#tag/Coupons/operation/createCouponReservation) for a customer doesn't impact this field.

sandboxboolean

An indicator of whether the customer is part of a sandbox or live Application. See the [docs](https://docs.talon.one/docs/product/applications/overview#application-environments).

loyaltyobject

Customer-specific information about loyalty points.

cardsarray<object>16 fields

Displays information about the balances of the loyalty cards.

programsobjectrequired

Displays information about point balances in profile-based programs.

referralsarray<object>
idinteger (int64)required

The internal ID of this entity.

createdstring (date-time)required

The time this entity was created.

startDatestring (date-time)

Timestamp at which point the referral code becomes valid.

expiryDatestring (date-time)

Expiration date of the referral code. Referral never expires if this is omitted.

usageLimitinteger (int64)required

The number of times a referral code can be used. `0` means no limit but any campaign usage limits will still apply.

campaignIdinteger (int64)required

ID of the campaign from which the referral received the referral code.

advocateProfileIntegrationIdstringrequired

The Integration ID of the Advocate's Profile.

friendProfileIntegrationIdstring

An optional Integration ID of the Friend's Profile.

attributesobject

Arbitrary properties associated with this item.

importIdinteger (int64)

The ID of the Import which created this referral.

codestringrequired

The referral code.

usageCounterinteger (int64)required

The number of times this referral code has been successfully used.

batchIdstring

The ID of the batch the referrals belong to.

referredCustomersarray<string>required

An array of referred customers.

couponsarray<object>

The coupons reserved by this profile. This array includes hard and soft reservations.

idinteger (int64)required

The internal ID of the coupon.

createdstring (date-time)required

The time the coupon was created.

campaignIdinteger (int64)required

The ID of the campaign that owns this entity.

valuestringrequired

The coupon code.

usageLimitinteger (int64)required

The number of times the coupon code can be redeemed. `0` means unlimited redemptions but any campaign usage limits will still apply.

discountLimitnumber

The total discount value that the code can give. Typically used to represent a gift card value.

reservationLimitinteger (int64)

The number of reservations that can be made with this coupon code.

startDatestring (date-time)

Timestamp at which point the coupon becomes valid.

expiryDatestring (date-time)

Expiration date of the coupon. Coupon never expires if this is omitted.

limitsarray<object>4 fields

Limits configuration for a coupon. These limits will override the limits set from the campaign. **Note:** Only usable when creating a single coupon which is not tied to a specific recipient. Only per-profile limits are allowed to be configured.

usageCounterinteger (int64)required

The number of times the coupon has been successfully redeemed.

discountCounternumber

The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon.

discountRemaindernumber

The remaining discount this coupon can give.

reservationCounternumber

The number of times this coupon has been reserved.

attributesobject

Custom attributes associated with this coupon.

referralIdinteger (int64)

The integration ID of the referring customer (if any) for whom this coupon was created as an effect.

recipientIntegrationIdstring

The Integration ID of the customer that is allowed to redeem this coupon.

importIdinteger (int64)

The ID of the Import which created this coupon.

reservationboolean

Defines the reservation type: - `true`: The coupon can be reserved for multiple customers. - `false`: The coupon can be reserved only for one customer. It is a personal code.

Default true

batchIdstring

The id of the batch the coupon belongs to.

isReservationMandatoryboolean

An indication of whether the code can be redeemed only if it has been reserved first.

Default false

implicitlyReservedboolean

An indication of whether the coupon is implicitly reserved for all customers.

profileRedemptionCountinteger (int64)required

The number of times the coupon was redeemed by the profile.

statestringrequired

Can be: - `active`: The coupon can be used. It is a reserved coupon that is not pending, used, or expired, and it has a non-exhausted limit counter. **Note:** This coupon state is returned for [scheduled campaigns](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule), but the coupon cannot be used until the campaign is **running**. - `used`: The coupon has been redeemed and cannot be used again. It is not pending and has reached its redemption limit or was redeemed by the profile before expiration. - `expired`: The coupon was never redeemed, and it is now expired. It is non-pending, non-active, and non-used by the profile. - `pending`: The coupon will be usable in the future. - `disabled`: The coupon is part of a non-active campaign.

giveawaysarray<object>
idinteger (int64)required

The internal ID of this entity.

createdstring (date-time)required

The time this entity was created.

codestringrequired

The code value of this giveaway.

poolIdinteger (int64)required

The ID of the pool to return giveaway codes from.

startDatestring (date-time)

Timestamp at which point the giveaway becomes valid.

endDatestring (date-time)

Timestamp at which point the giveaway becomes invalid.

attributesobject

Arbitrary properties associated with this giveaway.

usedboolean

Indicates whether this giveaway code was given before.

importIdinteger (int64)

The ID of the Import which created this giveaway.

profileIntegrationIdstring

The third-party integration ID of the customer profile that was awarded the giveaway, if the giveaway was awarded.

profileIdinteger (int64)

The internal ID of the customer profile that was awarded the giveaway, if the giveaway was awarded and an internal ID exists.

achievementsarray<object>
statusstringrequired

The status of the achievement.

One ofinprogresscompletedexpirednot_started

progressnumberrequired

The current progress of the customer in the achievement.

startDatestring (date-time)

Timestamp at which the customer started the achievement.

completionDatestring (date-time)

Timestamp at which point the customer completed the achievement.

endDatestring (date-time)

Timestamp at which point the achievement ends and resets for the customer.

achievementIdinteger (int64)required

The internal ID of the achievement.

namestringrequired

The internal name of the achievement used in API requests.

titlestringrequired

The display name of the achievement in the Campaign Manager.

descriptionstring (string)required

The description of the achievement in the Campaign Manager.

campaignIdinteger (int64)required

The ID of the campaign the achievement belongs to.

targetnumber

The required number of actions or the transactional milestone to complete the achievement.

achievementRecurrencePolicystringrequired

The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again. - `on_completion`: When the customer progress status reaches `completed`, the achievement resets and becomes available again.

One ofno_recurrenceon_expirationon_completion

achievementActivationPolicystringrequired

The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule.

One ofuser_actionfixed_schedule

achievementFixedStartDatestring (date-time)

The achievement's start date when `achievementActivationPolicy` is equal to `fixed_schedule`. **Note:** It is an RFC3339 timestamp string.

achievementEndDatestring (date-time)

The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It is an RFC3339 timestamp string.

achievementAllowRollbackAfterCompletionboolean

When `true`, customer progress can be rolled back in completed achievements.

json
{
  "profile": {
    "accountId": 31,
    "closedSessions": 3,
    "created": {},
    "sandbox": false,
    "integrationId": "URNGV8294NV",
    "attributes": {
      "Language": "english",
      "ShippingCountry": "DE"
    },
    "totalSales": 299.99,
    "lastActivity": {},
    "id": 6,
    "loyaltyMemberships": [
      {
        "joined": {},
        "loyaltyProgramId": 323414846
      },
      {
        "joined": {},
        "loyaltyProgramId": 323414846
      }
    ],
    "audienceMemberships": [
      {
        "name": "Travel audience",
        "id": 2
      },
      {
        "name": "Travel audience",
        "id": 2
      }
    ]
  },
  "loyalty": {
    "cards": [
      {
        "ledger": {
          "pendingBalance": 10,
          "nextTierName": "Silver",
          "negativeBalance": 10,
          "currentBalance": 100,
          "spentBalance": 0,
          "tentativeCurrentBalance": 100,
          "tentativePendingBalance": 20,
          "pointsToNextTier": 20,
          "expiredBalance": 0,
          "currentTier": {
            "expiryDate": {},
            "downgradePolicy": "one_down",
            "name": "bronze",
            "id": 11,
            "startDate": {}
          },
          "tentativeNegativeBalance": 100
        },
        "identifier": "summer-loyalty-card-0543",
        "oldCardIdentifier": "summer-loyalty-card-0543",
        "usersPerCardLimit": 111,
        "created": {},
        "profiles": [
          {
            "integrationId": "R195412",
            "timestamp": {}
          },
          {
            "integrationId": "R195412",
            "timestamp": {}
          }
        ],
        "subledgers": {
          "key": {
            "pendingBalance": 10,
            "nextTierName": "Silver",
            "negativeBalance": 10,
            "currentBalance": 100,
            "spentBalance": 0,
            "tentativeCurrentBalance": 100,
            "tentativePendingBalance": 20,
            "pointsToNextTier": 20,
            "expiredBalance": 0,
            "currentTier": {
              "expiryDate": {},
              "downgradePolicy": "one_down",
              "name": "bronze",
              "id": 11,
              "startDate": {}
            },
            "tentativeNegativeBalance": 100
          }
        },
        "batchId": "wdefpov",
        "programTitle": "Loyalty program",
        "programName": "Loyalty_program",
        "modified": {},
        "id": 6,
        "blockReason": "Current card lost. Customer needs a new card.",
        "newCardIdentifier": "summer-loyalty-card-0543",
        "programID": 125,
        "status": "active"
      },
      {
        "ledger": {
          "pendingBalance": 10,
          "nextTierName": "Silver",
          "negativeBalance": 10,
          "currentBalance": 100,
          "spentBalance": 0,
          "tentativeCurrentBalance": 100,
          "tentativePendingBalance": 20,
          "pointsToNextTier": 20,
          "expiredBalance": 0,
          "currentTier": {
            "expiryDate": {},
            "downgradePolicy": "one_down",
            "name": "bronze",
            "id": 11,
            "startDate": {}
          },
          "tentativeNegativeBalance": 100
        },
        "identifier": "summer-loyalty-card-0543",
        "oldCardIdentifier": "summer-loyalty-card-0543",
        "usersPerCardLimit": 111,
        "created": {},
        "profiles": [
          {
            "integrationId": "R195412",
            "timestamp": {}
          },
          {
            "integrationId": "R195412",
            "timestamp": {}
          }
        ],
        "subledgers": {
          "key": {
            "pendingBalance": 10,
            "nextTierName": "Silver",
            "negativeBalance": 10,
            "currentBalance": 100,
            "spentBalance": 0,
            "tentativeCurrentBalance": 100,
            "tentativePendingBalance": 20,
            "pointsToNextTier": 20,
            "expiredBalance": 0,
            "currentTier": {
              "expiryDate": {},
              "downgradePolicy": "one_down",
              "name": "bronze",
              "id": 11,
              "startDate": {}
            },
            "tentativeNegativeBalance": 100
          }
        },
        "batchId": "wdefpov",
        "programTitle": "Loyalty program",
        "programName": "Loyalty_program",
        "modified": {},
        "id": 6,
        "blockReason": "Current card lost. Customer needs a new card.",
        "newCardIdentifier": "summer-loyalty-card-0543",
        "programID": 125,
        "status": "active"
      }
    ],
    "programs": {
      "key": {
        "ledger": {
          "pendingBalance": 10,
          "nextTierName": "Silver",
          "negativeBalance": 10,
          "currentBalance": 100,
          "spentBalance": 0,
          "tentativeCurrentBalance": 100,
          "tentativePendingBalance": 20,
          "pointsToNextTier": 20,
          "expiredBalance": 0,
          "currentTier": {
            "expiryDate": {},
            "downgradePolicy": "one_down",
            "name": "bronze",
            "id": 11,
            "startDate": {}
          },
          "tentativeNegativeBalance": 100
        },
        "joinDate": {},
        "subLedgers": {
          "key": {
            "pendingBalance": 10,
            "nextTierName": "Silver",
            "negativeBalance": 10,
            "currentBalance": 100,
            "spentBalance": 0,
            "tentativeCurrentBalance": 100,
            "tentativePendingBalance": 20,
            "pointsToNextTier": 20,
            "expiredBalance": 0,
            "currentTier": {
              "expiryDate": {},
              "downgradePolicy": "one_down",
              "name": "bronze",
              "id": 11,
              "startDate": {}
            },
            "tentativeNegativeBalance": 100
          }
        },
        "name": "program1",
        "id": 5,
        "title": "My loyalty program"
      }
    }
  },
  "referrals": [
    {
      "code": "27G47Y54VH9L",
      "created": {},
      "usageLimit": 1,
      "campaignId": 78,
      "usageCounter": 1,
      "batchId": "tqyrgahe",
      "advocateProfileIntegrationId": "URNGV8294NV",
      "expiryDate": {},
      "importId": 4,
      "friendProfileIntegrationId": "BZGGC2454PA",
      "attributes": {
        "channel": "web"
      },
      "referredCustomers": [
        "referredCustomers",
        "referredCustomers"
      ],
      "id": 6,
      "startDate": {}
    }
  ],
  "coupons": [
    {
      "recipientIntegrationId": "URNGV8294NV",
      "implicitlyReserved": false,
      "created": {},
      "campaignId": 211,
      "usageLimit": 100,
      "referralId": 326632952,
      "profileRedemptionCount": 5,
      "usageCounter": 10,
      "batchId": "32535-43255",
      "discountCounter": 10,
      "expiryDate": {},
      "importId": 4,
      "reservationLimit": 45,
      "reservationCounter": 1,
      "reservation": false,
      "attributes": "{}",
      "id": 6,
      "state": "active",
      "value": "XMAS-20-2021",
      "discountLimit": 30,
      "startDate": {},
      "limits": [
        {
          "period": "yearly",
          "entities": [
            "Coupon"
          ],
          "limit": 1000,
          "action": "createCoupon"
        },
        {
          "period": "yearly",
          "entities": [
            "Coupon"
          ],
          "limit": 1000,
          "action": "createCoupon"
        }
      ],
      "discountRemainder": 5,
      "isReservationMandatory": false
    }
  ],
  "giveaways": [
    {
      "profileIntegrationId": "R195412",
      "code": "GIVEAWAY1",
      "importId": 4,
      "endDate": {},
      "created": {},
      "profileId": 1,
      "poolId": 1,
      "attributes": "{}",
      "id": 6,
      "used": true,
      "startDate": {}
    }
  ],
  "achievements": [
    {
      "endDate": {},
      "achievementAllowRollbackAfterCompletion": false,
      "campaignId": 3,
      "achievementId": 3,
      "description": "50% off for every 50th purchase in a year.",
      "achievementFixedStartDate": {},
      "title": "50% off on 50th purchase.",
      "target": 10,
      "achievementRecurrencePolicy": "no_recurrence",
      "achievementActivationPolicy": "fixed_schedule",
      "name": "FreeCoffee10Orders",
      "achievementEndDate": {},
      "progress": 10,
      "completionDate": {},
      "startDate": {},
      "status": "completed"
    }
  ]
}

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