curl --request GET \
--url https://lojinha.dev/api/v1/products/:slug \
--header 'Authorization: Bearer <token>'
{
"product": {
"id": "4cf35a0f-7f25-43ef-8e5e-208fbfeb1bd0",
"store": "org_2StqHEqEqKtCH66IJjLb73J2ww6",
"status": "ACTIVE",
"name": "A Tormenta de Espadas",
"slug": "a-tormenta-de-espadas",
"description": "<p>Terceiro livro da série</p>",
"price": 8000,
"originalPrice": 12000,
"quantity": 9,
"sku": "LI-004",
"createdAt": "2023-07-22T00:51:44.685Z",
"updatedAt": "2023-07-24T02:09:03.948Z",
"deletedAt": null,
"_count": {
"collections": 2,
"orders": 2
}
}
}
Retorna o primeiro produto pela slug
curl --request GET \
--url https://lojinha.dev/api/v1/products/:slug \
--header 'Authorization: Bearer <token>'
{
"product": {
"id": "4cf35a0f-7f25-43ef-8e5e-208fbfeb1bd0",
"store": "org_2StqHEqEqKtCH66IJjLb73J2ww6",
"status": "ACTIVE",
"name": "A Tormenta de Espadas",
"slug": "a-tormenta-de-espadas",
"description": "<p>Terceiro livro da série</p>",
"price": 8000,
"originalPrice": 12000,
"quantity": 9,
"sku": "LI-004",
"createdAt": "2023-07-22T00:51:44.685Z",
"updatedAt": "2023-07-24T02:09:03.948Z",
"deletedAt": null,
"_count": {
"collections": 2,
"orders": 2
}
}
}
Show child attributes
DRAFT | ACTIVE
string
com HTML
Stock Keeping Unit
, pode
ser o código de barras de um produto úniconull
{
"product": {
"id": "4cf35a0f-7f25-43ef-8e5e-208fbfeb1bd0",
"store": "org_2StqHEqEqKtCH66IJjLb73J2ww6",
"status": "ACTIVE",
"name": "A Tormenta de Espadas",
"slug": "a-tormenta-de-espadas",
"description": "<p>Terceiro livro da série</p>",
"price": 8000,
"originalPrice": 12000,
"quantity": 9,
"sku": "LI-004",
"createdAt": "2023-07-22T00:51:44.685Z",
"updatedAt": "2023-07-24T02:09:03.948Z",
"deletedAt": null,
"_count": {
"collections": 2,
"orders": 2
}
}
}