POST /providerapi/offlineconversion
The POST /providerapi/offlineconversion endpoint enables you to upload user-level offline conversions, which can include use cases such as attributing in-store sales, place visits, merchant product catalog items, or custom events.
TIP: For general information about offline measurement, FAQs, and other details, see Offline conversion events.
Request preparation guidelines
NOTE: Some IDs, such as raw UID2s, raw EUIDs, and their respective tokens, are case sensitive. Pass all IDs and tokens without changing the case. Mismatched IDs can cause ID parsing or token decryption errors.
Here are some recommendations to help you structure your requests effectively:
- Since event names are displayed to advertisers in the platform UI, be sure to use consistent and easy-to-read patterns for naming your offline conversion events.
- When uploading product catalog data for merchants, be sure to include additional fields required beyond the standard schema. For example,
MerchantId,EventName,OrderId, andLineItems. - Upload individual IDs by listing them as item objects in the
Itemsarray.- If you provide an
ImpressionIdvalue in theItemsarray, no other ID is required. - Otherwise, each item object in the
Itemsarray must have at least one supported ID type.
- If you provide an
- Upload multiple IDs grouped together in either of the following ways:
- Using a
UserIdArrayarray with up to 20 IDs per array. - Listing IDs of different ID types within a single item object. To upload IDs with the same ID type, add another item object to the
Itemsarray or use theUserIdArrayproperty.
- Using a
IMPORTANT: This endpoint is designed to receive offline or batched events. Advertisers are expected to filter out non-consented events before submission. For details, see Privacy Settings object properties.
Data upload guidelines
Here are some recommendations for uploading data for offline measurement:
- The total request size may not exceed 28.6 MB. There's no limit on the number of events you can send.
- Consolidate your data into as few API calls as possible. For example, instead of sending 3,000 conversion events in 3,000 separate calls, use a single API request to send the entire batch of 3,000 offline conversions.
- To ensure that the data for sales measurement is captured and attributed properly, be sure to follow these guidelines (based on the event date specified in the
Items.TimestampUtcproperty):- Send data to The Trade Desk as soon as possible, ideally, within 1 to 3 days of the transaction date.
- Avoid uploading data older than 25 days after the date the event occurred. This helps us account for any lag time that we need after ingesting the data to run attribution properly for any month in the calendar year for a 30-day look-back.
See also FAQs in Offline conversion events.
Environment
This endpoint uses a specific environment for offline attribution. The following table shows the environment, path, and full endpoint URL.
Request syntax
The following sections explain the syntax for different ways to include user IDs in the Items array:
- Individually (one ID per object)
- Grouped (multiple IDs within a single object)
TIP: Start by reviewing the syntax and field usage guidelines in Request object properties. Then, refer to these resources for real-world use cases and request body examples: Conversion event data examples and Merchant event data examples.
Single user ID per object
The following example shows the POST /providerapi/offlineconversion request syntax with three conversion events. The first event uses an impression ID, which means no other ID is necessary for that item. The second event uses a placeholder for a specific different user ID type. The first two events show only required fields, the last event demonstrates how to include optional privacy settings properties.
{
"DataProviderId": "DATA_PROVIDER_ID_PLACEHOLDER",
"Items": [
{
"ImpressionID": "IMPRESSION_ID_PLACEHOLDER",
"TrackingTagId": "TRACKING_TAG_ID_PLACEHOLDER",
"TimestampUtc": "DATETIME_PLACEHOLDER"
// Additional event metadata goes here.
},
{
"ID_TYPE_PLACEHOLDER": "ID_STRING_PLACEHOLDER",
"TrackingTagId": "TRACKING_TAG_ID_PLACEHOLDER",
"TimestampUtc": "EVENT_DATETIME_PLACEHOLDER"
// Additional event metadata goes here.
},
{
"ID_TYPE_PLACEHOLDER": "ID_STRING_PLACEHOLDER",
"TrackingTagId": "TRACKING_TAG_ID_PLACEHOLDER",
"TimestampUtc": "EVENT_DATETIME_PLACEHOLDER",
"PrivacySettings": [
{
"privacy_type": "PRIVACY_REGULATION_TYPE_PLACEHOLDER",
"is_applicable": 1,
"consent_string": "USER CONSENT STRING PLACEHOLDER"
}
]
// Additional event metadata goes here.
}
]
}
The following example shows how to include additional metadata and custom properties.
NOTE: These fields help enrich the conversion signal but are not required for standard uploads. However, when uploading merchant product catalog items, the following fields are required:
MerchantId,OrderId,EventName, and at least one line item with theitem_codeproperty.
{
"DataProviderId": "DATA_PROVIDER_ID_PLACEHOLDER",
"Items": [
{
"ID_TYPE_PLACEHOLDER": "ID_STRING_PLACEHOLDER",
"TrackingTagId": "TRACKING_TAG_ID_PLACEHOLDER",
"TimestampUtc": "EVENT_DATETIME_PLACEHOLDER",
"MerchantId": "MERCHANT_ID_PLACEHOLDER",
"ReferrerUrl": "WEBPAGE_URL_PLACEHOLDER",
"ClientIPAddress": "CLIENT_IP_ADDRESS_PLACEHOLDER",
"EventName": "USER_ACTION_PLACEHOLDER",
"Value": CONVERSION_AMOUNT_PLACEHOLDER,
"ValueCurrency": "CURRENCY_PLACEHOLDER",
"Country": "FULL_COUNTRY_NAME_PLACEHOLDER",
"Region": "GEO_REGION_PLACEHOLDER",
"NielsenDMA": METRO_AREA_CODE_PLACEHOLDER,
"City": "CITY_NAME_PLACEHOLDER",
"PostalCode": "ZIP_CODE_PLACEHOLDER",
"OrderId": "ORDER_ID_PLACEHOLDER",
"LineItems": [
{
"item_code": "SKU_OR_PRODUCT_ID_PLACEHOLDER",
"name": "PRODUCT_NAME_PLACEHOLDER",
"price": UNIT_PRICE_PLACEHOLDER,
"qty": NUMBER_OF_UNITS_PLACEHOLDER,
"cat": "PRODUCT_CATEGORY_PLACEHOLDER",
"item_brand": "ITEM_BRAND_NAME_PLACEHOLDER"
}
],
"TD1": "CUSTOM_METADATA_1_PLACEHOLDER",
"TD2": "CUSTOM_METADATA_2_PLACEHOLDER"
}
]
}
NOTE: Any included
TD1-TD10values are automatically applied to all objects in theLineItemsarray.
Multiple user IDs per object
The following sections provide examples that show two valid ways to submit the same set of user IDs of different type in the Items object—one using the UserIdArray format and the other using individual ID fields.
Multiple user IDs included as an array
This POST /providerapi/offlineconversion request example demonstrates how to use the compact UserIdArray format. You can bundle multiple IDs (up to 20) into a single array of [type, id] pairs. For ID type integer mappings, see Supported ID types.
IMPORTANT: When using the
UserIdArrayproperty, you must define its structure using theUserIdArrayMetadataFormatproperty. This must be set to["type", "id"]—in this exact order of values—wheretypeis an integer mapped to the user ID type, andidis an ID value as a string. For details, see theUserIdArrayproperty description.
{
"DataProviderId": "DATA_PROVIDER_ID_PLACEHOLDER",
"UserIdArrayMetadataFormat": ["type", "id"],
"Items": [
{
"TrackingTagId": "TRACKING_TAG_ID_PLACEHOLDER",
"TimestampUtc": "EVENT_DATETIME_PLACEHOLDER",
"UserIdArray": [
[0, "TDID_PLACEHOLDER"],
[1, "DAID_PLACEHOLDER"],
[2, "UID2_PLACEHOLDER"]
[3, "UID2_TOKEN_PLACEHOLDER"],
[4, "EUID_PLACEHOLDER"],
[5, "EUID_TOKEN_PLACEHOLDER"]
[6, "RAMP_ID_PLACEHOLDER"]
]
// Additional event metadata goes here.
}
]
}
For real-world use cases and request samples, see Conversion event data examples and Merchant event data examples.
Multiple user IDs included individually
This POST /providerapi/offlineconversion request example demonstrates how to include individual user ID fields directly within the object.
IMPORTANT: Each included ID must be of different type.
{
"DataProviderId": "DATA_PROVIDER_ID_PLACEHOLDER",
"Items": [
{
"TrackingTagId": "TRACKING_TAG_ID_PLACEHOLDER",
"TimestampUtc": "EVENT_DATETIME_PLACEHOLDER",
"TDID": "TDID_PLACEHOLDER",
"DAID": "DAID_PLACEHOLDER",
"UID2": "UID2_PLACEHOLDER",
"UID2_TOKEN": "UID2_TOKEN_PLACEHOLDER",
"EUID": "EUID_PLACEHOLDER",
"EUID_TOKEN": "EUID_TOKEN_PLACEHOLDER",
"RampID": "RAMP_ID_PLACEHOLDER"
// Additional event metadata goes here.
}
]
}
For real-world use cases and request samples, see Conversion event data examples and Merchant event data examples.
Request object properties
The following table lists the POST /providerapi/offlineconversion request object properties.
| Property | Required? | Data Type | Description |
|---|---|---|---|
DataProviderId |
Required | String | The provider ID supplied to you by your Technical Account Manager. IMPORTANT: If you use a non-merchant tracking tag, the data provider ID must match the OfflineDataProviderId field in your tracking tag. |
Items |
Required | Object Array | The Items property is a list of data for offline conversion events.You can add multiple IDs of different types to an item object. For object properties, see Items object. |
UserIdArrayMetadataFormat |
Required only if UserIdArray is used |
String Array | Specifies the metadata format for entries in the UserIdArray property is provided in one or more objects in the Items array.IMPORTANT: This field must be always set to ["type", "id"](only in this exact order) when the UserIdArray is used as shown in this example. Any other order or variation is not allowed. |
Items object properties
Here's what you need to know about the object properties in the Items array:
- The
Itemsobject can contain multiple ID types, but only one ID of the same type is allowed in each object of theItemsobject array. For example, you must not include twoTDIDvalues. See also Multiple user IDs included individually. - If you need to include multiple user IDs of the same kind in the same item object, use the
UserIdArrayarray. - You can mix formats for passing single and multiple user IDs within the same request.
- If an
ImpressionIdvalue is provided for an item, no user IDs are required. The TDID of the item will be set to an all-zero GUID. - Product catalog data for merchants requires additional fields beyond the standard schema. For example,
MerchantId,EventName,OrderId, andLineItems. See also Merchant event data examples. - Any included
TD1-TD10values are automatically applied to all objects in theLineItemsarray.
For real-world use cases and request samples, see Conversion event data examples and Merchant event data examples.
The following table lists the Items object properties for offline conversion events.
| Property Name | Required? | Data Type | Description | Example |
|---|---|---|---|---|
ID_TYPE_PLACEHOLDER |
Required only if ImpressionId is not provided. |
String | A supported ID type. IMPORTANT: The Items object can contain multiple ID types, but only one ID of the same type is allowed in each object of the Items object array. For example, you must not include two TDID values. |
UID2Token |
ImpressionId |
Optional | GUID | The 36-character string (including dashes) generated to link the conversion to the impression record. NOTE: If provided with no other ID in the array, the TDID of the item will be set to an all-zero GUID. |
49gCBlwj-9d33-0927-s9g7-sd7nF3D248d5 |
UserIdArray |
Optional | Object array | An array for uploading multiple user IDs. Here's what you need to know about using this property:
|
Multiple user IDs per object |
TrackingTagId |
Required | String | The ID of the offline tracking tag created using the tracking tag endpoints. See also Offline conversion events. | bjsks98 |
ClientIPAddress |
Optional | String | The client's IP address associated with the conversion event. | 198.51.100.7 |
ReferrerUrl |
Optional | String | The URL of the web page associated with the conversion event. | https://www.example.com/ |
TimestampUtc |
Required | String | The timestamp indicating when the conversion event occurred, in UTC, using the ISO 8601 format. The value must not be set to a future time. | 2022-03-23T22:11:13.1341903Z |
Value |
Optional | Decimal | The monetary value of this conversion as a decimal. | 19.98 |
ValueCurrency |
Optional | String | The currency of the Value field amount. |
USD |
Country |
Optional | String | The full name of the country where the conversion occurred. | United States |
Region |
Conditionally required | String | Required if the Country field is set. The full name or code of the geographic region (such as a state, province, or territory) where the conversion occurred. |
NY, New York |
NielsenDMA* |
Optional | Integer | The numerical metropolitan area geotargeting code where the conversion occurred. | 501 |
City |
Optional | String | The city where the conversion occurred. | US NYC |
PostalCode |
Optional | String | The postal or ZIP code where the conversion occurred. | 10004 |
PrivacySettings |
Optional | Object array | User privacy settings based on data privacy consent processing. For object properties, see Privacy Settings object properties. IMPORTANT: Since this endpoint is designed to receive offline or batched events, advertisers are expected to filter out non-consented events before submission. This setting is optional and intended only for cases where filtering non-consented events is not feasible for the advertiser. |
Conversion event data examples |
MerchantId |
Required for uploading merchant product catalog data | String | The numeric platform ID of the merchant assigned by The Trade Desk to the merchant during the onboarding process. | 11001 |
EventName |
Required for uploading merchant product catalog data | String | The type of event defined by the partner platform. Use a supported event listed in the Event mapping section or create a new event in the Events Tracking tab of the Advertiser Data (One) tile in the platform UI. For details, see Event Tracking in the Knowledge Portal. | purchase |
OrderId |
Required for uploading merchant product catalog data | String | The unique identifier for a transaction or conversion event, with a maximum length of 64 characters. | abc123XyZ |
LineItems |
Required for uploading merchant product catalog data | Object array | One or more items in the order. For object properties, see LineItem object properties. | Merchant event data examples |
TD1 - TD10 |
Optional | String | Optional reporting fields used for categorization or other organization with the maximum length of 64 characters. NOTE: Any included TD1-TD10 values are automatically applied to all objects in the LineItems array. |
N/A |
* © 2026, The Nielsen Company (US), LLC. The DMA® data is used pursuant to a license from The Nielsen Company (US), LLC. Any use and/or reproduction of these materials without the express written consent of The Nielsen Company (US), LLC, is strictly prohibited. DMA® data is valid for the period 2025 - 2026. DMA® is a registered service mark of The Nielsen Company (US), LLC and is used pursuant to license.
Supported ID types
The following table lists the ID types currently supported in the Items object, including their corresponding integer mapping values required when uploading IDs as an array (UserIdArray).
NOTE: If you provide an
ImpressionIdvalue in theItemsarray, no other ID is required. Otherwise, each item object in theItemsarray must have at least one supported ID type.
| Integer Mapping | ID Type | Data Type | Description |
|---|---|---|---|
0 |
TDID |
GUID | The Trade Desk 36-character GUID (including dashes) for this user. |
1 |
DAID |
GUID | The raw device ID for this user, sent in 36-character GUID format (including dashes). Use the iOS ID for advertisers (IDFA) or Android advertising ID (AAID). |
2 |
UID2 |
String | The raw UID2 value, also known as UID2. This value is case-sensitive. Raw UID2s are generated and managed using UID2 APIs. See also Unified IDs. |
3 |
UID2Token |
String | The encrypted UID2 token, also known as an advertising token. This token is case-sensitive. Tokens are generated and managed using UID2 APIs. For details about UID2 APIs, see UID2 Endpoints. For details about UID2 tokens, see Raw IDs vs. tokens. |
4 |
EUID |
String | The raw European Unified ID value, also known as EUID. This value is case-sensitive. EUID offers user transparency and privacy controls designed to meet market requirements in European regions with the same normalization and encoding of PII as UID2. See also European Unified ID Overview. |
5 |
EUIDToken |
String | The encrypted EUID token, also known as an advertising token. This token is case-sensitive. For details, see Unified IDs. |
6 |
RampID |
String | The 49-character or 70-character RampID (previously known as IdentityLink). IMPORTANT: This must be a RampID from LiveRamp that is mapped specifically for The Trade Desk. For details about mapping a RampID, see LiveRamp documentation. |
For real-world use cases and request samples, see Conversion event data examples and Merchant event data examples.
Event mapping
The Trade Desk provides a list of events that you can track without any additional configuration. Here's what you need to know about the event names list:
- The list is ordered from bottom-funnel actions, such as purchases (which are most desired), to top-funnel actions (that occur less consistently or are less critical).
- Some event names have similar functions (for example,
initiatecheckoutandstartcheckout) and are shown together. You can use whichever one, depending on your business needs. - To configure and manage additional events as a merchant with a product catalog, you need to use the platform UI. For details, see Event Tracking in the Knowledge Portal.
| Event Name | User Action |
|---|---|
purchase |
The user completed a purchase and has the Thank You page displayed. |
donate |
The user donated to the business or a cause. |
subscribe |
The user subscribed to a service or content offering. |
reserve |
The user made a reservation. |
starttrial |
The user started a free trial. |
applicationapproval |
The user's application was approved. |
submitapplication |
The user submitted an application. |
initiatecheckout |
The user started the checkout process. TIP: There is no functional difference between initiatecheckout and startcheckout. Choose the one that aligns best with your own internal systems. |
startcheckout |
The user started the checkout process. TIP: There is no functional difference between initiatecheckout and startcheckout. Choose the one that aligns best with your own internal systems. |
addpaymentinfo |
The user added payment information during checkout. |
addbilling |
The user added or updated their billing information. |
addtocart |
The user added an item to the shopping cart. |
addtowishlist |
The user added an item to the wish list. |
wishlistitem |
The user added an item or SKU number to the wish list. |
customizeproduct |
The user customized a product configuration. |
viewcart |
The user viewed the contents of the shopping cart. |
viewitem |
The user viewed an item or SKU number. |
viewcontent |
The user viewed a specific piece of content, such as a product or landing page. |
viewcategory |
The user viewed a category page. |
listview |
The user viewed a list of items. |
pageview |
The user viewed a page on the site. |
searchitem |
The user searched for an item or SKU number. |
searchcategory |
The user searched for a category. |
search |
The user performed a search on the site or app. |
sitevisit |
The user visited the site. |
login |
The user logged in to the site. |
contact |
The user contacted the business (for example, by chat, email, or phone). |
messagebusiness |
The user sent a message to the business or contacted the business via form or email. |
direction |
The user requested and received directions to the business. |
findlocation |
The user searched for or requested a store or business location. |
share |
The user shared content, a product, or a promotion. |
save |
The user saved content or an item to revisit later. |
rate |
The user rated a product or service. |
schedule |
The user scheduled an appointment or visit. |
invite |
The user invited another person to use the product or service. |
watchvideo |
The user watched a video. |
download |
The user downloaded a file or asset. |
adclick |
The user clicked an ad. |
adview |
The user viewed an ad. |
lead |
The user submitted their information as a lead. |
submitform |
The user submitted a form. |
completeregistration |
The user completed a registration or sign-up form. |
levelcomplete |
The user completed a level in a game or experience. |
Privacy Settings object properties
IMPORTANT: Since this endpoint is designed to receive offline or batched events, advertisers are expected to filter out non-consented events before submission. This setting is optional and intended only for cases where filtering non-consented events is not feasible for the advertiser.
The following table lists the PrivacySettings object properties.
| Property Name | Required? | Data Type | Description | Example | Notes |
|---|---|---|---|---|---|
privacy_type |
Required | String | Specifies the applicable privacy regulation based on the user's geographical location:
|
GDPR |
Only one value per PrivacySettings object. |
is_applicable |
Required | Boolean | Indicates if the value specified in the privacy_type property is applicable. |
true or 1 |
Must always be set to true if the privacy_type property is populated. |
consent_string |
Required | String | The user's consent when the privacy regulations are in effect. The format depends on the privacy_type property value:
|
N/A | For details, see the IAB documentation on the Transparency and Consent Framework and Global Privacy Platform. |
Line Items object properties
Here's what you need to know about the LineItems array:
- This object is required for uploading product catalog data for merchants.
- Any included
TD1-TD10values are automatically applied to all objects in theLineItemsarray.
The following table lists the LineItems object properties that contain merchant product catalog line item information.
| Property Name | Required? | Data Type | Description | Example |
|---|---|---|---|---|
item_code |
Required | String | The item identifier (such as SKU). | #3234567894 |
name |
Optional | String | The name associated with the item code with the maximum length of 150 characters. If not provided, the information is pulled from the catalog for the specified item_codevalue. |
Lemon Sandwich Creme Cookies, Family Size, 25 oz |
qty |
Optional | Integer | The number of items in the order for the item code. | 12 |
price |
Optional | Decimal | The unit price of the item. | 9.99 |
cat |
Optional | String | The item category ID. If not provided, the information is pulled from the catalog for the specified item_codevalue.NOTE: The API uses the provided value in all cases except when a merchant has a product catalog with the specified item code in it, but with a different category ID. In this case, the product catalog category ID will be used. |
1110 |
item_brand |
Optional | String | The brand name of the item. | Cookie Brand Name |
For real-world use cases and request samples, see Merchant event data examples.
Versioning
Two versions of the Data API are available. The difference is the response format. For details, see API versions. This documentation includes both versions of the response error information.
API versions
Version 2 of the Data API is available, and includes improvements to the API response. Version 1 is fully supported, but is being deprecated. We recommend upgrading as soon as possible.
To use version 2, see Response (v2).
For details on the version timeline, see Data API version 2 with improved error handling and response format.
The following table compares the two versions.
| Comparison aspect | Version 1 (default) | Version 2 (recommended) |
|---|---|---|
| HTTP status codes | Inconsistent and sometimes not general (for example, 400 BadRequest instead of 401 Unauthorized for an authentication issue) |
Two types of improvement:
|
| Deserialization errors | Entire request fails | Per-item errors surfaced in FailedLines |
FailedLines error codes |
Compact, undocumented | Named codes with full reference |
FailedLine properties |
TDID, DataName, ErrorCode, Message |
Adds ItemNumber |
| Response message format for failed requests | Plain string | JSON with ErrorCode and Message fields |
| Consistency of error responses for failed requests | Varies by endpoint | Consistent across endpoints |
| Requires custom header | No | Yes: see Using the custom header |
Using the custom header
To use version 2, add the following custom header:
- Header name:
TTD-Version - Value:
2
For example: TTD-Version: 2
NOTE: The custom header is required only if you want to use a version that is not the default. Valid values for this header are
1or2, and if you're using the default version, currently version 1, there is no need to include the extra header.
What you need to know
Here's what you need to know about returned responses for both versions:
- If the entire request fails with no items processed, an error response is returned.
- If the
FailedLinesarray is empty, all items succeeded.
IMPORTANT: A
200 OKstatus code does not indicate complete success. Always check theFailedLinesarray for line-level errors.
Response (v2)
To use version 2, you'll need to:
- Use a new custom header. For details, see Using the custom header.
- Update how you parse error responses. The new responses are in JSON format.
The following sections provide details about success and failed responses for version 2, including response format, response examples, and error messaging.
Success response (v2)
If the request is successful, the response has an HTTP status code of 200 OK and includes a FailedLines array with details of any items that were not processed.
Success response example (v2)
The following is an example of a success response with one FailedLines entry:
{
"FailedLines": [
{
"ErrorCode": "ItemDeserializationError",
"Message": "Item number 2: A deserialization error occurred. Could not find member 'xTDID' on object of type 'AdvertiserDataItem'. Path 'Items[1].xTDID', line 14, position 16.",
"ItemNumber": "2"
}
]
}
Success response object properties
The following table lists the object properties for a successful response.
| Property | Data type | Description |
|---|---|---|
FailedLines |
Object Array | If all lines are successful, this array is returned empty. Otherwise, it lists any lines that failed, which you can use to troubleshoot errors that occurred in your request. For object properties, see Failed Line object properties (v2). |
FailedLine object properties (v2)
The following table lists the FailedLine object properties for version 2 of the Data APIs.
| Property | Data type | Description |
|---|---|---|
TDID |
GUID | The Trade Desk 36-character GUID (including dashes) for this user. Included in the response only if applicable. |
DataName |
String | The segment name specified for the ID in the request. Included in the response only if applicable. |
ItemNumber |
String | The index of the failed item in the request. |
ErrorCode |
String | For details, see FailedLine error codes and messages (v2). |
Message |
String | For details, see FailedLine error codes and messages (v2). |
FailedLine error codes and messages (v2)
The following table lists the error codes that might be returned from this endpoint in a FailedLine entry in the FailedLines object, with the reason for each error. This information is for version 2 of the Data API.
| Error code | Reason |
|---|---|
MissingOrInvalidTDIDAndImpressionId |
No TDID could be resolved and no valid ImpressionId was present. |
MissingOrInvalidTrackingTagId |
The TrackingTagId on the item is not valid. |
InvalidMerchantId |
The MerchantId is invalid. |
InvalidTimestamp |
The item's TimestampUTC value is invalid. |
InvalidUserIdTypeOrUserId |
A UserIdArray contains an unrecognized identity type or an invalid ID value. |
Unauthorized |
Caller lacks permission for the item's tracking tag. |
ItemDeserializationError |
A deserialization error occurred while processing the item. |
Failed response (v2)
If the request fails with no lines processed, a failed response is returned.
Failed response example (v2)
The error response is JSON and includes ErrorCode and Message properties. For example, the following response would return a 403 Forbidden HTTP status code:
{
"ErrorCode": "TargetingDataLimitReached",
"Message": "The maximum allowed targeting data elements limit for the specified advertiser/data provider has been reached."
}
Failed response object properties (v2)
The following table lists the object properties for a failed response.
| Property | Data type | Description |
|---|---|---|
ErrorCode |
String | For details, see FailedLine error codes and messages (v2). |
Message |
String | For details, see FailedLine error codes and messages (v2). |
Failed response error codes and messages (v2)
The following table provides a list of common failed response errors and their respective HTTP status codes.
| HTTP status code | Error code | Reason |
|---|---|---|
| 400 (Bad Request) | UnknownRequest |
The requested resource could not be recognized. |
| 400 (Bad Request) | IncorrectContent |
A field in the request body contains an invalid value. |
| 400 (Bad Request) | MissingData |
A required field in the request body was absent or empty. |
| 400 (Bad Request) | SerializationFailed |
Request body could not be deserialized - verify the JSON is valid and matches the expected schema. |
| 401 (Unauthorized) | AuthenticationFailed |
The provided credentials could not be authenticated - verify credentials. |
| 401 (Unauthorized) | InvalidToken |
The provided token is invalid - verify token. |
| 403 (Forbidden) | IncorrectPermissions |
The provided credentials lack the required permissions for the specified ID. |
| 403 (Forbidden) | AdvertiserMisconfigured |
The provided AdvertiserId is not configured to send data on the requested resource. |
| 403 (Forbidden) | DataProviderMisconfigured |
The provided DataProviderId is not configured to send data on the requested resource. |
| 403 (Forbidden) | MerchantMisconfigured |
The provided MerchantId is not configured to send data on the requested resource. |
| 403 (Forbidden) | TargetingDataLimitReached |
The maximum allowed targeting data elements limit for the specified advertiser/data provider has been reached. |
| 404 (Not Found) | EndpointNotConfigured |
The requested endpoint is not configured to accept this type of request. |
| 413 (Content Too Large) | MaxRequestSizeExceeded |
Request payload exceeds the maximum allowed size. |
| 429 (Too Many Requests) | N/A | Rate limit for an API endpoint was exceeded. |
IMPORTANT: When the rate limit for an API endpoint is exceeded, the server returns a 429 status code and prevents execution. Your code must be able to handle this type of error. For example, upon receiving a 429 error, wait up to one hour before retrying or reduce request volume to remain within rate limits. See also Rate limits.
Response (v1, legacy)
Version 1 is the default. The following sections provide details about error responses for version 1, including response format and error messaging.
TIP: For general information about offline measurement, FAQs, and other details, see Offline conversion events.
Success response object properties
The following table lists the POST /providerapi/offlineconversion object properties for a successful response.
| Property | Data Type | Description |
|---|---|---|
FailedLines |
Object Array | If all lines are successful, this array is returned empty. Otherwise, it lists any lines that failed, which you can use to troubleshoot errors that occurred in your request. For object properties, see Failed Line object properties (v1). |
FailedLine object properties (v1)
The following table lists the FailedLine object properties.
| Property | Data Type | Description |
|---|---|---|
TDID |
GUID | The Trade Desk 36-character GUID (including dashes) for this user. |
DataName |
String | The segment name specified for the ID in the request. |
ItemNumber |
String | The index of the failed item in the request. |
ErrorCode |
String | For details, see Error codes and messages. |
Message |
String | For details, see Error codes and messages. |
Failed response error codes and messages (v1)
The following table provides a list of common errors and their respective HTTP error codes.
| ID | Error Case | HTTP Response | Error Message Example |
|---|---|---|---|
| 1 | Request sent without any body (empty). | 400 Bad Request | "Missing request data." |
| 2 | Request sent without TTD signature HEADER attribute. | 400 Bad Request | "Requests must have a TtdSignature header value." |
| 3 | Request sent with incorrect TTD signature in HEADER. | 400 Bad Request | "The signature does not match the request body for provider: 'abcdefgh'." |
| 4 | Requested provider does not have a secret key | 400 Bad Request | "This provider has not been configured to accept data: ‘abcdefgh'." |
| 5 | Request sent with an empty 'Items attribute' array. | 400 Bad Request | "Items attribute must be a non-empty list." |
| 6 | General processing error (possible invalid values in the Items array). |
400 Bad Request | "A deserialization error occurred." |
| 7 | One or more items do not contain a merchant ID and the Data Provider ID does not match the OfflineDataProviderId field in the tracking tag |
400 Bad Request | "The data provider 'dataproviderABC' does not match the offline provider 'dataproviderDEF' on tracking tag 'abcdefg'." |
| 8 | One or more items contain an invalid merchant ID. | 400 Bad Request | "The merchantId 12345 is invalid and so cannot be used with the CAPI endpoint." |
| 9 | Tracking tag does not belong to the merchant. | 400 Bad Request | "The merchantId 12345 is not configured to allow events for tracking tag 'abcdefg' via the CAPI endpoint." |
| 10 | Missing or invalid TrackingTagId property. |
200 OK | "Invalid tracking tag ID was provided, item number 1." |
| 11 | ID is not provided or provided ID is invalid when there is no impression ID. | 200 OK | "A valid TDID, DAID, UID2, UID2Token, RampID, EUID, or EUIDToken must be provided when there is no ImpressionId, item number 1." |
| 12 | Provided ID is not valid when there is an impression ID. | 200 OK | "Provided TDID, DAID, UID2, UID2Token, RampID, EUID, or EUIDToken is not valid, item number 1." |
| 13 | Provided timestamp is set to a future time. | 200 OK | "Timestamp cannot be a future time, item number 1." |
| 14 | Request includes a UserIdArray list but is missing the required UserIdArrayMetadataFormat property. |
400 Bad Request | "UserIdArrayMetadataFormat cannot be null if UserIdArray is provided." |
| 15 | Request includes the UserIdArrayMetadataFormat property with incorrect format. |
400 Bad Request | "UserIdArrayMetadataFormat must contain "type" and "id"." |
| 16 | Request sent with an invalid user ID or user ID type. | 200 OK | "Invalid user ID type 9 in line 1, item number 1." or "Invalid user Id XY3001RNflf2z1F1N-gq in line 1, item number 1." |