Templates · Payments

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

  1. 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.
  2. Use a test mode secret key (sk_test_…) from the Stripe Dashboard, Developers, API keys. Stripe bodies are form-encoded.
  3. Fill in the environment, pick it in the environment menu and send the first request.

Environment variables

VariableWhat it is
stripeSecretKeysecretTest mode secret key, sk_test_…
customerIdFilled by "Create a customer".
productIdFilled by "Create a product".
priceIdFilled by "Create a price".
paymentIntentIdFilled by "Create a Payment Intent".

Requests

Customers

  • POST
    Create a customer /customers

    Creates a customer and saves its id as customerId.

  • GET
    List customers /customers

    The ten most recent customers.

  • GET
    Retrieve a customer /customers/{{customerId}}

    One customer by id.

  • POST
    Update a customer /customers/{{customerId}}

    Stripe updates with POST; this sets a metadata key.

  • DELETE
    Delete a customer /customers/{{customerId}}

    Permanently deletes the customer.

Products and prices

  • POST
    Create a product /products

    Creates a product and saves its id as productId.

  • POST
    Create a price /prices

    A $10.00 monthly price for the product; saves priceId.

  • GET
    List prices /prices

    Active prices.

Payments

  • POST
    Create a Payment Intent /payment_intents

    A $20.00 payment for the customer; saves paymentIntentId.

  • GET
    Retrieve a Payment Intent /payment_intents/{{paymentIntentId}}

    Its status and amounts.

  • POST
    Create a Checkout Session /checkout/sessions

    A hosted payment page for the monthly price; open the url in the response.

  • POST
    Refund a payment /refunds

    Refunds a succeeded Payment Intent in full.

Account

  • GET
    Retrieve balance /balance

    Available and pending funds; a quick way to check the key.

  • GET
    List events /events

    Recent events, the same ones webhooks deliver.