Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-python-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools.

## 1.19.1 - 2026-11-27

### Fixed

- `ListProducts` now sends `product_ids` as the `id` filter. Previously it was accepted but never sent, so all products were returned. It is merged with `ids`, with duplicates removed

### Deprecated

- `ListProducts` `product_ids` is deprecated, use `ids` instead

## 1.19.0 - 2026-11-24

### Added
Expand Down
2 changes: 1 addition & 1 deletion paddle_billing/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def build_request_session(self) -> Session:
"Authorization": f"Bearer {self.__api_key}",
"Content-Type": "application/json",
"Paddle-Version": str(self.use_api_version),
"User-Agent": "PaddleSDK/python 1.19.0",
"User-Agent": "PaddleSDK/python 1.19.1",
}
)

Expand Down
10 changes: 8 additions & 2 deletions paddle_billing/Resources/Products/Operations/ListProducts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@


class ListProducts(HasParameters):
"""
Deprecated: `product_ids` is deprecated, use `ids` instead. It is merged into the `id` filter.
"""

def __init__(
self,
pager: Pager | None = None,
Expand All @@ -38,6 +42,7 @@ def __init__(
# Validation
validations: list[tuple[str, list[Any], type]] = [
("ids", self.ids, str),
("product_ids", self.product_ids, str),
("includes", self.includes, ProductIncludes),
("statuses", self.statuses, Status),
("tax_categories", self.tax_categories, TaxCategory),
Expand All @@ -54,8 +59,9 @@ def get_parameters(self) -> dict[str, str]:
parameters = {}
if self.pager:
parameters.update(self.pager.get_parameters())
if self.ids:
parameters["id"] = ",".join(self.ids)
ids = list(dict.fromkeys([*self.ids, *self.product_ids]))
if ids:
parameters["id"] = ",".join(ids)
if self.includes:
parameters["include"] = ",".join(map(enum_stringify, self.includes))
if self.statuses:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

setup(
version="1.19.0",
version="1.19.1",
author="Paddle and contributors",
author_email="team-dx@paddle.com",
description="Paddle's Python SDK for Paddle Billing",
Expand Down
28 changes: 27 additions & 1 deletion tests/Functional/Resources/Products/test_ProductsClient.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from json import loads
from pytest import mark
from pytest import mark, raises
from urllib.parse import unquote

from paddle_billing.Entities.Collections import ProductCollection
from paddle_billing.Entities.Product import Product
from paddle_billing.Entities.Shared import CustomData, Status, TaxCategory

from paddle_billing.Exceptions.SdkExceptions.InvalidArgumentException import InvalidArgumentException
from paddle_billing.Resources.Products.Operations import CreateProduct, ListProducts, UpdateProduct, ProductIncludes
from paddle_billing.Resources.Shared.Operations import Pager

Expand Down Expand Up @@ -179,6 +180,24 @@ def test_update_product_uses_expected_payload(
200,
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb,pro_01h1vjes1y163xfj1rh1tkfb65",
),
(
ListProducts(product_ids=["pro_01gsz4s0w61y0pp88528f1wvvb"]),
200,
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb",
),
(
ListProducts(ids=["pro_01gsz4s0w61y0pp88528f1wvvb"], product_ids=["pro_01h1vjes1y163xfj1rh1tkfb65"]),
200,
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb,pro_01h1vjes1y163xfj1rh1tkfb65",
),
(
ListProducts(
ids=["pro_01gsz4s0w61y0pp88528f1wvvb", "pro_01h1vjes1y163xfj1rh1tkfb65"],
product_ids=["pro_01h1vjes1y163xfj1rh1tkfb65", "pro_01gsz4s0w61y0pp88528f1wvvb", "pro_02new"],
),
200,
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb,pro_01h1vjes1y163xfj1rh1tkfb65,pro_02new",
),
(
ListProducts(tax_categories=[TaxCategory.DigitalGoods, TaxCategory.Standard]),
200,
Expand All @@ -193,6 +212,9 @@ def test_update_product_uses_expected_payload(
"List products filtered by status",
"List products filtered by id",
"List products filtered by multiple ids",
"List products filtered by product_ids",
"List products filtered by ids and product_ids",
"List products merges duplicate ids and product_ids preserving order",
"List products filtered by tax categories",
"List products with includes",
],
Expand All @@ -219,6 +241,10 @@ def test_list_products_returns_expected_response(
unquote(last_request.url) == expected_url
), "The URL does not match the expected URL, verify the query string is correct"

def test_list_products_rejects_non_string_product_ids(self):
with raises(InvalidArgumentException):
ListProducts(product_ids=[123]) # type: ignore[list-item]

@mark.parametrize(
"product_id, includes, expected_response_status, expected_response_body, expected_url",
[
Expand Down
Loading