Introduction to the Stripe CLI

  Рет қаралды 57,325

Stripe Developers

Stripe Developers

4 жыл бұрын

In this edition of Stripe Developer Office Hours, follow along as CJ Avilla walks through the fundamentals of using the Stripe Command Line Interface, or simply “the CLI”. We cover getting started, using multiple API commands, how to test webhooks, and more.
Resources
- Full Reference: stripe.com/docs/cli
- Download the Stripe CLI: github.com/stripe/stripe-cli
- Using the Stripe CLI: stripe.com/docs/stripe-cli
- jq: stedolan.github.io/jq/
Table of contents
01:35 - Installation
02:32 - Getting started
02:34 - `stripe`
03:00 - `stripe -v`
03:21 - `stripe status`
03:34 - Connecting to your Stripe account
04:42 - `stripe plans list`
04:54 - `stripe config`
05:26 - Connecting a second Stripe account
07:00 - API Resource Commands
07:15 - Create a Customer and subscribe them to a Plan
15:07 - Pairing Stripe CLI with jq
17:28 - Webhook Commands
18:13 - `stripe listen`
21:00 - `stripe trigger`
25:36 - Forwarding events to local webhook handler
27:40 - Resending events
28:36 - `stripe serve`
29:23 - `stripe samples`
32:07 - Quick Wins ⚡️
Presenter
CJ Avilla, Developer Advocate @ Stripe - / cjav_dev
Support
If you have a question, please feel free to reach out to our support team at support.stripe.com/ or on Discord at stripe.com/go/developer-chat.
Updates
Sign up to stay updated with developer news: go.stripe.global/dev-digest
Feedback
If you have any feedback about this or other episodes, let us know: forms.gle/VjNqzRhotM2snYo88.
#Stripe #Payments

Пікірлер: 90
@JakeJJKs
@JakeJJKs 3 жыл бұрын
I'm a software engineer putting my entrepreneurial spirit to the test, and I have honestly no clue how I would go about it without stripe.
@LazyDali
@LazyDali 2 жыл бұрын
That CLI is so useful. Awesome! And clearly explained. Thanks!
@futuregootecks
@futuregootecks Жыл бұрын
Holy smokes this was super helpful!!! Fledgling dev here, but there was so much useful insight in here that I would have missed if I was only reading the docs. Totally building my first stripe app with the cli now!
@StripeDev
@StripeDev Жыл бұрын
Thank you for the feedback, glad you found it helpful!
@oasis142
@oasis142 Жыл бұрын
Excellent, simple, to the point. Thanks stripe devs!
@StripeDev
@StripeDev Жыл бұрын
Thanks for watching, we really appreciate your feedback!
@petebytes5010
@petebytes5010 3 жыл бұрын
Wish all API's I work with had this capability - makes things so much easier!!!
@danielazori5455
@danielazori5455 2 жыл бұрын
Thank You!💞💖All the Best , Daniela Zori !💞💖
@jvcss
@jvcss Жыл бұрын
I just have to thank for this platform to exist
@mackymccormack8446
@mackymccormack8446 Жыл бұрын
Great tool, nicely explained, thank you
@user-xs9si3qb2t
@user-xs9si3qb2t 2 ай бұрын
27:50 特にここからとても参考になりました。これでピンポイントでデバッグできます!
@kirikiki7100
@kirikiki7100 4 жыл бұрын
Very good, thanks!
@Fh_Ndiritu
@Fh_Ndiritu Жыл бұрын
Awesome intro. Thank you!
@ChrisTian-ox5nr
@ChrisTian-ox5nr 2 жыл бұрын
This is great! THank you!
@francoisrafaralahy2786
@francoisrafaralahy2786 10 ай бұрын
Nice great explanation ! thanks for this job
@Neonb88
@Neonb88 Жыл бұрын
KZfaq should recommend this to me in the future; it will help with future TraderEx work
@jaysee3611
@jaysee3611 4 жыл бұрын
Hey can you show us how we can change the statement descriptor using this with connected stripe accounts?
@hbela1000
@hbela1000 Жыл бұрын
This tuto is an abs. must to have.thx.
@jansgreen4650
@jansgreen4650 3 жыл бұрын
I have a problems with my app, the test returns
@bhagyathakur2016
@bhagyathakur2016 3 жыл бұрын
Hey Stripe ! How to pass discription of service in payment intent API
@AlexGower
@AlexGower 6 ай бұрын
Thank you for doing the lords work
@anthonya9907
@anthonya9907 3 жыл бұрын
Complete novice here, but this is such a great guide for anyone getting involved with Stripe! I'm having difficulty with the building a csv list from stripe. Everything works well, until I try to do this. I'm using the following prompt: stripe customers list | jq '.data[] | [.id,.name,.email] | @csv' and I get an error stating that '[.id' is not recognized as an internal or external command, operable program or batch file. Am I doing something wrong?
@KeithBlack01
@KeithBlack01 2 жыл бұрын
Do you have to use this for adding lookup codes against live products? - I see you can add lookup codes when testing straight from stripe control panel but not for live products - am I missing something? Also can't seem to copy & paste into this CLI - that would be useful given the length of items names being generated. Thanks
@mehedihasanmim529
@mehedihasanmim529 Жыл бұрын
Made my day!
@Vincetroid
@Vincetroid 5 ай бұрын
what do you do when you get 504 instead of 200?
@Maxpl01t
@Maxpl01t Жыл бұрын
Hiya mate, I've been trying to configure stripe autocompletion on my zsh shell terminal on macOS with no luck, could you please provide instructions?
@logemann74
@logemann74 3 ай бұрын
this resend feature on event level is awesome. Havent found that out so far....
@Neonb88
@Neonb88 Жыл бұрын
Best stuff (useful to actually processing a payment) is near the end of the video. You can always skip to "quick wins" and then go back through and actually memorize the commands Personal To-dos for future me: 1. Subscription / recurring payments 2. How much can I customize the Stripe UIs based on their given stuff? (vs. ReactJS, ) 3.
@zenzen7091
@zenzen7091 2 жыл бұрын
Hey there :) Nice demo, everything is working as expected on my side. I do have a question though ^^ I'm trying to use CLI commands within my end-to-end tests, and would like to automatically create an account with details_submitted set to true, so that the user I'll link afterwards is all ready. Is there a way to do so ? Thanks a lot !
@StripeDev
@StripeDev 2 жыл бұрын
Hey there! For Connect account, we would recommend using "stripe accounts create" with parameters from this Doc: stripe.com/docs/connect/testing.
@user-ug1ci9le8m
@user-ug1ci9le8m 11 ай бұрын
Thanks for the video. How did you make the "movies" plan though?
@StripeDev
@StripeDev 11 ай бұрын
Hi Michael-you can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration: stripe.com/docs/api/prices. Here's more info about building a subscription integration: stripe.com/docs/billing/subscriptions/build-subscriptions. If you still need help, please post your question on the Stripe Developer Discord channel: stripe.com/go/developer-chat. Or send us an email, here: support.stripe.com/.
@Cransridge2288
@Cransridge2288 Жыл бұрын
great video thanks, FYI the -j has now been replaced with: --format JSON
@jackhepple1049
@jackhepple1049 2 жыл бұрын
can a cardholder hold more than 1 virtual card, also is there any way to create a loop for example for 15 cards rather than having to type out the command each time? (not much cli experience)
@StripeDev
@StripeDev 2 жыл бұрын
Hey Jack-great questions! A cardholder can definitely be assigned more than one virtual card. What exactly do you mean about the loop though? Are you wanting to create one that would assign 15 cards to the same cardholder? If so, it should be possible to contain the card.create request inside a loop to do that.
@raygan3
@raygan3 2 жыл бұрын
If we toggle stripe test mode in the dashboard it turns off production mode? Or I can work with both production and test environments at same time?
@StripeDev
@StripeDev 2 жыл бұрын
Hey Szymon - you can only work in either live mode or test mode at one time. If you're having issues using Stripe CLI, please don't hesitate to ask us any questions. Thanks.
@raygan3
@raygan3 2 жыл бұрын
is it ever possible to receive duplicate webhook requests from stripe for the same event? Should we save event id in the database and check if it was processed before?
@StripeDev
@StripeDev 2 жыл бұрын
Hi Szymon-you might want to check our our Best Practices documentation, it may help answer these questions for you: stripe.com/docs/webhooks/best-practices.
@ravindranathmopparthy8116
@ravindranathmopparthy8116 Жыл бұрын
stripe status doesn't work for version 1.16.0. "Unknown command "status" for "stripe".
@user-cm2di5ce2e
@user-cm2di5ce2e 6 ай бұрын
Same here.
@ronrivero1039
@ronrivero1039 Жыл бұрын
why do you use "payment-method" when in Stripe it is "payment_method"? I am confused which one to follow now?
@carlweis
@carlweis Жыл бұрын
Great. Video! Thank you! What camera do you use to record these videos!
@StripeDev
@StripeDev Жыл бұрын
CJ uses a Sony a6400-here's a list of the gear and software he uses/recommends: www.cjav.dev/uses. Hope this helps!
@midnightcoder2189
@midnightcoder2189 Жыл бұрын
Is there a way to quickly add new products and make them live using Stripe CLI? I can create new product but they end up in test mode and the only option I have in Dashboard is to "Copy to live mode". Would be nice if that is available in CLI too
@StripeDev
@StripeDev Жыл бұрын
Hi there! By default the CLI uses testmode, but there is a --live flag that they can use for livemode: stripe.com/docs/cli/post#post-live
@thedigitalceo
@thedigitalceo 2 жыл бұрын
I haven’t seen any technology have such an in depth CLI it’s great but just wondering is there any other benefit to using the CLI besides for testing local environments?
@StripeDev
@StripeDev 2 жыл бұрын
Thanks a lot, we're glad you're enjoying it! Here are some benefits you can take note of. For local environment testings, you can: Make API requests [0][1]. Tail logs [2]. Listen and trigger webhook events [3], this is useful if you would like to get real time updates and trigger respective actions in your systems [4]. The Stripe CLI also allows you to: Check Stripe’s status [5]. Open the relative Stripe documentation or Dashboard in your browser [6]. Copy Stripe’s sample projects to your local environment [7]. Provide feedback for Stripe [8]. The Stripe CLI can also be run within a container with the use of Docker [9]. [0] stripe.com/docs/stripe-cli/test [1] stripe.com/docs/cli/resources [2] stripe.com/docs/cli/logs/tail [3] stripe.com/docs/stripe-cli/webhooks [4] stripe.com/docs/webhooks [5] stripe.com/docs/cli/status [6] stripe.com/docs/cli/open [7] stripe.com/docs/cli/samples/create [8] stripe.com/docs/cli/feedback [9] stripe.com/docs/cli/docker
@thedigitalceo
@thedigitalceo 2 жыл бұрын
@@StripeDev got it. That’s pretty amazing. I don’t think we’ve ever seen these use cases but I can see this as being helpful! It’s been instrumental for us for testing our apps locally. I’m glad to see Stripe extending all these resources for developers
@StripeDev
@StripeDev 2 жыл бұрын
That makes us happy to hear! Feel free to reach out if you have any other questions.
@laygir
@laygir Жыл бұрын
Hey, got a question, when I trigger an event through cli I see failing events/requets on my Stripe dashboard for the registered webhook endpoint. Am I supposed to disable registered webhook endpoint everytime I want to test things locally? Or is there a configuration somewhere to prevent registered endpoint from receiving events when trigger is coming from cli?
@StripeDev
@StripeDev Жыл бұрын
Hey there-are you able to share the error messaging you're seeing?
@laygir
@laygir Жыл бұрын
@@StripeDev I posted a detailed reply here but now I do not see it, not sure what's wrong with KZfaq :/
@StripeDev
@StripeDev Жыл бұрын
We'd be happy to help-feel free to reach out to us at heretohelp@stripe.com with details!
@shifrin7499
@shifrin7499 Жыл бұрын
Well - but HOW do you trigger event for specific customer id? otherwise you can't really test any of the webhook!
@StripeDev
@StripeDev Жыл бұрын
Hey Vlad-what type of Event are you trying to trigger exactly? Please feel free to check out the related documentation in the mean time: stripe.com/docs/cli/trigger.
@gerrigg
@gerrigg Жыл бұрын
hello. thanks for this. question: when triggering say an invoice.payment_failed event, how can I specify the customer? --help doesn't show flags to support this. thank you
@StripeDev
@StripeDev Жыл бұрын
Hey there! When using Stripe trigger, it uses a "fixture" which is a list of API requests we'll run to cause the events for you. This specific event is defined here: github.com/stripe/stripe-cli/blob/master/pkg/fixtures/triggers/invoice.payment_failed.json. In this case, it sounds like you want to override the customer, which the fixture is creating first. We suggest explicitly using a feature that lets you override this parameter with the one you want-this is documented here: stripe.com/docs/cli/fixtures#fixtures-override. What the fixture does is create an InvoiceItem and then creates an Invoice-you'll want to override the customer on both so the call would look like this: stripe trigger invoice.payment_failed --skip customer --override "invoiceitem:customer=cus_ABC" --override "invoice:customer=cus_ABC"
@gerrigg
@gerrigg Жыл бұрын
@@StripeDev Awesome! Thanks so much. I'll give that a try!
@gerrigg
@gerrigg Жыл бұрын
@@StripeDev Hmmm, running that fixture seems to simply create an invoice successfully, not a failed payment. ??? Thanks. Also, I thought a while back, in Test Mode, in our Stripe Dashboard/UI we could send events manually? That seemed much easier IMHO :)
@StripeDev
@StripeDev Жыл бұрын
Hello Ravindranath-can you tell us a bit more about what's happening? Are you referring to the part of the video starting at 03:21? We also encourage you to post your questions to our Stripe Developer Discord channel as well: discord.com/invite/RuJnSBXrQn.
@almidoro
@almidoro 2 жыл бұрын
How can we test in CLI a especific object, for example, a update on subscription (sub...) that has been failed the payment? I triggered the event but CLI creates a new subscription for the test.
@StripeDev
@StripeDev 2 жыл бұрын
Hi André-can you explain a bit more about the issue you're running into with the failed payment and the subscription?
@almidoro
@almidoro 2 жыл бұрын
Hello. I have developed in my plataform some subscripitons plans and assigned then for the customers. Now I need to set the updates trough webhooks of thes subscripitions. For example, when a recurring payment failed for some problem with card. I’d like to test these situations but I didn’t undestand if is possible using the CLI
@StripeDev
@StripeDev 2 жыл бұрын
Got it, thanks for explaining, André! If you're looking to test a bit with subscriptions and learn to manage payment failures with the CLI, check out this doc: stripe.com/docs/billing/subscriptions/fixed-price#what-you%E2%80%99ll-build. We also have a bunch of resources around testing Billing: stripe.com/docs/billing/testing.
@almidoro
@almidoro 2 жыл бұрын
@@StripeDev thank you. I’ll study it.
@alpachino468
@alpachino468 9 ай бұрын
Can I create Stripe keys using Microsoft Paint?
@StripeDev
@StripeDev 9 ай бұрын
No. Stripe keys are generated through Stripe's website or API, and they require specific cryptographic algorithms to ensure their security.
@alpachino468
@alpachino468 9 ай бұрын
@@StripeDev Thanks but it was a very silly question, I must admit. Ok so I do need some real help though. On a charity website I maintain, I allow donations to be accepted, where donors can input an amount of their choice. All works fine and payment gets accepted. What I also try to do is append the ID of the donation campaign within the session's and price's metadata, with the intention of performing a lookup of all payments and then filtering by the campaign'd ID in order to collate all payments for a particular campaign so that I can present to users how much we have raised. Any way to do this? Am I even making sense?
@StripeDev
@StripeDev 9 ай бұрын
Yes, your ask does make sense. So, when a payment is made, you can include additional information such as the donation campaign ID in the metadata of the payment. Here's an example of how you can achieve this using Stripe's API: 1. When creating a payment, include the campaign ID in the metadata parameter: "import stripe stripe.api_key = 'YOUR_STRIPE_SECRET_KEY' payment_intent = stripe.PaymentIntent.create( amount=1000, currency='usd', metadata={ 'campaign_id': 'YOUR_CAMPAIGN_ID', }, )" 2. When retrieving payments, you can filter them based on the campaign ID: "import stripe stripe.api_key = 'YOUR_STRIPE_SECRET_KEY' # Retrieve all payments payments = stripe.PaymentIntent.list() # Filter payments based on campaign ID campaign_payments = [payment for payment in payments if payment.metadata.get('campaign_id') == 'YOUR_CAMPAIGN_ID']" You can then use the `campaign_payments´ list to perform any analysis or calculations to determine how much you have raised for a particular campaign. Note that you will need to replace `YOUR_STRIPE_SECRET_KEY´ with your actual Stripe secret key and `YOUR_CAMPAIGN_ID´ with the relevant IDs for each campaign on your website.
@i2mastering943
@i2mastering943 5 ай бұрын
Maybe it would be good to tell people they have to install homebrew for the brew command to actually work. It's actually funny how that important part is just simply skipped over.
@coachingreflexivo
@coachingreflexivo 4 жыл бұрын
Literally thought CLI was short for "client" as in server/client. Lol.
@thibao8726
@thibao8726 3 жыл бұрын
how to install tripe CLI ?
@cjav_dev
@cjav_dev 3 жыл бұрын
Hey Thi, there's a step by step guide for installing the Stripe CLI here: stripe.com/docs/stripe-cli.
@thibao8726
@thibao8726 3 жыл бұрын
@@cjav_dev i have install it, but i want ask you i want save to database card id and customer id , when i save 2 card and 1 customer, how do i do ?
@tddtv
@tddtv Жыл бұрын
Only problem with this is that if you don't know the object structure of the various params in your head, you have to go figure that out because this doesn't intellisense for you. All easy AFTER you get to know the objects you need to use and object structs
@JeanAlesiagain3
@JeanAlesiagain3 3 жыл бұрын
Which video is the actual basic tutorial that teaches you what you don't even know you don't know?
@jarodmorris611
@jarodmorris611 3 жыл бұрын
Sorry, there's a conspiracy in the stripe world to never tell you. You have to magically pass the test to even begin to realize you don't know what you don't know. Until then you're SOL.
@jdotsystem
@jdotsystem Жыл бұрын
Actually, I became sleepy after started this movie viewing I would like to know overview about your product
@jarodmorris611
@jarodmorris611 3 жыл бұрын
I have CentOS 7 and a Virtual Private Server. I rarely find anyone that shows how to use one of those. It's always a local machine. I get it, that people's setup could be vastly different, but isn't that true about local machines too and yet people constantly show their local machine and installation, config, etc. I used wget to grab the repository for stripe-cli, unzipped it, then was instructed to run the executable. Only there IS NO EXECUTABLE. It's a file with title 'stripe'. NO EXTENSION AT ALL. It's horribly frustrating to have 99 options and videos act like there is only 1 possibility. It's like going into a bar and saying, "I'd like a beer." uh, which beer? There are only a few thousand in the world to choose from.
@jarodmorris611
@jarodmorris611 3 жыл бұрын
UPDATE: For anyone reading this that is also frustrated.... you have to run ./stripe login {secret_key_here} and then it should do what you want it to do
@jarodmorris611
@jarodmorris611 3 жыл бұрын
I've used the --interactive flag and been able to provide the secret key manually (don't get even a single digit wrong!) and then it asks me to provide a device-name and I do and then it says it's configured. Then if I go to ./stripe login, it does the "Waiting for confirmation" and hangs there. NO ONE has a tutorial for CentOS stripe-cli, etc. It should not be so hard to give Stripe money from my sales.
@hemanth6951
@hemanth6951 3 жыл бұрын
8hrs I used stripe cli 25gb data gone 😁
@sillypablo3495
@sillypablo3495 Жыл бұрын
This isnt working
@StripeDev
@StripeDev Жыл бұрын
Hi Pablo-sorry to hear you're having issues. If you get back to us with where you're seeing an error, we might be able to help further. Alternatively, you can find support through our developer discord community here: discord.com/invite/stripe
@gunrunjk
@gunrunjk Жыл бұрын
it gets error $_SERVER['HTTP_STRIPE_SIGNATURE']. how can I fix it ?, this is coming from stripe dashboard logs. Fatal error: Uncaught Error: Class "Stripe\Webhook" not found in C:\xampp\htdocs\index.php:16
@StripeDev
@StripeDev Жыл бұрын
Hi Junki. It looks like an SDK installation problem. Your code is unable to include Stripe SDK. We recommend going through the installation guide: github.com/stripe/stripe-php#requirements and using either Composer (recommended) or the manual installation.
@learninggcn1113
@learninggcn1113 5 ай бұрын
Wow,Now version 1.19.2 have canceled the status sub-command The result is : stripe status Unknown command "status" for "stripe". See "stripe --help" for a list of available commands.
.NET Core Starter
54:35
Stripe Developers
Рет қаралды 8 М.
Stripe Webhooks
1:00:16
Stripe Developers
Рет қаралды 41 М.
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 106 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:26
CRAZY GREAPA
Рет қаралды 21 МЛН
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 13 МЛН
How To Accept Payments With Stripe
23:05
Web Dev Simplified
Рет қаралды 269 М.
Webhook helpers in stripe-php
18:57
Stripe Developers
Рет қаралды 10 М.
What is Stripe? How 2 brothers built it into a $100B company
8:28
Accept a payment with the PaymentElement using Node.js
24:16
Stripe Developers
Рет қаралды 14 М.
Coding a Web Server in 25 Lines - Computerphile
17:49
Computerphile
Рет қаралды 330 М.
Make Money from your API Tutorial
13:10
Fireship
Рет қаралды 870 М.
Collect payment in installments with Subscription Schedules
19:50
Stripe Developers
Рет қаралды 10 М.
Node.js Express Starter
36:06
Stripe Developers
Рет қаралды 20 М.
Python Flask Starter
36:42
Stripe Developers
Рет қаралды 8 М.
Accept a payment
24:09
Stripe Developers
Рет қаралды 9 М.
Запрещенный Гаджет для Авто с aliexpress 2
0:50
Тимур Сидельников
Рет қаралды 573 М.
Какой ноутбук взять для учёбы? #msi #rtx4090 #laptop #юмор #игровой #apple #shorts
0:18