Skip to content

Remove Limit, StartingAfter, and EndingBefore fields for List methods that do not accept those fields#2368

Merged
mbroshi-stripe merged 1 commit into
private-previewfrom
mbroshi/fix-list-params
Jun 2, 2026
Merged

Remove Limit, StartingAfter, and EndingBefore fields for List methods that do not accept those fields#2368
mbroshi-stripe merged 1 commit into
private-previewfrom
mbroshi/fix-list-params

Conversation

@mbroshi-stripe

@mbroshi-stripe mbroshi-stripe commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Why?

Some Stripe V1 APIs return a list object but don't accept limit, starting_after, or ending_before as parameters. The Go SDK includes ListParams in every list method params struct, which makes those fields appear accessible. If a user sets them, the API returns a 400 "param not recognized" error.

Affected endpoints:

  • GET /v1/accounts/{account}/capabilities
  • GET /v1/reporting/report_types
  • GET /v1/reporting/payment_location_capabilities (private preview only)

After this change, the params structs for these endpoints embed Params instead of ListParams, so those pagination fields simply don't exist on the type.

What?

  • Replaces the embedded ListParams with Params in CapabilityListParams, PaymentLocationCapabilityListParams, and ReportingReportTypeListParams. This removes the Limit, StartingAfter, and EndingBefore fields from those latter types.
  • The corresponding service methods pass in an empty ListParams to the iteration infrastructure.

Changelog

  • Fixes a bug where Limit, StartingAfter, and EndingBefore were embedded in CapabilityListParams, PaymentLocationCapabilityListParams, and ReportingReportTypeListParams even though they are not valid parameters and would have always resulted in a 400 from the Stripe API if set. If you were including them before in any of those 3 structs, you can safely remove them.

@mbroshi-stripe mbroshi-stripe requested a review from jar-stripe June 2, 2026 20:20
@mbroshi-stripe mbroshi-stripe enabled auto-merge (squash) June 2, 2026 20:21
@mbroshi-stripe mbroshi-stripe merged commit 4272a44 into private-preview Jun 2, 2026
13 checks passed
@mbroshi-stripe mbroshi-stripe deleted the mbroshi/fix-list-params branch June 2, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants