FAQs
Support
Customer Login

CrescoData API

Welcome to our API integration page.

Use the CrescoData Commerce Connect Platform to integrate to over 100 commerce channels.

The available endpoints are on the left. Code examples are shown on the right. If you can’t find what you are looking for please email support@crescodata.com

Getting An ID Token

An ID Token is required to access all CrescoData APIs.

Once you receive an email with your CrescoData username and temporary password, follow the instructions in the email to reset the password.

You can then use our POST /auth/login API and include your new password, username and a clientId that we will provide you to retrieve an IdToken

The IdToken will be valid for 1 hour, after which you'll need the refresh it (see Refreshing Your ID Token).

The IdToken must be provided in all API calls under the Authorization header, for example:

request_headers = {
  "Authorization": login_response['Tokens']['IdToken']
}

Attributes

clientId
string
Required

The app client ID
password
string
Required

The user's password
username
string
Required

The username

Return Body

ChallengeName
string

A challenge name. Will only be returned if a password reset is required. If you've reset your password through the management portal, this should always be null and can be ignored.
ChallengeParameters
object

The challenge parameters. Will only be returned if a challenge is required. If you've reset your password through the management portal, this should always be null and can be ignored.
Session
string

The session. Will only be returned if a challenge is required. If you've reset your password through the management portal, this should always be null and can be ignored.
Tokens
object

The tokens to be stored for API Calls.
AccessToken
string

An access token. This token can be ignored and is not used at the moment.
ExpiresIn
integer

The amount seconds to when the IdToken will expire
IdToken
string

The token that is required to be given in the Authorization header for all API calls
RefreshToken
string

A refresh token to be used to renew your IdToken when it expires
TokenType
string

The type of token
POST /auth/login
import requests body = {'clientId': '3dbog2ulfp35us0c5p9enks5t4', 'password': '$MyGreatPassword1#', 'username': 'john.doe'} headers = None params = None response = requests.post('https://api-dev.crescodata.com/auth/login', params=params, headers=headers, json=body)
Return Sample for POST /auth/login
{ "Tokens": { "AccessToken": "<base64 encoded token>", "ExpiresIn": 3600, "IdToken": "<base64 encoded token>", "RefreshToken": "<base64 encoded token>", "TokenType": "Bearer" } }

Refreshing Your ID Token

You'll be required to refresh your IdToken once it's expired.

Our API will return a 401 http status code if an expired IdToken is used in the Authorization header.

Your Cresco API integration should handle capturing this status code across all authenticated APIs and call the token refresh API below in order to obtain a new IdToken

Attributes

clientId
string
Required

The app client ID
refreshToken
string
Required

The refresh token

Return Body

ChallengeName
string

A challenge name. Will only be returned if a password reset is required. If you've reset your password through the management portal, this should always be null and can be ignored.
ChallengeParameters
object

The challenge parameters. Will only be returned if a challenge is required. If you've reset your password through the management portal, this should always be null and can be ignored.
Session
string

The session. Will only be returned if a challenge is required. If you've reset your password through the management portal, this should always be null and can be ignored.
Tokens
object

The tokens to be stored for API Calls.
AccessToken
string

An access token. This token can be ignored and is not used at the moment.
ExpiresIn
integer

The amount seconds to when the IdToken will expire
IdToken
string

The token that is required to be given in the Authorization header for all API calls
RefreshToken
string

A refresh token to be used to renew your IdToken when it expires
TokenType
string

The type of token
POST /auth/token/refresh
import requests body = {'clientId': '3dbog2ulfp35us0c5p9enks5t4', 'refreshToken': '<your RefreshToken from login call>'} headers = None params = None response = requests.post('https://api-dev.crescodata.com/auth/token/refresh', params=params, headers=headers, json=body)
Return Sample for POST /auth/token/refresh
{ "Tokens": { "AccessToken": "<base64 encoded token>", "ExpiresIn": 3600, "IdToken": "<base64 encoded token>", "RefreshToken": "<base64 encoded token>", "TokenType": "Bearer" } }

Create a Merchant

If you're a CrescoData customer, you can create multiple merchants under your account.

Creating a merchant using our Management Portal or Branded Portal is the simplest way. Alternatively, you can create merchants via our API. See Add a company.

If you've created a merchant through our API, you should save a mapping between the auto-generated CrescoData companyId and your internal merchant identifier in your system to prevent duplicates and re-creating the merchant.

You can view your newly created merchant in our Management or Branded Portal or by using the Get a company API.

You can now start Creating Services for your merchant

Create Merchant Services

A merchant can have multiple sync services, for example Products and Orders sync.

Typically, each sync service for your merchant will have 1 source (for example Shopify) and 1 or more destinations (for example Amazon US and Ebay Australia).

The simplest way to create services for your merchant is by using our Management or Branded Portal. See Add an integration if you would like to use our API to create merchant services instead.

Once services are setup and activated for your merchant, you can start synchronizing data. Depending on how you're integrated, this could happen automatically or by sending us records.

Send Records

Once your merchant has active source service(s), you can optionally send items such as orders and products to it.

For example, if you want to send orders, use the integrationId of the merchant's active order source service (the integration where "syncType"="orders", "get"="true" and "active"="true")

Attributes

integrationId
string

The merchant's integrationId. The integrationId must be active and must be a source (have get=true) to successfully send a record to this integration.
items
array <object>
Required

The list of record objects
groupId
string

The group identifier of this record. Use to merge together different records into variants. Only set this to true if your record does not contain all the variants, and you need to combine variants together from a different future or past API calls
id
string
Required

The unique record identifier which will be used to determine whether to update or create this record on CrescoData. Send the same record, but with a different id, it will create a duplicate record on CrescoData.
merge
boolean

Whether to merge this record with one that exists already in our system. If record does not exist, this flag will be ignored.
record
One Of: object, null}
Required

The record object. The format of the record depends on the type of integration you have such as orders or products. Set this to null to mark this record as deleted.
requestId
string

The request ID, leave empty to get this auto generated

Return Body

requestId
string

Your request id. You can use this to query any errors.
POST /streams_batch
import requests body = {'integrationId': '11111111-2222-3333-4444-555555555555', 'items': [{'id': '123', 'record': {'id': '123', 'sample': 'test'}}]} headers = {"Authorization": "{IdToken}"} params = None response = requests.post('https://api-dev.crescodata.com/streams_batch', params=params, headers=headers, json=body)
Return Sample for POST /streams_batch
{ "requestId": "11111111-2222-3333-4444-555555555555" }

Create a New Order

If you're integrated to send records in CrescoData's format, use the attributes below and send it in the items.record in our POST /streams_batch API

Create a new order on CrescoData by providing as much information as possible in your payload based on our order schema below. Exclude any field that you do not want to provide. Sending null or empty text values will not be accepted.

Note: Any attribute(s) can be moved into variants or out of variants, depending on whether you want the attribute to be shared across all line items. For example, you can set the publish attribute under variants to specify it only for that line item, or on the top level to specify it across all line items. However, some attributes such as systemOrderId should always be specified on the top level, whereas others like systemOrderItemId should be specified under variants to prevent issues.

Attributes

addresses
object

The address object for this order
billing
object

The order's billing address
city
string

The city
company
string

The customer's company
country
string

The country code
Supported Values
AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW
email
string

The email of the customer
extra1
string

Any extra details for of the address
extra2
string

A second extra detail for of the address
latitude
number

The latitude of the location
locationId
string

A location ID for the address
longitude
number

The longitude of the location
name
string

The customer's name
phone1
string

The phone number of the customer
phone2
string

An extra phone number of the customer
state
string

The name of the state, example "California"
stateCode
string

The code state, example "CA"
street
string

The street address
zip
string

The zip / postal code for the address
shipping
object

The order's shipping address
city
string

The city
company
string

The customer's company
country
string

The country code
Supported Values
AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW
email
string

The email of the customer
extra1
string

Any extra details for of the address
extra2
string

A second extra detail for of the address
latitude
number

The latitude of the location
locationId
string

A location ID for the address
longitude
number

The longitude of the location
name
string

The customer's name
phone1
string

The phone number of the customer
phone2
string

An extra phone number of the customer
state
string

The name of the state, example "California"
stateCode
string

The code state, example "CA"
street
string

The street address
zip
string

The zip / postal code for the address
cancelledReason
string

The reason this order item was cancelled
cancels
array <object>

A list of cancellations
cancelId
string
Required

The quantity ordered for this item
cancelledReason
string

The reason this order item was cancelled
quantity
integer
min 0

The quantity cancelled for this item
confirmed
boolean

Whether the order has been confirmed
country
string

The country where the order was placed
Supported Values
AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW
createdAt
string

The date the order was created
currency
string

The currency for the price of this order item
Supported Values
AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BRL BSD BTC BTN BWP BYN BYR BZD CAD CDF CHF CLF CLP CNY COP CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GGP GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS IMP INR IQD IRR ISK JEP JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LTL LVL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD UYU UZS VEF VND VUV WST XAF XAG XAU XCD XDR XOF XPF YER ZAR ZMK ZMW ZWL
customerId
string

The system's customer ID who purchased this order
customerNewsletterSubscriber
boolean

Whether this customer accepts marketing
discountCodes
array <object>

A list of discount codes
amount
number
min 0

The amount discounted off the order
amountFundedBySeller
number
min 0

The amount discounted off the order is funded by seller
discountCode
string
Required

The discount code of the order
giftMessage
string

A plain text gift message for this order
invoiceData
string

The invoice data, either in PDF or HTML format encoded format
invoiceId
string

The invoice ID or number
invoiceTaxNumber
string

The tax number for the invoice
invoiceTaxOffice
string

The tax office for the invoice
invoiceUrl
string

The invoice url
isDropship
boolean

Whether the order is a dropship order
isGift
boolean

Whether the order was a gift
itemPaidPrice
number
min 0

The amount paid for this order item. Only required if item has been paid for
itemPrice
number
min 0

The price of this order item, before any sales, coupons or discounts
itemSalePrice
number
min 0

The sale price of this order item.
itemShippingCost
number
min 0

The shipping cost for this order item.
itemStatus
string

The status of the order item
Supported Values
readyToShip paid cancelled cancelPending cancelRejected cancelAccepted shipped pending picked completed returned awaitingPayment pendingAvailability awaitingPickup partiallyRefunded partiallyCancelled undelivered returnRejected returnCompleted returnReverted refunded
itemUnitPrice
number
min 0

The unit price of this order item.
itemWeight
number

The weight of the product
itemWeightUnit
string

The unit that the weight of the product is specified in
Supported Values
kg g lbs oz ton mg
link
string

The link to the order on the system
merchantProductId
string

The merchant's product ID for this order item
merchantVariantId
string

The merchant's product variant ID for this order item
messageToSeller
string

Any message to the seller regarding this order in plain text
orderDiscountAmount
number
min 0

The amount discounted off the order
orderDiscountCode
string

The discount code off the order
orderGmv
number
min 0

The GMV of the order
orderItemDiscountAmount
number
min 0

The amount discounted off the order item
orderItemTax
number
min 0

The tax of the order item
orderSubTotal
number

The sub total cost of this order
orderTotal
number

The total cost of this order, excluding coupons
orderTotalPaid
number

The total amount paid for this order
originalOrderId
string

The order ID used to update destination channels
originalOrderItemId
string

The order item ID used to update destination channels
paymentType
string

The payment type for the placed order
productName
string

The name of the ordered product
publish
boolean
Required

Whether or not this record should be published to connected systems
quantity
integer
min 0

The quantity ordered for this item
refundedShippingAmount
number

The shipping amount refunded
returns
array <object>

A list of returns
pickupAddress
object

The address of the pick up, if it's a pick-up return type
city
string

The city
company
string

The customer's company
country
string

The country code
Supported Values
AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW
email
string

The email of the customer
extra1
string

Any extra details for of the address
extra2
string

A second extra detail for of the address
latitude
number

The latitude of the location
locationId
string

A location ID for the address
longitude
number

The longitude of the location
name
string

The customer's name
phone1
string

The phone number of the customer
phone2
string

An extra phone number of the customer
state
string

The name of the state, example "California"
stateCode
string

The code state, example "CA"
street
string

The street address
zip
string

The zip / postal code for the address
pickupDate
string

The date the return will be picked up, if it's a pick-up return type
quantity
integer
min 0

The quantity returned for this line item return
refundBankAccount
string

The bank account used for the refund when using a credit card
refundBankName
string

The name of the bank used for the refund when using a credit card
refundBankNumber
string

The bank number used for the refund when using a credit card
refundMethod
string

The method of refund for this line item return, example: credit card
refundedAmount
number

The amount refunded for this line item return
returnId
string
Required

The unique return id required to identify this return and prevent duplicated returns being created
returnType
string

The type of the return for this line item, example: pickup or drop off
returnedReason
string

The reason this order item was returned
saleChannel
string

The sale channel for this order
shipments
array <object>

A list of shipments
quantity
integer
min 0

The quantity shipped for this line item shipment
shipmentId
string
Required

The shipment ID. Set this to the tracking id if you do not have a unique shipment identifier
shippingProvider
string

The shipping provider for this line item shipment
shippingType
string

The shipping type for this line item shipment
trackingId
string

The tracking id/number for this line item shipment
shippedAt
string

The date the order item was shipped
shippingCost
number

The shipping cost of this order
shippingDiscountAmount
number

The shipping discount amount of this order
shippingLabel
string

The shipping label, base64 encoded
shippingLabelId
string

The prefix of shipping label file store in shared company on s3
shippingMessage
string

Any shipping message for this order
shippingTax
number

The shipping tax cost of this order
sku
string

The sku of the order item
status
string
Required

The cresco order status
stockLocationId
string

The stock location id the quantity was retrieved from, if applicable
systemOrderId
string
Required

The ID of the order
systemOrderItemId
string
Required

The ID of the order item
systemOrderItemNumber
string
Required

The order item number
systemOrderNumber
string
Required

The order number where the order was placed
systemProductId
string

The system's product ID of this order item
systemStatus
string

The system's order status
systemVariantId
string

The variant id of the order item
tags
string

Tags plain text
tax
number
min 0

The amount of tax charged for this order, in dollar value
taxInclusive
boolean

Tax Inclusive flag
taxName
string

The name of the tax
taxRate
number
min 0

The amount of tax rate charged for this order item, in percentage
trackingId
string

The tracking id/number for this order item. Provide this under the shipments list if you support multiple shipments in a line item.
updatedAt
string

The date the order was last updated
variantName
string

The variant name of this order item
Create a New Order
{ "addresses": { "billing": { "name": "Test Person", "company": "CrescoData", "zip": "123456", "street": "address line 1", "city": "Singapore", "state": "Singapore", "email": "test@crescodata.com", "phone1": "12345677", "phone2": "45678910", "extra1": "address line 2", "extra2": "address line 3", "country": "SG" }, "shipping": { "name": "Test Person", "company": "CrescoData", "zip": "123456", "street": "address line 1", "city": "Singapore", "state": "Singapore", "email": "test@crescodata.com", "phone1": "12345677", "phone2": "45678910", "extra1": "address line 2", "extra2": "address line 3", "country": "SG" } }, "country": "SG", "createdAt": "2022-01-01T00:00:00+00:00", "currency": "SGD", "customerId": "customer_1", "saleChannel": "Amazon", "isGift": false, "isDropship": false, "link": "https://link/to/order.com", "messageToSeller": "Hello", "tax": 10, "taxRate": 10, "tags": "test, order-1", "orderDiscountAmount": 2.0, "orderDiscountCode": "DISCOUNT-2", "orderGmv": 100, "orderSubTotal": 100, "orderTotal": 100, "orderTotalPaid": 98, "paymentType": "credit card", "refundedShippingAmount": 0, "originalOrderId": "Amazon-Order-123", "shippingCost": 8, "shippingLabel": "https://link-to-the-label.com", "shippingMessage": "Knock on door", "shippingTax": 0, "status": "partiallyShipped", "systemOrderId": "1", "systemOrderNumber": "order-1", "systemStatus": "AWAITING_APPROVAL", "taxInclusive": true, "publish": true, "updatedAt": "2022-01-01T01:00:00+00:00", "variants": [ { "systemOrderItemId": "a1", "systemOrderItemNumber": "line-a1", "confirmed": true, "sku": "abc", "quantity": 2, "originalOrderItemId": "amazon-order-123-1", "productName": "My Product", "variantName": "Green / S", "itemPrice": 50, "itemUnitPrice": 25, "itemSalePrice": 50, "itemPaidPrice": 49, "itemShippingCost": 4, "itemStatus": "shipped", "orderItemDiscountAmount": 1, "orderItemTax": 5, "shipments": [ { "shipmentId": "tracking-123", "trackingId": "tracking-123", "shippingProvider": "DHL", "quantity": 2 } ] }, { "systemOrderItemId": "a2", "systemOrderItemNumber": "line-a2", "confirmed": true, "sku": "def", "quantity": 2, "originalOrderItemId": "amazon-order-123-2", "productName": "My Other Product", "variantName": "Blue / S", "itemPrice": 50, "itemUnitPrice": 25, "itemSalePrice": 50, "itemPaidPrice": 49, "itemShippingCost": 4, "itemStatus": "pending", "orderItemDiscountAmount": 1, "orderItemTax": 5 } ] }

Shipment Order

To send an order shipment in our supported format, you can simply exclude any attributes from the Order Attributes listed above that are not needed for shipping.

You can still optionally send any or all other order attributes for a more enriched sync.

It's recommended you set items.merge to true when sending an order shipment payload to the POST /streams_batch API, especially if you're not including other order attributes that may previously have been sent. This prevents CrescoData from overwriting and losing previously sent attributes.

A single order line item can have one or more shipments. The sample on the right shows a typical payload for an order shipment.

Shipment Order
{ "systemOrderId": "123", "systemOrderNumber": "order123", "saleChannel": "amazon_au", "originalOrderId": "Amazon-order-id-123", "status": "partiallyShipped", "publish": true, "variants": [ { "systemOrderItemId": "a", "systemOrderItemNumber": "item-a", "originalOrderItemId": "Amazon-order-line-id-a", "sku": "abc", "quantity": 2, "itemStatus": "shipped", "shipments": [ { "shipmentId": "tracking123", "trackingId": "tracking123", "shippingProvider": "DHL", "quantity": 2 } ] }, { "systemOrderItemId": "b", "systemOrderItemNumber": "item-b", "originalOrderItemId": "Amazon-order-line-id-b", "sku": "def", "quantity": 4, "itemStatus": "partiallyShipped", "shipments": [ { "shipmentId": "tracking123", "trackingId": "tracking123", "shippingProvider": "DHL", "quantity": 2 }, { "shipmentId": "tracking456", "trackingId": "tracking456", "shippingProvider": "UPS", "quantity": 1 } ] } ] }

Cancel Order

To send an order cancellation in our supported format, you can simply exclude any attributes from the Order Attributes listed above that are not needed for cancelling an order.

You can still optionally send any or all other order attributes for a more enriched sync.

It's recommended you set items.merge to true when sending an order cancellation payload to the POST /streams_batch API, especially if you're not including other order attributes that may previously have been sent. This prevents CrescoData from overwriting and losing previously sent attributes.

A single order line item can have one or more cancellations. The sample on the right shows a typical payload for an order cancellation.

Cancel Order
{ "systemOrderId": "123", "systemOrderNumber": "order123", "saleChannel": "amazon_au", "originalOrderId": "Amazon-order-id-123", "status": "cancelled", "publish": true, "variants": [ { "systemOrderItemId": "a", "systemOrderItemNumber": "item-a", "originalOrderItemId": "Amazon-order-line-id-a", "sku": "sku-a", "quantity": 3, "itemStatus": "cancelled", "cancels": [ { "cancelId": "cancel001", "quantity": 1, "cancelledReason": "reason code" }, { "cancelId": "cancel002", "quantity": 2, "cancelledReason": "reason code" } ] } ] }

Return Order

To send an order return in our supported format, you can simply exclude any attributes from the Order Attributes listed above that are not needed for returning an order.

You can still optionally send any or all other order attributes for a more enriched sync.

It's recommended you set items.merge to true when sending an order return payload to the POST /streams_batch API, especially if you're not including other order attributes that may previously have been sent. This prevents CrescoData from overwriting and losing previously sent attributes.

A single order line item can have one or more returns. The sample on the right shows a typical payload for an order return.

Return Order
{ "systemOrderId": "123", "systemOrderNumber": "order123", "originalOrderId": "Amazon-order-id-123", "saleChannel": "amazon_au", "status": "partiallyRefunded", "publish": true, "variants": [ { "systemOrderItemId": "a", "systemOrderItemNumber": "item-a", "originalOrderItemId": "Amazon-order-line-id-a", "sku": "abc", "quantity": 3, "itemStatus": "partiallyRefunded", "returns": [ { "returnId": "return-01", "quantity": 1, "refundedAmount": 10.5, "returnedReason": "Too small", "returnType": "dropoff" }, { "returnId": "return-02", "quantity": 1, "refundedAmount": 10.5, "returnedReason": "No reason", "returnType": "dropoff" } ] } ] }

Create / Update Product

If you're integrated to send records in CrescoData's format, use the attributes below and send it in the items.record in our POST /streams_batch API

Create or update a product on CrescoData by providing as much information as possible in your payload based on our product schema below. Exclude any non-required field that you do not want to provide. Sending null or empty text values will not be accepted.

Note: Any attribute(s) can be moved into variants or out of variants, depending on whether you want the attribute to be shared across all variants, and you can exclude the variants list if your product does not have variants. For example, you can set the descriptionHtml attribute under variants to specify a different description for that specific variant, or on the top level to specify it across all variants.

Attributes

adult
boolean

Whether the product is adult or not
ageGroup
string

The age group of the product
Supported Values
newborn infant toddler kids adult all
allowBackorders
boolean

Allow customer place order when out of stock
asin
string

The ASIN of the variant
available
boolean
Required

Whether the variant is available
availableEnd
string

End date after which the variant is no longer available
availableStart
string

Start date of when the variant is available
brand
string

The brand of the product
color
string

The color of the product
condition
string

The condition of the product
Supported Values
new used refurbished
costPrice
number

The cost price of the product
country
string

The country of the product
Supported Values
AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW
createdAt
string

The date this product or variant was created on the source
currency
string

The currency in which the prices are specified
Supported Values
AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BRL BSD BTC BTN BWP BYN BYR BZD CAD CDF CHF CLF CLP CNY COP CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GGP GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS IMP INR IQD IRR ISK JEP JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LTL LVL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD UYU UZS VEF VND VUV WST XAF XAG XAU XCD XDR XOF XPF YER ZAR ZMK ZMW ZWL
deleted
boolean

Whether this product has been deleted
descriptionHtml
string

The description of the product or variant in html
ean
string

The EAN of the variant
gender
string

The gender of the product or variant
groups
array <string>

The list of groups or collections this product belongs to.
gtin
string

The GTIN of the variant
handlingTime
integer

The handling time, in days
highlightsHtml
string

A list of highlights for the product in HTML
images
array <string>
Required

A list of images showing the variant
isbn
string

The ISBN of the variant
itemHeight
number

The height of the product or variant
itemHeightUnit
string

The unit in which the height of the product is specified
Supported Values
cm m km mm ft in
itemLength
number

The length of the product
itemLengthUnit
string

The unit in which the length of the product is specified
Supported Values
cm m km mm ft in
itemWidth
number

The width of the product
itemWidthUnit
string

The unit in which the width of the product is specified
Supported Values
cm m km mm ft in
manufacturer
string

The manufacturer of the product
material
string

The material of the product or variant is made of
merchantCategoryName
string

The category of the product in the source system
merchantProductId
string
Required

The unique identifier for the product in the source system
merchantVariantId
string
Required

The unique identifier for the variant used in the source system
metaFields
object

Any meta data information
minimumOrderQuantity
integer
min 0

The minimum number of stock you can order for this product.
modelNumber
string

The model number
mpn
string

The MPN of the variant
optionLabel1
string

The label of the first variant option
optionLabel2
string

The label of the second variant option
optionLabel3
string

The label of the third variant option
optionLabel4
string

The label of the fourth variant option
optionValue1
string

The value of the first variant option
optionValue2
string

The value of the second variant option
optionValue3
string

The value of the third variant option
optionValue4
string

The value of the fourth variant option
overwrites
object

The overwrites either by system or integration. The key should be in the format such as system:lazada_sg,amazon - {type}:{comma separated values} and value is an object containing the attribute(s) to overwrite.

Contact support to find the list of available systems and countries you can overwrite for. You can optionally also overwrite by a specific merchant service (integrationId) using integration:{integrationId}. See the sample on the right for more information.

packageContentHtml
string

A description for the content of the packaged product in HTML format
packageHeight
number

The height of the container for the product
packageHeightUnit
string

The unit in which the height of the container for the product is specified
Supported Values
cm m km mm ft in
packageLength
number

The length of the container for the product
packageLengthUnit
string

The unit in which the length of the container for the product is specified
Supported Values
cm m km mm ft in
packageQuantity
integer
min 1

The number of quantities available to order in a pack.
packageWidth
number

The width of the container
packageWidthUnit
string

The unit in which the width of the container is specified
Supported Values
cm m km mm ft in
parentSku
string

The parent sku
price
number
Required

The price of the product
productImages
array <string>

A list of product-level images to be shared across all variants.
publish
boolean
Required

Whether or not this record should be published to connected systems
retailPrice
number

The retail price of the product
saleEnd
string

The end date for the sale promotion. Only applicable when a salePrice is present
saleName
string

The promotion or name of the sale for this item
salePrice
number

The promotional price of the product
saleStart
string

The start date of the sale promotion. Only applicable when a salePrice is present
searchTerms
array <string>

A list of search terms or tags
season
string

The season for the variant
shippingCost
number

The fixed cost of shipping this product, if applicable
shippingDetails
string

Any details related to shipping.
shippingType
string

The shipping type or logistic class to be used
shipsInternationally
boolean

Whether this product ships internationally.
shortDescriptionHtml
string

A short summary description of the product in HTML format
size
string

The size of the variant
sizeImage
string

The size chart image for this variant
sizeSystem
string

The size system that the size of the product is specified in
sku
string
Required

The SKU of the variant
specificationsHtml
string

The specifications of the product in HTML format
stockQuantities
object

The stock quantity available for each store
stockQuantity
integer
Required

The total available stock quantity of the product
style
string

The style of the variant
subTitle
string

The sub title of the product, typically a shorter text appearing below the title on marketplaces that supports it.
systemCategoryId
string

The category ID of a publishing system. Typically only added inside overwrites per system.
taxFree
boolean

Whether this variant is tax exempt.
taxInclusive
boolean

Whether this variant is listed with taxes included.
title
string
Required

The title of the product
upc
string

The UPC of the variant
updatedAt
string

The date this product or variant was updated on the source
variantTitle
string

The title of the variant
vendor
string

The vendor of the product
videoUrl
string

The video url
volume
string

The volume of the variant, if applicable. Free text and should include any units within the text.
warrantyDetails
string

The warranty details
warrantyPeriod
string

The period of the warranty for the given unit
Supported Values
day week month year
warrantyUnit
integer
min 1

The unit value of the warranty period
weight
number

The weight of the product
weightUnit
string

The unit that the weight of the product is specified in
Supported Values
kg g lbs oz
Create / Update Product
{ "merchantProductId": "1", "brand": "My Brand", "createdAt": "2021-01-01T00:00:00+00:00", "updatedAt": "2022-01-01T00:00:00+00:00", "currency": "SGD", "merchantCategoryName": "Mens > Shoes > Boots", "productImages": [ "https://link.to/images.jpeg", "https://link.to/images2.jpeg" ], "descriptionHtml": "<p>My product description</p>", "shortDescriptionHtml": "<p>My short description</p>", "specificationsHtml": "<p>Some specifications</p>", "title": "My Small Blue Shoe", "itemHeight": 9, "itemHeightUnit": "cm", "itemLength": 5, "itemLengthUnit": "cm", "itemWidth": 3, "itemWidthUnit": "cm", "packageHeight": 10, "packageHeightUnit": "cm", "packageLength": 10, "packageLengthUnit": "cm", "packageWidth": 10, "packageWidthUnit": "cm", "weight": 0.05, "weightUnit": "kg", "variants": [ { "available": true, "color": "Blue", "deleted": false, "images": [ "https://link.to/variant-images.jpeg", "https://link.to/variant-images2.jpeg" ], "merchantVariantId": "1", "optionLabel1": "Color", "optionValue1": "Blue", "optionSwatch1": "https://link.com/to/blue/swatch", "optionLabel2": "Size", "optionValue2": "S", "parentSku": "a", "publish": true, "price": 99.9, "costPrice": 101.0, "retailPrice": 101.0, "saleStart": "2021-01-01T00:00:00+00:00", "saleEnd": "2022-01-01T00:00:00+00:00", "salePrice": 50.0, "size": "S", "sizeImage": "https://link.com/to/size-chart.jpg", "sizeSystem": "US", "sku": "a1", "stockQuantities": { "location-1": 5, "location-2": 10 }, "stockQuantity": 15, "upc": "11111111", "overwrites": { "system:lazada_sg": { "salePrice": 22.9, "stockQuantity": 1000 }, "system:amazon": { "publish": false }, "system:zalora": { "available": false } } }, { "available": true, "color": "Green", "deleted": false, "descriptionHtml": "<p>My green variant description</p>", "images": [ "https://link.to/variant-images-green.jpeg", "https://link.to/variant-images2-green.jpeg" ], "merchantVariantId": "1", "optionLabel1": "Color", "optionValue1": "Green", "optionSwatch1": "https://link.com/to/green/swatch", "optionLabel2": "Size", "optionValue2": "S", "parentSku": "a", "publish": true, "price": 99.9, "costPrice": 101.0, "retailPrice": 101.0, "saleStart": "2021-01-01T00:00:00+00:00", "saleEnd": "2022-01-01T00:00:00+00:00", "salePrice": 50.0, "size": "S", "sizeImage": "https://link.com/to/size-chart.jpg", "sizeSystem": "US", "sku": "a2", "stockQuantities": { "location-1": 5, "location-2": 10 }, "stockQuantity": 15, "upc": "11111112", "overwrites": { "system:lazada_sg": { "salePrice": 22.9, "stockQuantity": 1000 }, "system:amazon": { "publish": false }, "system:zalora": { "available": false } } }, { "available": true, "color": "Green", "deleted": false, "images": [ "https://link.to/variant-images-green.jpeg", "https://link.to/variant-images2-green.jpeg" ], "merchantVariantId": "1", "optionLabel1": "Color", "optionValue1": "Green", "optionSwatch1": "https://link.com/to/green/swatch", "optionLabel2": "Size", "optionValue2": "M", "parentSku": "a", "publish": true, "price": 99.9, "costPrice": 101.0, "retailPrice": 101.0, "saleStart": "2021-01-01T00:00:00+00:00", "saleEnd": "2022-01-01T00:00:00+00:00", "salePrice": 50.0, "size": "M", "sizeImage": "https://link.com/to/size-chart.jpg", "sizeSystem": "US", "sku": "a3", "stockQuantities": { "location-1": 5, "location-2": 10 }, "stockQuantity": 15, "upc": "11111113", "overwrites": { "system:lazada_sg": { "salePrice": 22.9, "stockQuantity": 888 }, "system:amazon": { "publish": true }, "system:zalora": { "available": false } } }, { "available": true, "color": "Blue", "deleted": false, "images": [ "https://link.to/variant-images-green.jpeg", "https://link.to/variant-images2-green.jpeg" ], "merchantVariantId": "1", "optionLabel1": "Color", "optionValue1": "Blue", "optionSwatch1": "https://link.com/to/green/swatch", "optionLabel2": "Size", "optionValue2": "M", "parentSku": "a", "publish": true, "price": 99.9, "costPrice": 101.0, "retailPrice": 101.0, "saleStart": "2021-01-01T00:00:00+00:00", "saleEnd": "2022-01-01T00:00:00+00:00", "salePrice": 50.0, "size": "M", "sizeImage": "https://link.com/to/size-chart.jpg", "sizeSystem": "US", "sku": "a4", "stockQuantities": { "location-1": 3, "location-2": 5 }, "stockQuantity": 8, "upc": "11111114", "overwrites": { "system:lazada_sg": { "salePrice": 22.9, "stockQuantity": 888 }, "system:amazon": { "publish": false }, "system:zalora": { "available": false } } } ], "overwrites": { "system:lazada_sg": { "descriptionHtml": "<p>Custom description for lazada SG</p>", "systemCategoryId": "99999" }, "system:zalora": { "systemCategoryId": "12345", "descriptionHtml": "<p>Custom description for any zalora country</p>" }, "system:ebay,cotd": { "publish": false }, "integration:11111111-2222-3333-4444-555555555555": { "publish": false } } }

Query & Pagination

Pagination

All CrescoData APIs to list records will support pagination and defining how many records to return in your API call.

The limit query parameter allows you to specify how many records you want returned. It must be between 1 and 9999. However, if the size of the response payload is > 400KB, our API may not return the number of records you requested for.

The page query parameter is used to paginate and query the next batch of records. This parameter must always be empty on your first API call. If there are more records available to be fetched, the response of your API call will have an x-cresco-page header returned which you can use in the subsequent API call.

The x-cresco-page response header will not be present if there are no more records to query for, in which case you should terminate your pagination. Note that the x-cresco-page value is often but not always a number, depending on how the database is indexed. Always use the value of this header and never perform your own offset calculation to determine the next page

Additionally, some list APIs will require you to use a scroll parameter if you're paginating past the 10,000th record. See the documentation of each API on whether can/will need to use this when paginating more than 10,000 records.

Querying

Most attributes in our databases can be used for querying and sorting, including nested attributes. See the Query Attributes of each List API for more information.

List Cresco Orders

Below are all the supported attributes you can use to query orders in the CrescoData format.

Query Parameters

_sort
string

How to sort the data. This must be in the format of {field}:{asc | desc}. For example: updatedAt:desc
crescoId
string
Required

The Cresco status id assigned to this record
limit
integer
min 1
max 9999

The number of records to return in 1 call. Note that Cresco may not follow the limit given if the size of data returned it too large.
page
string

The current page or page token used to paginate. This could be an offset number or a base64 encoded string. Do not assume this to always be a number. Exclude this parameter on your first api call. On subsequent calls, use the x-cresco-page header value returned from the previous api call as this field value. If this header does not exist, there are no more records to query.
scroll
integer
min 1
max 10

The time, in minutes that your page token will be valid for. Use only if you need to paginate past 10000 records as it will slightly slow down the query. Note that the x-cresco-page header returned will always be the same base64 encoded token and should be used the the next page query until the x-cresco-page header is no longer returned.

Return Headers

x-cresco-page
string

The page / token you can use to paginate and query the next batch of records. This may be a number or a base64 encoded string. Use this value in the page query parameter of your next API call. If this header is not present, there are no more records to query for.
x-cresco-total
integer

The total number of records that match your query. This header may not be present if your query has not been indexed.
GET /orders
import requests body = None headers = {"Authorization": "{IdToken}"} params = {'_sort': 'updatedAt:desc', 'data.systemOrderNumber': 'test-123', 'limit': '10'} response = requests.get('https://api-dev.crescodata.com/orders', params=params, headers=headers, json=body)
Return Sample for GET /orders
{ "crescoId": "11111111-2222-3333-4444-555555555555", "companyId": "11111111-2222-3333-4444-555555555555", "agencyId": "11111111-2222-3333-4444-555555555555", "systemId": "11111111-2222-3333-4444-555555555555", "requestId": "11111111-2222-3333-4444-555555555555", "objectId": "123", "forceRefreshedAt": "2018-03-07T08:52:17+00:00", "updatedAt": "2018-03-07T08:52:17+00:00", "forceRefreshed": true, "data": [ { "addresses": { "billing": { "name": "Cresco Data", "zip": "089543", "street": "99 Duxton Rd", "city": "Singapore", "state": "Singapore", "email": "===sales@crescodata.com", "phone1": "+6531630046", "extra1": "Duxton Hill", "country": "SG" }, "shipping": { "name": "Cresco Data", "zip": "089543", "street": "99 Duxton Rd", "city": "Singapore", "state": "Singapore", "email": "===sales@crescodata.com", "phone1": "+6531630046", "extra1": "Duxton Hill", "country": "SG" } }, "confirmed": true, "country": "US", "customerNewsletterSubscriber": true, "createdAt": "2018-01-01T00:00:00+00:00", "currency": "USD", "giftMessage": "I <3 CrescoData", "isGift": true, "invoiceId": "12345678", "itemPrice": 10000.0, "itemPaidPrice": 8000.0, "itemSalePrice": 9000.0, "link": "https://sellercenter.lazada.sg/order/detail/7867343908156/100017863", "merchantProductId": "12345", "merchantVariantId": "98765", "messageToSeller": "This customer loves CrescoData!", "orderDiscountAmount": 2500.0, "orderDiscountCode": "orderDiscountCode", "orderItemDiscountAmount": 1000.0, "orderItemTax": 1000.0, "orderSubTotal": 12140.99, "orderTotal": 12140.99, "orderTotalPaid": 9640.99, "packageId": "12345abc", "paymentType": "Paypal", "productName": "Cresco's Platinum/Diamond/Gold Dress", "publish": true, "quantity": 3, "quantityShipped": 3, "quantityRefunded": 3, "quantityCancelled": 3, "quantityReturned": 3, "originalOrderId": "12345", "originalOrderItemId": "12345", "shippingCost": 40.99, "shippingType": "Normal", "shippingMessage": "Do not ring the doorbell", "shippingProvider": "DHL", "sku": "12345-abc", "status": "readyToShip", "systemOrderId": "9001", "systemOrderItemId": "1000001", "systemOrderItemNumber": "1000001", "systemOrderNumber": "test-123", "systemStatus": "Ready To Ship", "systemProductId": "11", "systemVariantId": "99", "tax": 100.0, "taxRate": 3, "taxName": "My Cresco Tax", "taxComponents": [ { "name": "Shipping", "rate": 1 }, { "name": "GST", "rate": 2 } ], "taxInclusive": true, "trackingId": "0011223344", "updatedAt": "2018-01-02T12:15:00+00:00", "variantName": "Diamond" } ] }
Return Headers Sample for GET /orders
{ "x-cresco-total": "99999", "x-cresco-page": "eyJjb21wYW55SWQiOiAiYTQxZDg3ZDEtMGMxNi00YzMxLWJlZjAtODNjMmU0NWQ2ZTBiIiwgIl9wa18iOiAiYmQzMzRkODMtNzFkMC00YTc0LWIyNjEtODlmN2YyMTg4NTNmIiwgInN5bmNUeXBlIjogInByb2R1Y3RzIn0=" }

List Cresco Products

Below are all the supported attributes you can use to query products in the CrescoData format.

Query Parameters

_sort
string

How to sort the data. This must be in the format of {field}:{asc | desc}. For example: updatedAt:desc
crescoId
string
Required

The Cresco status id assigned to this record
limit
integer
min 1
max 9999

The number of records to return in 1 call. Note that Cresco may not follow the limit given if the size of data returned it too large.
page
string

The current page or page token used to paginate. This could be an offset number or a base64 encoded string. Do not assume this to always be a number. Exclude this parameter on your first api call. On subsequent calls, use the x-cresco-page header value returned from the previous api call as this field value. If this header does not exist, there are no more records to query.
scroll
integer
min 1
max 10

The time, in minutes that your page token will be valid for. Use only if you need to paginate past 10000 records as it will slightly slow down the query. Note that the x-cresco-page header returned will always be the same base64 encoded token and should be used the the next page query until the x-cresco-page header is no longer returned.

Return Headers

x-cresco-page
string

The page / token you can use to paginate and query the next batch of records. This may be a number or a base64 encoded string. Use this value in the page query parameter of your next API call. If this header is not present, there are no more records to query for.
x-cresco-total
integer

The total number of records that match your query. This header may not be present if your query has not been indexed.
GET /products
import requests body = None headers = {"Authorization": "{IdToken}"} params = {'_sort': 'updatedAt:desc', 'data.quantity__gt': '1', 'data.quantity__lte': '100', 'data.title': 'Test', 'limit': '10'} response = requests.get('https://api-dev.crescodata.com/products', params=params, headers=headers, json=body)
Return Sample for GET /products
{ "crescoId": "11111111-2222-3333-4444-555555555555", "companyId": "11111111-2222-3333-4444-555555555555", "agencyId": "11111111-2222-3333-4444-555555555555", "systemId": "11111111-2222-3333-4444-555555555555", "requestId": "11111111-2222-3333-4444-555555555555", "objectId": "123", "forceRefreshedAt": "2018-03-07T08:52:17+00:00", "updatedAt": "2018-03-07T08:52:17+00:00", "forceRefreshed": true, "data": [ { "adult": false, "ageGroup": "adult", "allowBackorders": false, "available": true, "availableStart": "2018-01-01T00:00:00+00:00", "availableEnd": "2018-12-31T00:00:00+00:00", "brand": "Bejewelled", "categoryName": "Apparel > Dresses > Long Dresses", "categoryId": "11111111-2222-3333-4444-555555555555", "color": "red", "condition": "new", "country": "US", "currency": "USD", "deleted": false, "department": "Women", "description": "This dress is made of diamonds", "descriptionHtml": "<p>This dress is made of diamonds</p>", "ean": "501234567890", "gender": "female", "groups": [ "Sweaters", "Cottony" ], "gtin": "00000001234567", "highlights": "- diamond drizzled\n- gold gushed\n- platinum plated", "highlightsHtml": "<div><ul><li>diamond drizzled</li><li>gold gushed</li><li>platinum plated</li>", "images": [ "https://crescodata.com/wp-content/uploads/2018/08/cresco-data-logo.png", "https://crescodata.com/wp-content/uploads/2018/11/How-it-works-v2.png" ], "itemHeight": 56.5, "itemHeightUnit": "cm", "itemLength": 30, "itemLengthUnit": "cm", "itemWidth": 5, "itemWidthUnit": "cm", "language": "eng", "link": "https://uat.shopee.sg/product/123456/", "material": "diamond", "merchantCategoryName": "Shoes > I love those", "merchantProductId": "101", "merchantVariantId": "909", "metaFields": { "dimensions": { "value": "15x12", "group": "specs" }, "weight": { "value": "14g", "group": "specs" } }, "mobileLink": "https://mobile.uat.shopee.sg/product/123456/", "optionTitle": "Rock Type", "optionLabel1": "Color", "optionValue1": "Red", "optionSwatch1": "https://crescodata.com/wp-content/uploads/2018/01/cresco-swatch-50x50.png", "optionType1": "String|Select|Ratio", "optionLabel2": "Size", "optionValue2": "XX", "optionSwatch2": "https://crescodata.com/wp-content/uploads/2018/01/cresco-swatch-50x50.png", "optionType2": "String|Select|Ratio", "optionLabel3": "Length", "optionValue3": "16", "optionSwatch3": "https://crescodata.com/wp-content/uploads/2018/01/cresco-swatch-50x50.png", "optionType3": "String|Select|Ratio", "packageHeight": 60, "packageHeightUnit": "cm", "packageLength": 35.6, "packageLengthUnit": "cm", "packageWidth": 10, "packageWidthUnit": "cm", "parentSku": "12345-abc", "price": 9999.99, "costPrice": 7999.99, "publish": true, "saleEnd": "2018-01-31T00:00:00+00:00", "saleId": "134", "saleName": "My Promotion", "salePrice": 8999.99, "saleStart": "2018-01-01T00:00:00+00:00", "searchTerms": [ "diamonds", "dress", "gold" ], "shippingCost": 10, "shippingNumber": 123049, "shippingType": "DHL", "shortDescription": "Diamond Dress", "shortDescriptionHtml": "<p>Diamond Dress</p>", "size": "36", "sizeImage": "https://size-chart-image.jpg", "style": "Regular", "sizeSystem": "US", "sku": "12345-abc", "specifications": "50% Gold, 50% Platinum, 100% Diamond!", "specificationsHtml": "<div><ul><li>50% Gold</li<li>50% Platinum</li><li>100% Diamond!</li>", "stockQuantity": 10, "stockQuantities": { "cresco": 9, "warehouse": 1 }, "title": "Diamond Gold Plated Dress", "upc": "123456789098", "variantTitle": "Diamond", "warrantyUnit": 4, "warrantyPeriod": "month", "weight": 900, "weightUnit": "kg", "_addition_": {} } ] }
Return Headers Sample for GET /products
{ "x-cresco-total": "99999", "x-cresco-page": "eyJjb21wYW55SWQiOiAiYTQxZDg3ZDEtMGMxNi00YzMxLWJlZjAtODNjMmU0NWQ2ZTBiIiwgIl9wa18iOiAiYmQzMzRkODMtNzFkMC00YTc0LWIyNjEtODlmN2YyMTg4NTNmIiwgInN5bmNUeXBlIjogInByb2R1Y3RzIn0=" }

List integrations

GET /integrations
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/integrations', params=params, headers=headers, json=body)

Add an integration

Attributes

active
boolean
Required

Whether this sync should be active. If active, we will perform a test connection to ensure all credentials are valid and will not allow activation if they are invalid.
add
boolean
Required

This field is deprecated and should always be set to false
agencyId
string
Required

The id of the company's agency
Note: This attribute is only applicable to user roles: admin, staff
companyId
string
Required

The id of the company
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
createdAt
string
read-only

The time this company was created
delete
boolean
Required

This field is deprecated and should always be set to false
get
boolean
Required

Whether items will be retrieve via this integration
integrationId
string
read-only

The id of the link
meta
object
Required

This field is deprecated and should always be set to {}
minFromDate
string

This field is only applicable if get=true. It is the minimum date to import records from. For example, set this to 2022-01-01T00:00:00+00:00's day to only retrieve orders created after Jan 1st of 2022, midnight UTC time.
syncType
string
Required

The type of the sync that is active
systemId
string
Required

The id of the system used for this link
systemSettings
object

Any settings to overwrite for the system
update
boolean
Required

Whether updates to existing items are sent to this integration
updatedAt
string
read-only

The time this company was updated
POST /integrations
import requests body = {'active': False, 'add': False, 'agencyId': '11111111-2222-3333-4444-555555555555', 'companyId': '11111111-2222-3333-4444-555555555555', 'delete': False, 'get': True, 'meta': {}, 'syncType': 'products', 'systemId': '11111111-2222-3333-4444-555555555555', 'systemSettings': {}, 'update': False} headers = {"Authorization": "{IdToken}"} params = None response = requests.post('https://api-dev.crescodata.com/integrations', params=params, headers=headers, json=body)

Get an integration

GET /integrations/
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/integrations/<integrationId>', params=params, headers=headers, json=body)

Replace an integration

Attributes

active
boolean
Required

Whether this sync should be active. If active, we will perform a test connection to ensure all credentials are valid and will not allow activation if they are invalid.
add
boolean
Required

This field is deprecated and should always be set to false
agencyId
string
Required

The id of the company's agency
Note: This attribute is only applicable to user roles: admin, staff
companyId
string
Required

The id of the company
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
createdAt
string
read-only

The time this company was created
delete
boolean
Required

This field is deprecated and should always be set to false
get
boolean
Required

Whether items will be retrieve via this integration
integrationId
string
read-only

The id of the link
meta
object
Required

This field is deprecated and should always be set to {}
minFromDate
string

This field is only applicable if get=true. It is the minimum date to import records from. For example, set this to 2022-01-01T00:00:00+00:00's day to only retrieve orders created after Jan 1st of 2022, midnight UTC time.
syncType
string
Required

The type of the sync that is active
systemId
string
Required

The id of the system used for this link
systemSettings
object

Any settings to overwrite for the system
update
boolean
Required

Whether updates to existing items are sent to this integration
updatedAt
string
read-only

The time this company was updated
PUT /integrations/
import requests body = {'active': False, 'add': False, 'agencyId': '11111111-2222-3333-4444-555555555555', 'companyId': '11111111-2222-3333-4444-555555555555', 'delete': False, 'get': True, 'meta': {}, 'syncType': 'products', 'systemId': '11111111-2222-3333-4444-555555555555', 'systemSettings': {}, 'update': False} headers = {"Authorization": "{IdToken}"} params = None response = requests.put('https://api-dev.crescodata.com/integrations/<integrationId>', params=params, headers=headers, json=body)

Update an integration

Attributes

active
boolean
Required

Whether this sync should be active. If active, we will perform a test connection to ensure all credentials are valid and will not allow activation if they are invalid.
add
boolean
Required

This field is deprecated and should always be set to false
agencyId
string
Required

The id of the company's agency
Note: This attribute is only applicable to user roles: admin, staff
companyId
string
Required

The id of the company
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
createdAt
string
read-only

The time this company was created
delete
boolean
Required

This field is deprecated and should always be set to false
get
boolean
Required

Whether items will be retrieve via this integration
integrationId
string
read-only

The id of the link
meta
object
Required

This field is deprecated and should always be set to {}
minFromDate
string

This field is only applicable if get=true. It is the minimum date to import records from. For example, set this to 2022-01-01T00:00:00+00:00's day to only retrieve orders created after Jan 1st of 2022, midnight UTC time.
syncType
string
Required

The type of the sync that is active
systemId
string
Required

The id of the system used for this link
systemSettings
object

Any settings to overwrite for the system
update
boolean
Required

Whether updates to existing items are sent to this integration
updatedAt
string
read-only

The time this company was updated
PATCH /integrations/
import requests body = {'active': False, 'add': False, 'agencyId': '11111111-2222-3333-4444-555555555555', 'companyId': '11111111-2222-3333-4444-555555555555', 'delete': False, 'get': True, 'meta': {}, 'syncType': 'products', 'systemId': '11111111-2222-3333-4444-555555555555', 'systemSettings': {}, 'update': False} headers = {"Authorization": "{IdToken}"} params = None response = requests.patch('https://api-dev.crescodata.com/integrations/<integrationId>', params=params, headers=headers, json=body)

Delete an integration

DELETE /integrations/
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.delete('https://api-dev.crescodata.com/integrations/<integrationId>', params=params, headers=headers, json=body)

Get the change history of an integration

GET /integrations//history
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/integrations/<integrationId>/history', params=params, headers=headers, json=body)

Get any auth related information of an integration, such as an OAuth URL.

GET /integrations//auth
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/integrations/<integrationId>/auth', params=params, headers=headers, json=body)

Test the connection of an integration, based on the settings provided.

GET /integrations//test
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/integrations/<integrationId>/test', params=params, headers=headers, json=body)

Add an image

POST /images
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.post('https://api-dev.crescodata.com/images', params=params, headers=headers, json=body)

Run a cml template

Attributes

groupSources
array <object>

A list of group sources
overwrites
array <string>

A list of Cresco mapping language files to use as overwrites
record
object
Required

Data record to be mapped
template
string
Required

Cresco mapping language file
variables
object

Any additional variables to be made available to the template when rendering
POST /mapping/cml
import requests body = {'overwrites': ['<template>', '<template>'], 'record': {}, 'template': '<template>'} headers = {"Authorization": "{IdToken}"} params = None response = requests.post('https://api-dev.crescodata.com/mapping/cml', params=params, headers=headers, json=body)

Run a mako template

Attributes

record
array <object>
Required

Data record to be mapped
template
string
Required

Mako mapping language file
variables
object

Any additional variables to be made available to the template when rendering
POST /mapping/mako
import requests body = {'record': [{}], 'template': '<template>'} headers = {"Authorization": "{IdToken}"} params = None response = requests.post('https://api-dev.crescodata.com/mapping/mako', params=params, headers=headers, json=body)

List cresco master sync records

GET /
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/<syncType>', params=params, headers=headers, json=body)

Get a cresco master sync record

GET //
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/<syncType>/<crescoId>', params=params, headers=headers, json=body)

Get the change history of a cresco master sync record

GET ///history
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/<syncType>/<crescoId>/history', params=params, headers=headers, json=body)

Add a user

Attributes

agencyId
string

The agency ID of this user. Required if role is set to "agency"
Note: This attribute is only applicable to user roles: admin, staff
companyId
string

The company ID of this user. Required if role is set to "company"
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
email
string
Required

The email, which should usually be the same as the user name.
logoUrl
string

The optional url to the logo for this user.
name
string
Required

The full name of this user
passwordExpiresIn
string

How long before the user will need to reset the password, after they set their new password. This will be a string number in seconds, and should be set to "7776000" (90 days) to follow good security practices
role
string
Required

The role of the user. You can only create users under roles lower than you. For example if you are a CrescoData customer user, your role is "agency", therefore you can only create users under the "agency" or "company" role. "admin" and "staff" roles are strictly only for CrescoData employees
Supported Values
admin staff company manager agency
sendEmail
boolean
Required

Whether or not to send the temporary password and username info to the "email" you set. If this is set to false, you will need to send the temporary password you set to the user yourself.
syncs
array <string>
Conditional
required if role equals ['agency', 'company', 'manager']}

A list of sync types this user has permissions for. Check with CrescoData what sync types you will need.
temporaryPassword
string
Required

The temporary password, which would be used to change the password during the first login attempt.
username
string
Required

The username, which should usually be the same as the email.
POST /users
import requests body = {'agencyId': '11111111-2222-3333-4444-555555555555', 'email': 'test@crescodata.com', 'name': 'Test User', 'passwordExpiresIn': '7776000', 'role': 'manager', 'sendEmail': False, 'syncs': ['products', 'prices', 'stock', 'orders'], 'temporaryPassword': 'abc123', 'username': 'test@crescodata.com'} headers = {"Authorization": "{IdToken}"} params = None response = requests.post('https://api-dev.crescodata.com/users', params=params, headers=headers, json=body)

List users

GET /users
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/users', params=params, headers=headers, json=body)

Get a user

GET /users/
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/users/<username>', params=params, headers=headers, json=body)

Delete a user

DELETE /users/
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.delete('https://api-dev.crescodata.com/users/<username>', params=params, headers=headers, json=body)

Update a user

Attributes

agencyId
string

The agency ID of this user. Required if role is set to "agency"
Note: This attribute is only applicable to user roles: admin, staff
companyId
string

The company ID of this user. Required if role is set to "company"
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
enabled
boolean

Whether this user is enabled or disabled
logoUrl
string

The optional url to the logo for this user.
name
string

The full name of this user
passwordExpiresIn
string

How long after the last password reset, in seconds, before the user will need to reset the password.This will be a string number in seconds, and should be set to "7776000" (90 days) to follow good security practices
passwordUpdatedAt
string

When this users password was last changed.
Note: This attribute is only applicable to user roles: admin, staff
role
string

The role of the client
Supported Values
admin staff company manager agency
syncs
array <string>
Conditional
required if role equals ['agency', 'company', 'manager']}

A list of sync types this user has permissions for. Check with CrescoData what sync types you will need.
templateId
string

The template id to use for emails
username
string
Required

The username, which should usually be the same as the email.
PUT /users/
import requests body = {'enabled': True, 'name': 'Test User Update', 'role': 'admin', 'syncs': ['prices', 'stock'], 'username': 'test@crescodata.com'} headers = {"Authorization": "{IdToken}"} params = None response = requests.put('https://api-dev.crescodata.com/users/<username>', params=params, headers=headers, json=body)

Force reset a user password

POST /users//password/reset
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.post('https://api-dev.crescodata.com/users/<username>/password/reset', params=params, headers=headers, json=body)

List channel request payloads

GET /publish
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/publish', params=params, headers=headers, json=body)

Get a channel request payload

GET /publish//
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/publish/<integrationId>/<crescoId>', params=params, headers=headers, json=body)

Get the change history of a channel request payload

GET /publish///history
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/publish/<integrationId>/<crescoId>/history', params=params, headers=headers, json=body)

List system responses

GET /system_results
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/system_results', params=params, headers=headers, json=body)

Get response history for a record

GET /system_results///history
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/system_results/<crescoId>/<integrationId>/history', params=params, headers=headers, json=body)

Group object

The available groups within a taxonomy.

Attributes

agencyId
string

The agency this group belongs to. Leave empty if public.
Note: This attribute is only applicable to user roles: admin, staff
companyId
string

The company this group belongs to. Leave empty if public to all companies under the agency ID.
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
data
object

Any additional data for the group.
groupId
string
Required

The id of the group.
isLeaf
boolean

Whether this group is a leaf group. Only leaf groups should be used for mapping.
label
string

The label of the group.
name
string
Required

The full name of the group.
parentGroupId
string

The parent group id. Will not have a value for root-level groups.
taxonomyId
string
Required

The internal id of the taxonomy
version
integer
min 0

The taxonomy version.
Group object
{ "groupId": "shoes > women > heels", "taxonomyId": "11111111-2222-3333-4444-555555555555", "label": "Heels", "name": "shoes > women > heels", "version": 1583221646, "isLeaf": true, "parentGroupId": "shoes > women" }

Attribute object

The available attributes within a taxonomy. Each attribute is assigned to one group.

Attributes

agencyId
string

The agency this attribute belongs to. Leave empty if public.
Note: This attribute is only applicable to user roles: admin, staff
attributeId
string
Required

The id of the attribute.
companyId
string

The company this attribute belongs to. Leave empty if public to all companies under the agency ID.
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
constraints
array <object>

A list of constraints for this attribute.
attributeId
string
Required

The channel's attribute id to check against
ruleType
string
Required

The rule type
Supported Values
equals starts_with ends_with contains
ruleValues
array <string>
Required

The rule values
data
object

Any additional attribute data for internal use.
description
string

The description of the attribute.
groupId
string
Required

The id of the category.
hasOptions
boolean
Required

Whether this attribute has an options list.
mandatory
boolean
Required

Whether this attribute is required.
name
string
Required

The name of the attribute.
options
array <object>

The list of options for this attribute. If not provided, and hasOptions is true, query the options endpoint for the list of options.
constraints
array <object>

A list of constraints for this option.
attributeId
string
Required

The channel's attribute id to check against
ruleType
string
Required

The rule type
Supported Values
equals starts_with ends_with contains
ruleValues
array <string>
Required

The rule values
name
string

The name of the option.
optionId
string
Required

The id of option.
reserved
boolean

Whether this attribute is reserved to be used by Cresco. This typically means you do not need to map a source attribute to this channel attribute.
taxonomyId
string
Required

The internal id of the taxonomy.
type
string
Required

The attribute type.
Supported Values
text singleSelect multiSelect html number boolean
version
integer
min 0

The taxonomy version.
Attribute object
{ "attributeId": "battery-size", "groupId": "shoes", "taxonomyId": "11111111-2222-3333-4444-555555555555", "name": "Color", "description": "Color", "type": "text", "mandatory": false, "data": {}, "reserved": false, "hasOptions": true, "constraints": [ { "attributeId": "zalora_system_system", "ruleType": "equals", "ruleValues": [ "US" ] } ], "version": 1583221646 }

Option object

A option object

Attributes

agencyId
string

The agency this option belongs to. Leave empty if public.
Note: This attribute is only applicable to user roles: admin, staff
attributeId
string
Required

The id of the attribute
companyId
string

The company this option belongs to. Leave empty if public to all companies under the agency ID.
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
constraints
array <object>

A list of constraints for this option.
attributeId
string
Required

The channel's attribute id to check against
ruleType
string
Required

The rule type
Supported Values
equals starts_with ends_with contains
ruleValues
array <string>
Required

The rule values
groupId
string
Required

The id of the group.
name
string

The name of the option.
optionId
string
Required

The id of option.
taxonomyId
string
Required

The internal id of the taxonomy
version
integer
min 0

The taxonomy version.
Option object
{ "attributeId": "color", "taxonomyId": "11111111-2222-3333-4444-555555555555", "groupId": "shoes", "version": 1583221646, "optionId": "5", "name": "5", "constraints": [ { "attributeId": "size_system", "ruleType": "equals", "ruleValues": [ "UK", "AUD" ] } ] }

Get groups

Query Parameters

_sort
string

How to sort the data. This must be in the format of {field}:{asc | desc}. For example: updatedAt:desc
agencyId
string

The agency this group belongs to. Leave empty if public.

Other supported queries:

  • agencyId__not: Search records where the agencyId does not match your query value
  • agencyId__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
Note: This attribute is only applicable to user roles: admin, staff
companyId
string

The company this group belongs to. Leave empty if public to all companies under the agency ID.

Other supported queries:

  • companyId__not: Search records where the companyId does not match your query value
  • companyId__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
groupId
string
Required

The id of the group.

Other supported queries:

  • groupId__not: Search records where the groupId does not match your query value
isLeaf
boolean

Whether this group is a leaf group. Only leaf groups should be used for mapping.

Other supported queries:

  • isLeaf__not: Search records where the isLeaf does not match your query value
  • isLeaf__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
label
string

The label of the group.

Other supported queries:

  • label__not: Search records where the label does not match your query value
  • label__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
limit
integer
min 1
max 9999

The number of records to return in 1 call. Note that Cresco may not follow the limit given if the size of data returned it too large.
name
string
Required

The full name of the group.

Other supported queries:

  • name__not: Search records where the name does not match your query value
page
string

The current page or page token used to paginate. This could be an offset number or a base64 encoded string. Do not assume this to always be a number. Exclude this parameter on your first api call. On subsequent calls, use the x-cresco-page header value returned from the previous api call as this field value. If this header does not exist, there are no more records to query.
parentGroupId
string

The parent group id. Will not have a value for root-level groups.

Other supported queries:

  • parentGroupId__not: Search records where the parentGroupId does not match your query value
  • parentGroupId__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
scroll
integer
min 1
max 10

The time, in minutes that your page token will be valid for. Use only if you need to paginate past 10000 records as it will slightly slow down the query. Note that the x-cresco-page header returned will always be the same base64 encoded token and should be used the the next page query until the x-cresco-page header is no longer returned.
taxonomyId
string
Required

The internal id of the taxonomy

Other supported queries:

  • taxonomyId__not: Search records where the taxonomyId does not match your query value
version
integer
min 0

The taxonomy version.

Other supported queries:

  • version__not: Search records where the version does not match your query value
  • version__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
  • version__lt: Less Than
  • version__lte: Less Than or Equals To
  • version__gt: Greater Than
  • version__gte: Greater Than or Equals To

Return Headers

x-cresco-page
string

The page / token you can use to paginate and query the next batch of records. This may be a number or a base64 encoded string. Use this value in the page query parameter of your next API call. If this header is not present, there are no more records to query for.
x-cresco-total
integer

The total number of records that match your query. This header may not be present if your query has not been indexed.
GET /taxonomies/<__taxonomyId__>/groups
import requests body = None headers = {"Authorization": "{IdToken}"} params = {} response = requests.get('https://api-dev.crescodata.com/taxonomies/<__taxonomyId__>/groups', params=params, headers=headers, json=body)
Return Headers Sample for GET /taxonomies/<__taxonomyId__>/groups
{ "x-cresco-total": "99999", "x-cresco-page": "eyJjb21wYW55SWQiOiAiYTQxZDg3ZDEtMGMxNi00YzMxLWJlZjAtODNjMmU0NWQ2ZTBiIiwgIl9wa18iOiAiYmQzMzRkODMtNzFkMC00YTc0LWIyNjEtODlmN2YyMTg4NTNmIiwgInN5bmNUeXBlIjogInByb2R1Y3RzIn0=" }

Get group attributes

Query Parameters

_sort
string

How to sort the data. This must be in the format of {field}:{asc | desc}. For example: updatedAt:desc
agencyId
string

The agency this attribute belongs to. Leave empty if public.

Other supported queries:

  • agencyId__not: Search records where the agencyId does not match your query value
  • agencyId__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
Note: This attribute is only applicable to user roles: admin, staff
attributeId
string
Required

The id of the attribute.

Other supported queries:

  • attributeId__not: Search records where the attributeId does not match your query value
companyId
string

The company this attribute belongs to. Leave empty if public to all companies under the agency ID.

Other supported queries:

  • companyId__not: Search records where the companyId does not match your query value
  • companyId__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
description
string

The description of the attribute.

Other supported queries:

  • description__not: Search records where the description does not match your query value
  • description__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
groupId
string
Required

The id of the category.

Other supported queries:

  • groupId__not: Search records where the groupId does not match your query value
hasOptions
boolean
Required

Whether this attribute has an options list.

Other supported queries:

  • hasOptions__not: Search records where the hasOptions does not match your query value
limit
integer
min 1
max 9999

The number of records to return in 1 call. Note that Cresco may not follow the limit given if the size of data returned it too large.
mandatory
boolean
Required

Whether this attribute is required.

Other supported queries:

  • mandatory__not: Search records where the mandatory does not match your query value
name
string
Required

The name of the attribute.

Other supported queries:

  • name__not: Search records where the name does not match your query value
options.name
string

The name of the option.

Other supported queries:

  • options.name__not: Search records where the name does not match your query value
  • options.name__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
options.optionId
string
Required

The id of option.

Other supported queries:

  • options.optionId__not: Search records where the optionId does not match your query value
options__constraints.attributeId
string
Required

The channel's attribute id to check against

Other supported queries:

  • options__constraints.attributeId__not: Search records where the attributeId does not match your query value
options__constraints.ruleType
string
Required

The rule type

Other supported queries:

  • options__constraints.ruleType__not: Search records where the ruleType does not match your query value
Supported Values
equals starts_with ends_with contains
options__constraints.ruleValues
array <string>
Required

The rule values

Other supported queries:

  • options__constraints.ruleValues__not: Search records where the ruleValues does not match your query value
page
string

The current page or page token used to paginate. This could be an offset number or a base64 encoded string. Do not assume this to always be a number. Exclude this parameter on your first api call. On subsequent calls, use the x-cresco-page header value returned from the previous api call as this field value. If this header does not exist, there are no more records to query.
reserved
boolean

Whether this attribute is reserved to be used by Cresco. This typically means you do not need to map a source attribute to this channel attribute.

Other supported queries:

  • reserved__not: Search records where the reserved does not match your query value
  • reserved__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
scroll
integer
min 1
max 10

The time, in minutes that your page token will be valid for. Use only if you need to paginate past 10000 records as it will slightly slow down the query. Note that the x-cresco-page header returned will always be the same base64 encoded token and should be used the the next page query until the x-cresco-page header is no longer returned.
taxonomyId
string
Required

The internal id of the taxonomy.

Other supported queries:

  • taxonomyId__not: Search records where the taxonomyId does not match your query value
type
string
Required

The attribute type.

Other supported queries:

  • type__not: Search records where the type does not match your query value
Supported Values
text singleSelect multiSelect html number boolean
version
integer
min 0

The taxonomy version.

Other supported queries:

  • version__not: Search records where the version does not match your query value
  • version__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
  • version__lt: Less Than
  • version__lte: Less Than or Equals To
  • version__gt: Greater Than
  • version__gte: Greater Than or Equals To

Return Headers

x-cresco-page
string

The page / token you can use to paginate and query the next batch of records. This may be a number or a base64 encoded string. Use this value in the page query parameter of your next API call. If this header is not present, there are no more records to query for.
x-cresco-total
integer

The total number of records that match your query. This header may not be present if your query has not been indexed.
GET /taxonomies/<__taxonomyId__>/groups//attributes
import requests body = None headers = {"Authorization": "{IdToken}"} params = {} response = requests.get('https://api-dev.crescodata.com/taxonomies/<__taxonomyId__>/groups/<groupId>/attributes', params=params, headers=headers, json=body)
Return Headers Sample for GET /taxonomies/<__taxonomyId__>/groups/<groupId>/attributes
{ "x-cresco-total": "99999", "x-cresco-page": "eyJjb21wYW55SWQiOiAiYTQxZDg3ZDEtMGMxNi00YzMxLWJlZjAtODNjMmU0NWQ2ZTBiIiwgIl9wa18iOiAiYmQzMzRkODMtNzFkMC00YTc0LWIyNjEtODlmN2YyMTg4NTNmIiwgInN5bmNUeXBlIjogInByb2R1Y3RzIn0=" }

Get group attribute options

Query Parameters

_sort
string

How to sort the data. This must be in the format of {field}:{asc | desc}. For example: updatedAt:desc
agencyId
string

The agency this option belongs to. Leave empty if public.

Other supported queries:

  • agencyId__not: Search records where the agencyId does not match your query value
  • agencyId__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
Note: This attribute is only applicable to user roles: admin, staff
attributeId
string
Required

The id of the attribute

Other supported queries:

  • attributeId__not: Search records where the attributeId does not match your query value
companyId
string

The company this option belongs to. Leave empty if public to all companies under the agency ID.

Other supported queries:

  • companyId__not: Search records where the companyId does not match your query value
  • companyId__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
constraints.attributeId
string
Required

The channel's attribute id to check against

Other supported queries:

  • constraints.attributeId__not: Search records where the attributeId does not match your query value
constraints.ruleType
string
Required

The rule type

Other supported queries:

  • constraints.ruleType__not: Search records where the ruleType does not match your query value
Supported Values
equals starts_with ends_with contains
constraints.ruleValues
array <string>
Required

The rule values

Other supported queries:

  • constraints.ruleValues__not: Search records where the ruleValues does not match your query value
groupId
string
Required

The id of the group.

Other supported queries:

  • groupId__not: Search records where the groupId does not match your query value
limit
integer
min 1
max 9999

The number of records to return in 1 call. Note that Cresco may not follow the limit given if the size of data returned it too large.
name
string

The name of the option.

Other supported queries:

  • name__not: Search records where the name does not match your query value
  • name__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
optionId
string
Required

The id of option.

Other supported queries:

  • optionId__not: Search records where the optionId does not match your query value
page
string

The current page or page token used to paginate. This could be an offset number or a base64 encoded string. Do not assume this to always be a number. Exclude this parameter on your first api call. On subsequent calls, use the x-cresco-page header value returned from the previous api call as this field value. If this header does not exist, there are no more records to query.
scroll
integer
min 1
max 10

The time, in minutes that your page token will be valid for. Use only if you need to paginate past 10000 records as it will slightly slow down the query. Note that the x-cresco-page header returned will always be the same base64 encoded token and should be used the the next page query until the x-cresco-page header is no longer returned.
taxonomyId
string
Required

The internal id of the taxonomy

Other supported queries:

  • taxonomyId__not: Search records where the taxonomyId does not match your query value
version
integer
min 0

The taxonomy version.

Other supported queries:

  • version__not: Search records where the version does not match your query value
  • version__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
  • version__lt: Less Than
  • version__lte: Less Than or Equals To
  • version__gt: Greater Than
  • version__gte: Greater Than or Equals To

Return Headers

x-cresco-page
string

The page / token you can use to paginate and query the next batch of records. This may be a number or a base64 encoded string. Use this value in the page query parameter of your next API call. If this header is not present, there are no more records to query for.
x-cresco-total
integer

The total number of records that match your query. This header may not be present if your query has not been indexed.
GET /taxonomies/<__taxonomyId__>/groups//attributes//options
import requests body = None headers = {"Authorization": "{IdToken}"} params = {} response = requests.get('https://api-dev.crescodata.com/taxonomies/<__taxonomyId__>/groups/<groupId>/attributes/<attributeId>/options', params=params, headers=headers, json=body)
Return Headers Sample for GET /taxonomies/<__taxonomyId__>/groups/<groupId>/attributes/<attributeId>/options
{ "x-cresco-total": "99999", "x-cresco-page": "eyJjb21wYW55SWQiOiAiYTQxZDg3ZDEtMGMxNi00YzMxLWJlZjAtODNjMmU0NWQ2ZTBiIiwgIl9wa18iOiAiYmQzMzRkODMtNzFkMC00YTc0LWIyNjEtODlmN2YyMTg4NTNmIiwgInN5bmNUeXBlIjogInByb2R1Y3RzIn0=" }

Company object

Each company record represents an isolated account or merchant within the platform.

Each company has access to records within its own company only. Companies can therefore by used to create country specific accounts for the same brand.

How products are grouped and therefore how companies are setup depends on the use-cases of where data comes from (how many input channels and most effective way to query those) and where datais sent to (single marketplace account or one account per country)

Attributes

agencyData
object

Any data related to this company
agencyId
string
Required

The agency ID for this merchant.
Note: This attribute is only applicable to user roles: admin, staff, manager
agencyLevel
boolean

Whether this company's integrations should be treated as agency-level
Note: This attribute is only applicable to user roles: admin, staff, agency
companyId
string
read-only

The id of the company
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
country
string
Required

The country of the company
Supported Values
AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW
createdAt
string
read-only

The time this company was created
logo
string

The url to the system thumbnail logo
name
string
Required

The name of the company
updatedAt
string
read-only

The time this company was updated
Company object
{ "companyId": "11111111-2222-3333-4444-555555555555", "name": "Cresco Data", "country": "SG", "agencyId": "11111111-2222-3333-4444-555555555555", "updatedAt": "2019-01-01T00:00:00+00:00", "createdAt": "2019-01-01T00:00:00+00:00", "agencyData": { "anything": 123 } }

List companies

Query Parameters

_sort
string

How to sort the data. This must be in the format of {field}:{asc | desc}. For example: updatedAt:desc
agencyId
string
Required

The agency ID for this merchant.

Other supported queries:

  • agencyId__not: Search records where the agencyId does not match your query value
Note: This attribute is only applicable to user roles: admin, staff, manager
agencyLevel
boolean

Whether this company's integrations should be treated as agency-level

Other supported queries:

  • agencyLevel__not: Search records where the agencyLevel does not match your query value
  • agencyLevel__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
Note: This attribute is only applicable to user roles: admin, staff, agency
companyId
string
read-only

The id of the company

Other supported queries:

  • companyId__not: Search records where the companyId does not match your query value
  • companyId__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
country
string
Required

The country of the company

Other supported queries:

  • country__not: Search records where the country does not match your query value
Supported Values
AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW
createdAt
string
read-only

The time this company was created

Other supported queries:

  • createdAt__not: Search records where the createdAt does not match your query value
  • createdAt__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
  • createdAt__lt: Less Than
  • createdAt__lte: Less Than or Equals To
  • createdAt__gt: Greater Than
  • createdAt__gte: Greater Than or Equals To
limit
integer
min 1
max 9999

The number of records to return in 1 call. Note that Cresco may not follow the limit given if the size of data returned it too large.
logo
string

The url to the system thumbnail logo

Other supported queries:

  • logo__not: Search records where the logo does not match your query value
  • logo__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
name
string
Required

The name of the company

Other supported queries:

  • name__not: Search records where the name does not match your query value
page
string

The current page or page token used to paginate. This could be an offset number or a base64 encoded string. Do not assume this to always be a number. Exclude this parameter on your first api call. On subsequent calls, use the x-cresco-page header value returned from the previous api call as this field value. If this header does not exist, there are no more records to query.
scroll
integer
min 1
max 10

The time, in minutes that your page token will be valid for. Use only if you need to paginate past 10000 records as it will slightly slow down the query. Note that the x-cresco-page header returned will always be the same base64 encoded token and should be used the the next page query until the x-cresco-page header is no longer returned.
updatedAt
string
read-only

The time this company was updated

Other supported queries:

  • updatedAt__not: Search records where the updatedAt does not match your query value
  • updatedAt__exists: Set to true to search records that have this attribute set, false to search records that don't have this attribute set.
  • updatedAt__lt: Less Than
  • updatedAt__lte: Less Than or Equals To
  • updatedAt__gt: Greater Than
  • updatedAt__gte: Greater Than or Equals To

Return Headers

x-cresco-page
string

The page / token you can use to paginate and query the next batch of records. This may be a number or a base64 encoded string. Use this value in the page query parameter of your next API call. If this header is not present, there are no more records to query for.
x-cresco-total
integer

The total number of records that match your query. This header may not be present if your query has not been indexed.
GET /companies
import requests body = None headers = {"Authorization": "{IdToken}"} params = {} response = requests.get('https://api-dev.crescodata.com/companies', params=params, headers=headers, json=body)
Return Headers Sample for GET /companies
{ "x-cresco-total": "99999", "x-cresco-page": "eyJjb21wYW55SWQiOiAiYTQxZDg3ZDEtMGMxNi00YzMxLWJlZjAtODNjMmU0NWQ2ZTBiIiwgIl9wa18iOiAiYmQzMzRkODMtNzFkMC00YTc0LWIyNjEtODlmN2YyMTg4NTNmIiwgInN5bmNUeXBlIjogInByb2R1Y3RzIn0=" }

Add a company

Attributes

agencyData
object

Any data related to this company
agencyId
string
Required

The agency ID for this merchant.
Note: This attribute is only applicable to user roles: admin, staff, manager
agencyLevel
boolean

Whether this company's integrations should be treated as agency-level
Note: This attribute is only applicable to user roles: admin, staff, agency
companyId
string
read-only

The id of the company
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
country
string
Required

The country of the company
Supported Values
AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW
createdAt
string
read-only

The time this company was created
logo
string

The url to the system thumbnail logo
name
string
Required

The name of the company
updatedAt
string
read-only

The time this company was updated
POST /companies
import requests body = {'agencyData': {'anything': 123}, 'agencyId': '11111111-2222-3333-4444-555555555555', 'country': 'SG', 'name': 'Cresco Data'} headers = {"Authorization": "{IdToken}"} params = None response = requests.post('https://api-dev.crescodata.com/companies', params=params, headers=headers, json=body)

Get a company

GET /companies/
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/companies/<companyId>', params=params, headers=headers, json=body)

Delete a company

DELETE /companies/
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.delete('https://api-dev.crescodata.com/companies/<companyId>', params=params, headers=headers, json=body)

Update a company

Attributes

agencyData
object

Any data related to this company
agencyId
string
Required

The agency ID for this merchant.
Note: This attribute is only applicable to user roles: admin, staff, manager
agencyLevel
boolean

Whether this company's integrations should be treated as agency-level
Note: This attribute is only applicable to user roles: admin, staff, agency
companyId
string
read-only

The id of the company
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
country
string
Required

The country of the company
Supported Values
AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW
createdAt
string
read-only

The time this company was created
logo
string

The url to the system thumbnail logo
name
string
Required

The name of the company
updatedAt
string
read-only

The time this company was updated
PATCH /companies/
import requests body = {'agencyData': {'anything': 123}, 'agencyId': '11111111-2222-3333-4444-555555555555', 'country': 'SG', 'name': 'Cresco Data'} headers = {"Authorization": "{IdToken}"} params = None response = requests.patch('https://api-dev.crescodata.com/companies/<companyId>', params=params, headers=headers, json=body)

Replace a company

Attributes

agencyData
object

Any data related to this company
agencyId
string
Required

The agency ID for this merchant.
Note: This attribute is only applicable to user roles: admin, staff, manager
agencyLevel
boolean

Whether this company's integrations should be treated as agency-level
Note: This attribute is only applicable to user roles: admin, staff, agency
companyId
string
read-only

The id of the company
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
country
string
Required

The country of the company
Supported Values
AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW
createdAt
string
read-only

The time this company was created
logo
string

The url to the system thumbnail logo
name
string
Required

The name of the company
updatedAt
string
read-only

The time this company was updated
PUT /companies/
import requests body = {'agencyData': {'anything': 123}, 'agencyId': '11111111-2222-3333-4444-555555555555', 'country': 'SG', 'name': 'Cresco Data'} headers = {"Authorization": "{IdToken}"} params = None response = requests.put('https://api-dev.crescodata.com/companies/<companyId>', params=params, headers=headers, json=body)

Get the history of a company

GET /companies//history
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/companies/<companyId>/history', params=params, headers=headers, json=body)

List metrics

GET /dashboard/metrics
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/dashboard/metrics', params=params, headers=headers, json=body)

Add a metric

Attributes

agencyId
string
Conditional
required if companyId is not given

The agency this metric belongs to
Note: This attribute is only applicable to user roles: admin, staff
companyId
string

The company this metric belongs to.
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
createdAt
string
read-only

The date this metric was created
eventAction
string

The event action to query for. Typically needed for `syncs`, `enriched` and `accounts` event groups
eventGroup
string
Conditional
required if metricType equals event}

The event group to query for.
eventQueryParams
object

The parameters to use when querying.
eventTracker
string

The event tracker to query for. Typically needed for `syncs`, `enriched` and `accounts` event groups
groupName
string

The group name of this metric.
metricId
string
read-only

The ID of this metric
metricType
string
Required

The type of this metric.
Supported Values
event state billing
name
string
Required

The name of this metric.
range
string
Conditional
required if metricType equals ['event', 'billing']}

The range to query the event. Example values are "1 month" or "1 week", which will query from the start of the month or week up to now. You can also do "1 month:1 month, which is last month.
stateApi
string
Conditional
required if metricType equals state}

The API to retrieve the state from.
updatedAt
string
read-only

The date this metric was updated
username
string

The user this metric belongs to.
viewFormat
string

The format to view the data in on the front-end. Typically table or different chart types are supported, and is only needed for event metric types.
POST /dashboard/metrics
import requests body = {'agencyId': '11111111-2222-3333-4444-555555555555', 'companyId': '11111111-2222-3333-4444-555555555555', 'eventAction': 'added', 'eventGroup': 'enrich', 'eventQueryParams': {'aggregateBy': 'companyId', 'limit': 5, 'sum': True}, 'eventTracker': 'products', 'groupName': 'Prods', 'metricType': 'state', 'name': 'Top 5 Merchants Last Week with new SKUs Published', 'range': '1 week:1 week', 'stateApi': 'products', 'username': 'staff@crescodata.com', 'viewFormat': 'barChart'} headers = {"Authorization": "{IdToken}"} params = None response = requests.post('https://api-dev.crescodata.com/dashboard/metrics', params=params, headers=headers, json=body)

Delete a metric

DELETE /dashboard/metrics/
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.delete('https://api-dev.crescodata.com/dashboard/metrics/<metricId>', params=params, headers=headers, json=body)

Update a metric

Attributes

agencyId
string
Conditional
required if companyId is not given

The agency this metric belongs to
Note: This attribute is only applicable to user roles: admin, staff
companyId
string

The company this metric belongs to.
Note: This attribute is only applicable to user roles: admin, staff, agency, manager
createdAt
string
read-only

The date this metric was created
eventAction
string

The event action to query for. Typically needed for `syncs`, `enriched` and `accounts` event groups
eventGroup
string
Conditional
required if metricType equals event}

The event group to query for.
eventQueryParams
object

The parameters to use when querying.
eventTracker
string

The event tracker to query for. Typically needed for `syncs`, `enriched` and `accounts` event groups
groupName
string

The group name of this metric.
metricId
string
read-only

The ID of this metric
metricType
string
Required

The type of this metric.
Supported Values
event state billing
name
string
Required

The name of this metric.
range
string
Conditional
required if metricType equals ['event', 'billing']}

The range to query the event. Example values are "1 month" or "1 week", which will query from the start of the month or week up to now. You can also do "1 month:1 month, which is last month.
stateApi
string
Conditional
required if metricType equals state}

The API to retrieve the state from.
updatedAt
string
read-only

The date this metric was updated
username
string

The user this metric belongs to.
viewFormat
string

The format to view the data in on the front-end. Typically table or different chart types are supported, and is only needed for event metric types.
PUT /dashboard/metrics/
import requests body = {'agencyId': '11111111-2222-3333-4444-555555555555', 'companyId': '11111111-2222-3333-4444-555555555555', 'eventAction': 'added', 'eventGroup': 'enrich', 'eventQueryParams': {'aggregateBy': 'companyId', 'limit': 5, 'sum': True}, 'eventTracker': 'products', 'groupName': 'Prods', 'metricType': 'state', 'name': 'Top 5 Merchants Last Week with new SKUs Published', 'range': '1 week:1 week', 'stateApi': 'products', 'username': 'staff@crescodata.com', 'viewFormat': 'barChart'} headers = {"Authorization": "{IdToken}"} params = None response = requests.put('https://api-dev.crescodata.com/dashboard/metrics/<metricId>', params=params, headers=headers, json=body)

Get a metric

GET /dashboard/metrics/
import requests body = None headers = {"Authorization": "{IdToken}"} params = None response = requests.get('https://api-dev.crescodata.com/dashboard/metrics/<metricId>', params=params, headers=headers, json=body)