Produtos

Produtos lançados nos últimos 60 dias

GET
/v1/products/launches

Produtos cuja primeira venda na loja, em todo o histórico, cai dentro dos 60 dias que terminam em dateTo. Por produto: data da primeira venda (Ativo desde), clientes novos, compradores distintos, parte de novos entre os compradores, pedidos e margem, tudo sobre a janela. newCustomers segue a definição da listagem (clientes cuja primeira compra na loja foi um pedido com o produto); buyers é uma contagem distinta, que a listagem não publica. Lê analytics.fct_order_sku_sales e analytics.fct_customer_cohort. Loja com histórico que começa dentro da janela responde history_too_short, sem linhas. Cache de 5 minutos.

Autorização

ClientIdAuthClientSecretAuth
headerx-client-id<token>

Client ID

headerx-client-secret<token>

Client secret

Parâmetros de query

organizationId*string
Formatouuid
integrationId*string

Id canônico da integração de origem, exposto por GET /v1/products/integrations como sourceIntegrationId.

Formatouuid
dateTo?string

Último dia da janela. Padrão: hoje.

Formatodate
gtmMotionId?string

GTM motion of the organization (UUID), as listed by GET /v1/gtm-motions. Optional: without it, the response covers the organization's default GTM motion. The default motion is answered with the organization's data, the same numbers as when the parameter is omitted. Another GTM motion of the organization only sees its own stores (V4MOS-2707): a store belongs to a motion whole, so GET /v1/products/integrations lists only the motion's stores (none for a motion without a store) and a route that reads one store answers exactly as for the organization when integrationId is a store of the motion, and 404 GTM_MOTION_STORE_NOT_IN_MOTION otherwise. Not a UUID: 400. Not a live GTM motion of the organization: 403 GTM_MOTION_NOT_IN_ORGANIZATION.

Formatouuid

Corpo da resposta

Lançamentos da janela, ordenados por clientes novos e depois por pedidos, do maior para o menor. Todos eles: agrupar a cauda é do chamador.

application/json
  1. response
state*string
Valor em"ready""no_launches""history_too_short"
reason*|

Por que launches está vazio; null quando ready.

Valor em"store_history_shorter_than_window""no_launch_in_window"null
asOf*|
Formatodate-time
integrationId*string
Formatouuid
windowDays*integer
period*
launches*array<>
curl -X GET "https://example.com/v1/products/launches?organizationId=497f6eca-6276-4993-bfeb-53cbbbba6f08&integrationId=497f6eca-6276-4993-bfeb-53cbbbba6f08&gtmMotionId=019a5b2e-7c4d-7abc-8def-0123456789ab"
{  "state": "ready",  "reason": "store_history_shorter_than_window",  "asOf": "2019-08-24T14:15:22Z",  "integrationId": "497a18ca-284e-40c0-985d-f72be35d468e",  "windowDays": 60,  "period": {    "from": "2019-08-24",    "to": "2019-08-24"  },  "launches": [    {      "productId": "string",      "productName": "string",      "firstSaleDate": "2019-08-24",      "newCustomers": 0,      "buyers": 0,      "newShare": 0,      "orders": 0,      "netSales": 0,      "marginTotal": 0,      "marginAverage": 0,      "marginNdReason": "incomplete_gross_value"    }  ]}