#sai_rez
1 messages · Page 1 of 1 (latest)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I have tried something like that but keep getting errors
curl https://api.stripe.com/v1/customers/<customerId>
-u <secret_key>:
-d "expand[]"="sources"
-G
What are the errors?
{ "error": { "message": "You did not provide an API key. You need to provide your API key in the Authorization header, using Bearer auth (e.g. 'Authorization: Bearer YOUR_SECRET_KEY'). See https://stripe.com/docs/api#authentication for details, or we can help at https://support.stripe.com/.", "type": "invalid_request_error" } } zsh: command not found: -u
Sounds like a bash error as opposed to an API issue. I think you're missing a \ after the URL:
curl https://api.stripe.com/v1/customers/<customerId> \
-u <secret_key>: \
-d "expand[]"="sources" \
-G
Yes you were right! although I do also see at the end of the object, does the mean the expand did not work?
(3) Could not parse the URL, failed to set query
I see okay, if I was accessing card country value like this
customer.sources.data[0].card_country;
Would i need to expand further or would expanding sources show the card countryu?
Sorry I should have been more clear, the above was how I was trying to access value in node
Yes, that's not actually a field. It'd be card[country] assuming type: 'card'