Skip to content

sdk(python): v2027_01 Checkout model requires product_price_id, which the 2027-01 API no longer returns #16146

Open

Description

@LukasLewandowski

What happens

With the Python SDK's polar.v2027_01 client, checkouts.create() creates the checkout on the server but then fails to read the response:

polar.base.PolarDeserializationError: Failed to deserialize data: while loading model <class 'polar.v2027_01.outputs.Checkout'> (1 sub-exception)
  adaptix.load_error.NoRequiredFieldsLoadError: fields={'product_price_id'}

The 2027-01 API response for a checkout no longer has product_price_id (it has product, product_price, products and prices), and the Checkout schema in the 2027-01 OpenAPI spec doesn't list it either. But polar.v2027_01.outputs.Checkout still declares product_price_id: str | None as a required field. The same field is also required in CheckoutPublic and CheckoutPublicConfirmed of v2027_01.

polar.v2026_10 works fine with the same call.

Versions

  • polar-sdk 1.0.2 (latest release) and 1.0.3a5 (latest pre-release): both fail the same way
  • Python 3.13, sandbox environment, organization access token

Reproduce

import asyncio, os, uuid
from polar.v2027_01 import PolarAsync

async def main() -> None:
    async with PolarAsync(os.environ["POLAR_ACCESS_TOKEN"], environment="sandbox") as polar:
        products = await polar.products.list(is_archived=False, is_recurring=False, limit=10)
        await polar.checkouts.create(
            products=[products.items[0].id],  # a one-time product with a fixed price
            external_customer_id=str(uuid.uuid4()),
        )  # -> PolarDeserializationError: fields={'product_price_id'}

asyncio.run(main())

Expected

checkouts.create() returns a Checkout. Probably product_price_id should be removed from (or made optional in) the v2027_01 checkout models, to match the 2027-01 API. Other calls with v2027_01 that we tried (products.list, orders.list) work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions