The Charge object

Attributes

  • idstring

    Unique identifier for the object.

  • amountinteger

    Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).

  • balance_transactionnullable stringExpandable

    ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes).

  • billing_detailsMap

    Billing information associated with the payment method at the time of the transaction.

  • currencyenum

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

  • customernullable stringExpandable

    ID of the customer this charge is for if one exists.

  • descriptionnullable string

    An arbitrary string attached to the object. Often useful for displaying to users.

  • disputedboolean

    Whether the charge has been disputed.

  • invoicenullable stringExpandable

    ID of the invoice this charge is for if one exists.

  • metadataMap

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

  • payment_intentnullable stringExpandable

    ID of the PaymentIntent associated with this charge, if one exists.

  • payment_method_detailsnullable Map

    Details about the payment method at the time of the transaction.

  • receipt_emailnullable string

    This is the email address that the receipt for this charge was sent to.

  • refundedboolean

    Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.

  • shippingnullable Map

    Shipping information for the charge.

  • statement_descriptornullable string

    For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.

  • statement_descriptor_suffixnullable string

    Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.

  • statusenum

    The status of the payment is either succeeded, pending, or failed.

More attributes

  • objectstring

  • amount_capturedinteger

  • amount_refundedinteger

  • applicationnullable stringExpandableConnect only

  • application_feenullable stringExpandableConnect only

  • application_fee_amountnullable integerConnect only

  • calculated_statement_descriptornullable string

  • capturedboolean

  • createdtimestamp

  • failure_balance_transactionnullable stringExpandable

  • failure_codenullable string

  • failure_messagenullable string

  • fraud_detailsnullable Map

  • livemodeboolean

  • on_behalf_ofnullable stringExpandableConnect only

  • outcomenullable Map

  • paidboolean

  • payment_methodnullable string

  • radar_optionsnullable Map

  • receipt_numbernullable string

  • receipt_urlnullable string

  • refundsnullable MapExpandable

  • reviewnullable stringExpandable

  • source_transfernullable stringExpandableConnect only

  • transfernullable stringExpandableConnect only

  • transfer_datanullable MapConnect only

  • transfer_groupnullable stringConnect only

The Charge object
{
"id": "ch_3MmlLrLkdIwHu7ix0snN0B15",
"object": "charge",
"amount": 1099,
"amount_captured": 1099,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_3MmlLrLkdIwHu7ix0uke3Ezy",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"calculated_statement_descriptor": "Stripe",
"captured": true,
"created": 1679090539,
"currency": "usd",
"customer": null,
"description": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {},
"invoice": null,
"livemode": false,
"metadata": {},
"on_behalf_of": null,
"outcome": {
"network_status": "approved_by_network",
"reason": null,
"risk_level": "normal",
"risk_score": 32,
"seller_message": "Payment complete.",
"type": "authorized"
},
"paid": true,
"payment_intent": null,
"payment_method": "card_1MmlLrLkdIwHu7ixIJwEWSNR",
"payment_method_details": {
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": null
},
"country": "US",
"exp_month": 3,
"exp_year": 2024,
"fingerprint": "mToisGZ01V71BCos",
"funding": "credit",
"installments": null,
"last4": "4242",
"mandate": null,
"network": "visa",
"three_d_secure": null,
"wallet": null
},
"type": "card"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTTJKVGtMa2RJd0h1N2l4KOvG06AGMgZfBXyr1aw6LBa9vaaSRWU96d8qBwz9z2J_CObiV_H2-e8RezSK_sw0KISesp4czsOUlVKY",
"refunded": false,
"review": null,
"shipping": null,
"source_transfer": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}

Create a chargeDeprecated

This method is no longer recommended—use the Payment Intents API to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge object used to request payment.

Parameters

  • amountintegerRequired

    Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).

  • currencyenumRequired

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

  • customerstring

    The ID of an existing customer that will be charged in this request.

  • descriptionstring

    An arbitrary string which you can attach to a Charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the description of the charge(s) that they are describing.

  • metadataMap

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

  • receipt_emailstring

    The email address to which this charge’s receipt will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a Customer, the email address specified here will override the customer’s email address. If receipt_email is specified for a charge in live mode, a receipt will be sent regardless of your email settings.

  • shippingMap

    Shipping information for the charge. Helps prevent fraud on charges for physical goods.

  • sourcestring

    A payment source to be charged. This can be the ID of a card (i.e., credit or debit card), a bank account, a source, a token, or a connected account. For certain sources—namely, cards, bank accounts, and attached sources—you must also pass the ID of the associated customer.

  • statement_descriptorstring

    For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.

  • statement_descriptor_suffixstring

    Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.

More parameters

  • application_fee_amountintegerConnect only

  • captureboolean

  • on_behalf_ofstringConnect only

  • radar_optionsMap

  • transfer_dataMapConnect only

  • transfer_groupstringConnect only

Returns

Returns the charge object if the charge succeeded. This call throws an error if something goes wrong. A common source of error is an invalid or expired card, or a valid card with insufficient available balance.

POST /v1/charges
Stripe.apiKey = "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc";
ChargeCreateParams params =
ChargeCreateParams.builder()
.setAmount(1099L)
.setCurrency("usd")
.setSource("tok_visa")
.build();
Charge charge = Charge.create(params);
Response
{
"id": "ch_3MmlLrLkdIwHu7ix0snN0B15",
"object": "charge",
"amount": 1099,
"amount_captured": 1099,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_3MmlLrLkdIwHu7ix0uke3Ezy",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"calculated_statement_descriptor": "Stripe",
"captured": true,
"created": 1679090539,
"currency": "usd",
"customer": null,
"description": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {},
"invoice": null,
"livemode": false,
"metadata": {},
"on_behalf_of": null,
"outcome": {
"network_status": "approved_by_network",
"reason": null,
"risk_level": "normal",
"risk_score": 32,
"seller_message": "Payment complete.",
"type": "authorized"
},
"paid": true,
"payment_intent": null,
"payment_method": "card_1MmlLrLkdIwHu7ixIJwEWSNR",
"payment_method_details": {
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": null
},
"country": "US",
"exp_month": 3,
"exp_year": 2024,
"fingerprint": "mToisGZ01V71BCos",
"funding": "credit",
"installments": null,
"last4": "4242",
"mandate": null,
"network": "visa",
"three_d_secure": null,
"wallet": null
},
"type": "card"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTTJKVGtMa2RJd0h1N2l4KOvG06AGMgZfBXyr1aw6LBa9vaaSRWU96d8qBwz9z2J_CObiV_H2-e8RezSK_sw0KISesp4czsOUlVKY",
"refunded": false,
"review": null,
"shipping": null,
"source_transfer": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}

Update a charge

Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Parameters

  • customerstring

    The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge.

  • descriptionstring

    An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the description of the charge(s) that they are describing.

  • metadataMap

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

  • receipt_emailstring

    This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address.

  • shippingMap

    Shipping information for the charge. Helps prevent fraud on charges for physical goods.

More parameters

  • fraud_detailsMap

  • transfer_groupstringConnect only

Returns

Returns the charge object if the update succeeded. This call will throw an error if update parameters are invalid.

POST /v1/charges/:id
Stripe.apiKey = "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc";
Charge resource = Charge.retrieve("ch_3MmlLrLkdIwHu7ix0snN0B15");
ChargeUpdateParams params =
ChargeUpdateParams.builder().putMetadata("shipping", "express").build();
Charge charge = resource.update(params);
Response
{
"id": "ch_3MmlLrLkdIwHu7ix0snN0B15",
"object": "charge",
"amount": 1099,
"amount_captured": 1099,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_3MmlLrLkdIwHu7ix0uke3Ezy",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"calculated_statement_descriptor": "Stripe",
"captured": true,
"created": 1679090539,
"currency": "usd",
"customer": null,
"description": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {},
"invoice": null,
"livemode": false,
"metadata": {
"shipping": "express"
},
"on_behalf_of": null,
"outcome": {
"network_status": "approved_by_network",
"reason": null,
"risk_level": "normal",
"risk_score": 32,
"seller_message": "Payment complete.",
"type": "authorized"
},
"paid": true,
"payment_intent": null,
"payment_method": "card_1MmlLrLkdIwHu7ixIJwEWSNR",
"payment_method_details": {
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": null
},
"country": "US",
"exp_month": 3,
"exp_year": 2024,
"fingerprint": "mToisGZ01V71BCos",
"funding": "credit",
"installments": null,
"last4": "4242",
"mandate": null,
"network": "visa",
"network_token": {
"used": false
},
"three_d_secure": null,
"wallet": null
},
"type": "card"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTTJKVGtMa2RJd0h1N2l4KPDLl6UGMgawkab5iK86LBYtkq0XrhiQf1RsA2ubesH4GHiixEU8_1-Wp7h4oQEdfSUGiZpJwtQHBErT",
"refunded": false,
"refunds": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/charges/ch_3MmlLrLkdIwHu7ix0snN0B15/refunds"
},
"review": null,
"shipping": null,
"source_transfer": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}

Retrieve a charge

Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.

Parameters

No parameters.

Returns

Returns a charge if a valid identifier was provided, and throws an error otherwise.

GET /v1/charges/:id
Stripe.apiKey = "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc";
Charge charge = Charge.retrieve("ch_3MmlLrLkdIwHu7ix0snN0B15");
Response
{
"id": "ch_3MmlLrLkdIwHu7ix0snN0B15",
"object": "charge",
"amount": 1099,
"amount_captured": 1099,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_3MmlLrLkdIwHu7ix0uke3Ezy",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"calculated_statement_descriptor": "Stripe",
"captured": true,
"created": 1679090539,
"currency": "usd",
"customer": null,
"description": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {},
"invoice": null,
"livemode": false,
"metadata": {},
"on_behalf_of": null,
"outcome": {
"network_status": "approved_by_network",
"reason": null,
"risk_level": "normal",
"risk_score": 32,
"seller_message": "Payment complete.",
"type": "authorized"
},
"paid": true,
"payment_intent": null,
"payment_method": "card_1MmlLrLkdIwHu7ixIJwEWSNR",
"payment_method_details": {
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": null
},
"country": "US",
"exp_month": 3,
"exp_year": 2024,
"fingerprint": "mToisGZ01V71BCos",
"funding": "credit",
"installments": null,
"last4": "4242",
"mandate": null,
"network": "visa",
"three_d_secure": null,
"wallet": null
},
"type": "card"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTTJKVGtMa2RJd0h1N2l4KOvG06AGMgZfBXyr1aw6LBa9vaaSRWU96d8qBwz9z2J_CObiV_H2-e8RezSK_sw0KISesp4czsOUlVKY",
"refunded": false,
"review": null,
"shipping": null,
"source_transfer": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}

List all charges

Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.

Parameters

  • customerstring

    Only return charges for the customer specified by this customer ID.

More parameters

  • createdMap

  • ending_beforestring

  • limitinteger

  • payment_intentstring

  • starting_afterstring

  • transfer_groupstringConnect only

Returns

A Map with a data property that contains an array of up to limit charges, starting after charge starting_after. Each entry in the array is a separate charge object. If no more charges are available, the resulting array will be empty. If you provide a non-existent customer ID, this call throws an error.

GET /v1/charges
Stripe.apiKey = "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc";
ChargeListParams params = ChargeListParams.builder().setLimit(3L).build();
ChargeCollection charges = Charge.list(params);
Response
{
"object": "list",
"url": "/v1/charges",
"has_more": false,
"data": [
{
"id": "ch_3MmlLrLkdIwHu7ix0snN0B15",
"object": "charge",
"amount": 1099,
"amount_captured": 1099,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_3MmlLrLkdIwHu7ix0uke3Ezy",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"calculated_statement_descriptor": "Stripe",
"captured": true,
"created": 1679090539,
"currency": "usd",
"customer": null,
"description": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {},
"invoice": null,
"livemode": false,
"metadata": {},
"on_behalf_of": null,
"outcome": {
"network_status": "approved_by_network",
"reason": null,
"risk_level": "normal",
"risk_score": 32,
"seller_message": "Payment complete.",
"type": "authorized"
},
"paid": true,
"payment_intent": null,
"payment_method": "card_1MmlLrLkdIwHu7ixIJwEWSNR",
"payment_method_details": {
"card": {
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": null
},
"country": "US",
"exp_month": 3,
"exp_year": 2024,
"fingerprint": "mToisGZ01V71BCos",
"funding": "credit",
"installments": null,
"last4": "4242",
"mandate": null,
"network": "visa",
"three_d_secure": null,
"wallet": null
},
"type": "card"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTTJKVGtMa2RJd0h1N2l4KOvG06AGMgZfBXyr1aw6LBa9vaaSRWU96d8qBwz9z2J_CObiV_H2-e8RezSK_sw0KISesp4czsOUlVKY",
"refunded": false,
"review": null,
"shipping": null,
"source_transfer": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
{...}
{...}
],
}