Stripe API collection template
Customers, products, prices, Payment Intents, Checkout and refunds in Stripe test mode.
What's inside
The Stripe requests most integrations start with: create a customer, a product and a price, take a payment with a Payment Intent or a Checkout Session, and refund it. Requests that create something save its id to the environment, so the next ones work without copying ids.
14 requests in 4 folders · Base URL https://api.stripe.com/v1 · Bearer token
Set it up
- Open Stripe API in Requestarium (or in the app: Import, Start from a template) and import it. You get the collection and a "Stripe API" environment.
- Use a test mode secret key (sk_test_…) from the Stripe Dashboard, Developers, API keys. Stripe bodies are form-encoded.
- Fill in the environment, pick it in the environment menu and send the first request.
Environment variables
| Variable | What it is |
|---|---|
stripeSecretKeysecret | Test mode secret key, sk_test_… |
customerId | Filled by "Create a customer". |
productId | Filled by "Create a product". |
priceId | Filled by "Create a price". |
paymentIntentId | Filled by "Create a Payment Intent". |
Requests
Customers
- POSTCreate a customer
/customersCreates a customer and saves its id as customerId.
- GETList customers
/customersThe ten most recent customers.
- GETRetrieve a customer
/customers/{{customerId}}One customer by id.
- POSTUpdate a customer
/customers/{{customerId}}Stripe updates with POST; this sets a metadata key.
- DELETEDelete a customer
/customers/{{customerId}}Permanently deletes the customer.
Products and prices
- POSTCreate a product
/productsCreates a product and saves its id as productId.
- POSTCreate a price
/pricesA $10.00 monthly price for the product; saves priceId.
- GETList prices
/pricesActive prices.
Payments
- POSTCreate a Payment Intent
/payment_intentsA $20.00 payment for the customer; saves paymentIntentId.
- GETRetrieve a Payment Intent
/payment_intents/{{paymentIntentId}}Its status and amounts.
- POSTCreate a Checkout Session
/checkout/sessionsA hosted payment page for the monthly price; open the url in the response.
- POSTRefund a payment
/refundsRefunds a succeeded Payment Intent in full.
Account
- GETRetrieve balance
/balanceAvailable and pending funds; a quick way to check the key.
- GETList events
/eventsRecent events, the same ones webhooks deliver.