> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Mark the payment intent as confirmed, and move the order to the complete state

> This endpoint is used to complete the order with succeeded payment intent. First it will check if the payment intent has `status` `succeeded`, if yes, then it will move the order to the complete state.



## OpenAPI

````yaml /api-reference/storefront.yaml patch /api/v2/storefront/stripe/payment_intents/{id}/confirm
openapi: 3.0.3
info:
  version: 2.0.0
  title: Storefront API
  description: >-
    Storefront API is a modern REST API based on the [JSON API
    spec](https://jsonapi.org/) which provides you with all the necessary
    endpoints to build amazing user interfaces either in JavaScript frameworks
    or native mobile libraries.


    Import to
    [Postman](https://raw.githubusercontent.com/spree/spree/main/docs/api-reference/storefront.yaml)
  contact:
    name: Vendo Connect Inc.
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  license:
    name: BSD-3-Clause
    url: https://github.com/spree/spree/blob/main/LICENSE.md
servers:
  - url: https://demo.spreecommerce.org
    description: demo
  - url: http://localhost:3000
    description: localhost
security: []
tags:
  - name: Account
  - name: Account / Address
  - name: Account / Credit Cards
  - name: Account / Orders
  - name: Cart
  - name: Cart / Line Items
  - name: Cart / Coupons
  - name: Cart / Other
  - name: Checkout
  - name: Checkout / State
  - name: Checkout / Shipments
  - name: Checkout / Payments
  - name: Checkout / Store Credit
  - name: Stripe
  - name: Adyen
  - name: Countries
  - name: Digital Downloads
  - name: Order Status
  - name: Products
  - name: Variants
  - name: Stores
  - name: Policies
  - name: Taxons
  - name: Vendors
  - name: Wishlists
  - name: Wishlists / Wished Items
paths:
  /api/v2/storefront/stripe/payment_intents/{id}/confirm:
    patch:
      tags:
        - Stripe
      summary: >-
        Mark the payment intent as confirmed, and move the order to the complete
        state
      description: >-
        This endpoint is used to complete the order with succeeded payment
        intent. First it will check if the payment intent has `status`
        `succeeded`, if yes, then it will move the order to the complete state.
      operationId: confirm-stripe-payment-intent
      responses:
        '200':
          $ref: '#/components/responses/StripePaymentIntent'
        '403':
          $ref: '#/components/responses/403Forbidden'
        '404':
          $ref: '#/components/responses/404NotFound'
        '422':
          $ref: '#/components/responses/422UnprocessableEntity'
      security:
        - orderToken: []
components:
  responses:
    StripePaymentIntent:
      description: >-
        200 Success - Returns the Stripe Payment Intent with the Stripe ID,
        client key, ephemeral_key, customer_id, amount and Stripe Payment Method
        ID.
      content:
        application/vnd.api+json:
          schema:
            type: object
            properties:
              data:
                type: object
                properties:
                  id:
                    type: string
                    example: 980a80d5-f51b-4065-b3a0-622fc5cb6bf6
                  type:
                    type: string
                    default: payment_intent
                  attributes:
                    type: object
                    properties:
                      stripe_id:
                        type: string
                        description: The Stripe internal ID of the Payment Intent
                      client_secret:
                        type: string
                        description: >
                          The client secret can be used to complete a payment
                          from your frontend. It should not be stored, logged,
                          or exposed to anyone other than the customer. Make
                          sure that you have TLS enabled on any page that
                          includes the client secret.
                      ephemeral_key_secret:
                        type: string
                        description: |
                          Secret of the created ephemeral key.
                      customer_id:
                        type: string
                        description: >
                          Stripe's customer ID of the authenticated user (or new
                          one if unauthenticated).
                      amount:
                        type: number
                        description: The payment amount
                      stripe_payment_method_id:
                        type: string
                        description: >
                          This is the same stripe_payment_method_id that was
                          sent in the parameters. It can be used to confirm
                          Stripe intent that was not confirmed before
          examples:
            Stripe Payment Intent:
              value:
                data:
                  id: 980a80d5-f51b-4065-b3a0-622fc5cb6bf6
                  type: payment_intent
                  attributes:
                    stripe_id: pi_3QhUuj2ESifGlJez0ADSS4tu
                    client_secret: >-
                      pi_3KQRG2DcAgmy0ota09WCW6nf_secret_8XTxRbOyg7oEkvvIOvnP75dRw
                    ephemeral_key_secret: >-
                      ek_test_YWNjdF8xTGtSb1lJaFIwZ0llZ0llyG1LbFhsVU9XWHY1SlNyMXRKVzNJb0hyQ2JZam1HY28_007lGgvGaA
                    customer_id: cus_Q9uqUz6gVQFku2
                    amount: '44.0'
                    stripe_payment_method_id: pm_1Qedd42ESifGlJez0IOx5AZ3
    403Forbidden:
      description: 403 Forbidden - You are not authorized to access this page.
      content:
        application/vnd.api+json:
          schema:
            properties:
              error:
                type: string
                example: You are not authorized to access this page.
                default: You are not authorized to access this page.
          examples:
            403 Example:
              value:
                error: You are not authorized to access this page.
    404NotFound:
      description: 404 Not Found - Resource not found.
      content:
        application/vnd.api+json:
          schema:
            properties:
              error:
                type: string
                example: The resource you were looking for could not be found.
                default: The resource you were looking for could not be found.
          examples:
            404 Example:
              value:
                error: The resource you were looking for could not be found.
    422UnprocessableEntity:
      description: 422 Unprocessable Entity
      content:
        application/vnd.api+json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            422 Example:
              value:
                error: Example is invalid
                errors:
                  example:
                    - Example is invalid
  schemas:
    Error:
      x-internal: false
      title: Error
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    orderToken:
      type: apiKey
      in: header
      description: |-
        Order token to authorize Cart and Checkout requests.

        [How to obtain X-Spree-Order-Token](../authentication#for-guest-users)
      name: X-Spree-Order-Token

````