{"id":5223,"date":"2023-05-23T11:28:46","date_gmt":"2023-05-23T11:28:46","guid":{"rendered":"https:\/\/unremot.com\/blog\/?p=5223"},"modified":"2023-05-23T11:28:46","modified_gmt":"2023-05-23T11:28:46","slug":"how-to-use-stripe-api","status":"publish","type":"post","link":"https:\/\/unremot.com\/blog\/how-to-use-stripe-api\/","title":{"rendered":"How to use Stripe API &#8211; a step-by-step integration guide and full documentation list"},"content":{"rendered":"<p>This article will discuss how to use Stripe API with step-by-step integration guide and full documentation list. Let&#8217;s get started!<\/p>\n\n<h2><b>Overview of Stripe API<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Stripe is a payment processing platform on the internet. Million businesses from startups to large corporation use Stripe to accept and make payments and manage their online operations. Developers use Stripe API is a RESTful API to create, retrieve, update, and delete Stripe resources. They can use Stripe API integration to handle complicated processes. In this blog, we show developers how to use Stripe API.<\/span><\/p>\n<p style=\"text-align: center;\"><strong>Also read:\u00a0<a href=\"https:\/\/unremot.com\/blog\/how-to-use-spotify-api\/\">How to use Spotify API; a step-by-step integration guide and full documentation list<\/a><\/strong><\/p>\n<h2><b>List of Stripe developer API and functionalities<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">The Stripe Open API is a robust tool that allows developers to create apps to retrieve, update, and delete Stripe resources. The API is user-friendly and efficient and offers several services like payment, invoicing, and subscriptions. The Stripe API has a range of functionalities given below<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Accepting payments from different instruments.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Creating and managing customer accounts<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Generate invoices (on-off or periodically) as required<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Refund payments when required<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Integrating with other programs<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Some of the\u00a0 most popular API functionalities are:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Balances\u00a0 &#8211; Allows you to see balances in your Stripe Account<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Balance Transactions \u2013 This represents the funds move through your Stripe account and are created for all types of transactions \u2013 inflow and outflows.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Charges \u2013 These are charges to credit or debit account,<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Customers \u2013 This object represents a customer for your business. You can <\/span><span style=\"font-weight: 400;\">create, retrieve, update, and delete customer profiles. You can <\/span><span style=\"font-weight: 400;\">set up recurrent payments, or track payments.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Subscriptions \u2013 The Stripe Subscription API allows you to create and manage customers\u2019 subscription plans.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Disputes \u2013 Disputes occur when a customer raises concerns about charges or transactions with their card issuer. When this occurs, you have a chance to refute the allegations by providing evidentiary documentation.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Products \u2013 Products describe the specific goods or services you offer to your customer.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The Stripe API is available in several programming languages that makes it easy to integrate into your application. The Stripe API provides tools to help you begin<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Tutorials<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Documentation<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Support<\/span><\/li>\n<\/ul>\n<p style=\"text-align: center;\"><strong>Also read:\u00a0<a href=\"https:\/\/unremot.com\/blog\/how-to-use-youtube-api\/\">How To Use YouTube API; A Step-By-Step Guide Integration and Full Documentation List<\/a><\/strong><\/p>\n<h2><b>How to use Stripe API &#8211; step-by-step integration guide<\/b><\/h2>\n<p><strong>Step1: Create a Stripe account\u00a0<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Create an account by going to the Stripe website (https:\/\/stripe.com). To create your Stripe account, fill out the required fields, including your email address, company information, and banking information and click on the <\/span><i><span style=\"font-weight: 400;\">Create <\/span><\/i><span style=\"font-weight: 400;\">button. Stripe app is based on Stripe rest API.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now Click the sign-in button to login to the Stripe docs site and start using test mode API for authenticated requests.<\/span><\/p>\n<p><strong>Step2: Obtain API keys<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Go to the Dashboard after creating a Stripe account. The dashboard contains information like developers\u2019 API keys, view transactions, and customer reports. Click on <\/span><i><span style=\"font-weight: 400;\">Activate Payment<\/span><\/i><span style=\"font-weight: 400;\"> and enter business type and business details. Once you fill details you will be able to accept payments.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are two Stripe API keys \u2013 the secret key and the Stripe publishable API key. The secret key is used for server-side operations and the publishable is are used for client side operations. Never reveal the server-side key to anyone. You need to verify your account before Stripe restricts your account.\u00a0<\/span><\/p>\n<p><strong>Step3: Install the Stripe library<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Stripe library is language specific. Depending on the programming language you are using, you need to install the Stripe API Library. The library is easy to integrate and you can use the <\/span><a href=\"https:\/\/stripe.com\/docs\/development\/quickstart\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">developer<\/span><\/a><span style=\"font-weight: 400;\"> tool to install the Stripe Library<\/span><\/p>\n<p><strong>Step4: Set up server-side integration<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">To use the Stripe API on your server, include the Stripe library in your code and initialize it with your Secret Key. This step varies depending on the programming language you&#8217;re using.<\/span><\/p>\n<p><strong>Step 5: Create a checkout form<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">After installing the library and setting up the server-side integration, you need to create a checkout form. This is where the customer will enter all the payment information such as credit card number, CVV, expiration date. You can create a form from the Stripe Library.<\/span><\/p>\n<p><strong>Step 6: Client-side tokenization<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">To ensure the card details are secure, you should tokenize payment data on the client-side. Tokenization entails encrypting the card information and creating a distinct token from it. As a result, your server will never come into contact with sensitive card information. The token is then processed by your server after being transmitted there<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><b>Step 7: Create a charge<\/b><\/p>\n<p><span style=\"font-weight: 400;\">You can create a charge, now that you have customer information. A charge is a payment you collect from a customer.\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><strong>Also read:\u00a0<a href=\"https:\/\/unremot.com\/blog\/how-to-use-slack-api\/\">How to use Slack API; a step-by-step integration guide and full documentation list<\/a><\/strong><\/p>\n<h2><b>Stripe API docs references<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">The Stripe API is organized around REST. The Stripe API docs references is a great resource for developers. It contains the following\u00a0<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>API Reference: <\/b><span style=\"font-weight: 400;\">The Stripe API reference is the main source for developers wishing to integrate Stripe into their program. It has comprehensive information on methods, request parameters, response handling, and errors -handling. You can find the API reference <a href=\"https:\/\/stripe.com\/docs\/api\" target=\"_blank\" rel=\"noopener\">here<\/a><\/span><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>API versioning <\/b><span style=\"font-weight: 400;\">:<\/span><span style=\"font-weight: 400;\"> Stripe API versioning supports backward compatibility. You can indicate the specific Stripe version you want to use by providing it the Stripe-version header. Consult the &#8220;API Versioning&#8221; section of the API Reference for more details.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li aria-level=\"1\"><b>Authentication: <\/b><span style=\"font-weight: 400;\">Stripe uses API keys to verify to authenticate queries. You can manage and view your on the Stripe dashboard. The API has two sets of keys: Publishable keys and Secret Keys. Never reveal your keys in public, especially on public forums like GitHub<\/span><b>.\u00a0<\/b><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Webhooks<\/b><span style=\"font-weight: 400;\"> : Stripe uses webhooks to send real-time notifications for account-related events in your Stripe account or connected accounts.\u00a0 You can configure the webhooks from the dashboard.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Payment methods<\/b><span style=\"font-weight: 400;\">: Stripe supports various payment method such as credit and debit cards, bank transfers, and digital wallets. The API reference gives instructions on how to build, get access to, administer, and integrate payment.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Stripe API Changelog<\/b><span style=\"font-weight: 400;\">: The Stripe API Changelog documents all the updates and modifications\u00a0 made to the Stripe API. It documents about updated features, enhancements, and issue corrections. You can ensure compatibility with the most recent API versions by keeping up with the <a href=\"https:\/\/stripe.com\/docs\/upgrades\" target=\"_blank\" rel=\"noopener\">changelog<\/a>.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Stripe API Tutorial:<\/b><span style=\"font-weight: 400;\"> Stripe provides an in-depth API tutorial that walks you step-by-step through the integration of Stripe into your application. Setting up your Stripe account, using the API, managing webhooks, and managing payments are all covered in <a href=\"https:\/\/stripe.com\/docs\/api\/tutorial\" target=\"_blank\" rel=\"noopener\">this tutorial<\/a>.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The Stripe API documentation tool is a user-friendly interface to explore the documentation and search for specific topic. The code examples are an excellent base to build your code.\u00a0<\/span><\/p>\n<h2><b>Stripe API examples<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">In this section learn how to leverage the Stripe API to process payment seamlessly. You can use the Stripe API examples to create payment intent, collect customer details, handle card authentication, and confirm payment. We have used Stripe API in popular programming languages.\u00a0 The step 1 : set-up portion is common for most languages<\/span><\/p>\n<p><b>Step1: Setup the Stripe CLI<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Install<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To install the CLI through the command line, download and extract a versioned ZIP file for your operating system. To install the Stripe CLI with homebrew run<\/span><\/p>\n<p><span style=\"font-weight: 400;\">brew install stripe\/stripe-cli\/stripe<\/span><\/p>\n<p><b>Authenticate<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Login and authenticate to your Stripe user Account to generate restricted keys.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Command line command-<\/span><\/p>\n<p><span style=\"font-weight: 400;\">stripe login<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Press the Enter to complete the authentication process<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Your pairing code is: enjoy-enough-outwit-win<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This pairing code verifies your authentication with Stripe.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Press Enter to open the browser or visit https:\/\/dashboard.stripe.com\/stripecli\/confirm_auth?t=THQdJfL3x12udFkNorJL8OF1iFlN8Az1 (^C to quit)<\/span><\/p>\n<p><b>Confirm setup\u00a0<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Now that you have installed the CLI, you can make a single API request to Create a product\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">stripe products create \\<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8211;name=&#8221;My First Product&#8221; \\<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8211;description=&#8221;Created with the Stripe CLI&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Look for the product identifier (in\u00a0<\/span><span style=\"font-weight: 400;\">id<\/span><span style=\"font-weight: 400;\">) in the response object. Save it for the next step.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If everything worked, the command-line displays the following response.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;id&#8221;: &#8220;prod_LTenIrmp8Q67sa&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;object&#8221;: &#8220;product&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;active&#8221;: true,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;attributes&#8221;: [],<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;created&#8221;: 1668198126,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;default_price&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;description&#8221;: &#8220;Created with the Stripe CLI&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;identifiers&#8221;: {},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;images&#8221;: [],<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;livemode&#8221;: false,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;metadata&#8221;: {},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;name&#8221;: &#8220;My First Product&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;package_dimensions&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;price&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;product_class&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;shippable&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;sku&#8221;: &#8220;my-first-product-10&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;statement_descriptor&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;tax_code&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;type&#8221;: &#8220;service&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;unit_label&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;updated&#8221;: 1668198126,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;url&#8221;: null<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now call <\/span><a href=\"https:\/\/stripe.com\/docs\/api\/prices\/create\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Create a price<\/span><\/a><span style=\"font-weight: 400;\">\u00a0to attach a price of 30 USD. Swap the placeholder in\u00a0<\/span><span style=\"font-weight: 400;\">product<\/span><span style=\"font-weight: 400;\">\u00a0with your product identifier (for example,\u00a0<\/span><span style=\"font-weight: 400;\">prod_LTenIrmp8Q67sa<\/span><span style=\"font-weight: 400;\">).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">stripe prices create \\<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8211;unit-amount=3000 \\<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8211;currency=usd \\<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8211;product=&#8221;{{PRODUCT_ID}}&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If everything worked you get following response<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;id&#8221;: &#8220;price_1KzlAMJJDeE9fu01WMJJr79o&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;object&#8221;: &#8220;price&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;active&#8221;: true,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;billing_scheme&#8221;: &#8220;per_unit&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;created&#8221;: 1652636348,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;currency&#8221;: &#8220;usd&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;livemode&#8221;: false,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;lookup_key&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;metadata&#8221;: {},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;nickname&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;product&#8221;: &#8220;prod_Lh9iTGZhb2mcBy&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;recurring&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;tax_behavior&#8221;: &#8220;unspecified&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;tiers_mode&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;transform_quantity&#8221;: null,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;type&#8221;: &#8220;one_time&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;unit_amount&#8221;: 3000,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;unit_amount_decimal&#8221;: &#8220;3000&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<h3><b>How to use Stripe PHP API<\/b><\/h3>\n<p><b>Step1: Setup the Stripe CLI<\/b><\/p>\n<p><b>Step2: Manage third-party dependencies<\/b><\/p>\n<p><span style=\"font-weight: 400;\">You can use <\/span><span style=\"font-weight: 400;\">\u00a0<\/span><a href=\"https:\/\/getcomposer.org\/download\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Composer<\/span><\/a><span style=\"font-weight: 400;\"> to manage third-party dependencies from\u00a0<\/span><a href=\"https:\/\/packagist.org\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Packagist<\/span><\/a><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">which allows you to add new libraries and include them in your PHP projects.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Installer Composer<\/span><\/p>\n<p><span style=\"font-weight: 400;\">From the command line<\/span><span style=\"font-weight: 400;\">\u00a0<\/span><a href=\"https:\/\/getcomposer.org\/download\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">download Composer<\/span><\/a><span style=\"font-weight: 400;\">\u00a0using the instructions.<\/span><\/p>\n<p><strong>Ste3: Install the PHP Server0side SDK<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">The latest version of the Stripe PHP server-side SDK is v10.0.0. It supports PHP versions 5.6.0+..Check your PHP version.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">php \u2013version<\/span><\/p>\n<p><b>Install the library<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Install the library with\u00a0<\/span><a href=\"http:\/\/getcomposer.org\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Composer<\/span><\/a><span style=\"font-weight: 400;\">, a package manager for PHP:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">composer require stripe\/stripe-php<\/span><\/p>\n<p><span style=\"font-weight: 400;\">After you install the library with Composer, it\u2019s automatically added as a dependency in your project\u2019s composer.json file. For example:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&#8220;require&#8221;: {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;stripe\/stripe-php&#8221;: &#8220;^10.0.0&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To use the bindings, use Composer\u2019s\u00a0<\/span><a href=\"https:\/\/getcomposer.org\/doc\/01-basic-usage.md#autoloading\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">autoload<\/span><\/a><span style=\"font-weight: 400;\">. For example:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&#8220;require&#8221;: {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;stripe\/stripe-php&#8221;: &#8220;^10.0.0&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">require_once(&#8216;vendor\/autoload.php&#8217;);<\/span><\/p>\n<p><strong>Step 4: Run your first SDK request<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Now that you have the PHP SDK installed, you can create a subscription\u00a0<\/span><a href=\"https:\/\/stripe.com\/docs\/api\/products\/create\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Product<\/span><\/a><span style=\"font-weight: 400;\">\u00a0and attach a\u00a0<\/span><a href=\"https:\/\/stripe.com\/docs\/api\/prices\/create\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Price<\/span><\/a><span style=\"font-weight: 400;\">\u00a0with a couple API requests. We\u2019re using the product identifier returned in the response to create the price in this example.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&lt;?php<\/span><\/p>\n<p><span style=\"font-weight: 400;\">require_once(&#8216;vendor\/autoload.php&#8217;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$stripe = new \\Stripe\\StripeClient(&#8220;sk_test_tR3PYbcVNZZ796tH88S4VQ2u&#8221;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$product = $stripe-&gt;products-&gt;create([<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8216;name&#8217; =&gt; &#8216;Starter Subscription&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8216;description&#8217; =&gt; &#8216;$12\/Month subscription&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">]);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">echo &#8220;Success! Here is your starter subscription product id: &#8221; . $product-&gt;id . &#8220;\\n&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">$price = $stripe-&gt;prices-&gt;create([<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8216;unit_amount&#8217; =&gt; 1200,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8216;currency&#8217; =&gt; &#8216;usd&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8216;recurring&#8217; =&gt; [&#8216;interval&#8217; =&gt; &#8216;month&#8217;],<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8216;product&#8217; =&gt; $product[&#8216;id&#8217;],<\/span><\/p>\n<p><span style=\"font-weight: 400;\">]);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">echo &#8220;Success! Here is your premium subscription price id: &#8221; . $price-&gt;id . &#8220;\\n&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">?&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Save the file as created_price.php. from the command line . cd to the directory you saved the file.\u00a0 Run<\/span><\/p>\n<p><span style=\"font-weight: 400;\">php create_price.php<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If everything works properly you will see the following response. Save these identifiers and use them while building your integration.\u00a0<\/span><\/p>\n<h3><b>How to use Stripe API Typescript<\/b><\/h3>\n<p><span style=\"font-weight: 400;\"><strong>Step1:<\/strong> Set Up a TypeScript Project If you don&#8217;t already have a TypeScript project set up, start by creating a new directory for your project and initializing it with TypeScript. Open your terminal and navigate to the project directory. Run the following commands:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">mkdir stripe-api-project<\/span><\/p>\n<p><span style=\"font-weight: 400;\">cd stripe-api-project<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm init -y<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm install typescript &#8211;save-dev<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Install the Stripe TypeScript Library To use the Stripe API with TypeScript, you&#8217;ll need to install the Stripe TypeScript library. Run the following command in your terminal:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm install @stripe\/stripe-js \u2013save<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This command installs the official Stripe TypeScript library, which provides type definitions and utility functions for working with the Stripe API.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step3:<\/strong> Create TypeScript Files In your project directory, create a TypeScript file (e.g., <\/span><b>index.ts<\/b><span style=\"font-weight: 400;\">) to write your TypeScript code. Open the file in a code editor.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step4:<\/strong> Import the Stripe TypeScript Library At the top of your <\/span><b>index.ts<\/b><span style=\"font-weight: 400;\"> file, import the Stripe TypeScript library as follows:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import { Stripe } from &#8216;@stripe\/stripe-js&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step5:<\/strong> Initialize the Stripe Object Create a function to initialize the Stripe object. Inside this function, use the <\/span><b>loadStripe<\/b><span style=\"font-weight: 400;\"> function from the Stripe library to load the Stripe.js script and initialize the Stripe object. Here&#8217;s an example:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">async function initializeStripe(): Promise&lt;Stripe | null&gt; {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0const stripe = await import(&#8216;@stripe\/stripe-js&#8217;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0const stripeApiKey = &#8216;YOUR_STRIPE_PUBLIC_KEY&#8217;; \/\/ Replace with your actual Stripe publishable key<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0return stripe.loadStripe(stripeApiKey);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step6:<\/strong> Use Stripe Elements Next, create a function to handle the payment form submission. In this function, use the Stripe object to create a Stripe Elements instance and mount it to a container element. Here&#8217;s an example:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">async function handlePaymentFormSubmission() {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0const stripe = await initializeStripe();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0if (stripe) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0const elements = stripe.elements();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0const cardElement = elements.create(&#8216;card&#8217;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0cardElement.mount(&#8216;#card-element&#8217;); \/\/ Replace with the ID of your card element container<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\/\/ Handle form submission and tokenization<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0const form = document.getElementById(&#8216;payment-form&#8217;) as HTMLFormElement;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0form.addEventListener(&#8216;submit&#8217;, async (event) =&gt; {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0event.preventDefault();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const { token, error } = await stripe.createToken(cardElement);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (error) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ Handle error<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} else {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ Use the token for payment processing<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const tokenId = token.id;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ Send the token to your server for processing<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0});<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step7:<\/strong> Compile and Run<\/span><\/p>\n<h3><b>How to use Stripe API React<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">To use the Stripe API with React, you&#8217;ll need to install the Stripe JavaScript library and integrate it into your React application. Here&#8217;s a step-by-step guide on how to use the Stripe API with React:<\/span><\/p>\n<p><b>Step1: <\/b>Set Up a React Project If you don&#8217;t already have a React project set<span style=\"font-weight: 400;\"> up, start by creating a new directory for your project and initializing it with React. Open your terminal and navigate to the project directory. Run the following command:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npx create-react-app stripe-react-project<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This command sets up a new React project with Create React App.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Install the Stripe JavaScript Library\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To use the Stripe API with React, you&#8217;ll need to install the Stripe JavaScript library. Run the following command in your terminal:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm install @stripe\/stripe-js \u2013save<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This command installs the official Stripe JavaScript library, which provides the necessary functions and methods for working with the Stripe API.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step3:<\/strong> Create a Stripe Component In your React project<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Create a new component that will handle Stripe-related functionality. For example, you can create a component named <\/span><b>StripeForm.js<\/b><span style=\"font-weight: 400;\">. Open the file in a code editor.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step4:<\/strong> Import the Stripe JavaScript Library\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In your <\/span><b>StripeForm.js<\/b><span style=\"font-weight: 400;\"> file, import the Stripe JavaScript library as follows:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import { loadStripe } from &#8216;@stripe\/stripe-js&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step5:<\/strong> Initialize the Stripe Object\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Inside your StripeForm component, create a function to initialize the Stripe object. Use the loadStripe function from the Stripe library to load the Stripe.js script and initialize the Stripe object. Here&#8217;s an example:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">async function initializeStripe() {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0const stripeApiKey = &#8216;YOUR_STRIPE_PUBLIC_KEY&#8217;; \/\/ Replace with your actual Stripe publishable key<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0const stripe = await loadStripe(stripeApiKey);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Use the stripe object for payment processing<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step6:<\/strong> Use Stripe Elements\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Next, within your <\/span><b>StripeForm<\/b><span style=\"font-weight: 400;\"> component, you can use Stripe Elements to collect payment information. You can use the Stripe Elements React components provided by the Stripe JavaScript library. Here&#8217;s an example of creating a card input element:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import { CardElement, useElements, useStripe } from &#8216;@stripe\/react-stripe-js&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">function StripeForm() {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0const stripe = useStripe();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0const elements = useElements();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Handle form submission and payment processing<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0const handleSubmit = async (event) =&gt; {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0event.preventDefault();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\/\/ Perform payment processing using the stripe and elements objects<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0};<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0return (<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&lt;form onSubmit={handleSubmit}&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;CardElement \/&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;button type=&#8221;submit&#8221;&gt;Pay&lt;\/button&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&lt;\/form&gt;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step7:<\/strong> Compile and Run\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Compile and run your React project by running the following command in your terminal:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm start<\/span><\/p>\n<h3><b>How to use Stripe API Nodejs<\/b><\/h3>\n<p><span style=\"font-weight: 400;\"><strong>Step1:<\/strong> Setup the Stripe CLI<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Install the Node.js server-side SDK<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The latest version of the Stripe Node.js server-side SDK s v12.0.0. It supports Node.js versions 12+.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Check your Node version:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">node &#8211;version<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Initialize Node\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm init<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Initialize the library\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Install the library with\u00a0<\/span><a href=\"https:\/\/www.npmjs.com\/package\/node\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">npm<\/span><\/a><span style=\"font-weight: 400;\">, a package manager for Node:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm install stripe &#8211;save<\/span><\/p>\n<p><span style=\"font-weight: 400;\">After you install the library with npm, the library is automatically added as a dependency in your project\u2019s package.json file. For example:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;name&#8221;: &#8220;stripe-node-example&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;version&#8221;: &#8220;1.0.0&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;description&#8221;: &#8220;A Stripe demo&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;main&#8221;: &#8220;index.js&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;scripts&#8221;: {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&#8220;node &#8220;: &#8220;node create_price.js&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&#8220;test&#8221;: &#8220;echo \\&#8221;Error: no test specified\\&#8221; &amp;&amp; exit 1&#8243;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;author&#8221;: &#8220;&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;license&#8221;: &#8220;ISC&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0&#8220;dependencies&#8221;: {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&#8220;stripe&#8221;: &#8220;^12.0.0&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step3:<\/strong> Run your first SDK request<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now that you have the Node.js SDK installed, you can create a <\/span><span style=\"font-weight: 400;\">\u00a0subscription\u00a0<\/span><a href=\"https:\/\/stripe.com\/docs\/api\/products\/create\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Product<\/span><\/a><span style=\"font-weight: 400;\">\u00a0and attach a\u00a0<\/span><a href=\"https:\/\/stripe.com\/docs\/api\/prices\/create\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Price<\/span><\/a><span style=\"font-weight: 400;\">\u00a0with a couple API requests. The Node.js SDK returns\u00a0<\/span><a href=\"https:\/\/nodejs.dev\/learn\/understanding-javascript-promises\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">promises<\/span><\/a><span style=\"font-weight: 400;\">\u00a0which can be used as chainable callbacks. To demonstrate, we\u2019re passing the product identifier returned in the Product response to create a Price\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">in this example.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const stripe = require(&#8216;stripe&#8217;)(&#8216;sk_test_tR3PYbcVNZZ796tH88S4VQ2u&#8217;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">stripe.products.create({<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0name: &#8216;Starter Subscription&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0description: &#8216;$12\/Month subscription&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}).then(product =&gt; {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0stripe.prices.create({<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0unit_amount: 1200,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0currency: &#8216;usd&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0recurring: {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0interval: &#8216;month&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0product: product.id,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}).then(price =&gt; {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0console.log(&#8216;Success! Here is your starter subscription product id: &#8216; + product.id);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0console.log(&#8216;Success! Here is your premium subscription price id: &#8216; + price.id);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0});<\/span><\/p>\n<p><span style=\"font-weight: 400;\">});<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you everything worked in the command line show the following response. Save the identifiers so you can use them while building your applications.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Success! Here is your starter subscription product id: price_0KxBDl589O8KAxCG1alJgiA6<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Success! Here is your starter subscription price id: price_0KxBDm589O8KAxCGMgG7scjb<\/span><\/p>\n<h3><b>How to use Stripe Express Js API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\"><strong>Step1:<\/strong> Set Up an Express.js Project\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you haven&#8217;t already set up an Express.js project, start by creating a new directory for your project and initializing it with Express.js. Open your terminal and navigate to the project directory. Run the following commands:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">mkdir stripe-express-project<\/span><\/p>\n<p><span style=\"font-weight: 400;\">cd stripe-express-project<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm init -y<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm install express &#8211;save<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Install the Stripe Node.js Library\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To use the Stripe API with Express.js, you&#8217;ll need to install the Stripe Node.js library. Run the following command in your terminal:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">npm install stripe \u2013save<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This command installs the official Stripe Node.js library, which provides the necessary functions and methods for interacting with the Stripe API.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step3:<\/strong> Set Up Stripe Secret Key Obtain your Stripe Secret Key from the Stripe Dashboard. You&#8217;ll need to set the Secret Key in your Express.js application&#8217;s environment variables. You can use a package like <\/span><b>dotenv<\/b><span style=\"font-weight: 400;\"> to manage your environment variables.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step4:<\/strong> Set Up Express.js Server Create an Express.js server file (e.g., <\/span><b>server.js<\/b><span style=\"font-weight: 400;\">) and open it in a code editor. Import the required modules and set up your Express.js server. Here&#8217;s a basic example to get started:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const express = require(&#8216;express&#8217;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const stripe = require(&#8216;stripe&#8217;)(process.env.STRIPE_SECRET_KEY);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">const app = express();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/ Configure Express.js middleware, routes, and other settings<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/\/ Start the server<\/span><\/p>\n<p><span style=\"font-weight: 400;\">app.listen(3000, () =&gt; {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0console.log(&#8216;Server is running on port 3000&#8217;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">});<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step5:<\/strong> Handle API Requests\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In your Express.js server file, you can define routes to handle different API requests. For example, to create a charge, you can define a route as follows:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">app.post(&#8216;\/create-charge&#8217;, async (req, res) =&gt; {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0try {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0const { amount, currency, source } = req.body;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\/\/ Create a charge using the Stripe API<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0const charge = await stripe.charges.create({<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0amount: amount,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0currency: currency,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0source: source,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0});<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\/\/ Return the charge object as the response<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0res.json(charge);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0} catch (error) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\/\/ Handle any errors that occur during the charge creation<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0res.status(500).json({ error: error.message });<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">});<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step6:<\/strong> Test the API\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can now test your Stripe Express.js API by sending HTTP requests to the defined routes. You can use tools like Postman or cURL to send requests to your Express.js server.<\/span><\/p>\n<h3><b>How to use Stripe API Django<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Set up the Django API<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Create a Django project called StripeApp with Django Rest framework library installed.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Create a new app in our StripeApp project root<\/span><\/p>\n<p><span style=\"font-weight: 400;\">python manage.py startapp payments<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Ensure the urls.py, views.py, settings\/py, and urls.py\u00a0 are visible in the project structure.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Install the Stripe Library<\/span><\/p>\n<p><span style=\"font-weight: 400;\">pip install &#8211;upgrade stripe<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Sign up and get publishable and secret Key and copy the keys in your Django project.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">payments\/views.pystripe.api_key = \u2018sk_test_\u2019 # your real key will be much longer<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Make a test request to the Stripe API<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Creae a simple view making a stripe payment to check if your key is valid.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\"># payments\/views.py@api_view([&#8216;POST&#8217;])<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">def test_payment(request):test_payment_intent = stripe.PaymentIntent.create(<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u00a0 \u00a0 amount=1000, currency=&#8217;pln&#8217;, <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u00a0 \u00a0 payment_method_types=[&#8216;card&#8217;],<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u00a0 \u00a0 receipt_email=&#8217;test@example.com&#8217;)return Response(status<\/span><span style=\"font-weight: 400;\">=status.HTTP_200_OK, <\/span><i><span style=\"font-weight: 400;\">data<\/span><\/i><span style=\"font-weight: 400;\">=test_payment_intent)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Connect the view with the URL in payments\/urls.py<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\"># payments\/urls.py<\/span><\/i><span style=\"font-weight: 400;\">from django.conf.urls import url<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">from payments import viewsurlpatterns = [<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u00a0 \u00a0 url(r&#8217;^test-payment\/$&#8217;, views.test_payment),<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">]<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now define the payments URL prefix in <\/span><span style=\"font-weight: 400;\">stripeapp\/urls.py<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\"># stripeapp\/urls.py<\/span><\/i><span style=\"font-weight: 400;\">urlpatterns = [<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u00a0 \u00a0 path(&#8216;admin\/&#8217;, admin.site.urls),<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><i><span style=\"font-weight: 400;\">\u00a0 \u00a0 # add this line<\/span><\/i><i><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/i><b>\u00a0 \u00a0 path(&#8216;payments\/&#8217;, include(&#8216;payments.urls&#8217;))<\/b><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">]<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now send a request to (http:\/\/localhost:8000\/payments\/test-payment) using Postman. If successful you should get JSON object like<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{ <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">&#8220;id&#8221;: &#8220;pi_123&#8221;, #you will have a unique id every time<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">&#8220;object&#8221;: &#8220;payment_intent&#8221;,<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">&#8220;amount&#8221;: 1000,<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">&#8220;amount_capturable&#8221;: 0,<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">&#8220;amount_received&#8221;: 0, <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">&#8220;application&#8221;: null,<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">&#8220;application_fee_amount&#8221;: null,<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">&#8230;<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">}<\/span><\/p>\n<h3><b>How to use Stripe Ruby API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">In this section we focus on how to use Stripe API. Stripe server side libraries (also known as SDK) help you interact with the Stripe REST APIs.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Initial Setup\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Click the sign in to login to the Stripe doc site and start using your test mode API keys to authenticate requests.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step1:<\/strong> Follow steps mention Stripe CLI<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Manage third-party dependencies<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It is best to use Rub to manage third-party dependencies if any. This allows you to add new libraries and use them in your projects. Check if RubuyGem is installed.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">gem \u2013version<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you get the response RubyGem is not found, you can <\/span><a href=\"http:\/\/rubygems.org\/pages\/download\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">download RubyGems<\/span><\/a><span style=\"font-weight: 400;\">\u00a0from their downloads page.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step3:<\/strong> Install the Ruby server-side SDK<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The latest version of the Stripe Ruby server-side SDK is v8.0.0. It supports Ruby versions 2.3+.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Check your Ruby version:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">ruby -v<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Install the library\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/guides.rubygems.org\/make-your-own-gem\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Create a gem file<\/span><\/a><span style=\"font-weight: 400;\">\u00a0and install the generated gem using a bundler with\u00a0<\/span><a href=\"https:\/\/rubygems.org\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">RubyGems<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Add the latest version of the\u00a0<\/span><a href=\"https:\/\/rubygems.org\/gems\/stripe\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Stripe gem<\/span><\/a><span style=\"font-weight: 400;\">\u00a0to a project:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bundle add stripe<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Install the required gems from your specified sources:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">bundle install<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step4:<\/strong> Run your first SK<\/span><\/p>\n<p><span style=\"font-weight: 400;\">All Ruby SDK are installed, you can create a subscription <\/span><span style=\"font-weight: 400;\">\u00a0<\/span><a href=\"https:\/\/stripe.com\/docs\/api\/products\/create\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Product<\/span><\/a><span style=\"font-weight: 400;\">\u00a0and attach a\u00a0<\/span><a href=\"https:\/\/stripe.com\/docs\/api\/prices\/create\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Price<\/span><\/a><span style=\"font-weight: 400;\">\u00a0with some API requests.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For example<\/span><\/p>\n<p><span style=\"font-weight: 400;\">require &#8216;rubygems&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">require &#8216;stripe&#8217;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Stripe.api_key = &#8220;sk_test_tR3PYbcVNZZ796tH88S4VQ2u&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">starter_subscription = Stripe::Product.create(<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0name: &#8216;Starter Subscription&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0description: &#8216;$12\/Month subscription&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">starter_subscription_price = Stripe::Price.create(<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0currency: &#8216;usd&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0unit_amount: 1200,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0recurring: {interval: &#8216;month&#8217;},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0product: starter_subscription[&#8216;id&#8217;],<\/span><\/p>\n<p><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">puts &#8220;Success! Here is your starter subscription product id: #{starter_subscription.id}&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">puts &#8220;Success! Here is your starter subscription price id: #{starter_subscription_price.id}&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Save the file as create_price.rb. From the command line cd to go directory where you saved the file and run<\/span><\/p>\n<p><span style=\"font-weight: 400;\">ruby create_price.rb<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If everything worked you should get the following response<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Success! Here is your starter subscription product id: price_0KxBDl589O8KAxCG1alJgiA6<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Success! Here is your starter subscription price id: price_0KxBDm589O8KAxCGMgG7scjb<\/span><\/p>\n<h3><b>How to use Stripe Python API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\"><strong>Step1:<\/strong> Manage third-party dependencies<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We recommend use the\u00a0<\/span><a href=\"https:\/\/docs.python.org\/3\/tutorial\/venv.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">venv<\/span><\/a><span style=\"font-weight: 400;\">\u00a0module to manage third-party dependencies. The module permits you to add new libraries and include them in your Python 3 projects.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In the command line type<\/span><\/p>\n<p><span style=\"font-weight: 400;\">third-party dependencies<\/span><\/p>\n<p><span style=\"font-weight: 400;\">On GNU\/MacOS bash<\/span><\/p>\n<p><span style=\"font-weight: 400;\">python3 -m venv env<\/span><\/p>\n<p><span style=\"font-weight: 400;\">source env\/bin\/activate<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Install Python server-side SDK\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The latest version of the Stripe Python server-side SDK is v5.0.0. It supports Python versions 2.7, 3.6+.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Check your Python version:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">python3 &#8211;version<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Install the library<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Install the library from <\/span><a href=\"http:\/\/pypi.python.org\/pypi\/stripe\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">PyPi<\/span><\/a> <span style=\"font-weight: 400;\">\u00a0a package manager for Python:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">pip3 install &#8211;upgrade stripe<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Next, specify the following version in your requirements.txt file:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">stripe&gt;=5.0.0<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step3:<\/strong> Run your first SDK request<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now that you have installed Python SDK, you can create a <\/span><span style=\"font-weight: 400;\">subscription\u00a0<\/span><a href=\"https:\/\/stripe.com\/docs\/api\/products\/create\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Product<\/span><\/a><span style=\"font-weight: 400;\">\u00a0and attach a\u00a0<\/span><a href=\"https:\/\/stripe.com\/docs\/api\/prices\/create\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Price<\/span><\/a><span style=\"font-weight: 400;\">\u00a0with a couple API requests. We\u2019re using the product identifier returned in the response to create the price in this example.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import stripe<\/span><\/p>\n<p><span style=\"font-weight: 400;\">stripe.api_key = &#8220;sk_test_tR3PYbcVNZZ796tH88S4VQ2u&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">starter_subscription = stripe.Product.create(<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0name=&#8221;Starter Subscription&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0description=&#8221;$12\/Month subscription&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">starter_subscription_price = stripe.Price.create(<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0unit_amount=1200,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0currency=&#8221;usd&#8221;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0recurring={&#8220;interval&#8221;: &#8220;month&#8221;},<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0product=starter_subscription[&#8216;id&#8217;],<\/span><\/p>\n<p><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\"># Save these identifiers<\/span><\/p>\n<p><span style=\"font-weight: 400;\">print(f&#8221;Success! Here is your starter subscription product id: {starter_subscription.id}&#8221;)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">print(f&#8221;Success! Here is your starter subscription price id: {starter_subscription_price.id}&#8221;)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Save the file as create_price.py. From the command line, cd to the directory containing the file you just save and run.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">python3 create_price.py<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If everything works, the command line shows the following response. Save these identifiers so you can use them while building\u00a0 your integration.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Success! Here is your starter subscription product id: price_0KxBDl589O8KAxCG1alJgiA6<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Success! Here is your starter subscription price id: price_0KxBDm589O8KAxCGMgG7scjb<\/span><\/p>\n<h3><b>How to use Stripe API Jar<\/b><\/h3>\n<p><span style=\"font-weight: 400;\"><strong>Step1:<\/strong> Download the Stripe API Jar First, you need to download the Stripe API Jar file. Visit the <a href=\"https:\/\/stripe.com\/docs\/libraries#java\" target=\"_blank\" rel=\"noopener\">Stripe website <\/a><\/span><span style=\"font-weight: 400;\">and download the latest version of the Stripe API Jar.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step2:<\/strong> Set Up Your Java Project Create a new Java project or open an existing one in your preferred integrated development environment (IDE). Make sure you have the necessary dependencies and build tools set up.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step3:<\/strong> Add the Stripe API Jar to Your Project Copy the downloaded Stripe API Jar file to your project&#8217;s directory. In your IDE, right-click on your project&#8217;s name and select &#8220;Properties&#8221; or &#8220;Build Path&#8221; (depending on your IDE) to open the project settings. Look for the &#8220;Libraries&#8221; or &#8220;Dependencies&#8221; tab and click on it. Then, click on the &#8220;Add JARs&#8221; or &#8220;Add External JARs&#8221; button and select the Stripe API Jar file you downloaded.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import com.stripe.Stripe;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import com.stripe.model.Charge;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import com.stripe.exception.StripeException;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">import com.stripe.model.Customer;<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step4:<\/strong> Set Your Stripe API Key Before making any API calls, you need to set your Stripe API key. Obtain your API key from the Stripe Dashboard. In your Java code, add the following line and replace &#8220;YOUR_STRIPE_API_KEY&#8221; with your actual<\/span><span style=\"font-weight: 400;\"> API key:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Stripe.apiKey = &#8220;YOUR_STRIPE_API_KEY&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Step5:<\/strong> Make API Calls Now, you can start making API calls using the Stripe API Jar. You can perform various actions, such as creating charges, managing customers, creating subscriptions, and more. Here&#8217;s an example of creating a charge:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">params.put(&#8220;amount&#8221;, 2000); \/\/ Amount in cents<\/span><\/p>\n<p><span style=\"font-weight: 400;\">params.put(&#8220;currency&#8221;, &#8220;usd&#8221;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">params.put(&#8220;source&#8221;, &#8220;tok_visa&#8221;); \/\/ Example card token<\/span><\/p>\n<p><span style=\"font-weight: 400;\">try {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0Charge charge = Charge.create(params);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0System.out.println(&#8220;Charge created: &#8221; + charge);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">} catch (StripeException e) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\/\/ Handle exception<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0e.printStackTrace();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<h3><b>How to use Stripe API WordPress<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">A free WordPress fundraising plugin called Paymattic works with the Stripe payment gateway. Several website accept payment with Paymattic. It features subscription payments and on-off payments. Paymattic&#8217;s user-friendly interface makes it simple to manage payments forms.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">First go to <\/span><b>\u00a0<\/b><span style=\"font-weight: 400;\">Paymattic &gt; Payment Gateway\u00a0from your WordPress dashboard.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on Stripe tab in the left navigation tab.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The Stripe setting page will open. Select test mode or live mode in the setting page. After choosing your preferred mode you will need publishable and secret key.\u00a0<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">You can get the keys once you log in to your Stripe dashboard and go to the Developers options.\u00a0<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Now navigate to API keys and find the publishable and secret key.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Copy paste\u00a0 keys into the respective fields in <\/span><span style=\"font-weight: 400;\">\u00a0<\/span><i><span style=\"font-weight: 400;\">Paymattic &gt; Payment Gateway &gt; Stripe.<\/span><\/i><\/li>\n<li><span style=\"font-weight: 400;\">Click <\/span><i><span style=\"font-weight: 400;\">Save Settting <\/span><\/i><span style=\"font-weight: 400;\">Button to finish the integration.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">You need to create a form to see how Stripe works with Payymatic.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To create your form go to\u00a0Paymattic &gt; Create Form.<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Click on the\u00a0<\/span><b>Add New Form<\/b><span style=\"font-weight: 400;\">\u00a0option.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Click on \u00a0<\/span><b>Advance<\/b><span style=\"font-weight: 400;\">\u00a0<\/span><b>Editor<\/b><span style=\"font-weight: 400;\">\u00a0to build a form from scratch.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Add all your required form fields.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">At last, add Stripe payment gateway from the payment method fields.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Configure your desired settings for Stripe checkout in the\u00a0<\/span><b>Card Elements (Stripe)<\/b><span style=\"font-weight: 400;\">\u00a0field.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Click on\u00a0 the <\/span><b>Update Fields<\/b><span style=\"font-weight: 400;\"> button.<\/span><\/li>\n<\/ul>\n<p style=\"text-align: center;\"><strong>Also read:\u00a0<a href=\"https:\/\/unremot.com\/blog\/how-to-use-chatgpt-api\/\">How to use ChatGPT API; a step-by-step integration guide and full documentation list<\/a><\/strong><\/p>\n<h2><b>Stripe API pricing<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Stripe API pricing is transparent. There are two models\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Integrated model \u2013 The model gives you complete access to the payment platform with pay-as-you-go pricing. The payment is 2.9% + 30 Cents. There are no set up fees, monthly fees or hidden fees in this model.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Customized packages- You can set up a customized package for your business. This model is ideal for businesses with a large payment volume or high value transactions. You can speak with an <\/span><a href=\"https:\/\/stripe.com\/en-in\/contact\/sales\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">expert<\/span><\/a><span style=\"font-weight: 400;\"> for more information.<\/span><\/li>\n<\/ul>\n<h2><b>Most used Stripe APIs<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">The most used <a href=\"https:\/\/unremot.com\/category\/stripe-api\">Stripe API<\/a> are\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Customer \u2013 the API is used to create, delete and update customer profiles<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Payment API \u2013 the payment api allows you to accept payment through credit and debit cards or any other payment instrument. You can use the payment API for charges or refunds.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Invoice API \u2013 The invoice API create\u00a0 and send invoices to customer. The API can be used to track transaction history of a customer and customer information.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Subscription API \u2013 This API helps you manage subscriptions for your product and services.\u00a0<\/span><\/li>\n<\/ul>\n<h3><b>Stripe ACH API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The <\/span><a href=\"https:\/\/stripe.com\/docs\/payments\/ach-debit\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Stripe ACH API<\/span><\/a><span style=\"font-weight: 400;\"> lets you accept payments from US bank accounts. The ACH debit card is a reusable, delayed payment method. It can take 4 business days for a transaction to receive acknowledgment of the success and failure of a transaction.\u00a0<\/span><\/p>\n<h3><b>Stripe connect API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The <\/span><a href=\"https:\/\/stripe.com\/docs\/connect\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Stripe connect API<\/span><\/a><span style=\"font-weight: 400;\"> lets you route payments between multiple parties. It is ideal for business models like marketplaces and software platforms. The API lets you route payment between businesses, customers, and the recipient.\u00a0<\/span><\/p>\n<h3><b>Stripe charge API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The <\/span><a href=\"https:\/\/stripe.com\/docs\/api\/versioning\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Stripe Charges API<\/span><\/a><span style=\"font-weight: 400;\"> is to charge credit or debit cards. You can retrieve or refund individual charges and list all charges made to an account.\u00a0<\/span><\/p>\n<h3><b>Stripe orders API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Stripe has decided to wind down the <\/span><a href=\"https:\/\/stripe.com\/docs\/orders\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Order API<\/span><\/a><span style=\"font-weight: 400;\">. The API will be depreciated on May 26 2023.<\/span><\/p>\n<h3><b>Stripe API pagination<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The <\/span><a href=\"about:blank\"><span style=\"font-weight: 400;\">Stripe API pagination<\/span><\/a><span style=\"font-weight: 400;\"> allows you to retrieve bulk lists \u2013 list customers, list charges, or list invoices. You can opt for cursor-based pagination or auto pagination.\u00a0<\/span><\/p>\n<h3><b>Stripe API balance transaction<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The <\/span><a href=\"https:\/\/stripe.com\/docs\/reports\/balance-transaction-types\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Stripe API balance transaction<\/span><\/a><span style=\"font-weight: 400;\"> represents funds moving through the Stripe account. They are made for each kind of transaction that enters or exits your Stripe account&#8217;s balance.<\/span><\/p>\n<h3><b>Stripe issuing API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The <\/span><a href=\"https:\/\/stripe.com\/docs\/issuing\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Stripe issuing API<\/span><\/a><span style=\"font-weight: 400;\"> is primarily for businesses to create, manage, and distribute payments instantly. Issuing is available the US, the UK, and countries in the European Economic Area.\u00a0<\/span><\/p>\n<h3><b>cc checker Stripe API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The <\/span><a href=\"https:\/\/github.com\/topics\/cc-checker\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">CC Checker Stripe API<\/span><\/a><span style=\"font-weight: 400;\"> checks the validity of the credit card numbers. The API is based on the luhn algorithm and is used to verify if the credit card is real or fake.\u00a0<\/span><\/p>\n<h3><b>Stripe subscription create API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Stripe <\/span><a href=\"https:\/\/stripe.com\/docs\/api\/subscriptions\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">subscription create API<\/span><\/a><span style=\"font-weight: 400;\"> is used to create new subscription on existing customers. Each customer can have up to 500 active or schedule subscriptions. Subscription model takes recurrent payment from a customer.\u00a0<\/span><\/p>\n<h3><b>Stripe recurring payments API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The Stripe recurring payment API or the <\/span><a href=\"https:\/\/stripe.com\/docs\/api\/subscriptions\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">subscriptions<\/span><\/a><span style=\"font-weight: 400;\"> allow you to charge the customer on recurrent basis and allows customers to pay for products or services regularly.\u00a0<\/span><\/p>\n<h3><b>Stripe Treasury API<\/b><\/h3>\n<p><a href=\"https:\/\/stripe.com\/docs\/treasury\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Stripe Treasury API<\/span><\/a><span style=\"font-weight: 400;\"> is a banking-as-a-service API that lets you embed financial services in your software. Many users use Strip issuing in conjunction with Strip Treasury API to attach cards and spend funds in the account.\u00a0<\/span><\/p>\n<h3><b>Stripe graphql API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The open-source <\/span><a href=\"https:\/\/nhost.io\/blog\/open-source-stripe-graphql-api\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Stripe Graphql API<\/span><\/a><span style=\"font-weight: 400;\"> makes it possible to query data from your database and Stripe account in a single GraphQL query.\u00a0<\/span><\/p>\n<h3><b>Stripe Invoice API<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The <\/span><a href=\"https:\/\/stripe.com\/docs\/api\/invoices\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Stripe Invoice API<\/span><\/a><span style=\"font-weight: 400;\"> allows you to generate statement of how much is owed by the customer. It is generated on one-off basis or periodically from a subscription. <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will discuss how to use Stripe API with step-by-step integration guide and full documentation list. Let&#8217;s get started! Overview of Stripe API Stripe is a payment processing platform on the internet. Million businesses from startups to large corporation use Stripe to accept and make payments and manage their online operations. Developers use Stripe [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":5228,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[76],"tags":[],"class_list":{"0":"post-5223","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-technology","8":"entry"},"_links":{"self":[{"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/posts\/5223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/comments?post=5223"}],"version-history":[{"count":4,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/posts\/5223\/revisions"}],"predecessor-version":[{"id":5227,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/posts\/5223\/revisions\/5227"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/media\/5228"}],"wp:attachment":[{"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/media?parent=5223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/categories?post=5223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unremot.com\/blog\/wp-json\/wp\/v2\/tags?post=5223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}