Skip to main content
GET
/
v1
/
products?collection=:slug
Produtos por coleção
curl --request GET \
  --url 'https://lojinha.dev/api/v1/products?collection=%3Aslug' \
  --header 'Authorization: Bearer <token>'
{
  "products": [
    {
      "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
      }
    }
  ],
  "total": 1
}

Documentation Index

Fetch the complete documentation index at: https://docs.lojinha.dev/llms.txt

Use this file to discover all available pages before exploring further.

collection
string
Slug da coleção.

Resposta

Um produto só fica disponível pela API se as duas situações seguintes forem atendidas: (1) O produto precisa ter um status ativo, (2) se o produto estiver em uma coleção, esta coleção não pode estar arquivada.
products
array
total
number
O número total de produtos encontrados
{
  "products": [
    {
      "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
      }
    }
  ],
  "total": 1
}