Skip to main content
Contributor IV
June 19, 2024
Solved

Set a custom property using node sdk

  • June 19, 2024
  • 2 replies
  • 88 views

custom property not being set using node.js SDK

 

payload like so: 
 

const subscribe: SubscriptionCreateJobCreateQuery = {
data: {
type: ProfileSubscriptionBulkCreateJobEnum.ProfileSubscriptionBulkCreateJob,
attributes: {
profiles: {
data: [
{
type: ProfileEnum.Profile,
attributes: {
email: toEmail,
subscriptions: {
email: {
marketing: {
consent: "SUBSCRIBED",
},
},
},
properties: {
submissionId,
},
},
},
],
},
},
relationships: {
list: { data: { type: "list", id: listId } },
},
},
};
const response = await profilesApi.subscribeProfiles(subscribe);

 

 

properties: { submissionId }

 

This value is not present in the UI when I submit the profile - I can the contact has been created in the UI, but the proeprty is not being set. 

Am I doing something wrong? 

Thanks. 

    This topic has been closed for replies.
    Best answer by KeviSunshine

    Hi @hmenen,

    As far as I know, the new bulk-subscribe endpoint doesn’t supporting adding/updating profile properties anymore. There is no field `properties` in the documentation: https://developers.klaviyo.com/en/reference/subscribe_profiles.

    We’ve had to change our integrations to call an insert/update/upsert function for the profile before subscribing the profile (or vice versa since you can create a profile via the bulk subscribe endpoint).

     

    Best,

    Kevin.

    2 replies

    Partner
    June 20, 2024

    Hello @hmenen you have to pass the customer property  as a key value pair.

     

    Change 

    submission Id

    To

    submissionId: "ID_VALUE"

    https://theforms.pro
    KeviSunshine
    Expert Problem Solver III
    Expert Problem Solver III
    June 20, 2024

    Hi @hmenen,

    As far as I know, the new bulk-subscribe endpoint doesn’t supporting adding/updating profile properties anymore. There is no field `properties` in the documentation: https://developers.klaviyo.com/en/reference/subscribe_profiles.

    We’ve had to change our integrations to call an insert/update/upsert function for the profile before subscribing the profile (or vice versa since you can create a profile via the bulk subscribe endpoint).

     

    Best,

    Kevin.