Creating Charges with Stripe using Postman
Stripe gives a wast set of information for using its API using CURL, Java, JS, and other programming languages.
What we see frequently missing is how to configure a request for use in Postman.
The first step to use Postman is to set up the stripe token. Let us take a CURL request and convert it to something that can be run on Postman.
curl https://api.stripe.com/v1/charges \
-u sk_test_8d6xxxxxxxxxxg4bC0g9XXXX: \
-d amount=2000 \
-d currency=inr \
-d source=tok_visa \
-d description="My First Test Charge (created for API docs)"
The first thing to setup is a the auth token. Use the type as “Bearer Token” and pass your live/test keys.
The second part is to configure the parameters that need to be sent as part of the request. In the case of Stripe Charges, it could be Amount, Currency, Source, and a few others.
Parameters are configured in the Body section. In the body section select the x-www-form-urlencoded. This will allow to configure parameters as key value pairs.
That’s it.. Select send and see the response.