Hello, we are using the following flow [website] =...
# support
b
Hello, we are using the following flow [website] => [rudderstack] => [Klaviyo] in cloud mode. When sending an identify event (see below), it reaches correctly Klaviyo buu I have noticed in the destination logs it reports a 409 error. Is it expected? Is there something in the payload we create that needs to be fixed? Source:
Copy code
{
  "anonymousId": "8495da4c-1637-4de1-82b9-7dd038af5578",
  "channel": "web",
  "context": {
    "app": {
      "name": "RudderLabs JavaScript SDK",
      "namespace": "com.rudderlabs.javascript",
      "version": "2.36.0"
    },
    "campaign": {},
    "email": "gregyoyoyo@mailinator.com",
    "library": {
      "name": "RudderLabs JavaScript SDK",
      "version": "2.36.0"
    },
    "locale": "en-US",
    "os": {
      "name": "",
      "version": ""
    },
    "page": {
      "initial_referrer": "$direct",
      "initial_referring_domain": "",
      "path": "/",
      "referrer": "http://localhost:8080/",
      "referring_domain": "localhost:8080",
      "search": "",
      "tab_url": "http://localhost:8080/",
      "title": "[redacted]",
      "url": "[redacted]"
    },
    "screen": {
      "density": 1,
      "height": 1440,
      "innerHeight": 670,
      "innerWidth": 2479,
      "width": 2560
    },
    "sessionId": 1687931246760,
    "subscribe": true,
    "traits": {
      "email": "gregyoyoyo@mailinator.com",
      "properties": {
        "consent": "email",
        "listId": "UxaWUr",
        "subscribe": true
      }
    },
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
  },
  "integrations": {
    "All": true,
    "Google Analytics 4": {
      "clientId": "[redacted]",
      "sessionId": "1687931243",
      "sessionNumber": 26
    }
  },
  "messageId": "6dc4cee4-921b-47c3-a513-739ef158d781",
  "originalTimestamp": "2023-06-28T05:51:04.906Z",
  "rudderId": "aa4ec9ab-0e41-4050-bbd6-289c0e52110a",
  "sentAt": "2023-06-28T05:51:04.910Z",
  "type": "identify",
  "userId": ""
}
Destination:
Copy code
[
    {
        "version": "1",
        "type": "REST",
        "method": "POST",
        "endpoint": "https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs",
        "headers": {
            "Authorization": "Klaviyo-API-Key [redacted]",
            "Content-Type": "application/json",
            "Accept": "application/json",
            "revision": "2023-02-22"
        },
        "params": {},
        "body": {
            "JSON": {
                "data": {
                    "type": "profile-subscription-bulk-create-job",
                    "attributes": {
                        "list_id": "UxaWUr",
                        "subscriptions": [
                            {
                                "email": "gregyoyoyo@mailinator.com",
                                "channels": {
                                    "email": [
                                        "MARKETING"
                                    ]
                                }
                            }
                        ]
                    }
                }
            },
            "JSON_ARRAY": {},
            "XML": {},
            "FORM": {}
        },
        "files": {}
    },
    {
        "version": "1",
        "type": "REST",
        "method": "PATCH",
        "endpoint": "https://a.klaviyo.com/api/profiles/01GSDQF4Y4KQZHK5248WGSRWMC",
        "headers": {
            "Authorization": "Klaviyo-API-Key [redacted]",
            "Content-Type": "application/json",
            "Accept": "application/json",
            "revision": "2023-02-22"
        },
        "params": {},
        "body": {
            "JSON": {
                "data": {
                    "type": "profile",
                    "attributes": {
                        "external_id": "8495da4c-1637-4de1-82b9-7dd038af5578",
                        "email": "gregyoyoyo@mailinator.com",
                        "properties": {}
                    },
                    "id": "01GSDQF4Y4KQZHK5248WGSRWMC"
                }
            },
            "JSON_ARRAY": {},
            "XML": {},
            "FORM": {}
        },
        "files": {}
    }
]
Error:
Copy code
{
  "response": "{\"status\":409,\"message\":\"[Generic Response Handler] Request failed for destination klaviyo with status: 409\",\"destinationResponse\":{\"response\":{\"errors\":[{\"id\":\"2874cf97-3d81-46df-b8ad-25b67a45b27a\",\"status\":409,\"code\":\"duplicate_profile\",\"title\":\"Conflict.\",\"detail\":\"A profile already exists with one of these identifiers.\",\"source\":{\"pointer\":\"/data/attributes\"},\"meta\":{\"duplicate_profile_id\":\"01H408WPKHQSB11G232XD6EEFN\"}}]},\"status\":409,\"rudderJobMetadata\":{\"jobId\":3492795183,\"attemptNum\":0,\"userId\":\"\",\"sourceId\":\"21obNEnfouYjjOsietHecHwRCOZ\",\"destinationId\":\"21wPs4Cs2q7gE7HihKl1g7giAz9\",\"workspaceId\":\"1wsII1JCHJOrqwBxqGrf47WS6JH\",\"secret\":null}},\"statTags\":{\"errorCategory\":\"network\",\"errorType\":\"aborted\",\"destType\":\"KLAVIYO\",\"module\":\"destination\",\"implementation\":\"native\",\"feature\":\"dataDelivery\",\"destinationId\":\"21wPs4Cs2q7gE7HihKl1g7giAz9\",\"workspaceId\":\"1wsII1JCHJOrqwBxqGrf47WS6JH\"}}",
  "firstAttemptedAt": "2023-06-28T05:51:16.679Z",
  "content-type": "application/json"
}
๐Ÿ‘€ 1
m
Hey There! ๐Ÿ‘‹ Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
b
This error is thrown by Klaviyo due to conflict in profiles. Here, in this case your payload contains two profile identifiers
external_id
and
email
and they already belong to two different existing profiles. Thatโ€™s the reason for this error. All the set of identifiers in the payload should belong to a single profile. If you want to prioritize email here to identify a profile, you can enable this toggle from UI.
b
Thanks! I have just done it, it works great no more error reported.
๐Ÿ‘ 2