Skip to content

Using v3 Catalog/Product filters #104

Description

@joegarcia

Expected behavior

I'm trying to use the v3 Products API's, but I need to filter by "id:not_in". As far as I know, Python does not allow colons in variable names. So what is the work-around to this?

I expect that all the filters using a colon will not work.

# v3 products
include_fields = "sku, price"
sort = "sku"
id:not_in = "689"
endpoint = '/catalog/products'
response = api.get(endpoint, include_fields=include_fields, id:not_in=id:not_in, limit=5, page=1, sort=sort)

The expected result would be a list of products where the IDs are not in the list of IDs.

Actual behavior

id:not_in = "689"
NameError: name 'not_in' is not defined

Steps to reproduce behavior

Use above filter to reproduce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions