Creates an OffSessionPayment object.
Learn more about calling API v2 endpoints.Parameters
- amountobjectRequired
The “presentment amount” to be collected from the customer.
- amount.
currencyenumRequired Three-letter ISO currency code, in lowercase. Must be a supported currency.
- amount.
valueintegerRequired A non-negative integer representing how much to charge in the smallest currency unit.
- cadenceenumRequired
The frequency of the underlying payment.
Possible enum valuesrecurringIndicates a transaction occurring on a regular interval.
unscheduledIndicates a transaction occurring at irregular periods.
- customerstringRequired
ID of the Customer to which this OffSessionPayment belongs.
- metadatamapRequired
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. Learn more about storing information in metadata.
- payment_
methodstringRequired ID of the payment method used in this OffSessionPayment.
- on_
behalf_ ofstring The account (if any) for which the funds of the OffSessionPayment are intended.
- payment_
method_ optionsobject Payment method options for the off-session payment.
- payment_method_options.
cardobject Payment method options for the card payment type.
- retry_
detailsobject Details about the OffSessionPayment retries.
- retry_details.
retry_ policystring The pre-configured retry policy to use for the payment.
- retry_details.
retry_ strategyenum Indicates the strategy for how you want Stripe to retry the payment.
Possible enum valuesbest_available Indicates that you want Stripe to retry the payment automatically via the best available strategy.
noneIndicates that you don’t want Stripe to retry the payment.
- statement_
descriptorstring Text that appears on the customer’s statement as the statement descriptor for a non-card charge. This value overrides the account’s default statement descriptor. For information about requirements, including the 22-character limit, see the Statement Descriptor docs.
- statement_
descriptor_ suffixstring Provides information about a card charge. Concatenated to the account’s statement descriptor prefix to form the complete statement descriptor that appears on the customer’s statement.
- test_
clockstring Test clock that can be used to advance the retry attempts in a sandbox.
- transfer_
dataobject The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for connected accounts.
- transfer_data.
destinationstringRequired The account (if any) that the payment is attributed to for tax reporting, and where funds from the payment are transferred to after payment success.
- transfer_data.
amountinteger The amount transferred to the destination account. This transfer will occur automatically after the payment succeeds. If no amount is specified, by default the entire payment amount is transferred to the destination account. The amount must be less than or equal to the amount_requested, and must be a positive integer representing how much to transfer in the smallest currency unit (e.g., 100 cents to charge $1.00).
Returns
Response attributes
- idstring
Unique identifier for the object.
- objectstring, value is "v2.payments.off_session_payment"
String representing the object’s type. Objects of the same type share the same value of the object field.
- amount_
requestedobject The “presentment amount” to be collected from the customer.
- amount_requested.
currencyenum Three-letter ISO currency code, in lowercase. Must be a supported currency.
- amount_requested.
valueinteger A non-negative integer representing how much to charge in the smallest currency unit.
- cadenceenum
The frequency of the underlying payment.
Possible enum valuesrecurringIndicates a transaction occurring on a regular interval.
unscheduledIndicates a transaction occurring at irregular periods.
- compartment_
idstring ID of the owning compartment.
- createdtimestamp
Creation time of the OffSessionPayment. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z.
- customerstring
ID of the Customer to which this OffSessionPayment belongs.
- failure_
reasonnullable enum The reason why the OffSessionPayment failed.
Possible enum valuesauthorization_expired The payment failed because the authorization expired.
rejected_by_ partner The payment failed because the payment partner returned a terminal failure.
retries_exhausted The payment failed because we ran out of retry attempts.
- nullable string
The payment error encountered in the previous attempt to authorize the payment.
- latest_
payment_ attempt_ recordnullable string Payment attempt record for the latest attempt, if one exists.
- livemodeboolean
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
- 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. Learn more about storing information in metadata.
- on_
behalf_ ofnullable string The account (if any) for which the funds of the OffSessionPayment are intended.
- payment_
methodstring ID of the payment method used in this OffSessionPayment.
- payment_
recordnullable string Payment record associated with the OffSessionPayment.
- payments_
orchestrationobject Details about the payments orchestration configuration.
- payments_orchestration.
enabledboolean True when you want to enable payments orchestration for this off-session payment. False otherwise.
- retry_
detailsobject Details about the OffSessionPayment retries.
- retry_details.
attemptsinteger Number of authorization attempts so far.
- retry_details.
retry_ policynullable string The pre-configured retry policy to use for the payment.
- retry_details.
retry_ strategyenum Indicates the strategy for how you want Stripe to retry the payment.
Possible enum valuesheuristicIndicates that you want Stripe to retry the payment automatically via pre-determined heuristics.
noneIndicates that you don’t want Stripe to retry the payment.
scheduledIndicates that you want Stripe to retry the payment automatically on a fixed schedule.
smartIndicates that you want Stripe to retry the payment automatically via ML predictions.
- statement_
descriptornullable string Text that appears on the customer’s statement as the statement descriptor for a non-card charge. This value overrides the account’s default statement descriptor. For information about requirements, including the 22-character limit, see the Statement Descriptor docs.
- statement_
descriptor_ suffixnullable string Provides information about a card charge. Concatenated to the account’s statement descriptor prefix to form the complete statement descriptor that appears on the customer’s statement.
- statusenum
Status of this OffSessionPayment, one of
pending,pending_,retry processing,failed,canceled,requires_, orcapture succeeded.Possible enum valuescanceledThe payment was manually canceled.
failedThe payment is terminally failed.
pendingPayment has not yet been attempted.
pending_retry The payment failed a previous attempt and will be retried automatically.
processingThe payment is currently processing an authorization attempt. Any manual operations on it will be blocked.
requires_capture The payment is awaiting capture.
succeededThe payment has successfully moved money.
- test_
clocknullable string Test clock that can be used to advance the retry attempts in a sandbox.
- transfer_
datanullable object The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for connected accounts.
- transfer_data.
amountnullable integer The amount transferred to the destination account. This transfer will occur automatically after the payment succeeds. If no amount is specified, by default the entire payment amount is transferred to the destination account. The amount must be less than or equal to the amount_requested, and must be a positive integer representing how much to transfer in the smallest currency unit (e.g., 100 cents to charge $1.00).
- transfer_data.
destinationstring The account (if any) that the payment is attributed to for tax reporting, and where funds from the payment are transferred to after payment success.
Card payment methods do not support heuristic retries.
You may not provide payment method options that do not match the payment method type.
Debit payment methods do not support custom retry policies.
You may not specify both a retry_policy and retry_strategy. These parameters are mutually exclusive.
Debit payment methods do not support smart retries.
Test clocks may not be used with the Off-Session Payments API in livemode. Please use your sandbox keys to test with test clocks.
To schedule ACH payment retries with the Off-Session Payments API, you must first enable ACH retries on the Stripe dashboard.
The Off-Session Payments API has limits on the maximum amount you may charge in each currency.
The Off-Session Payments API has limits on the minimum amount you may charge in each currency.
A generic error occurred during payment. See error message for more details.
Indicates that the payment method you provided is not compatible with the Off-Session Payments API. The Off-Session Payments API currently only supports card payment methods, including ones generated from wallets.
To use the Off-Session Payments API, you must first attach the PaymentMethod to the Customer via the Setup Intents API.
Payments orchestration is not supported with connect integrations.
Smart retries are not supported for orchestrated OSPS at this time.
Payments orchestration is currently only supported for card payment method types.
To use the Off-Session Payments API, you must first set up the PaymentMethod for off-session usage via the Setup Intents API.
To use the Off-Session Payments API, you must first set up the PaymentMethod for off-session usage via the Setup Intents API. You must use the same value for on_ when calling into the SetupIntent API as what you use in the Off-Session Payments API.
To use the Off-Session Payments API, you must first set up the PaymentMethod for off-session usage via the Setup Intents API. You must use the same value for on_ when calling into the SetupIntent API as what you use in the Off-Session Payments API.
To schedule SEPA Debit payment retries with the Off-Session Payments API, you must first enable SEPA Debit retries on the Stripe dashboard.
{ "amount_requested": { "value": 2000, "currency": "usd" }, "cadence": "recurring", "compartment_id": "wksp_test_6OdsB30MSQB61rhH1uYqVKa", "created": "2025-01-01T00:00:00.000Z", "customer": "cus_SJjFsJvGPQKfH1", "failure_reason": null, "id": "osp_test_6pO5OrRN03IzV8rd3BaY", "last_authorization_attempt_error": null, "latest_payment_attempt_record": null, "livemode": false, "metadata": {}, "object": "v2.payments.off_session_payment", "on_behalf_of": null, "payment_method": "pm_1RP6TAG7mvlzf7RNfspLoGQ9", "payment_record": null, "payments_orchestration": null, "retry_details": { "attempts": 0, "retry_strategy": "smart" }, "statement_descriptor": null, "statement_descriptor_suffix": null, "status": "pending", "test_clock": null, "transfer_data": null}