openapi: 3.2.0
info:
version: '2.2'
title: Dynamic Yield Experience User Data API
description: API definitions for all Dynamic Yield public endpoints.
contact:
name: API Support
email: apisupport@mastercard.com
url: https://developer.mastercard.com/support
servers:
- url: https://dy-api.com/v2
description: US data center
- url: https://direct.dy-api.com/v2
description: US data center, direct endpoint
- url: https://dy-api.eu/v2
description: EU data center
- url: https://direct.dy-api.eu/v2
description: EU data center, direct endpoint
security:
- ApiKeyAuth: []
tags:
- name: User Data API
description: Update user data.
paths:
/userdata/channels/{channel}/opt-in:
summary: Update Reconnect Opt-In
post:
summary: Update Reconnect Opt-In
description: Update a user's opt-in status to a specific channel in real time.
operationId: updateReconnectOptIn
tags:
- User Data API
parameters:
- $ref: '#/components/parameters/UserDataChannel'
requestBody:
$ref: '#/components/requestBodies/UpdateReconnectOptInBody'
responses:
'202':
$ref: '#/components/responses/SuccessUserData'
'400':
$ref: '#/components/responses/InvalidUserData'
/userdata/channels/{channel}/opt-out:
summary: Update Reconnect Opt-Out
post:
summary: Update Reconnect Opt-Out
description: Update a user's opt-out status to a specific channel in real time.
operationId: updateReconnectOptOut
tags:
- User Data API
parameters:
- $ref: '#/components/parameters/UserDataChannel'
requestBody:
$ref: '#/components/requestBodies/UpdateReconnectOptInBody'
responses:
'202':
$ref: '#/components/responses/SuccessUserData'
'400':
$ref: '#/components/responses/InvalidUserData'
/userdata/events:
summary: External Events
post:
summary: External Events
description: Track user interaction event using the user's `cuid`. Use in cases where the user's `dyid` is unavailable (e.g. offline activity).
operationId: externalEvents
tags:
- User Data API
requestBody:
$ref: '#/components/requestBodies/ExternalEventsBody'
responses:
'202':
$ref: '#/components/responses/SuccessUserData'
'400':
$ref: '#/components/responses/InvalidUserData'
/userdata/{feedKey}/bulk:
summary: User Data API
post:
summary: User Data API
description: 'The User Data API enables you to update your user data on demand, including partial updates.
**Support site article:** User Data Feed'
operationId: userDataApi
tags:
- User Data API
parameters:
- $ref: '#/components/parameters/UserDataFeedKey'
requestBody:
$ref: '#/components/requestBodies/UserDataBody'
responses:
'202':
$ref: '#/components/responses/SuccessUserData'
'400':
$ref: '#/components/responses/InvalidUserData'
components:
schemas:
UserDataRequests:
description: A list of user data update requests to be executed.
type: array
items:
oneOf:
- $ref: '#/components/schemas/UserDataRequestUpsert'
- $ref: '#/components/schemas/UserDataRequestDelete'
- $ref: '#/components/schemas/UserDataRequestArray'
SecondaryIdentifiers:
type: array
items:
type: object
properties:
type:
type: string
example: hashedPhoneNumber
value:
type: string
example: 49c7b1f6d24121078d8f37997b433586fe9a28e2dc4fbd0803eac237ac82255e
CartItemPrice:
description: unit.cents format using the section default currency.
type: number
example: 23.99
InformAffinity:
title: Inform Affinity
description: Report an array of product attributes to use in affinity personalization.
type: object
properties:
name:
$ref: '#/components/schemas/EventName'
properties:
allOf:
- $ref: '#/components/schemas/EventProperties'
- properties:
dyType:
description: Must be `inform-affinity-v1`.
type: string
pattern: inform-affinity-v1
source:
description: The source of the user data
type: string
data:
description: 'An array of attributes and values.
Important: Reported attributes and values must be an exact match to the product feed
Each item in the array includes an attribute and up to 10 values:
- attribute: "name of attribute"
- values: ["value1", "value2"...]'
type: array
items:
type: object
properties:
attribute:
description: name of attribute
values:
type: array
maxItems: 10
items:
type: string
required:
- dyType
- data
example:
name: Inform Affinity
properties:
dyType: inform-affinity-v1
source: registration-form
data:
- attribute: categories
values:
- shoes
- tops
- accessories
- attribute: brand
values:
- adidas
OfflinePurchase:
title: Offline Purchase
description: Reports that the user completed a purchase.
type: object
properties:
name:
$ref: '#/components/schemas/EventName'
properties:
allOf:
- $ref: '#/components/schemas/EventProperties'
- properties:
dyType:
description: Must be `offline-purchase-v1`.
type: string
pattern: offline-purchase-v1
default: offline-purchase-v1
example: offline-purchase-v1
uniqueTransactionId:
allOf:
- $ref: '#/components/schemas/UniqueTransactionId'
- description: The purchase transaction ID. Each line contains a maximum of one SKU. If multiple items were purchased together, create multiple lines with the same transactionId.
The transaction ID must be unique per transaction, including online purchases.
A transaction with the same ID as another transaction previously ingested within the past day is ignored.
transactionSource:
$ref: '#/components/schemas/TransactionSource'
transactionDatetime:
$ref: '#/components/schemas/TransactionDatetime'
currency:
$ref: '#/components/schemas/Currency'
value:
$ref: '#/components/schemas/Value'
cart:
allOf:
- $ref: '#/components/schemas/CartExternal'
- description: The cart's absolute current state. Products are ordered from the first added to the cart to the most recent.
required:
- dyType
- uniqueTransactionId
- transactionDatetime
- value
- cart
required:
- name
- properties
UserDataActionArray:
description: Use `array_add` and `array_remove` to edit data in existing arrays.
type: string
enum:
- array_add
- array_remove
example: array_add
ExternalIdentify:
title: Identify
description: Reports that the user has been identified.
type: object
properties:
name:
allOf:
- $ref: '#/components/schemas/EventName'
- example: CDP Initial Sync
properties:
allOf:
- $ref: '#/components/schemas/EventProperties'
- properties:
dyType:
description: Must be `external-identify-v1`.
type: string
pattern: external-identify-v1
default: external-identify-v1
example: external-identify-v1
secondaryIdentifiers:
type: array
items:
$ref: '#/components/schemas/SecondaryIdentifiers'
required:
- dyType
- secondaryIdentifiers
required:
- name
- properties
UserDataUpsert:
description: Add CRM data here. Date values within the CRM Data should be date & time in ISO 8601 format, with or without milliseconds (YYYY-MM-DDThh:mm:ssTZD or YYYY-MM-DDThh:mm:ss.sTZD ), expressed either in UTC or in local time. Alternatively, you can use an epoch timestamp.
type: object
additionalProperties: {}
TransactionSource:
description: The source where the transaction occurred, usually the physical store ID.
type: string
example: f877e8a9dbb
Ip:
description: 'The client IP address, for geolocation-based targeting and audience building. If not passed, the caller IP is used. This applies only to client-side API calls when isImplicitClientData: true is set in the Options object.'
type: string
example: 54.100.200.255
ReconnectIdentifierValue:
description: The identifier value.
type: string
Timestamp:
description: Date & time in ISO 8601 format, with or without milliseconds (YYYY-MM-DDThh:mm:ssTZD or YYYY-MM-DDThh:mm:ss.sTZD ), expressed either in UTC or in local time. Alternatively, you can use an epoch timestamp.
type: string
format: date-time
example: '2021-07-24T13:44:17+02:00'
EventProperties:
description: Data for the reported event.
type: object
Size:
description: Product size.
type: string
example: L
UpdateReconnectOptInPayloadWebApp:
title: Update Opt-In/Out Status – Web-Push/App-Push
type: object
properties:
associatedDevice:
description: The device associated with the user for web/app push notifications.
type: object
properties:
dyid:
$ref: '#/components/schemas/Dyid'
identifier:
description: The identifier to opt in or out for.
type: object
properties:
type:
allOf:
- $ref: '#/components/schemas/ReconnectIdentifierType'
- enum:
- pushID
default: pushID
example: pushID
value:
$ref: '#/components/schemas/ReconnectIdentifierValue'
required:
- identifier
CustomEvent:
title: Custom Event
description: Use custom events to report any event that isn't already defined for use in Experience OS, but is significant to your business.
**Note:** custom events support only symbols that are encoded with UTF-8 ([Basic Multilingual Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane)). Some characters with diacritics (additional symbols above or below the letter) are read as the base character. For example, **é** is processed as **e**.
type: object
properties:
name:
description: Event name for display. Does not have a `dyType` property.
type: string
example: VIP Login
properties:
description: Properties can be strings, numbers, or Boolean. Note that we don't support nested properties when creating targeting rules over custom events.
type: object
properties:
value:
description: Indicates the monetary value of the event, with or without the optional currency designation. Use for goals based on events.
type: number
example: 98.7
currency:
$ref: '#/components/schemas/Currency'
additionalProperties:
anyOf:
- type: string
- type: number
- type: boolean
required:
- name
example:
name: Custom Event Example 1
properties:
isVIP: true
DeviceEngagement:
description: Data for the served device.
type: object
properties:
ip:
$ref: '#/components/schemas/Ip'
CartQuantity:
description: Number of items.
type: number
EventsExternal:
description: One or more events to report.
type: array
items:
oneOf:
- $ref: '#/components/schemas/OfflinePurchase'
- $ref: '#/components/schemas/InformAffinity'
- $ref: '#/components/schemas/ExternalIdentify'
- $ref: '#/components/schemas/CustomEvent'
CartTransactionItemValue:
description: Value of the line item in actual payment currency.
The value is the product of `itemPrice` times `quantity`, after discount and taxes.
Negative values are ignored.
Required if the `value` property is not defined. Otherwise, it's optional.
type: number
example: 23.99
UserDataUser:
description: User's identifying details.
type: object
properties:
cuid:
$ref: '#/components/schemas/Cuid'
cuidType:
allOf:
- $ref: '#/components/schemas/CuidType'
- description: The type of identifier used to identify the user. The value should be one of the following:
emailphoneNumberemail and phoneNumber, pass the corresponding identifier value in plain text.