Stripe API Design Decisions

Understand the technical aspects to design the Stripe API.

Until now, we have understood the requirements of Stripe and its importance in the payment system. In this lesson, we will learn about Stripe and discuss the interaction of various micro-services that make it operational. Further, we will decide on some important technical aspects such as API architectural styles for interaction with different entities, communication protocols, and data formats for exchanging data with clients and backend services.

Let's start with the internal services of Stripe by presenting its abstract architecture.

Design overview

Stripe provides a good number of services to their customers that handle each aspect of the payment process. We will focus on prominent services that include customer, session, invoices, charges, refunds, balance, and payout services, as shown in the figure below:

Press + to interact
Internal services of the Stripe payment gateway
Internal services of the Stripe payment gateway

The client could be a customer or merchant whose requests are passed through the API gateway and directed to a relevant service. Each service shown in the above figure is described below:

  • Customer service: This service performs the operations relevant to a customer's data—for example, creating, updating, deleting, retrieving, and storing their payment details.

  • Session service: The session service is responsible for maintaining the session during the payment process. This service mainly handles customer data, such as ID, name, and other relevant credentials, during the payment process.

  • Invoices service: This performs the task of generating statements of funds that the customer is paying.

  • Charges service: This service is responsible for charging a credit or debit card. An important role of this service is to assign a unique ID to each charge operation.

  • Refunds service: Sometimes, a ...