Creating a Payment in Stripe

Last updated on August 01, 2024.

This document guides you in creating a object in Stripe. This object is used to charge payments from credit and debit cards, among other payment sources.

Creating a Charge

To charge a credit card or other payment source, you need to create a object. If your API key is in test mode, the supplied payment source (e.g., credit card) is not charged, although everything else occurs as if your transaction is in live mode.

  • URL:
  • Method: POST
  • Headers: { Content-Type: "application/json", Authorization: "Bearer ",
    "Idempotency-Key": "" }
  • Purpose / Description: Creates a Stripe charge object. If is passed, it will charge the amount to the credit card.

The table below displays and describes the fields available for the request:

FieldRequired Type Options Details
amountYes Int - Amount to be charged in centavos.
currencyYes String - Charge amount currency in ISO currency code.
idempotency_keyNo String - UUID to avoid double charges.
customerNo String - Customer's Stripe ID to be charged.
sourceNo String - Credit Card's Stripe ID to be charged.
descriptionNo String - Descriptive text with other charge information will be displayed in the Stripe dashboard.
statement_descriptorNo String - For card charges, use instead. Otherwise, you can use this value as the complete charge description on your customers' statements. It must contain at least one letter, a maximum of 22 characters.
statement_descriptor_suffixNo String - Provides information about the charges customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.

Sample Request

Displayed below is a sample request body along with their parameters:

Note

Please visit the Stripe Documentation for more information on Stripe Charges: Stripe Charges

Have a suggestion for this page?

Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.