# Persons and Companies

To start using Persons and Companies profiles you must enable [Infobip CDP Extension](/extensions/infobip-people-cdp.md).&#x20;

### Fields mapping

After enabling Infobip CDP Extension you can start using fields `identity.person` and `identity.company`. &#x20;

| Orangepill Identity field | Infobip CDP field |
| ------------------------- | ----------------- |
| `person`                  | `id`              |
| `company`                 | `companyId`       |
| `id`                      | `externalId`      |

## Synchronize Orangepill and Infobip CDP

Two-way Identities and Persons syncronization process is executing in 3 steps.

#### Step 1

Updating orphan Orangepill Identities with Infobip Persons.

#### Step 2

Updating orphan Infobip Persons with Orangepill Identities.

#### Step 3

Creating new Orangepill Identities.

{% hint style="info" %}
Persons Sync results are sent to `user.channel.email` of User which started the process.
{% endhint %}

To start Persons Sync process use endpoint `POST /v1/identities/persons/sync`.

#### Optional parameters

<table><thead><tr><th width="156.33333333333331">Scope</th><th width="135">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>orangepill</td><td><code>country</code></td><td>Default country for new Identities. If not set <code>realm.country</code> is used.</td></tr><tr><td>orangepill</td><td><code>currency</code></td><td>Default currency for new Identities. If not set <code>realm.currency</code> is used.</td></tr><tr><td>infobip</td><td><code>limit</code></td><td>Number of results.</td></tr><tr><td>infobip</td><td><code>page</code></td><td>Results page number.</td></tr><tr><td>infobip</td><td><code>filter</code></td><td>Additional filter. Consult <a href="https://www.infobip.com/docs/api/customer-engagement/people/get-a-single-person-or-a-list-of-people">Infobip documentation</a> for details.</td></tr></tbody></table>

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request POST 'https://api.orangepill.cloud/v1/identities/persons/sync' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json' \
--data-raw '{
    "country": "HR",
    "currency": "EUR",
    "limit": "100",
    "page": 2
}'
```

{% endtab %}
{% endtabs %}

in response are queued task details.

{% tabs %}
{% tab title="Response" %}

```json
{
    "name": "EventStarted",
    "message": "Person sync is in processing pool.",
    "code": 200,
    "type": "persons.sync.started",
    "data": {
        "country": "HR",
        "currency": "EUR",
        "limit": "100",
        "page": 2,
        "owner": "6442b885880fc0254ad560e8"
    }
}
```

{% endtab %}
{% endtabs %}

## List Infobip CDP Persons

Use endpoint `GET /v1/identities/persons?parameters` to retrieve list of Infobip CDP persons.

Use [Infobip URL parameters](https://www.infobip.com/docs/api/customer-engagement/people/get-a-single-person-or-a-list-of-people) to filter results.

## Create Person and Identity

{% hint style="info" %}
Use Infobip Portal to create additional custom attributes and tags for Person profiles.
{% endhint %}

Use endpoint [POST /v1/identities/person](https://api.orangepill.cloud/openapi/ui#/v1.identities/post_v1_identities_person) to create new Infobip Person and Orangepill Identity.

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request POST 'https://api.orangepill.cloud/v1/identities/person' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
--data-raw '{
    "country": "US",
    "currency": "USD",
    "type": "person",
    "alias": "PERSON_ALIAS",
    "company": 3,
    "person": {
        "firstName": "Jane",
        "lastName": "Smith",
        "address": "67 Farringdon Road",
        "city": "London",
        "country": "United Kingdom",
        "gender": "FEMALE",
        "birthDate": "1966-01-15",
        "middleName": "Janie",
        "profilePicture": "http://profile.com",
        "tags": 
        [
            "VIP Customers",
            "New Customers"
        ],
        "customAttributes": 
        {
            "Contract Expiry": "2018-06-01",
            "Company": "Acme",
            "ShoppingCartList": 
        [
        {
            "productName": "Sneakers",
            "productPrice": 25.33,
            "productCategory": "Sport Sneakers",
            "productImage": "/image1.png"
        },
                {
                    "productName": "T-Shirt",
                    "productPrice": 9.99,
                    "productCategory": "Casual",
                    "productImage": "/image2.png"
                }
            ]
        },
        "contactInformation": 
        {
            "phone": 
        [
            {
                "number": "41793026727"
            }
        ],
        "email": 
        [
            {
                "address": "janewilliams@acme.com"
            }
        ],
        "push": 
        [
        {
            "applicationId": "FDCC8516470A3AE97FB8AC218D5D0D3D",
            "registrationId": "c5db0c47-465c-4e1c-abf8-7cedc275dd19",
            "additionalData": 
        {
            "birthdate": "1988-07-31",
            "email": "test@test.com",
            "firstName": "Jane",
            "gender": "F",
            "lastName": "Smith",
            "middleName": "Janie"
        },
        "systemData": 
                {
                    "cloudType": "GCM",
                    "registrationEnabled": true,
                    "sdkName": "MobileMessaging SDK",
                    "os": "Android"
                }
            }
        ],
        "facebook": 
        [
        {
            "applicationId": "370329180020364",
            "userId": "2094832040560427",
            "systemData": 
                {
                    "gender": "female",
                    "lastName": "Smith",
                    "firstName": "Jane"
                }
            }
        ],
        "line": 
        [
        {
            "applicationId": "1644264921",
            "userId": "U045147f1ad961bfe996b72bbf417f3c9",
            "systemData": 
                {
                    "displayName": "Jane Smith"
                }
            }
        ],
        "instagram": 
        [
        {
            "applicationId": "17841446795352028",
            "userId": "12461436693342628",
            "systemData": 
                {
                    "displayName": "jane.smith"
                }
            }
        ],
        "twitter": 
        [
        {
            "applicationId": "1148203323283877",
            "userId": "370329180020364",
            "systemData": 
                    {
                        "displayName": "Jane Smith"
                    }
                }
            ]
        }        
    },
    "data": {
        "custom_field1": "custom_value1"
    }
}'
```

{% endtab %}
{% endtabs %}

in response is new person `Identity`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "id": "634b56217f6a7b0be52dffbd",
    "owner": "6be52d34b56217fffbd6a7b0",
    "country": "US",
    "currency": "USD",
    "type": "person",
    "alias": "PERSON_ALIAS",
    "company": "3",
    "person": {
        "firstName": "Jane",
        "lastName": "Smith",
        "address": "67 Farringdon Road",
        "city": "London",
        "country": "United Kingdom",
        "gender": "FEMALE",
        "birthDate": "1966-01-15",
        "middleName": "Janie",
        "profilePicture": "http://profile.com",
        "origin": "API",
        "modifiedFrom": "API",
        "tags": 
        [
            "VIP Customers",
            "New Customers"
        ],
        "customAttributes": 
        {
            "Contract Expiry": "2018-06-01",
            "Company": "Acme",
            "ShoppingCartList": 
        [
        {
            "productName": "Sneakers",
            "productPrice": 25.33,
            "productCategory": "Sport Sneakers",
            "productImage": "/image1.png"
        },
                {
                    "productName": "T-Shirt",
                    "productPrice": 9.99,
                    "productCategory": "Casual",
                    "productImage": "/image2.png"
                }
            ]
        },
        "contactInformation": 
        {
            "phone": 
        [
            {
                "number": "41793026727"
            }
        ],
        "email": 
        [
            {
                "address": "janewilliams@acme.com"
            }
        ],
        "push": 
        [
        {
            "applicationId": "FDCC8516470A3AE97FB8AC218D5D0D3D",
            "registrationId": "c5db0c47-465c-4e1c-abf8-7cedc275dd19",
            "additionalData": 
        {
            "birthdate": "1988-07-31",
            "email": "test@test.com",
            "firstName": "Jane",
            "gender": "F",
            "lastName": "Smith",
            "middleName": "Janie"
        },
        "systemData": 
                {
                    "cloudType": "GCM",
                    "registrationEnabled": true,
                    "sdkName": "MobileMessaging SDK",
                    "os": "Android"
                }
            }
        ],
        "facebook": 
        [
        {
            "applicationId": "370329180020364",
            "userId": "2094832040560427",
            "systemData": 
                {
                    "gender": "female",
                    "lastName": "Smith",
                    "firstName": "Jane"
                }
            }
        ],
        "line": 
        [
        {
            "applicationId": "1644264921",
            "userId": "U045147f1ad961bfe996b72bbf417f3c9",
            "systemData": 
                {
                    "displayName": "Jane Smith"
                }
            }
        ],
        "instagram": 
        [
        {
            "applicationId": "17841446795352028",
            "userId": "12461436693342628",
            "systemData": 
                {
                    "displayName": "jane.smith"
                }
            }
        ],
        "twitter": 
        [
        {
            "applicationId": "1148203323283877",
            "userId": "370329180020364",
            "systemData": 
                    {
                        "displayName": "Jane Smith"
                    }
                }
            ]
        }        
    },
    "data": {
        "custom_field1": "custom_value1"
    },
    "created_at": "1519211809934",
    "error": null
}
```

{% endtab %}
{% endtabs %}

## Get Person

You can retrieve Person data either by calling `GET /v1/identities/:id/person` or by populating person field of Identity object using `GET /v1/identities/:id?populate=person`.

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request GET 'https://api.orangepill.cloud/v1/identities/634b56217f6a7b0be52dffbd?populate=person' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json' \
```

{% endtab %}
{% endtabs %}

in response is person `Identity`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "id": "634b56217f6a7b0be52dffbd",
    "owner": "6be52d34b56217fffbd6a7b0",
    "country": "US",
    "currency": "USD",
    "type": "person",
    "person": {
        "firstName": "Jane",
        "lastName": "Smith",
        "address": "67 Farringdon Road",
        "city": "London",
        "country": "United Kingdom",
        "gender": "FEMALE",
        "birthDate": "1966-01-15",
        "middleName": "Janie",
        "profilePicture": "http://profile.com",
    },
    "data": {
        "custom_field1": "custom_value1"
    },
    "created_at": "1519211809934",
    "error": null
}
```

{% endtab %}
{% endtabs %}

## Create Person for existing Identity

Use endpoint `POST /v1/identities/:id/person` to create new Person and assign it to existing identity.&#x20;

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request POST 'https://api.orangepill.cloud/v1/identities/634b56217f6a7b0be52dffbd/person' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
--data-raw '{
    "firstName": "Jane",
    "lastName": "Smith",
    "address": "67 Farringdon Road",
    "city": "London",
    "country": "United Kingdom",
    "gender": "FEMALE",
    "birthDate": "1966-01-15",
    "middleName": "Janie",
    "profilePicture": "http://profile.com"
}'
```

{% endtab %}
{% endtabs %}

in response is new person `Identity`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "id": "634b56217f6a7b0be52dffbd",
    "owner": "6be52d34b56217fffbd6a7b0",
    "country": "US",
    "currency": "USD",
    "type": "person",
    "person": {
        "firstName": "Jane",
        "lastName": "Smith",
        "address": "67 Farringdon Road",
        "city": "London",
        "country": "United Kingdom",
        "gender": "FEMALE",
        "birthDate": "1966-01-15",
        "middleName": "Janie",
        "profilePicture": "http://profile.com",
    },
    "data": {
        "custom_field1": "custom_value1"
    },
    "created_at": "1519211809934",
    "error": null
}
```

{% endtab %}
{% endtabs %}

## Assign existing Person to existing Identity

Use endpoint `PATCH /v1/identities/:id/person/:person/assign`  to map existing Person from Infobip CDP to existing Orangepill Identity.

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request PATCH 'https://api.orangepill.cloud/v1/identities/634b56217f6a7b0be52dffbd/person/255/assign' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
```

{% endtab %}
{% endtabs %}

in response is person `Identity`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "id": "634b56217f6a7b0be52dffbd",
    "owner": "6be52d34b56217fffbd6a7b0",
    "country": "US",
    "currency": "USD",
    "type": "person",
    "person": "255",
    "data": {
        "custom_field1": "custom_value1"
    },
    "created_at": "1519211809934",
    "error": null
}
```

{% endtab %}
{% endtabs %}

## Unassign Person of Identity

Use endpoint `PATCH /v1/identities/:id/person/unassign`  to unmap Infobip Person of Orangepill Identity.

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request PATCH 'https://api.orangepill.cloud/v1/identities/634b56217f6a7b0be52dffbd/person/unassign' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
```

{% endtab %}
{% endtabs %}

in response is person `Identity`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "id": "634b56217f6a7b0be52dffbd",
    "owner": "6be52d34b56217fffbd6a7b0",
    "country": "US",
    "currency": "USD",
    "type": "person",
    "person": null,
    "data": {
        "custom_field1": "custom_value1"
    },
    "created_at": "1519211809934",
    "error": null
}
```

{% endtab %}
{% endtabs %}

## Update Person

Use endpoint `PATCH /v1/identities/:id/person` to update Person profile.&#x20;

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request PATCH 'https://api.orangepill.cloud/v1/identities/634b56217f6a7b0be52dffbd/person' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
--data-raw '{
    "address": "129 Bethnel Road",
    "city": "Manchester"
}'
```

{% endtab %}
{% endtabs %}

in response is person `Identity`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "id": "634b56217f6a7b0be52dffbd",
    "owner": "6be52d34b56217fffbd6a7b0",
    "country": "US",
    "currency": "USD",
    "type": "person",
    "person": {
        "firstName": "Jane",
        "lastName": "Smith",
        "address": "129 Bethnel Road",
        "city": "Manchester",
        "country": "United Kingdom",
        "gender": "FEMALE",
        "birthDate": "1966-01-15",
        "middleName": "Janie",
        "profilePicture": "http://profile.com",
    },
    "data": {
        "custom_field1": "custom_value1"
    }
    "created_at": "1519211809934",
    "error": null
}
```

{% endtab %}
{% endtabs %}

## Delete Person

Use endpoint `DELETE /v1/identities/:id/person` to delete Person profile from Infobip People CDP.&#x20;

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request DELETE 'https://api.orangepill.cloud/v1/identities/634b56217f6a7b0be52dffbd/person' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
```

{% endtab %}
{% endtabs %}

in response is person `Identity`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "id": "634b56217f6a7b0be52dffbd",
    "owner": "6be52d34b56217fffbd6a7b0",
    "country": "US",
    "currency": "USD",
    "type": "person",
    "person": null,
    "data": {
        "custom_field1": "custom_value1"
    }
    "created_at": "1519211809934",
    "error": null
}
```

{% endtab %}
{% endtabs %}

## List Infobip CDP Companies

Use endpoint `GET /v1/identities/companies?parameters` to retrieve list of Infobip CDP companies.

Use [Infobip URL parameters](https://www.infobip.com/docs/api/customer-engagement/people/get-a-single-company-by-name-or-a-list-of-companies) to filter results.

## Create Company

{% hint style="info" %}
Use Infobip Portal to create additional custom attributes and tags for Company profiles.
{% endhint %}

Use endpoint `POST /v1/identities/company` to create new Company.

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request POST 'https://api.orangepill.cloud/v1/identities/companies' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Orangepill",
    "notes": "notes example",
    "country": "Croatia",
    "region": "Europe",
    "accountManager": "Agent Smith",
    "customerStage": "Active",
    "industry": "IT",
    "vatNumber": "003212059",
    "customAttributes": 
    {
        "Contract Expiry": "2025-06-01"
    },
    "domains": 
    [
        "orangepill.cloud"
    ]
}'
```

{% endtab %}
{% endtabs %}

in response is `Company`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "createdAt": "2023-03-04T19:16:41",
    "modifiedAt": "2023-03-04T19:16:41",
    "id": 1,
    "name": "Orangepill",
    "notes": "notes example",
    "country": "Croatia",
    "region": "Europe",
    "accountManager": "Agent Smith",
    "customerStage": "Active",
    "industry": "IT",
    "vatNumber": "003212059",
    "customAttributes": 
    {
        "Contract Expiry": "2025-06-01"
    },
    "domains": 
    [
        "orangepill.cloud"
    ]
}
```

{% endtab %}
{% endtabs %}

## Assign Company to Identity

Use endpoint `PATCH /v1/identities/:id`  to assign Company to Orangepill Identity.

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request PATCH 'https://api.orangepill.cloud/v1/identities/634b56217f6a7b0be52dffbd/person/255/assign' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
--data-raw '{
    "company": "3"
}'
```

{% endtab %}
{% endtabs %}

in response is person `Identity`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "id": "634b56217f6a7b0be52dffbd",
    "owner": "6be52d34b56217fffbd6a7b0",
    "country": "US",
    "currency": "USD",
    "type": "person",
    "person": "255",
    "company": "3",
    "data": {
        "custom_field1": "custom_value1"
    },
    "created_at": "1519211809934",
    "error": null
}
```

{% endtab %}
{% endtabs %}

## Unassign Person of Identity

Use endpoint `PATCH /v1/identities/:id`  with `null` value in `company` field to unassign Company to Orangepill Identity.

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request PATCH 'https://api.orangepill.cloud/v1/identities/634b56217f6a7b0be52dffbd/person/unassign' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
--data-raw '{
    "company": null
}'
```

{% endtab %}
{% endtabs %}

in response is person `Identity`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "id": "634b56217f6a7b0be52dffbd",
    "owner": "6be52d34b56217fffbd6a7b0",
    "country": "US",
    "currency": "USD",
    "type": "person",
    "person": "255",
    "company": null,
    "data": {
        "custom_field1": "custom_value1"
    },
    "created_at": "1519211809934",
    "error": null
}
```

{% endtab %}
{% endtabs %}

## Get Company

You can retrieve Company data either by calling `GET /v1/identities/:id/company` or by populating company field of Identity object using `GET /v1/identities/:id?populate=company`.&#x20;

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request GET 'https://api.orangepill.cloud/v1/identities/634b56217f6a7b0be52dffbd?populate=company' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json' \
```

{% endtab %}
{% endtabs %}

in response is person `Identity`.

{% tabs %}
{% tab title="Response" %}

```json
{
    "id": "634b56217f6a7b0be52dffbd",
    "owner": "6be52d34b56217fffbd6a7b0",
    "country": "US",
    "currency": "USD",
    "type": "person",
    "person": "255",
    "company": {
        "createdAt": "2023-03-04T19:16:41",
        "modifiedAt": "2023-03-04T19:16:41",
        "id": 1,
        "name": "Orangepill",
        "notes": "notes example",
        "country": "Croatia",
        "region": "Europe",
        "accountManager": "Agent Smith",
        "customerStage": "Active",
        "industry": "IT",
        "vatNumber": "003212059",
        "customAttributes": 
        {
            "Contract Expiry": "2025-06-01"
        },
        "domains": 
        [
            "orangepill.cloud"
        ]    
    },
    "data": {
        "custom_field1": "custom_value1"
    },
    "created_at": "1519211809934",
    "error": null
}
```

{% endtab %}
{% endtabs %}

## Update Company

Use endpoint `PATCH /v1/identities/companies/:id` to update Company profile.

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request PATCH 'https://api.orangepill.cloud/v1/identities/companies' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
--data-raw '{
    "customerStage": "Inactive"
}'
```

{% endtab %}
{% endtabs %}

in response is updated Company.

{% tabs %}
{% tab title="Response" %}

```json
{
        "createdAt": "2023-03-04T19:16:41",
        "modifiedAt": "2023-03-04T19:16:41",
        "id": 1,
        "name": "Orangepill",
        "notes": "notes example",
        "country": "Croatia",
        "region": "Europe",
        "accountManager": "Agent Smith",
        "customerStage": "Inactive",
        "industry": "IT",
        "vatNumber": "003212059",
        "customAttributes": 
        {
            "Contract Expiry": "2025-06-01"
        },
        "domains": 
        [
            "orangepill.cloud"
        ]    
}
```

{% endtab %}
{% endtabs %}

## Delete Company

Use endpoint `DELETE /v1/identitites/companies/:id` to delete Company profile from Infobip People CDP.&#x20;

{% tabs %}
{% tab title="cURL" %}

```shell

curl --location --request DELETE 'https://api.orangepill.cloud/v1/identities/companies/:id' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
```

{% endtab %}
{% endtabs %}

in response is empty array.

{% tabs %}
{% tab title="Response" %}

```json
[]
```

{% endtab %}
{% endtabs %}

## Send Custom Person Events

Use endpoint `POST /v1/identitites/:id/person/event/:event` to send custom event to Infobip People CDP.

{% tabs %}
{% tab title="cURL" %}

```shell

curl --location --request POST 'https://api.orangepill.cloud/v1/identities/634b56217f6a7b0be52dffbd/person/event/addToCart' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffda' \
--header 'Content-Type: application/json' \
--data-raw '{
    "data": {
        "properties": {
            "itemName": "Generic Shoes",
            "itemId": 9473370,
            "price": 56.324,
            "quantity": 2,
            "fromPromoCampaign": true,
            "inStockSince": "2019-09-30T16:35:52.3616436+03:00",
            "category": "Sneakers"
            }   
        }
    }
}'
```

{% endtab %}
{% endtabs %}

in response are event details.

{% tabs %}
{% tab title="Response" %}

```json
{
  "definitionId": "addToCart",
  "personId": "name@example.com",
  "personIdentifierType": "EMAIL",
  "occurredTime": "2020-03-30T16:35:52.3617777+03:00",
  "properties": {
    "itemName": "Generic Shoes",
    "itemId": 9473370,
    "price": 56.324,
    "quantity": 2,
    "fromPromoCampaign": true,
    "inStockSince": "2019-09-30T16:35:52.3616436+03:00",
    "category": "Sneakers"
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.orangepill.cloud/orangepill-api/persons-and-companies.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
