W3Block Docs
  • ๐Ÿš€Start here
    • Welcome to the Docs
    • Integrated Blockchains
  • ๐Ÿ‘จโ€๐Ÿ’ปDev Docs
    • API
      • Getting Started
      • Authentication
      • Commerce API services
        • Company Administration
          • Companies (Admin)
          • Assets (Admin)
          • Tags (Admin)
          • Products (Admin)
            • Order Rules (Admin)
          • Orders (Admin)
          • Faq (Admin)
          • Webhooks (Admin)
        • Products
        • Orders
        • Webhooks
        • Faq
        • Globals
      • Key API Services
        • Authentication
        • Companies
        • Tokens
          • Contracts
            • External Contacts
            • Royalty Eligible
          • Categories
            • Subcategories
          • Token Collections
            • Token Editions
          • Metadata
        • Blockchain
        • Cloudinary
        • Integration
          • Ecommerce
            • Associate Tokens
            • Hooks
        • Users
        • Vouchers
  • ๐Ÿ“˜Knowledge Base
    • First Steps
    • FAQ
    • Glossary
Powered by GitBook
On this page
  1. Dev Docs
  2. API
  3. Commerce API services
  4. Company Administration

Tags (Admin)

PreviousAssets (Admin)NextProducts (Admin)

Last updated 2 years ago

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:

Lists all company tags

Rest API reference:

Gets some company tag by id

Rest API reference:

Updates some company tag

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
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
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"
  }
}
get

Get some company tag by id

Authorizations
Path parameters
idstringRequired
companyIdstringRequired
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
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
    }
  ]
}
  • Service Methods
  • Creates a new tag inside a company
  • POST/admin/companies/{companyId}/tags
  • Lists all company tags
  • GET/admin/companies/{companyId}/tags
  • Gets some company tag by id
  • GET/admin/companies/{companyId}/tags/{id}
  • Updates some company tag
  • PATCH/admin/companies/{companyId}/tags/{id}
post

Create a company tag

Authorizations
Path parameters
companyIdstringRequired
Body
namestringRequiredExample: Tag 1
parentIdstring ยท uuidOptional
hidebooleanRequiredExample: false
Responses
201Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
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
    }
  ]
}
patch

Updates some company tag

Authorizations
Path parameters
idstringRequired
companyIdstringRequired
Body
namestringRequiredExample: Tag 1
parentIdstring ยท uuidOptional
hidebooleanRequiredExample: false
Responses
200Success
application/json
401
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
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
    }
  ]
}