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

# Confirms a cart.

> Confirms a cart.



## OpenAPI

````yaml put /public/checkout/cart/{id}/confirm
openapi: 3.1.0
info:
  title: Fynn API
  description: ''
  termsOfService: https://www.fynn.eu/tos
  contact:
    name: Fynn UG (haftungsbeschränkt)
    url: https://www.fynn.eu
    email: hi@fynn.eu
  license:
    name: Proprietary
    url: https://www.fynn.eu/license
  version: 0.0.0
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - JWT: []
tags: []
paths:
  /public/checkout/cart/{id}/confirm:
    parameters: []
    put:
      tags:
        - Cart
      summary: Confirms a cart.
      description: Confirms a cart.
      operationId: confirmCart
      parameters:
        - name: id
          in: path
          description: Cart identifier
          required: true
          deprecated: false
          schema:
            type: string
          style: simple
          explode: false
      requestBody:
        description: The updated Cart resource
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Cart.ConfirmCartRequest'
          text/html:
            schema:
              $ref: '#/components/schemas/Cart.ConfirmCartRequest'
        required: true
      responses:
        '200':
          description: Cart resource updated
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Cart.CartConfirmationResult-CartConfirmationResult
            text/html:
              schema:
                $ref: >-
                  #/components/schemas/Cart.CartConfirmationResult-CartConfirmationResult
          links: {}
        '400':
          description: Invalid input
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity
      deprecated: false
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X PUT \
             /public/checkout/cart/{id}/confirm \
             --header "Content-Type: application/json" \
             --header "Authorization: Bearer <token>" \
             --data '{
                "email": "",
                "phone": "",
                "invoiceAddressId": "https:\/\/example.com\/",
                "paymentMethodId": "https:\/\/example.com\/"
            }'
components:
  schemas:
    Cart.ConfirmCartRequest:
      type: object
      description: ''
      deprecated: false
      properties:
        email:
          format: email
          description: >-
            The customer email to be used for the cart. This is required when
            the cart is not attached to a customer.
          externalDocs:
            url: https://schema.org/email
          type:
            - string
            - 'null'
        phone:
          description: >-
            The customer phone to be used for the cart. This is required when
            the cart is not attached to a customer.
          type:
            - string
            - 'null'
        newInvoiceAddress:
          description: The new customer address to be used for the cart.
          anyOf:
            - $ref: '#/components/schemas/CreateCustomerAddressRequest'
            - type: 'null'
        invoiceAddressId:
          description: The customer address to be used for the cart.
          type:
            - string
            - 'null'
          format: uuid
          example: https://example.com/
        newPaymentMethod:
          description: The new payment method to be used for the cart.
          anyOf:
            - $ref: '#/components/schemas/SetupPaymentMethod'
            - type: 'null'
        paymentMethodId:
          description: The payment method to be used for the cart.
          type:
            - string
            - 'null'
          format: uuid
          example: https://example.com/
    Cart.CartConfirmationResult-CartConfirmationResult:
      type: object
      description: ''
      deprecated: false
      properties:
        action:
          description: The action to perform after the cart confirmation.
          type: string
          enum:
            - redirect
            - none
            - confirmation_message
        redirectUrl:
          description: The URL to redirect to after the cart confirmation.
          type:
            - string
            - 'null'
        status:
          description: The status of the cart after the cart confirmation.
          type: string
          enum:
            - open
            - confirming
            - redirect_to_payment
            - expired
            - completed
            - paid
        confirmationMessage:
          description: The message to show to the user after the cart confirmation.
          type:
            - string
            - 'null'
    CreateCustomerAddressRequest:
      type: object
      description: ''
      deprecated: false
      properties:
        countryCode:
          description: If not provided, we will use the customer country code.
          example: DE
          type:
            - string
            - 'null'
        firstName:
          maxLength: 255
          description: Can be empty if the customer is a company.
          example: John
          nullable: true
        lastName:
          maxLength: 255
          description: Can be empty if the customer is a company.
          example: Doe
          nullable: true
        vatId:
          minLength: 2
          maxLength: 255
          description: If not provided, we will use the customer vat id.
          example: DE123456789
          type:
            - string
            - 'null'
        companyName:
          maxLength: 255
          example: Acme Inc.
          type:
            - string
            - 'null'
        street:
          minLength: 2
          maxLength: 255
          description: >-
            The street of the customer. If not provided, we will use empty
            string.
          example: Musterstraße 1
          type:
            - string
            - 'null'
        houseNumber:
          minLength: 0
          maxLength: 255
          description: >-
            The house number of the customer. If not provided, we will use empty
            string.
          example: 1a
          type:
            - string
            - 'null'
        zip:
          description: >-
            The zip code of the customer. If not provided, we will use empty
            string.
          example: '12345'
          type:
            - string
            - 'null'
        city:
          minLength: 2
          maxLength: 255
          description: The city of the customer. If not provided, we will use empty string.
          example: Berlin
          type:
            - string
            - 'null'
        addition:
          maxLength: 255
          description: >-
            Additional address line of the customer. If not provided, we will
            use empty string.
          example: c/o John Doe
          type:
            - string
            - 'null'
        salutation:
          example: Herr
          enum:
            - Firma
            - Herr
            - Frau
        costCentre:
          minLength: 2
          maxLength: 255
          description: >-
            The cost centre of the customer. If not provided, we will use empty
            string.
          example: '12345'
          type:
            - string
            - 'null'
        type:
          minLength: 2
          maxLength: 255
          enum:
            - TYPE_DEFAULT
            - TYPE_INVOICE
          example: TYPE_DEFAULT
    SetupPaymentMethod:
      type: object
      description: ''
      deprecated: false
      properties:
        isMigration:
          readOnly: true
          type: boolean
        gateway:
          enum:
            - wallet
            - sepa_debit
            - stripe
            - fake_provider
            - paypal
            - bank_transfer
            - go_cardless
            - testing
          description: |-
            The payment gateway to use to process the given payment method type

            Possible values:
             * `paypal`: PayPal (supports "paypal")
             * `stripe`: Stripe (supports "card")
             * `testing`: Testing (supports all)
             * `go_cardless`: GoCardless (supports "sepa_debit")
             * `bank_transfer`: Bank Transfer (supports "bank_transfer")
             * `sepa_debit`: SEPA Credit and Debit with xml file (supports "sepa_debit")
             * `wallet`: Credit Balance from Wallet (supports "wallet")
          example: stripe
        type:
          enum:
            - sepa_debit
            - card
            - paypal
            - bank_transfer
            - wallet
            - fake_provider
          description: |-
            The payment method type to use for this payment method

            Possible values:
             * `sepa_debit`: SEPA Debit
             * `card`: Credit Card
             * `paypal`: PayPal
             * `bank_transfer`: Bank Transfer
             * `wallet`: Wallet
          example: card
        customerId:
          description: >-
            The customer that owns this payment method. If not provided, the
            customer will be determined by the authenticated user.
          example: ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a
          type:
            - string
            - 'null'
        isDefault:
          description: >-
            Determines if this payment method should be used as default payment
            method for the customer
          default: true
          example: true
          type: boolean
        futureUsageAllowed:
          description: >-
            Determines if this payment method is allowed to be used for future
            payments. Otherwise the payment method is only available for this
            payment.
          default: true
          example: true
          type: boolean
        stripe:
          description: >-
            Required when gateway is "stripe". Holds all necessary data for the
            payment gateway to create the payment method.
          anyOf:
            - $ref: '#/components/schemas/CreateStripeResource'
            - type: 'null'
        sepaMandate:
          description: >-
            Required when gateway is "sepa_debit". Holds all necessary data for
            the payment gateway to create the payment method.
          anyOf:
            - $ref: '#/components/schemas/CreateSepaMandateResource'
            - type: 'null'
        goCardless:
          description: >-
            Optional for gateway "go_cardless". It is only required when you
            want to migrate, or assign an existing GoCardless customer or
            mandate to fynn.
          anyOf:
            - $ref: '#/components/schemas/CreateGoCardlessResource'
            - type: 'null'
        redirectUrl:
          description: >-
            The redirect url to redirect the customer to after the payment
            method was created. This is only required, when you create a payment
            method with your own flow, independent from provided
            Hosted-Checkout, Hosted-Customerfront or Fynn.JS. Otherwise this has
            no effect.
          example: https://example.com/checkout/confirm
          type:
            - string
            - 'null'
        migration:
          readOnly: true
          type: boolean
      required:
        - gateway
        - type
    CreateStripeResource:
      type: object
      description: >-
        Stripe-specific data required when creating a payment method via the
        Stripe gateway.
      deprecated: false
      properties:
        paymentMethodId:
          pattern: ^(.*(^(card|pm)_.*$).*)$
          description: >-
            The Stripe payment method id, which was collected by Fynn.JS or
            Stripe.JS

            If `null` is provided, you get a `action_required` response, with
            the `{SETUP_INTENT_CLIENT_SECRET}` to perform the authorization in
            stripe.js, see <a
            href="https://stripe.com/docs/js/setup_intents/confirm_card_setup">Confirm
            card setup</a>.
          example: pm_1J5J2n2eZvKYlo2CJY2n2eZvKYlo2C
          type:
            - string
            - 'null'
        customerId:
          pattern: ^(cus_.*)$
          description: >-
            The Stripe customer id, which references the Stripe customer.

            If none is provided, the stripe customer id will be used, which was
            created automatically by Fynn, during fetching the stripe setup
            intent secret.
          example: cus_J5J2n2eZvKYlo2CJY2n2eZvKYlo2C
          type:
            - string
            - 'null'
    CreateSepaMandateResource:
      type: object
      description: >-
        SEPA mandate data required when creating a payment method via the SEPA
        direct debit gateway.
      deprecated: false
      properties:
        mandateReference:
          maxLength: 35
          description: >-
            The mandate reference will be generated automatically, if none is
            provided. You can set it when migrating from another payment
            provider.
          example: MNDT-123456789
          type:
            - string
            - 'null'
        iban:
          description: The customer's IBAN
          externalDocs:
            url: https://schema.org/identifier
          example: DE89370400440532013000
          type:
            - string
            - 'null'
        bic:
          description: The customer's BIC
          externalDocs:
            url: https://schema.org/identifier
          example: COBADEFFXXX
          type:
            - string
            - 'null'
        accountHolder:
          description: The bank account holder's name
          example: Max Mustermann
          type:
            - string
            - 'null'
        signingDate:
          description: >-
            The SEPA mandate signing date. If none is provided, the current date
            will be used.
          externalDocs:
            url: https://schema.org/Date
          default: today
          example: '2021-01-01'
          type:
            - string
            - 'null'
        type:
          enum:
            - CORE
            - B2B
            - COR1
          description: >-
            The SEPA mandate type. If none is provided, the default type "CORE"
            will be used.


            Possible values:
             * `CORE`: The core scheme is used for payments between consumers and companies
             * `B2B`: The B2B scheme is used for payments between companies. No refund is possible
             * `COR1`: The COR1 scheme is used for payments between consumers and companies. The payment is processed faster than with the core scheme
          default: CORE
          example: CORE
        sequence:
          enum:
            - FRST
            - RCUR
            - FNAL
            - OOFF
          description: >-
            The SEPA mandate sequence. If none is provided, the default sequence
            "FRST" will be used.


            Possible values:
             * `FRST`: The sepa mandate is used for the first time for a recurring payment
             * `RCUR`: The sepa mandate was already used the first time and is now used for recurring payments
             * `FNAL`: The sepa mandate is used for the last time for a recurring payment
             * `OOFF`: The sepa mandate is only allowed to be used for one payment
          default: FRST
          example: FRST
      required:
        - iban
        - bic
        - accountHolder
    CreateGoCardlessResource:
      type: object
      description: >-
        GoCardless-specific data for migrating or assigning an existing
        GoCardless customer or mandate to Fynn.
      deprecated: false
      properties:
        customerId:
          pattern: ^(CU.*)$
          description: >-
            The GoCardless customer id, which references the GoCardless
            customer. If none is provided, the GoCardless mandate flow will be
            started.
          example: CU123456789
          type:
            - string
            - 'null'
        mandateId:
          pattern: ^(MD.*)$
          description: >-
            The GoCardless mandate id, which references the GoCardless mandate.
            If none is provided, the GoCardless mandate flow will be started.
          example: MD123456789
          type:
            - string
            - 'null'
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````