Tags (Admin)

Tags can be used to associate products to some words or categories. A tag can be used to filter products into the e-commerce.

Tags can be created associated to other tags, so you can create a kind of sub-tagging or even a tree of tags and show it into your e-commerce.

Tag Model (Example)
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "companyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "string",
  "products": [],
  "parentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "parent": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "companyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "string",
    "parentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "hide": true
  },
  "hide": true,
  "children": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "companyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "string",
      "parentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "hide": true
    }
  ]
}

Service Methods

Creates a new tag inside a company

Rest API reference:

post

Create a company tag

Authorizations
Path parameters
companyIdstringRequired
Body
namestringRequiredExample: Tag 1
parentIdstring · uuidOptional
hidebooleanRequiredExample: false
Responses
201Success
application/json
post
POST /admin/companies/{companyId}/tags HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 45

{
  "name": "Tag 1",
  "parentId": null,
  "hide": false
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "products": [
    {}
  ],
  "parentId": "123e4567-e89b-12d3-a456-426614174000",
  "parent": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "companyId": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "products": [
      {}
    ],
    "parentId": "123e4567-e89b-12d3-a456-426614174000",
    "hide": true
  },
  "hide": true,
  "children": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "companyId": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "products": [
        {}
      ],
      "parentId": "123e4567-e89b-12d3-a456-426614174000",
      "hide": true
    }
  ]
}

Lists all company tags

Rest API reference:

get

Get all company tags paginated

Authorizations
Path parameters
companyIdstringRequired
Query parameters
pagenumberOptionalDefault: 1
limitnumberOptionalDefault: 10
searchstringOptional
sortBystring · enumOptionalExample: createdAtPossible values:
orderBystring · enumOptionalPossible values:
Responses
200Success
application/json
get
GET /admin/companies/{companyId}/tags HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "companyId": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "products": [
        {}
      ],
      "parentId": "123e4567-e89b-12d3-a456-426614174000",
      "parent": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "companyId": "123e4567-e89b-12d3-a456-426614174000",
        "name": "text",
        "products": [
          {}
        ],
        "parentId": "123e4567-e89b-12d3-a456-426614174000",
        "hide": true
      },
      "hide": true,
      "children": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "companyId": "123e4567-e89b-12d3-a456-426614174000",
          "name": "text",
          "products": [
            {}
          ],
          "parentId": "123e4567-e89b-12d3-a456-426614174000",
          "hide": true
        }
      ]
    }
  ],
  "meta": {
    "itemCount": 1,
    "totalItems": 1,
    "itemsPerPage": 1,
    "totalPages": 1,
    "currentPage": 1
  },
  "links": {
    "first": "http://example.com?page=1",
    "prev": "http://example.com?page=1",
    "next": "http://example.com?page=2",
    "last": "http://example.com?page=3"
  }
}

Gets some company tag by id

Rest API reference:

get

Get some company tag by id

Authorizations
Path parameters
idstringRequired
companyIdstringRequired
Responses
200Success
application/json
get
GET /admin/companies/{companyId}/tags/{id} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "products": [
    {}
  ],
  "parentId": "123e4567-e89b-12d3-a456-426614174000",
  "parent": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "companyId": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "products": [
      {}
    ],
    "parentId": "123e4567-e89b-12d3-a456-426614174000",
    "hide": true
  },
  "hide": true,
  "children": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "companyId": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "products": [
        {}
      ],
      "parentId": "123e4567-e89b-12d3-a456-426614174000",
      "hide": true
    }
  ]
}

Updates some company tag

Rest API reference:

patch

Updates some company tag

Authorizations
Path parameters
idstringRequired
companyIdstringRequired
Body
namestringRequiredExample: Tag 1
parentIdstring · uuidOptional
hidebooleanRequiredExample: false
Responses
200Success
application/json
patch
PATCH /admin/companies/{companyId}/tags/{id} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 45

{
  "name": "Tag 1",
  "parentId": null,
  "hide": false
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "products": [
    {}
  ],
  "parentId": "123e4567-e89b-12d3-a456-426614174000",
  "parent": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "companyId": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "products": [
      {}
    ],
    "parentId": "123e4567-e89b-12d3-a456-426614174000",
    "hide": true
  },
  "hide": true,
  "children": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "companyId": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "products": [
        {}
      ],
      "parentId": "123e4567-e89b-12d3-a456-426614174000",
      "hide": true
    }
  ]
}

Last updated