Skip to content

[Bug]: Python happy path client fails against current SDK due to outdated discovery parsing and checkout update usage #87

@KingAlesh

Description

@KingAlesh

Describe the bug

Hello,

After updating the Python happy path client to use the current SDK import paths (v2026-01-23), I attempted to run the script end-to-end.

I encountered several issues where the sample client no longer aligns with the current SDK and server behavior.


1. Discovery parsing fails

The client expects:

discovery_data["payment"]["handlers"]

However, the current discovery response returns:

discovery_data["payment_handlers"]

This results in a KeyError when accessing the old path.


2. Step 2 checkout update fails

Step 2 constructs LineItemUpdateRequest objects without providing an id.

In the current SDK:

  • LineItemUpdateRequest requires an id field
  • The client does not supply this value

This results in validation errors when building or sending the update payload.


3. Fulfillment update payload no longer valid

Later steps (fulfillment selection) use simplified payloads such as:

{"methods": [{"type": "shipping"}]}

However, the current API requires additional fields, including:

  • method IDs
  • line_item_ids
  • group IDs (when selecting options)

Without these, fulfillment updates fail with validation errors (e.g. HTTP 422).


To Reproduce

  1. Clone the samples repository

  2. Update the client imports to match the current SDK (v2026-01-23)

  3. Run the client:

    uv run simple_happy_path_client.py --server_url=http://localhost:8182
    
  4. Observe:

    • KeyError during discovery parsing
    • Validation errors when constructing checkout update requests
    • 422 errors during fulfillment steps

Expected behavior

The Python happy path client should run successfully against the current SDK and server implementation without requiring additional modifications.

Specifically:

  • Discovery parsing should match the current response shape
  • Checkout updates should construct valid LineItemUpdateRequest objects
  • Fulfillment updates should include all required fields

Screenshots

No response

Additional context

After adapting the client locally, I was able to get the flow working by:

  • Updating discovery parsing to use payment_handlers
  • Using server-returned line item IDs for update requests
  • Reusing method / group / line_item IDs for fulfillment updates

However, this required modifying the client logic beyond import updates alone

Related Issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions