Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better documentation needed on CreateSetupIntent::expand #355

Open
JonathanWoollett-Light opened this issue Mar 18, 2023 · 1 comment
Open

Comments

@JonathanWoollett-Light
Copy link
Contributor

JonathanWoollett-Light commented Mar 18, 2023

https://stripe.com/docs/api/setup_intents/create does not contain the expand argument that is in CreateSetupIntent.

Current documentation notes:

Specifies which fields in the response should be expanded.

I do not know what this means. In the simplest example, what should the value be?

Additional documentation is needed here.

@arlyon
Copy link
Owner

arlyon commented Mar 23, 2023

No worries!

https://stripe.com/docs/api/setup_intents/object

The SetupIntents object has a number of fields that are not included by default in the response type. You need to expand them manually in requests that return that type to get those fields back. I am not sure why expand is not included in the stripe docs, as it is definitely in their sdk definition which we use to generate the bindings:

jq '.paths["/v1/setup_intents"].post.requestBody.content["application/x-www-form-urlencoded"].encoding.expand' < spec3.sdk.json

You can expand a field by referring to its name in the expand array.

CreateSetupIntent {
  expand: &["customer"],
  ..Default::default()
}

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

No branches or pull requests

2 participants