I want to subscribe a user with email and their name, but it gives this error: 'first_name' is not a valid field for the resource 'profile'.
Im using the Klaviyo PHP SDK.
It works if i just remove first_name and last_name from attributes… But i want to include the name.
Code:
$klaviyo->Profiles->subscribeProfiles([
"data" => [
'type' => 'profile-subscription-bulk-create-job',
'attributes' => [
'custom_source' => 'Marketing Event',
'profiles' => ['data' => [
[
'type' => 'profile','attributes' => [
'email' => 'email@email.com',
'first_name'=>'firstname',
'last_name'=>'lastname',
'subscriptions' => [
'email' => [
'marketing' => [
'consent' => 'SUBSCRIBED',
],
],
],
],
],
],
],
],
'relationships' => [
'list' => [
'data' => [
'type' => 'list',
'id' => 'MYLISTID',
],
],
],
],
]);