This is a html view of the json schema please take the json schema as reference DOWNLOAD THE JSON SCHEMA

Contact


A Contact object to represent the details of a User in CX (E-Commerce) and Contact in AX (CRM).
This is used to manage contact data across any channel, from a single master source, either seen as a User for CX perspective as contact that has been granted to get ecommerce access or any kind of Contact for AX or Opco, covering contact core data ( profile, contact touch points, consents, attachment to accounts )

A single event cannot include modifications on scopes that have a different master. e.g. if you want to attach new accounts to a contact from AccountArea and EcommerceUserArea you need to send two different events. Only scopes having the same master can be used at the same time.

No Additional Properties

Type: object

The identifier is optional when creating a new contact (scope=CONTACT_CORE and type=COMMAND). It is mandatory when updating an existing contact.

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.


Type: object

Type: object


Must not be:

Type: const
Specific value: "CONTACT_CORE"

Type: const
Specific value: "COMMAND"
Type: object

Type: object

Type: const
Specific value: "EVENT"
Type: object

The following properties are required:

  • identifiers
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: object

Type: array
No Additional Items

At least one of the items must be:

Type: const
Specific value: "CONTACT_CORE"

Type: const
Specific value: "EVENT"
Type: object

Type: object

The following properties are required:

  • firstName
  • lastName
  • lastModified
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: object

Type: array
No Additional Items

At least one of the items must be:

Type: const
Specific value: "CONTACT_ACCOUNTS"

Type: const
Specific value: "EVENT"
Type: object

Type: object

The following properties are required:

  • attachedAccounts
  • lastModified
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: object

Type: array
No Additional Items

At least one of the items must be:

Type: const
Specific value: "CONTACT_ECOMMERCE_USER"

Type: const
Specific value: "EVENT"
Type: object

Type: object

The following properties are required:

  • attachedAccounts
  • ecommerceActivationStatus
  • lastModified
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: object

Type: array
No Additional Items

At least one of the items must be:

Type: const
Specific value: "CONTACT_CONSENT"
Type: object

The following properties are required:

  • consentArea
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: object

Type: array
No Additional Items

At least one of the items must be:

Type: const
Specific value: "CONTACT_CORE"
Type: object

The following properties are required:

  • coreArea
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: object

Type: array
No Additional Items

At least one of the items must be:

Type: const
Specific value: "CONTACT_ACCOUNTS"
Type: object

The following properties are required:

  • accountArea
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: object

Type: array
No Additional Items

At least one of the items must be:

Type: const
Specific value: "CONTACT_ECOMMERCE_USER"
Type: object

The following properties are required:

  • ecommerceUserArea

Example:

{
    "eventHeader": {
        "source": "SPARK",
        "version": "v1",
        "scope": [
            "CONTACT_CONSENT"
        ],
        "type": "COMMAND",
        "request": {
            "id": "1234567",
            "target": "SPARK_AX"
        }
    },
    "identifiers": {
        "contactId": "123456780912345678"
    },
    "consentArea": {
        "consents": [
            {
                "name": "ORDER_SHIPPED",
                "category": "TRANSACTIONAL",
                "subCategory": "TRACK_AND_TRACE",
                "channels": [
                    {
                        "type": "EMAIL",
                        "userPreference": true
                    },
                    {
                        "type": "PUSH_NOTIFICATION",
                        "userPreference": true
                    },
                    {
                        "type": "SMS",
                        "userPreference": false
                    }
                ],
                "lastModified": "2024-01-01T00:00:00Z"
            },
            {
                "name": "PROMOTIONS",
                "category": "MARKETING",
                "subCategory": "GENERAL",
                "channels": [
                    {
                        "type": "EMAIL",
                        "userPreference": false
                    },
                    {
                        "type": "PUSH_NOTIFICATION",
                        "userPreference": true
                    },
                    {
                        "type": "SMS",
                        "userPreference": true
                    }
                ],
                "lastModified": "2024-01-01T00:00:00Z"
            }
        ]
    }
}

EventHeader

Type: object

This object describes meta-data information related to the event


Examples:

{
    "source": "SPARK",
    "version": "v1",
    "scope": [
        "CONTACT_CONSENT"
    ],
    "type": "COMMAND",
    "request": {
        "id": "1234567",
        "target": "SPARK_AX"
    }
}
{
    "source": "SPARK_AX",
    "version": "v1",
    "scope": [
        "CONTACT_CONSENT"
    ],
    "type": "EVENT",
    "request": {
        "id": "1234567",
        "target": "SPARK"
    }
}

Type: enum (of string)

The source of this event. It can be:

  • SPARK : when the message is originating from SPARK webshop, eg: to update the consents of a contact.

  • SPARK_AX : when the message originates from Dynamics 365. eg: to respond to a Command from SPARK CX, or to opco.

  • OPCO : to feed the data for a contact from the Opco to SPARK

Must be one of:

  • "SPARK"
  • "SPARK_AX"
  • "OPCO"

Example:

"SPARK"

Type: enum (of string)

The version of the json format event

Must be one of:

  • "v1"

Example:

"v1"

Type: array of enum (of string)

All items must be unique

No Additional Items

Each item of this array must be:

Type: enum (of string)

Scope is used to decide what to be updated in the case of a matched online contact ( using email field ).
- CONTACT_CONSENT : to enable to update consent preferences.
- CONTACT_CORE : the scope used when one of the user profile data is updated
- CONTACT_ACCOUNTS : the scope used to controle accounts access
- CONTACT_ECOMMERCE_USER : the scope used when permissions or any other ecommerce related information is updated.
Only scopes having the same master can be used at the same time.

Must be one of:

  • "CONTACT_CONSENT"
  • "CONTACT_CORE"
  • "CONTACT_ACCOUNTS"
  • "CONTACT_ECOMMERCE_USER"

Example:

"CONTACT_CONSENT"

Type: enum (of string)

The type of the event.
- COMMAND is to request a change of the Contact to the master of the scope.
- EVENT is published by the master of the scope to inform slaves about a change of the Contact.
EVENT can be a successful response to a COMMAND message.
In case the COMMAND event is rejected, then the type returned is COMMAND

Must be one of:

  • "COMMAND"
  • "EVENT"

Example:

"COMMAND"

Type: object

The object holding the request information.


Example:

{
    "id": "1234567",
    "target": "SPARK"
}

Type: string

The unique identifier of the request provided by the COMMAND message, and then also returned by the EVENT message. It is used to correlate the EVENT message to the COMMAND message.

Must be at least 1 characters long


Example:

"1234567"

Type: enum (of string)

The intended consumer of this request. In case this message is EVENT in response to a COMMAND, request.target is equal to the 'source' value of the COMMAND
It can be:
SPARK - when the target is SPARK webshop, eg: to receive the updates of the consents of a contact.
SPARK_AX when the message is intended to be updated to Dynamics 365. eg: to update a contacts details.
OPCO, possibly when there is error in the contact request sent by OPCO.

Must be one of:

  • "SPARK"
  • "SPARK_AX"
  • "OPCO"

Example:

"SPARK"

Type: object

The object holding the identifiers for the contact


Example:

{
    "contactId": "123456780912345678"
}

Type: string

Unique identifier for the contact

Must be at least 1 characters long

Type: array

The errors being responded for the Contact command previously sent by the source. This can only be filled when COMMAND is sent by the master.

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:

Error

Type: object

The object holding the errors for the contact.


Examples:

{
    "code": "CONTACT_NOT_FOUND",
    "message": {
        "en-GB": "Contact abc@corporate.fr is unknown",
        "fr-FR": "Le contact abc@corporate.fr est inconnu"
    }
}
{
    "code": "ACCOUNT_NOT_FOUND",
    "message": {
        "en-GB": "Account TESTACCOUNT is unknown",
        "fr-FR": "Le compte TESTACCOUNT est inconnu"
    }
}

Type: enum (of string)

The error code

Must be one of:

  • "EMAIL_ALREADY_USED"
  • "EMAIL_NOT_FOUND"
  • "DEVICE_ID_NOT_FOUND"
  • "CONTACT_NOT_FOUND"
  • "CHANNEL_NOT_FOUND"
  • "ACCOUNT_NOT_FOUND"
  • "CONSENT_CHANNEL_NOT_FOUND"
  • "TECHNICAL_FAILURE"

Example:

"CONTACT_NOT_FOUND"

Multilingual Object

Type: object

The error message


Example:

{
    "en-GB": "Contact abc@corporate.fr is unknown",
    "fr-FR": "Le contact abc@corporate.fr est inconnu"
}

Each additional property must conform to the following schema

Type: string

Type: object

The object holding the consent preferences for the contact. Delta mode is possible, i.e all consent preferences do not need to be sent everytime but only the ones to be created or updated.


Example:

{
    "consent": [
        {
            "name": "TRAININGS",
            "category": "MARKETING",
            "subCategory": "GENERAL",
            "channels": [
                {
                    "type": "EMAIL",
                    "userPreference": true
                },
                {
                    "type": "PUSH_NOTIFICATION",
                    "userPreference": true
                },
                {
                    "type": "SMS",
                    "userPreference": false
                }
            ],
            "lastModified": "2024-01-01T00:00:00Z"
        },
        {
            "name": "ORDER_NOTIFICATIONS",
            "category": "TRANSACTIONAL",
            "subCategory": "GENERAL",
            "channels": [
                {
                    "type": "EMAIL",
                    "userPreference": false
                },
                {
                    "type": "PUSH_NOTIFICATION",
                    "userPreference": true
                },
                {
                    "type": "SMS",
                    "userPreference": true
                }
            ],
            "lastModified": "2024-01-01T00:00:00Z"
        }
    ]
}

Type: array

Array of consents based on categories (Promotions, Track and Trace, Marketing) and subcategories (transactional or non transactional) containing the channel (SMS/EMAIL/PUSH_NOTIFICATION) and consent preference (true/false)

No Additional Items

Each item of this array must be:

Consent

Type: object

Consent on a category and subcategories containing the channel (SMS/EMAIL/PUSH_NOTIFICATION) and consent preference (true/false)

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "ACTIVE"
Type: object

The following properties are required:

  • name
  • category
  • subCategory
  • channels

Type: enum (of string)

The status of the consent. ACTIVE is for consents to be updated or added. DELETED is when a Contact wants to remove a device for type PUSH_NOTIFICATION.

Must be one of:

  • "ACTIVE"
  • "DELETED"

Example:

"ACTIVE"

Type: string

The name of the consent object name holding the category, channel and the consent information

Must be at least 1 characters long


Examples:

"ORDER_NOTIFICATIONS"
"PROMOTIONS"
"TRAININGS"

Type: enum (of string)

The type of category to which the event belongs to

Must be one of:

  • "MARKETING"
  • "TRANSACTIONAL"

Example:

"MARKETING"

Type: enum (of string)

The subtype of category to which the event belongs to. For TRANSACTIONAL category, it can be either of GENERAL or TRACKANDTRACE. For MARKETING, it should be GENERAL.

Must be one of:

  • "GENERAL"
  • "TRACK_AND_TRACE"

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "TRANSACTIONAL"
Type: enum (of string)

Must be one of:

  • "GENERAL"
  • "TRACK_AND_TRACE"
Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "MARKETING"
Type: enum (of string)

Must be one of:

  • "GENERAL"

Example:

"TRACK_AND_TRACE"

Type: array

An array of channels containing consent values for different channels. All of the channels are mandatory

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:

Channel

Type: object

Channel specifying its consent value for a contact

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "PUSH_NOTIFICATION"
Type: object

The following properties are required:

  • deviceId
  • userPreference
  • type

Type: enum (of string)

The communication channel and its corresponding consent, whether allowed or not

Must be one of:

  • "EMAIL"
  • "PUSH_NOTIFICATION"
  • "SMS"

Example:

"EMAIL"

Type: boolean

The consent value for the channel


Example:

true

Type: string

The device id of the contact. This is required when type is PUSH_NOTIFICATION

Must be at least 1 characters long


Example:

"1234567"

Type: stringFormat: date-time

The last date and time of this consent information


Examples:

"2023-10-12T08:30:22.804Z"
"2023-10-12T08:30:22.804+01:00"

Type: object

The object holding the core data for the contact. The master is:

  • CX when only CX is deployed and opco don’t persist user on ERP.

  • OPCO when only CX is deployed and opco persist user on ERP

  • AX : when AX and CX are deployed


Example:

{
    "coreArea": {
        "title": "Mr.",
        "firstName": "John",
        "lastName": "Doe",
        "middleName": "M",
        "defaultLocale": "en-US",
        "email": "john.doe@example.com",
        "secondaryEmail": "john.doe2@example.com",
        "teamEmail": "team@example.com",
        "jobRoleCode": "DEV",
        "mobilePhoneNumber": "+1234567890",
        "landLinePhoneNumber": "+0987654321",
        "alternateMobilePhoneNumber": "+1122334455",
        "status": "ACTIVE"
    }
}

Type: string

Title corresponding for this core area

Must be at least 1 characters long

Type: string

The first name of the contact

Must be at least 1 characters long


Example:

"Jean"

Type: string

The last name of the contact

Must be at least 1 characters long


Example:

"Dupond"

Type: string

The middle name of the contact

Must be at least 1 characters long

Type: string

User's default language, if not present the account default locale will be used

Must be at least 1 characters long


Example:

"fr-BE"

Type: stringFormat: email

One of email or mobilePhoneNumber should be present. It should be unique if present and cannot be shared by another contact and should be present to be able to access ecommerce platform.

Must be at least 1 characters long


Example:

"geert@electracontractors.be"

Type: string

Should be present and cannot be shared by another contact.

Must be at least 1 characters long


Example:

"geert@electracontractors.be"

Type: string

Email shared across several accounts

Must be at least 1 characters long


Example:

"geert@electracontractors.be"

Type: string

The jobRoleCode chosen by the associate

Type: string

One of email or mobilePhoneNumber should be present and unique if present, it can’t be shared with another contact

Must match regular expression: ^\+[1-9]\d{1,14}$

Type: string

Landline phone number for this contact

Must match regular expression: ^\+[1-9]\d{1,14}$

Type: string

Should be unique if present, it can’t be shared with another contact

Must match regular expression: ^\+[1-9]\d{1,14}$

Type: enum (of string) Default: "ACTIVE"

Global status of the contact. it can have the following values:

  • ACTIVE : when account is active into Spark

  • DELETED : when account is deleted from Spark

Must be one of:

  • "ACTIVE"
  • "DELETED"

Type: stringFormat: date-time

The last date and time of contacts core information, when updated by the master


Examples:

"2023-10-12T08:30:22.804Z"
"2023-10-12T08:30:22.804+01:00"

Account area

Type: object

Area holding account related data of contact. Delta mode is possible, i.e all accounts do not need to be sent everytime but only the ones to be created or updated.


Example:

{
    "attachedAccounts": [
        {
            "opcoAccountId": "ACC123",
            "status": "ACTIVE"
        },
        {
            "opcoAccountId": "ACC456",
            "status": "BLOCKED"
        },
        {
            "opcoAccountId": "ACC789",
            "status": "DELETED"
        }
    ]
}

Type: array of object

Attached accounts must be a subset of the attached accounts in the Account area. Otherwise they cannot be attached to the ecommerce user.

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:

Type: object

Type: string

The accountID on the opco side

Type: enum (of string)

Status can have the following values:

  • ACTIVE : to attach an account to the contact.

  • DELETED : to detach this account to the contact.

  • BLOCKED : to disable temporarily the account for the contact.

Must be one of:

  • "ACTIVE"
  • "DELETED"
  • "BLOCKED"

Type: stringFormat: date-time

The last date and time of this account information, when updated by the master


Examples:

"2023-10-12T08:30:22.804Z"
"2023-10-12T08:30:22.804+01:00"

Ecommerce user area

Type: object

The object holding the data for the ecommerce contact.

Type: enum (of string)

Status related to the ecommerce user.

Must be one of:

  • "ACTIVATED"
  • "PENDING"
  • "ACTIVATION_EXPIRED"

Example:

"ACTIVATED"

Type: stringFormat: date-time

The last date and time of this ecommerce information, when updated by the master


Examples:

"2023-10-12T08:30:22.804Z"
"2023-10-12T08:30:22.804+01:00"

Type: array of object

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:

Type: object

Type: string

OpCo's organizational customer number that uniquely identifies its account.

Must be at least 1 characters long


Example:

"1234567"

Type: array

List of permissions allowed for the user in the account.

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:

Permission


Enumeration of permission available in the Spark platform.

  • MANAGE_USERS: make the user able to manage other users (this is known as admin user)

  • VIEW_NET_PRICE: make the user able to see net prices

  • VIEW_GROSS_PRICE: make the user able to see list,gros prices

  • VIEW_ORDER_LIST: make the user able to access the order list and details data

  • CONTRIBUTE_CART: make the user able to create and update a cart

  • VALIDATE_CART : user having this permission will be able to approve cart of the other users

  • EXPORT_INVOICE: make the user to download invoices documents

  • PLACE_ORDER_WITHOUT_VALIDATION: make the user to place an order without needing to wait for a validator approval.

  • RELEASE_BLANKET_ORDER: User is able to create release/sub order from blanket order and checkout of blanket order (Note - Users with this permission may not have CONTRIBUTE_CART or PLACE_ORDER_WITHOUT_VALIDATION permission and should be able to perform checkout specific to blanket order)

  • VIEW_BLANKET_ORDER: User is able to view list and details of blanket order (Punchout token would not contain any blanket order related permissions))

  • MANAGE_ADDRESSES In Pilot: this permission will allow the user to create/edit/delete delivery addresses.

  • EDIT_ORDER In Pilot: allows the user to edit open orders and make adjustments as needed.

  • PAY_INVOICE In Pilot: this permission will allow the user to pay invoices online.

Checkout and approve carts without purchase limit check

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Requires approvals for cart checkout

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Requires approvals if surpasses allowed purchase limits

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

The user is allowed to contribute and make a checkout if he is ordering under his purchase limit set by his admin, He only requires an approval if he surpasses the purchase limit both at cart limit and monthly purchase limit

User requires permissions to view or release blanket orders

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Must be one of:

  • "CONTRIBUTE_CART"
  • "EDIT_CUSTOMER_REF"
  • "EDIT_ORDER"
  • "EDIT_PUBLIC_LIST"
  • "EXPORT_INVOICE"
  • "MANAGE_ADDRESSES"
  • "MANAGE_QUOTE"
  • "MANAGE_USERS"
  • "PAY_INVOICE"
  • "PLACE_ORDER_WITHOUT_VALIDATION"
  • "RELEASE_BLANKET_ORDER"
  • "VALIDATE_CART"
  • "VIEW_BLANKET_ORDER"
  • "VIEW_CREDIT_INFO"
  • "VIEW_GROSS_PRICE"
  • "VIEW_NET_PRICE"
  • "VIEW_ORDER_LIST"

Example:

"VIEW_NET_PRICE"

Type: string

User's job denomination code. This is code of the reference value provided for the reference type 'JobTitle'.This is required when the job title reference table is not empty for an opco

Must be at least 1 characters long


Example:

"003"

Type: string

user's job denomination, This is required when the job title reference table is not empty for an opco

Must be at least 1 characters long


Example:

"Manager"

Price

Type: object

The max amount that this user can purchase by cart


Examples:

{
    "amount": 100000,
    "scale": 2,
    "currency": "EUR"
}
{
    "amount": 10000000,
    "scale": 4,
    "currency": "USD"
}

Type: integer

The actual unscaled amount based on list or customer


Example:

205987

Type: integer

The scale to be applied on the unscaled amount


Example:

2

Type: string

The currency code following the ISO 4217 standard 3 letter in which the prices are being displayed

Must be at least 3 characters long


Example:

"EUR"

PurchaseLimitByPeriod

Type: object

The max amount that this user can purchase within a period


Examples:

{
    "limit": {
        "amount": 100000,
        "scale": 2,
        "currency": "EUR"
    },
    "period": "MONTHLY"
}
{
    "limit": {
        "amount": 1000000,
        "scale": 2,
        "currency": "EUR"
    },
    "period": "MONTHLY"
}
{
    "limit": {
        "amount": 1000000,
        "scale": 2,
        "currency": "EUR"
    },
    "period": "MONTHLY"
}

Price

Type: object

Contains the amount informations based on the type of prices we might have

Type: integer

The actual unscaled amount based on list or customer


Example:

205987

Type: integer

The scale to be applied on the unscaled amount


Example:

2

Type: string

The currency code following the ISO 4217 standard 3 letter in which the prices are being displayed

Must be at least 3 characters long


Example:

"EUR"

Type: enum (of string)

The period for which the limit is applied.
- MONTHLY: to define purchase limit for current calendar month

Must be one of:

  • "MONTHLY"

Example:

"MONTHLY"