TrayiStats Logo

The Source of Truth for Supply Chain Data

Integrate real-time inventory, logistics, and supply chain intelligence directly into your applications with the Trayistats Supply API.

Why Trayistats?

Built for developers who need reliability and speed at scale. We handle the complexity of global logistics data so you don't have to.

Low Latency

Engineered for speed with edge caching, delivering responses in under 50ms worldwide.

Global Coverage

Unified data model aggregating sources from over 120 countries and 500+ carriers.

Developer Friendly

Type-safe SDKs available for Node.js, Python, and Go. Comprehensive OpenAPI specs.

Quick Start Example

Fetch available surveys with a single API call.

GET /supply/api/available-surveys
cURLNode.jsPython
# Fetch available surveys
curl -X GET \
"https://surveys.trayistats.com/supply/api/available-surveys" \
-H "accept: application/json"
{
  "success": "boolean",
  "data": {
    "Total": "number",
    "Items": [
      {
        "surveyId": "string | null",
        "title": "number",
        "completeGoal": "number",
        "CompleteRequired": "number",
        "loi": "number",
        "ir": "number",
        "cost": "number (decimal)",
        "countryLocaleId": "number",
        "launchedAt": "string (ISO 8601 datetime)",
        "lastUpdated": "string (ISO 8601 datetime)",
        "deduplicationStatus": "number",
        "AssociatedClientId": "string",
        "IsPulledSurvey": "number",
        "link": "string"
      }
    ]
  }
}

Environments

Base URLs for the TrayiStats Supply API. Use the Sandbox environment for testing and integration.

Sandbox Endpoint

Testing
https://surveys-sandbox.trayistats.com/supply/api

Production Endpoint

Live
https://surveys.trayistats.com/supply/api

Authentication Required

All endpoints require a valid API key passed in the header.

Best Practice

Survey & Attribute API Refresh Behavior

Understanding the refresh behavior and parameter requirements of each API endpoint is essential for efficient integration and optimal system performance.

Qualification Parameters

Format: URL Query Parameters

Qualifications are passed as query parameters using the format Q{AttributeID}={Value}.

Single Select: Q417=65

Multi Select: Q418=3677,3678 (Comma-separated)

Open Ended: Q101=25

Constraint: Value parts must not exceed 64 characters.

Available Surveys API

Refresh Interval: 15 minutes

The Available Surveys API is refreshed automatically every 15 minutes. This ensures that API consumers receive an up-to-date list containing only active surveys, while paused or inactive surveys are excluded from the response.

Integration Recommendation: Poll this endpoint at 15-minute intervals to maintain synchronization with the system's refresh cycle and ensure respondents are directed only to active projects.

Survey Attributes API

Refresh Behavior: Lifecycle-based

The Survey Attributes API provides attribute data when a survey is created or updated. This data remains consistent throughout the survey's lifecycle and does not change unless the survey is explicitly modified.

Integration Recommendation: Retrieve survey attributes once when a new survey becomes available, or when you detect a change in the survey's lastUpdated timestamp. Frequent polling is unnecessary.

Attributes API

Refresh Behavior: Static metadata

The Attributes API functions as a metadata reference and is independent of survey availability. Attribute definitions (such as demographic questions and response options) do not change based on survey status or activity.

Integration Recommendation: Cache attribute metadata locally. This endpoint requires minimal refresh calls—typically only when adding support for new locales or when notified of metadata updates.

API Reference

The TrayiStats Supply API allows you to programmatically manage surveys, retrieve country lists, and access survey attributes.

Available Surveys

Retrieves a list of all surveys currently live and available for the authenticated supply partner. This endpoint supports pagination and filtering by country and language.

GET
https://surveys.trayistats.com/supply/api/available-surveys

Headers

NameTypeRequired
access-keystringYes

A valid API access key is required for live endpoint access.

Survey Object

SurveyResponse
FieldTypeDescription
surveyIdstring | nullUnique identifier for the survey opportunity. Can be null.
titlenumberInternal title or ID of the survey.
completeGoalnumberTotal number of completes desired.
CompleteRequirednumberThe count of completes still required.
loinumberEstimated Length of Interview in minutes.
irnumberHistorical Incidence Rate (0-100).
costnumberCost Per Interview (CPI) in USD.
countryLocaleIdnumberIdentifier for the country and locale.
launchedAtstringTimestamp of survey launch (ISO 8601).
lastUpdatedstringTimestamp of the last update (ISO 8601).
deduplicationStatusnumberDeduplication setting status.
AssociatedClientIdstringUnique identifier for the associated client.
IsPulledSurveynumberFlag indicating if the survey is pulled (0 or 1).
linkstringThe survey entry link with placeholders.

Response Codes

200 OK

Request was successful and returns a list of surveys.

400 Bad Request

Invalid query parameters supplied.

401 Unauthorized

API Key is missing or invalid.

429 Too Many Requests

Rate limit exceeded.

Example Response

Key
Value
CURL PREVIEW
RESPONSE
{
  "success": "boolean",
  "data": {
    "Total": "number",
    "Items": [
      {
        "surveyId": "string | null",
        "title": "number",
        "completeGoal": "number",
        "CompleteRequired": "number",
        "loi": "number",
        "ir": "number",
        "cost": "number (decimal)",
        "countryLocaleId": "number",
        "launchedAt": "string (ISO 8601 datetime)",
        "lastUpdated": "string (ISO 8601 datetime)",
        "deduplicationStatus": "number",
        "AssociatedClientId": "string",
        "IsPulledSurvey": "number",
        "link": "string"
      }
    ]
  }
}

Get Survey by ID

Retrieve detailed configuration, question structure, and aggregate statistics for a specific survey using its unique identifier. This endpoint includes metadata about response rates.

GET
https://surveys.trayistats.com/supply/api/survey

Path Parameters

ParameterTypeDescription
surveyId
required
stringThe unique identifier of the survey you want to retrieve. Example: srv_12345

Query Parameters

ParameterTypeDescription
include_metadata
booleanWhether to include aggregate statistics (view count, completion rate) in the response object. Defaults to false.
expand
arrayExpand nested objects. Available values: questions, theme.

Survey Object

SurveyResponse
FieldTypeDescription
surveyIdstring | nullUnique identifier for the survey opportunity. Can be null.
titlenumberInternal title or ID of the survey.
completeGoalnumberTotal number of completes desired.
CompleteRequirednumberThe count of completes still required.
loinumberEstimated Length of Interview in minutes.
irnumberHistorical Incidence Rate (0-100).
costnumberCost Per Interview (CPI) in USD.
countryLocaleIdnumberIdentifier for the country and locale.
launchedAtstringTimestamp of survey launch (ISO 8601).
lastUpdatedstringTimestamp of the last update (ISO 8601).
deduplicationStatusnumberDeduplication setting status.
AssociatedClientIdstringUnique identifier for the associated client.
IsPulledSurveynumberFlag indicating if the survey is pulled (0 or 1).
linkstringThe survey entry link with placeholders.

Response Codes

200 OK

Returns a Survey Object.

404 Not Found

If the survey with the provided surveyId does not exist.

Example Request

Key
Value
CURL PREVIEW
RESPONSE
{
  "success": "boolean",
  "data": {
    "Total": "number",
    "Items": [
      {
        "surveyId": "string | null",
        "title": "number",
        "completeGoal": "number",
        "CompleteRequired": "number",
        "loi": "number",
        "ir": "number",
        "cost": "number (decimal)",
        "countryLocaleId": "number",
        "launchedAt": "string (ISO 8601 datetime)",
        "lastUpdated": "string (ISO 8601 datetime)",
        "deduplicationStatus": "number",
        "AssociatedClientId": "string",
        "IsPulledSurvey": "number",
        "link": "string"
      }
    ]
  }
}

Survey Attributes

Retrieves a list of specific attributes associated with a survey based on the provided ID. This endpoint allows you to filter attributes by active status and limit the number of results returned for pagination purposes.

GET
https://surveys.trayistats.com/supply/api/survey-attributes

Query Parameters

NameTypeDescription
survey_idrequiredstringThe unique identifier of the survey.
include_inactivebooleanInclude archived or inactive attributes. Defaults to false.
limitintegerMaximum number of attributes to return. Max 100.

Attribute Object

Returns an array of objects with the following schema:

id
string
Unique identifier for the attribute.
name
string
The display name of the attribute (e.g., "Customer Satisfaction Score").
type
enum
The data type. One of: text, number, single_select, multi_select.
options
array<string>
Available options if type is select. Nullable.
created_at
timestamp
ISO 8601 formatted timestamp of creation.

Request

Key
Value
CURL PREVIEW
RESPONSE
{
  "success": true,
  "data": {
    "Total": "int",
    "Items": [
      {
        "attributeId": "int",
        "options": "array"
      }
    ]
  }
}

List all countries

Returns a list of all supported countries where supply data is available. The response includes the ISO code and default locale for each country.

GET
https://surveys.trayistats.com/supply/api/country

The Country Object

HTTP 200 OK

Each item in the response array represents a supported country entity.

FieldTypeDescription
idstringUnique identifier for the country resource.
namestringThe common English name of the country.
iso_2stringTwo-letter ISO 3166-1 alpha-2 country code.
localestringDefault locale code (e.g., 'en-US').
regionstringOptionalContinent or sub-region.

Response Codes

200 OK

Request was successful and returns a list of countries.

401 Unauthorized

API Key is missing or invalid.

Example Request

Key
Value
CURL PREVIEW
RESPONSE
{
  "success": true,
  "data": {
    "Total": "number",
    "Items": [
      {
        "id": "string",
        "localeName": "string",
        "localeCode": "string",
        "countryName": "string"
      }
    ]
  }
}

Attributes Endpoint

Manage and retrieve product attributes for various locales. This endpoint allows you to sync your internal product definitions with our global supply chain standards.

GET
https://surveys.trayistats.com/supply/api/attributes

Query Parameters

ParameterTypeRequired
locale_idstringRequired

The ISO code for the country (e.g., en-US). Determines the language and specific attribute availability.

Common Errors

400Bad Request

Invalid locale_id provided.

401Unauthorized

Authentication token is missing or invalid.

Example Request

200 OK

Response

Key
Value
CURL PREVIEW
RESPONSE
{
  "success": true,
  "countryLocaleId": null,
  "data": {
    "Total": "int",
    "Items": [
      {
        "name": "string",
        "id": "int",
        "text": "string",
        "type": "string",
        "options": [
          {
            "id": "int",
            "text": "string"
          }
        ]
      }
    ]
  }
}

Survey Stats

Get performance metrics and conversion statistics for a specific survey. This includes both vendor-specific and global completion counts.

GET
https://surveys.trayistats.com/supply/api/survey-stats

Query Parameters

NameTypeRequired
SurveyIdstringYes

Stats Object

SurveyStatsResponse
FieldTypeDescription
vendorCompletesnumberTotal number of completes achieved through the vendor.
globalCompletesnumberTotal number of completes achieved globally.
vendorConversionnumberConversion rate for the vendor (%)
globalConversionnumberGlobal conversion rate for the survey (%)

Response Codes

200 OK

Request was successful and returns a list of surveys.

400 Bad Request

Invalid query parameters supplied.

401 Unauthorized

API Key is missing or invalid.

429 Too Many Requests

Rate limit exceeded.

Request

Key
Value
CURL PREVIEW
RESPONSE
{
  "success": true,
  "data": {
    "success": true,
    "Total": 1,
    "Items": [
      {
        "vendorCompletes": 21,
        "globalCompletes": 68,
        "vendorConversion": 0,
        "globalConversion": 4.25
      }
    ]
  }
}

Security

Secure your integration by implementing exit link verification and rotate keys regularly.