Learn about the payment lifecycle in digital commerce and how Checkout handles it. Checkout manages the following stages of a payment lifecycle: - Authorization - Payment capture - Authorization cancellation - Refund # Authorization It is the first stage in a payment process, during which a customer is verified for sufficient funds or credit to complete the payment transaction. If an authorization is successful, the given amount is reserved and not deducted from the customer's account. The payment is put on hold for a specific period of time (typically between a few days to a week) and the funds will not be available for other transactions during this time. If the designated timeframe elapses and the funds are not captured meanwhile, the authorization expires and the reserved funds are released. As a result, the customer regains access to these funds, making them available for other transactions. ## How Checkout manages authorizations When a customer clicks the final button in a checkout process or when you trigger a payment with the [Checkout Transactions API](https://docs.commercetools.com/checkout/transactions-api.md), the following takes place: 1. Checkout creates a [Payment](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3APayment) containing the selected payment method and a [Transaction](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3ATransaction) with `state=Initial`. 2. Checkout sends a payment request to the [payment service provider](https://docs.commercetools.com/checkout/connectors-and-applications.md#supported-psps-payment-integration-types-and-payment-methods) (PSP) or to the gift card management system to authorize the Payment. 3. Since the authorization request is asynchronous—while the PSP or the gift card management system processes the Payment—Checkout sets the `state` of the Transaction to `Pending` and creates an [Order](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3AOrder). 4. The PSP or the gift card management system notifies Checkout about the authorization outcome and, depending on the outcome, the `state` of the Transaction is set to `Success` or `Failure`. # Payment capture During this stage, an authorized Payment amount is captured—meaning the funds are deducted from a customer's account and transferred to the merchant’s account. The PSP or the gift card management system executes payment capture automatically, if an auto capture process is configured; or any merchant process can manually trigger the process during the processing of an Order. It might happen after the [Order](https://docs.commercetools.com/api/projects/orders.md) is created—when the goods are ready to be delivered, or in any other business scenario. ## How Checkout manages payment captures The process to capture funds after an Order is created is a business decision and your responsibility, as a merchant. If you trigger payment capture manually, you can [request payment capture](https://docs.commercetools.com/checkout/payment-intents-api.md#capture-payment) using the Checkout Payment Intents API. The request is sent to the PSP or gift card management system. After sending the request, Checkout adds a [Transaction](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3ATransaction) of `type=Charge` to the existing [Payment](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3APayment) inside the [Order](https://docs.commercetools.com/api/projects/orders.md). If the PSP or the gift card management system triggers the capture through an auto capture process, Checkout adds a [Transaction](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3ATransaction) of `type=Charge` after it's notified by the PSP or the gift card management system. # Authorization cancellation In this stage, an [authorization](https://docs.commercetools.com/checkout/payments-lifecycle.md#authorization) is voided before a payment is captured, allowing the customer to access the reserved funds again. This is typically done when an order must be cancelled, for example, when a customer requests to cancel the order or when the order cannot be fulfilled. ## How Checkout manages authorization cancellations Canceling an authorization is outside the scope of Checkout—similar to [payment capture](https://docs.commercetools.com/checkout/payments-lifecycle.md#payment-capture)—as it occurs after an Order is created. However, using the Checkout Payment Intents API, you can [request the Payment cancellation](https://docs.commercetools.com/checkout/payment-intents-api.md#cancel-payment) to the PSP or gift card management system. After sending the request, Checkout adds a [Transaction](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3ATransaction) of `type=CancelAuthorization` to the existing [Payment](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3APayment) inside the [Order](https://docs.commercetools.com/api/projects/orders.md). # Refund In this stage, a captured payment is returned to the customer for a given order. It occurs when the customer requests a refund, goods are returned, or you need to reimburse the customer for any reason. Depending on the scenario, a refund can be partial or full and cannot exceed the captured amount. ## How Checkout manages refunds You can [request a refund](https://docs.commercetools.com/checkout/payment-intents-api.md#refund-payment) to the PSP or gift card management system using the Checkout Payment Intents API. After sending the request, Checkout adds a [Transaction](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3ATransaction) of `type=Refund` to the existing [Payment](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3APayment) inside the [Order](https://docs.commercetools.com/api/projects/orders.md), along with the amount to be refunded. As several partial refunds can happen during the payment lifecycle, you can [refund Payment](https://docs.commercetools.com/checkout/payment-intents-api.md#refund-payment) multiple times, as long as the amount to refund does not exceed the total amount of the original Payment. # Automated reversals Checkout lets you set predicates to define conditions for automatically canceling or refunding a Payment if Order creation fails. Automated Reversal Predicates use true/false logic and can evaluate Cart fields, including Custom Fields. If the predicate evaluates as `true`, then the automated reversal is processed for the relevant Payment. Automated Reversal Predicates are configured on Payment Integrations. For more information about configuring predicates, see [Set predicates for automated reversals](https://docs.commercetools.com/checkout/payment-integration-predicates.md#set-predicates-for-automated-reversals). # Payments in the Merchant Center Payments created by Checkout can be viewed in the Merchant Center from an Order's detail page. To access the Payments related to an Order, go to Orders > Order list, select the Order, and then click the Payments tab. The following Payment information is available: - Payment method: the payment method used by the customer for the [Order](https://docs.commercetools.com/api/projects/orders.md) - Payment service provider (PSP): the [PSP](https://docs.commercetools.com/checkout/connectors-and-applications.md#supported-psps-payment-integration-types-and-payment-methods) or gift card management system associated with the payment method - Payment provider ID: the identifier assigned by the PSP or gift card management system on its system for the payment - Amount planned: the total amount of the Payment - Payment transactions: the [Transactions](https://docs.commercetools.com/api/projects/payments.md#transaction) added to the Payment during its lifecycle and the related information # FAQs ## When should I start fulfilling an Order? As PSPs and gift card management systems work asynchronously, regardless of the first response to an [authorization](https://docs.commercetools.com/checkout/payments-lifecycle.md#authorization) request that they return, you must wait for a notification that confirms the authorization of the Payment. To receive notifications about Payment updates, you can use [Subscriptions](https://docs.commercetools.com/api/projects/subscriptions.md). You should start fulfilling an Order only if the Payment contains a [Transaction](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3ATransaction) whose `type=Authorization` and `state=Success`. ## What happens if an Order was created but the Payment is not authorized? If the PSP or the gift card management system does not [authorize](https://docs.commercetools.com/checkout/payments-lifecycle.md#authorization) the Payment, Checkout updates the Payment by setting the `state` of the [Transaction](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Atype%3ATransaction) of `type=Authorization` to `Failure`. However, it's your responsibility to decide how to proceed with the created Order. ## What happens if an Order was not created but the Payment is authorized? After a Payment is authorized or captured, Checkout updates it accordingly. However, due to unpredictable errors, it can happen that a [Cart](https://docs.commercetools.com/api/projects/carts.md) might not be converted into an [Order](https://docs.commercetools.com/api/projects/orders.md). In such a case, for example, you can [cancel the Payment](https://docs.commercetools.com/checkout/payment-intents-api.md#cancel-payment) or [create the Order](https://docs.commercetools.com/urn?urn=ctp%3Aapi%3Aendpoint%3A%2F%7BprojectKey%7D%2Forders%3APOST) again. To receive notifications and react to similar scenarios, it's your responsibility to use [Subscriptions](https://docs.commercetools.com/api/projects/subscriptions.md).