Ankorstore Catalog API

ℹ️ This section describes the API endpoints that you can use to manage your catalog resources, such as products, product variants etc. ## 💡 Working with Products Here you will find information about the product resource and its sub-resources. If you need further information please refer to the API specification. ### Including Product Variants When retrieving the individual product via the API, you may pass an `?include=productVariants` query parameter that will return associated product variants inside the `included` root level object. ### Important Fields within Product Resource If the field contains no data, it will be `null`. ## 💡 Stock Management This API allows you to manage your product variants stock for the marketplace in both single- and bulk-operation mode. There are 2 opposite options available for the stock update requests - set an explicit product quantity or mark the corresponding product as "always in stock". ### Stock statuses Stock for the marketplace can be in one of two states. It can be `available` to order on the marketplace, or `reserved` for an order that has been submitted, but not yet shipped. Added together, these quantities make up the `onHand` state, which reflects the total quantity of the product variant "on hand" at your storage location(s). > ⚠️ **Unless specified otherwise, `stockQuantity` used in the following APIs refers to `onHand` quantity** See also [Stock State](#tag/folderName_Stock-Concepts/Stock-state) for more general information about stock states used in the Stock Tracking APIs. #### Example * 100 units of the product variant X are stock at your location (`onHand`). * 30 units of product variant X are `reserved` for Ankorstore orders that have not yet been shipped. * Then 70 units of product variant X are `available` to order on the marketplace. Now consider you produce 50 more units of product variant X, and sell 27 units on another marketplace. Your input for the stock update API would be: ``` // 100 + 50 - 27 = 133 "stockQuantity": 123 ``` ### Set product variant stock explicit quantity To set an explicit quantity for the particular product variant, you should specify the amount in the payload. In case if the target product variant was previously marked as "always in stock", this option will be disabled and the stock will be set to given value. Example of the payload to set a product variant stock to the given value (single-operation mode): `PATCH /api/v1/product-variants/1ed18988-6651-610e-8223-aa5cd9844f96/stock` ```json { "data": { "attributes": { "stockQuantity": 123 } } } ``` More details can be found in the endpoint specification ### Set product variant as "always in stock" To mark a particular product variant as "always in stock" and do not care about the stock amounts, you should include a flag `isAlwaysInStock` into the request payload. In case if the target product variant had explicit stock amount set previously, it will be reset. Example of the payload to set a product variant stock to the given value (single-operation mode): `PATCH /api/v1/product-variants/1ed18988-6651-610e-8223-aa5cd9844f96/stock` ```json { "data": { "attributes": { "isAlwaysInStock": true } } } ``` More details can be found in the endpoint specification ### Update stocks of multiple product variants in single request (bulk-operation mode) This API allows to update stocks of multiple product variants in single request. There is a specific endpoint which accepts up to 50 operations per request. Validation, business rules and payload of each operation is identical to the single-operation mode, described above. Example of the payload to update stocks of multiple product variants in single request: `POST /api/v1/operations` ```json { "atomic:operations": [ { "op": "update", "data": { "type": "productVariants", "id": "1ed18988-3253-610e-8223-aa5cd9844001", "attributes": { "isAlwaysInStock": true } } }, { "op": "update", "data": { "type": "productVariants", "id": "1ed18988-6651-610e-8223-aa5cd9844f96", "attributes": { "stockQuantity": 123 } } } ] } ``` More details can be found in the endpoint specification

OpenAPI Specification

ankorstore-catalog-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  version: 1.2.2-oas3.1
  title: Ankorstore Stock Tracking and Logistics Applications Catalog API
  summary: API specification for the Ankorstore Stock Tracking and Logistics system
  description: Ankorstore Stock Tracking and Logistics (ASTRAL) API specification
  contact:
    name: Ankorstore
    url: https://www.ankorstore.com
    email: api@ankorstore.com
  license:
    url: https://creativecommons.org/publicdomain/zero/1.0/
    name: CC0 1.0 Universal
servers:
- url: http://www.ankorlocal.com:8000
  description: Local Development Server
- url: https://www.preprod.ankorstore.com
  description: Staging Environment
- url: https://www.ankorstore.com
  description: Prod Environment
tags:
- name: Catalog
  description: "ℹ️ This section describes the API endpoints that you can use to manage your catalog resources, such as products, product variants etc.\n\n## \U0001F4A1 Working with Products\n\nHere you will find information about the product resource and its sub-resources. If you need further information please refer to the API specification.\n\n### Including Product Variants\n\nWhen retrieving the individual product via the API, you may pass an `?include=productVariants` query parameter that will return associated product variants inside the `included` root level object.\n\n### Important Fields within Product Resource\n\nIf the field contains no data, it will be `null`.\n\n## \U0001F4A1 Stock Management\n\nThis API allows you to manage your product variants stock for the marketplace in both single- and bulk-operation mode.\nThere are 2 opposite options available for the stock update requests - set an explicit product quantity\nor mark the corresponding product as \"always in stock\".\n\n### Stock statuses\nStock for the marketplace can be in one of two states. It can be `available` to order on the marketplace, or `reserved` for an order that has been submitted, but not yet shipped.\nAdded together, these quantities make up the `onHand` state, which reflects the total quantity of the product variant \"on hand\" at your storage location(s).\n\n> ⚠️ **Unless specified otherwise, `stockQuantity` used in the following APIs refers to `onHand` quantity**\n\nSee also [Stock State](#tag/folderName_Stock-Concepts/Stock-state) for more general information about stock states used in the Stock Tracking  APIs.\n\n#### Example\n* 100 units of the product variant X are stock at your location (`onHand`).\n* 30 units of product variant X are `reserved` for Ankorstore orders that have not yet been shipped.\n* Then 70 units of product variant X are `available` to order on the marketplace.\n\nNow consider you produce 50 more units of product variant X, and sell 27 units on another marketplace. Your input for the stock update API would be:\n```\n// 100 + 50 - 27 = 133\n\"stockQuantity\": 123\n```\n\n### Set product variant stock explicit quantity\n\nTo set an explicit quantity for the particular product variant, you should specify the amount in the payload.\nIn case if the target product variant was previously marked as \"always in stock\", this option will be disabled and the stock\nwill be set to given value.\n\nExample of the payload to set a product variant stock to the given value (single-operation mode):\n\n`PATCH /api/v1/product-variants/1ed18988-6651-610e-8223-aa5cd9844f96/stock`\n```json\n{\n  \"data\": {\n    \"attributes\": {\n      \"stockQuantity\": 123\n    }\n  }\n}\n```\nMore details can be found in the endpoint specification\n\n### Set product variant as \"always in stock\"\n\nTo mark a particular product variant as \"always in stock\" and do not care about the stock amounts, you should include a\nflag `isAlwaysInStock` into the request payload. In case if the target product variant had explicit stock amount set previously,\nit will be reset.\n\nExample of the payload to set a product variant stock to the given value (single-operation mode):\n\n`PATCH /api/v1/product-variants/1ed18988-6651-610e-8223-aa5cd9844f96/stock`\n```json\n{\n  \"data\": {\n    \"attributes\": {\n      \"isAlwaysInStock\": true\n    }\n  }\n}\n```\nMore details can be found in the endpoint specification\n\n### Update stocks of multiple product variants in single request (bulk-operation mode)\n\nThis API allows to update stocks of multiple product variants in single request. There is a specific endpoint which\naccepts up to 50 operations per request. Validation, business rules and payload of each operation is identical to the\nsingle-operation mode, described above.\n\nExample of the payload to update stocks of multiple product variants in single request:\n\n`POST /api/v1/operations`\n```json\n{\n  \"atomic:operations\": [\n    {\n      \"op\": \"update\",\n      \"data\": {\n        \"type\": \"productVariants\",\n        \"id\": \"1ed18988-3253-610e-8223-aa5cd9844001\",\n        \"attributes\": {\n          \"isAlwaysInStock\": true\n        }\n      }\n    },\n    {\n      \"op\": \"update\",\n      \"data\": {\n        \"type\": \"productVariants\",\n        \"id\": \"1ed18988-6651-610e-8223-aa5cd9844f96\",\n        \"attributes\": {\n          \"stockQuantity\": 123\n        }\n      }\n    }\n  ]\n}\n```\nMore details can be found in the endpoint specification\n"
paths:
  /api/v1/products:
    get:
      summary: List Products
      description: Returns all products
      operationId: list-products
      tags:
      - Catalog
      parameters:
      - name: include
        in: query
        description: 'A comma-separated list of resources to include (e.g: productVariant)'
        allowEmptyValue: true
        required: false
        schema:
          type: string
          enum:
          - productOption
          - productVariant
      - name: Accept
        in: header
        description: application/vnd.api+json
        schema:
          type: string
          default: application/vnd.api+json
      - name: page[limit]
        in: query
        description: limit the amount of results returned
        required: false
        schema:
          type: integer
          format: int64
      - name: page[before]
        in: query
        description: show items before the provided ID (uuid format)
        required: false
        schema:
          type: string
      - name: page[after]
        in: query
        description: show items after the provided ID (uuid format)
        required: false
        schema:
          type: string
      responses:
        '200':
          description: '[OK](https://jsonapi.org/format/#fetching-resources-responses-200)'
          content:
            application/vnd.api+json:
              schema:
                type: object
                title: Product Collection
                required:
                - data
                properties:
                  meta:
                    type: object
                    description: Meta with Pagination Details
                    required:
                    - page
                    additionalProperties: true
                    properties:
                      page:
                        description: Cursor pagination details
                        type: object
                        properties:
                          from:
                            type:
                            - string
                            - 'null'
                          to:
                            type:
                            - string
                            - 'null'
                          hasMore:
                            type: boolean
                          perPage:
                            type: integer
                        required:
                        - from
                        - to
                        - perPage
                  jsonapi:
                    description: An object describing the server's implementation
                    type: object
                    properties: &id002
                      version:
                        type: string
                      meta:
                        description: Non-standard meta-information that can not be represented as an attribute or relationship.
                        type: object
                        additionalProperties: true
                    additionalProperties: false
                  links:
                    description: Pagination navigation links. If a link does not exist then you cannot paginate any further in that direction.
                    type: object
                    properties:
                      first:
                        type: string
                        format: url
                      next:
                        type: string
                        format: url
                      prev:
                        type: string
                        format: url
                  data:
                    description: List of Product resource objects
                    type: array
                    uniqueItems: true
                    items:
                      title: Product Resource
                      description: The resource object for Product
                      type: object
                      additionalProperties: false
                      properties:
                        type:
                          type: string
                          default: products
                        id:
                          type: string
                          description: '[resource object identifier (uuid)](https://jsonapi.org/format/#document-resource-object-identification)'
                          format: uuid
                        attributes:
                          type: object
                          properties:
                            name:
                              type: string
                              description: The name of the product
                            description:
                              type: string
                              description: The description of the product
                            language:
                              type: string
                              description: The language of the title and description
                            dimensions:
                              type: string
                              description: The human readable dimensions of the product
                            netWeight:
                              type: string
                              description: The weight of the product itself
                            capacity:
                              type: string
                              description: eg. Capacity in weight eg 100g
                            position:
                              type: number
                              description: The position of the product in the brands catalog, lower the higher it is
                            unitMultiplier:
                              type: integer
                              description: How many products are shipped together, ie a case of 6 wine bottles. Presented options then would be 6, 12, 18 etc.
                            vatRate:
                              type: number
                              format: float
                              description: The VAT rate of the product
                            discountRate:
                              description: The percentage discount if a brand is offering one (0 - 1)
                              type: number
                              format: float
                            productTypeId:
                              description: 'Product Type ID

                                <div class="warning"> <b>Deprecation Notice</b><br/> <p>This attribute is deprecated and will be removed in a future release.</p> <p> We strongly encourage all users to update their integrations accordingly to ensure continued compatibility. If you have any questions or need assistance, please contact support. </p> </div>

                                '
                              type: number
                              format: integer
                            active:
                              type: boolean
                              description: Whether the product is active or not
                            outOfStock:
                              type: boolean
                              description: Whether the product is out of stock or not
                            archived:
                              type: boolean
                              description: Whether the product is archived or not
                            retailPrice:
                              description: The suggested retail price of the product
                              type: integer
                            wholesalePrice:
                              description: The wholesale price after the discount rate is applied
                              type: integer
                            originalWholesalePrice:
                              description: The original wholesale price set by the brand
                              type: integer
                            createdAt:
                              type: string
                              format: datetime
                              description: The timestamp when the product was created
                            indexedAt:
                              type:
                              - 'null'
                              - string
                              format: datetime
                              description: The timestamp when the product was indexed
                            updatedAt:
                              type: string
                              format: datetime
                              description: The timestamp when the product was updated
                            images:
                              type: array
                              description: List of product images ordered by display priority
                              items:
                                type: object
                                properties:
                                  order:
                                    type: integer
                                    description: Display order of the image (lower is higher priority)
                                  url:
                                    type: string
                                    description: URL of the product image
                            tags:
                              type: array
                              description: List of tags associated with the product
                              items:
                                type: string
                        relationships:
                          type: object
                          properties:
                            productOption:
                              description: 'Reference: Product Option Resource'
                              type: object
                              properties:
                                data:
                                  description: An array of objects each containing `type` and `id` members for to-many relationships.
                                  type: array
                                  items: &id001
                                    description: Resource identification present in Resource Objects and Resource Identifier Objects.
                                    type: object
                                    required:
                                    - id
                                    - type
                                    properties:
                                      id:
                                        type: string
                                        description: '[resource object identifier (uuid)](https://jsonapi.org/format/#document-resource-object-identification)'
                                        format: uuid
                                      type:
                                        type: string
                                        description: '[resource object type](https://jsonapi.org/format/#document-resource-object-identification)'
                                      meta:
                                        description: Non-standard meta-information that can not be represented as an attribute or relationship.
                                        type: object
                                        additionalProperties: true
                                    additionalProperties: false
                                  uniqueItems: true
                            productVariant:
                              description: 'Reference: Product Variant Resource'
                              type: object
                              properties:
                                data:
                                  description: An array of objects each containing `type` and `id` members for to-many relationships.
                                  type: array
                                  items: *id001
                                  uniqueItems: true
                      required:
                      - type
                      - id
                additionalProperties: false
              examples:
                example:
                  value:
                    meta:
                      page:
                        from: 123e4567-e89b-12d3-a456-426614174000
                        hasMore: true
                        perPage: 2
                        to: 1ecb023e-7ec0-6d5c-a477-0242ac170008
                    jsonapi:
                      version: '1.0'
                    links:
                      first: https://www.ankorstore.com/api/v1/orders?include=&page%5Blimit%5D=2
                      next: https://www.ankorstore.com/api/v1/orders?include=&page%5Bafter%5D=797910&page%5Blimit%5D=2
                      prev: https://www.ankorstore.com/api/v1/orders?include=&page%5Bbefore%5D=904234&page%5Blimit%5D=2
                    data:
                    - type: product
                      id: 0c5e6540-0da9-1ecb-bf59-0242ac170007
                      attributes:
                        name: Example Product
                        description: Example description of product
                        language: fr
                        dimensions: 5,5x5,5x6
                        netWeight: 100G
                        capacity: 100g
                        position: 34
                        unitMultiplier: 12
                        vatRate: 5.5
                        discountRate: 0
                        active: true
                        outOfStock: false
                        archived: false
                        retailPrice: 750
                        wholesalePrice: 426
                        originalWholesalePrice: 426
                        createdAt: '2020-08-27T14:26:38.000000Z'
                        indexedAt: '2022-02-10T03:26:11.000000Z'
                        updatedAt: '2022-02-09T14:49:09.000000Z'
                    - type: product
                      id: c8466a3c-4fb8-4474-a86f-20f10d14314f
                      attributes:
                        name: Example Product 2
                        description: Example description of product 2
                        language: fr
                        dimensions: 10,5x10,5x12
                        netWeight: 250G
                        capacity: 250g
                        position: 20
                        unitMultiplier: 12
                        vatRate: 5.5
                        discountRate: 0
                        active: true
                        outOfStock: false
                        archived: false
                        retailPrice: 900
                        wholesalePrice: 700
                        originalWholesalePrice: 700
                        createdAt: '2020-09-27T14:26:38.000000Z'
                        indexedAt: '2022-02-10T03:26:11.000000Z'
                        updatedAt: '2022-02-09T14:49:09.000000Z'
        '401':
          description: Unauthorized
          content:
            application/vnd.api+json:
              schema:
                type: object
                additionalProperties: false
                properties: &id003
                  errors:
                    type: array
                    uniqueItems: true
                    items:
                      type: object
                      properties:
                        code:
                          description: An application-specific error code, expressed as a string value.
                          type: string
                        detail:
                          description: A human-readable explanation specific to this occurrence of the problem.
                          type: string
                        status:
                          description: The HTTP status code applicable to this problem, expressed as a string value.
                          type: string
                        title:
                          description: The HTTP status code description applicable to this problem
                          type: string
                        source:
                          type: object
                          description: Optional object pointing towards the problematic field
                          properties:
                            pointer:
                              type: string
                              description: The field key
                        meta:
                          description: Non-standard meta-information that can not be represented as an attribute or relationship.
                          type: object
                          additionalProperties: true
                      additionalProperties: false
                  jsonapi:
                    description: An object describing the server's implementation
                    type: object
                    properties: *id002
                    additionalProperties: false
                required: &id004
                - errors
              example:
                jsonapi:
                  version: '1.0'
                errors:
                - detail: Unauthorized
                  status: '401'
        '406':
          description: Not Acceptable
          content:
            application/vnd.api+json:
              schema:
                type: object
                additionalProperties: false
                properties: *id003
                required: *id004
              example:
                jsonapi:
                  version: '1.0'
                errors:
                - detail: Not Acceptable
                  status: '406'
        '415':
          description: Unsupported Media Type
          content:
            application/vnd.api+json:
              schema:
                type: object
                additionalProperties: false
                properties: *id003
                required: *id004
              example:
                jsonapi:
                  version: '1.0'
                errors:
                - detail: Unsupported Media Type
                  status: '415'
  /api/v1/products/{product}:
    get:
      summary: Get Product
      description: Retrieve a specific product
      operationId: get-product
      tags:
      - Catalog
      parameters:
      - name: Accept
        in: header
        description: application/vnd.api+json
        schema:
          type: string
          default: application/vnd.api+json
      - name: product
        in: path
        required: true
        schema:
          default: 079ba9ad-dcdb-4dda-ba0a-1174dad313c5
          type: string
          description: '[resource object identifier (uuid)](https://jsonapi.org/format/#document-resource-object-identification)'
          format: uuid
      - name: include
        in: query
        description: 'A comma-separated list of resources to include (e.g: productVariant)'
        allowEmptyValue: true
        required: false
        schema:
          type: string
          enum:
          - productOption
          - productVariant
      responses:
        '200':
          description: '[OK](https://jsonapi.org/format/#fetching-resources-responses-200)'
          content:
            application/vnd.api+json:
              schema:
                type: object
                additionalProperties: false
                title: Product Get
                properties:
                  jsonapi:
                    description: An object describing the server's implementation
                    type: object
                    properties: &id008
                      version:
                        type: string
                      meta:
                        description: Non-standard meta-information that can not be represented as an attribute or relationship.
                        type: object
                        additionalProperties: true
                    additionalProperties: false
                  data:
                    title: Product Resource
                    description: The resource object for Product
                    type: object
                    additionalProperties: false
                    properties:
                      type:
                        type: string
                        default: products
                      id:
                        type: string
                        description: '[resource object identifier (uuid)](https://jsonapi.org/format/#document-resource-object-identification)'
                        format: uuid
                      attributes:
                        type: object
                        properties:
                          name:
                            type: string
                            description: The name of the product
                          description:
                            type: string
                            description: The description of the product
                          language:
                            type: string
                            description: The language of the title and description
                          dimensions:
                            type: string
                            description: The human readable dimensions of the product
                          netWeight:
                            type: string
                            description: The weight of the product itself
                          capacity:
                            type: string
                            description: eg. Capacity in weight eg 100g
                          position:
                            type: number
                            description: The position of the product in the brands catalog, lower the higher it is
                          unitMultiplier:
                            type: integer
                            description: How many products are shipped together, ie a case of 6 wine bottles. Presented options then would be 6, 12, 18 etc.
                          vatRate:
                            type: number
                            format: float
                            description: The VAT rate of the product
                          discountRate:
                            description: The percentage discount if a brand is offering one (0 - 1)
                            type: number
                            format: float
                          productTypeId:
                            description: 'Product Type ID

                              <div class="warning"> <b>Deprecation Notice</b><br/> <p>This attribute is deprecated and will be removed in a future release.</p> <p> We strongly encourage all users to update their integrations accordingly to ensure continued compatibility. If you have any questions or need assistance, please contact support. </p> </div>

                              '
                            type: number
                            format: integer
                          active:
                            type: boolean
                            description: Whether the product is active or not
                          outOfStock:
                            type: boolean
                            description: Whether the product is out of stock or not
                          archived:
                            type: boolean
                            description: Whether the product is archived or not
                          retailPrice:
                            description: The suggested retail price of the product
                            type: integer
                          wholesalePrice:
                            description: The wholesale price after the discount rate is applied
                            type: integer
                          originalWholesalePrice:
                            description: The original wholesale price set by the brand
                            type: integer
                          createdAt:
                            type: string
                            format: datetime
                            description: The timestamp when the product was created
                          indexedAt:
                            type:
                            - 'null'
                            - string
                            format: datetime
                            description: The timestamp when the product was indexed
                          updatedAt:
                            type: string
                            format: datetime
                            description: The timestamp when the product was updated
                          images:
                            type: array
                            description: List of product images ordered by display priority
                            items:
                              type: object
                              properties:
                                order:
                                  type: integer
                                  description: Display order of the image (lower is higher priority)
                                url:
                                  type: string
                                  description: URL of the product image
                          tags:
                            type: array
                            description: List of tags associated with the product
                            items:
                              type: string
                      relationships:
                        type: object
                        properties:
                          productOption:
                            description: 'Reference: Product Option Resource'
                            type: object
                            properties:
                              data:
                                description: An array of objects each containing `type` and `id` members for to-many relationships.
                                type: array
                                items: &id005
                                  description: Resource identification present in Resource Objects and Resource Identifier Objects.
                                  type: object
                                  required: &id006
                                  - id
                                  - type
                                  properties: &id007
                                    id:
                                      type: string
                                      description: '[resource object identifier (uuid)](https://jsonapi.org/format/#document-resource-object-identification)'
                                      format: uuid
                                    type:
                                      type: string
                                      description: '[resource object type](https://jsonapi.org/format/#document-resource-object-identification)'
                                    meta:
                                      description: Non-standard meta-information that can not be represented as an attribute or relationship.
                                      type: object
                                      additionalProperties: true
                                  additionalProperties: false
                                uniqueItems: true
                          productVariant:
                         

# --- truncated at 32 KB (142 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/ankorstore/refs/heads/main/openapi/ankorstore-catalog-api-openapi.yml