Stripe API

By Abhishek Kumar
8 min read
Explore Stripe's API for seamless payment integration. Manage transactions, customize payment flows, and receive real-time updates with advanced features and robust documentation.

Table of Contents

Online payment processing for internet businesses. Stripe is a suite of payment APIs that powers commerce for businesses of all sizes.

API Overview

Stripe is a comprehensive payment gateway that empowers businesses to accept, manage, and track payments seamlessly. It offers a user-friendly dashboard, customizable payment forms, and robust APIs for integration with various platforms. Stripe supports a wide range of payment methods, including credit cards, debit cards, ACH transfers, and digital wallets. With advanced features like fraud detection, subscription management, and recurring billing, Stripe helps businesses optimize their payment processes, reduce costs, and enhance customer experiences.

Stripe's API overview provides extensive documentation to guide developers through the integration process. The RESTful APIs enable flexible and scalable payment processing, allowing businesses to customize their payment flows and access real-time data. Webhooks offer a robust notification system, ensuring that businesses receive instant updates on payment events. To prevent excessive API usage, Stripe implements rate limits, which can be adjusted based on specific requirements. This comprehensive API ecosystem empowers developers to create tailored payment solutions that meet the unique needs of their businesses.

API Request Limits

Starter

5,000 requests per second

Standard

10,000 requests per second

Premium

20,000 requests per second

Enterprise

Custom

APIs

Account

Method: GET

Description: Retrieve the details of the account..

Endpoint: v1/account

Parameters: account

Account

Method: POST

Description: Update the details of the account..

Endpoint: v1/account

Parameters: account

Account

Method: GET

Description: Retrieve a list of accounts..

Endpoint: v1/accounts

Parameters: account

Account

Method: POST

Description: Create a new account..

Endpoint: v1/accounts

Parameters: account

AccountLink

Method: POST

Description: Create an AccountLink..

Endpoint: v1/account_links

Parameters: account_link

ApplePayDomain

Method: GET

Description: Retrieve an Apple Pay domain..

Endpoint: v1/apple_pay/domains/{domain}

Parameters: domain

ApplePayDomain

Method: POST

Description: Create an Apple Pay domain..

Endpoint: v1/apple_pay/domains

Parameters: domain

ApplicationFee

Method: GET

Description: Retrieve an existing application fee..

Endpoint: v1/application_fees/{id}

Parameters: id

ApplicationFee

Method: POST

Description: Create an application fee..

Endpoint: v1/application_fees

Parameters: amount

ApplicationFee

Method: GET

Description: List all application fees..

Endpoint: v1/application_fees

Parameters: application

ApplicationFee

Method: POST

Description: Refund an application fee..

Endpoint: v1/application_fees/{id}/refund

Parameters: amount

Balance

Method: GET

Description: Retrieve the balance of an account..

Endpoint: v1/balance

Parameters: account

Balance

Method: GET

Description: Retrieve the balance history of an account..

Endpoint: v1/balance/history

Parameters: account

BalanceTransaction

Method: GET

Description: Retrieve a balance transaction object..

Endpoint: v1/balance/history/{id}

Parameters: id

BankAccount

Method: GET

Description: Retrieve a specified bank account object..

Endpoint: v1/bank_accounts/{id}

Parameters: id

BankAccount

Method: POST

Description: Create a new bank account object..

Endpoint: v1/bank_accounts

Parameters: account

Capability

Method: GET

Description: Retrieve a capability..

Endpoint: v1/capabilities/{capability}

Parameters: capability

Capability

Method: POST

Description: Request a capability for a recipient..

Endpoint: v1/capabilities

Parameters: account

Charge

Method: GET

Description: Retrieve a charge object..

Endpoint: v1/charges/{id}

Parameters: id

Charge

Method: POST

Description: Create a new charge..

Endpoint: v1/charges

Parameters: amount

Charge

Method: POST

Description: Capture a charge..

Endpoint: v1/charges/{id}/capture

Parameters: amount

Charge

Method: GET

Description: List all charges..

Endpoint: v1/charges

Parameters: created

Charge

Method: POST

Description: Refund a charge.

Endpoint: v1/charges/{id}/refunds

Parameters: amount

Charge

Method: POST

Description: Update a specified charge to capture it..

Endpoint: v1/charges/{id}/capture

Parameters: amount

Checkout

Method: GET

Description: Retrieves the details of a Checkout Session..

Endpoint: v1/checkout/sessions/{session_id}

Parameters: session_id

Checkout

Method: POST

Description: Creates a Checkout Session..

Endpoint: v1/checkout/sessions

Parameters: cancel_url

Checkout

Method: GET

Description: List all Checkout Sessions..

Endpoint: v1/checkout/sessions

Parameters: created

ConnectCollectionTransfer

Method: POST

Description: Create a collection transfer..

Endpoint: v1/transfers

Parameters: amount

CountrySpec

Method: GET

Description: Retrieve a CountrySpec..

Endpoint: v1/country_specs/{country}

Parameters: country

CountrySpec

Method: GET

Description: List all CountrySpecs..

Endpoint: v1/country_specs

Parameters: limit

Coupon

Method: GET

Description: Retrieve a coupon..

Endpoint: v1/coupons/{id}

Parameters: id

Coupon

Method: POST

Description: Create a coupon..

Endpoint: v1/coupons

Parameters: amount_off

Coupon

Method: GET

Description: List all coupons..

Endpoint: v1/coupons

Parameters: created

CreditNote

Method: GET

Description: Retrieve a credit note object..

Endpoint: v1/credit_notes/{id}

Parameters: id

CreditNote

Method: POST

Description: Create a new credit note..

Endpoint: v1/credit_notes

Parameters: amount

CreditNote

Method: GET

Description: List all credit notes..

Endpoint: v1/credit_notes

Parameters: created

CreditNote

Method: POST

Description: Apply the credit note to an invoice..

Endpoint: v1/credit_notes/{id}/apply_to_invoice

Parameters: invoice

CreditNote

Method: POST

Description: Void a credit note..

Endpoint: v1/credit_notes/{id}/void

Parameters:

Customer

Method: GET

Description: Retrieve a customer..

Endpoint: v1/customers/{id}

Parameters: id

Customer

Method: POST

Description: Create a new customer..

Endpoint: v1/customers

Parameters: address

Customer

Method: GET

Description: List all customers..

Endpoint: v1/customers

Parameters: created

Customer

Method: POST

Description: Update a customer..

Endpoint: v1/customers/{id}

Parameters: address

CustomerBalanceTransaction

Method: GET

Description: Retrieve a specific CustomerBalanceTransaction object..

Endpoint: v1/customers/{customer}/balance_transactions/{id}

Parameters: customer

CustomerBalanceTransaction

Method: GET

Description: List all CustomerBalanceTransactions..

Endpoint: v1/customers/{customer}/balance_transactions

Parameters: customer

CustomerSource

Method: GET

Description: Retrieve a specified customer source object..

Endpoint: v1/customers/{customer}/sources/{id}

Parameters: customer

CustomerSource

Method: POST

Description: Create a new bank account for a customer..

Endpoint: v1/customers/{customer}/sources

Parameters: customer

CustomerSource

Method: GET

Description: List all sources attached to a customer..

Endpoint: v1/customers/{customer}/sources

Parameters: customer

CustomerTaxId

Method: GET

Description: Retrieve a customer's tax ID..

Endpoint: v1/customers/{customer}/tax_ids/{id}

Parameters: customer

CustomerTaxId

Method: POST

Description: Create a customer's tax ID..

Endpoint: v1/customers/{customer}/tax_ids

Parameters: customer

Discount

Method: GET

Description: Retrieve a discount..

Endpoint: v1/discounts/{id}

Parameters: id

Discount

Method: POST

Description: Create a new discount..

Endpoint: v1/discounts

Parameters: coupon

Discount

Method: GET

Description: List all discounts..

Endpoint: v1/discounts

Parameters: created

Dispute

Method: GET

Description: Retrieve a dispute object..

Endpoint: v1/disputes/{id}

Parameters: id

Dispute

Method: GET

Description: List all disputes..

Endpoint: v1/disputes

Parameters: created

Dispute

Method: POST

Description: Close a dispute..

Endpoint: v1/disputes/{id}/close

Parameters: evidence

Dispute

Method: POST

Description: Update a dispute..

Endpoint: v1/disputes/{id}

Parameters: evidence

EphemeralKey

Method: POST

Description: Create an ephemeral key..

Endpoint: v1/ephemeral_keys

Parameters: customer

Event

Method: GET

Description: Retrieve a single event..

Endpoint: v1/events/{id}

Parameters: id

Event

Method: GET

Description: List all events..

Endpoint: v1/events

Parameters: created

File

Method: GET

Description: Retrieve information about a file..

Endpoint: v1/files/{id}

Parameters: id

File

Method: POST

Description: Create a file..

Endpoint: v1/files

Parameters: file

File

Method: GET

Description: List all files..

Endpoint: v1/files

Parameters: created

FileLink

Method: GET

Description: Retrieve a FileLink object..

Endpoint: v1/file_links/{id}

Parameters: id

FileLink

Method: POST

Description: Create a new file link..

Endpoint: v1/file_links

Parameters: file

Invoice

Method: GET

Description: Retrieve an invoice object..

Endpoint: v1/invoices/{id}

Parameters: id

Invoice

Method: POST

Description: Create an invoice object..

Endpoint: v1/invoices

Parameters: customer

Invoice

Method: GET

Description: List all invoices..

Endpoint: v1/invoices

Parameters: collection_method

Invoice

Method: POST

Description: Update an invoice..

Endpoint: v1/invoices/{id}

Parameters: closed

InvoiceItem

Method: GET

Description: Retrieve an invoice item object..

Endpoint: v1/invoiceitems/{id}

Parameters: id

InvoiceItem

Method: POST

Description: Create an invoice item..

Endpoint: v1/invoiceitems

Parameters: amount

InvoiceItem

Method: GET

Description: List all invoice items..

Endpoint: v1/invoiceitems

Parameters: created

InvoiceItem

Method: POST

Description: Update an invoice item..

Endpoint: v1/invoiceitems/{id}

Parameters: amount

IssuerFraudRecord

Method: GET

Description: Retrieve an IssuerFraudRecord object..

Endpoint: v1

Parameters:

FAQ

How to authenticate with Stripe API?

To authenticate with Stripe API, you'll need to use a secret API key. You can create an API key in the Stripe Dashboard.

How to use Stripe Sandbox for testing?

Stripe Sandbox is a testing environment that allows you to test your integration with Stripe without using real money. To use Stripe Sandbox, you'll need to create a Sandbox account.

What are the rate limits for Stripe API?

Stripe API has rate limits in place to prevent excessive usage. The rate limits vary depending on the API method and your account type. You can check the API documentation for specific rate limits.

How to create a webhook endpoint in Stripe?

To create a webhook endpoint in Stripe, you can use the <code>createWebhookEndpoint</code> method in the Stripe API. You'll need to provide a URL for the webhook endpoint and configure the events you want to listen for.

How to use multiple API keys in Stripe for different purposes?

Stripe allows you to use multiple API keys for different purposes, such as testing and live usage. You can create and manage API keys in the Stripe Dashboard.

Last Update: September 03, 2024