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

# Create checkout

> Create checkout operation on all the items of a specific cart which is identified by a unique `cartId`. Along with `cartId`, checkout operation includes merchant account Id, amount to be paid, tax to be imposed on cart items and shipping address, and some other details.



## OpenAPI

````yaml checkout post /v2/checkout
openapi: 3.0.1
info:
  title: Checkout API
  description: >-
    fabric's Checkout API lets you complete the checkout process and place an
    order on the cart items. This process includes specifying a customer's
    shipping and payment details, and calculating tax and shipping rates.
  contact:
    name: Checkout Support
    url: https://www.fabric.inc/
    email: support.cnc@fabric.inc
  license:
    name: fabric API license
    url: https://fabric.inc/api-license
  version: 2.0.0
servers:
  - url: https://prod.checkout.fabric.inc
    description: Production
security: []
tags:
  - name: Checkout
    description: >-
      Checkout endpoint lets you create checkout operation and place an order on
      the cart items.
paths:
  /v2/checkout:
    post:
      tags:
        - Checkout
      summary: Create checkout
      description: >-
        Create checkout operation on all the items of a specific cart which is
        identified by a unique `cartId`. Along with `cartId`, checkout operation
        includes merchant account Id, amount to be paid, tax to be imposed on
        cart items and shipping address, and some other details.
      operationId: checkout
      parameters:
        - name: x-site-context
          in: header
          description: >-
            The `x-site-context` header is a JSON object that contains
            information about the source you wish to pull from. The mandatory
            `account` is the 24 character identifier found in Copilot. The
            `channel` (Sales channel ID), `stage` (environment name), and `date`
            attributes can be used to further narrow the scope of your data
            source.
          required: true
          schema:
            type: string
            example: >-
              {"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account":
              "1234abcd5678efgh9ijklmno","stage":"production"}
        - name: Authorization
          in: header
          description: Authorization token for the user
          required: false
          schema:
            type: string
            nullable: true
            example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjIyMTU4
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutResponse'
              example:
                checkoutComplete: true
                orderId: 111-121-1234
        '400':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
components:
  schemas:
    CheckoutRequest:
      description: Checkout request payload
      required:
        - cartId
        - paymentDetails
        - estimatedTax
      type: object
      properties:
        cartId:
          type: string
          description: Unique cart ID
          example: d7e78a21-bee3-4448-bf1c-d5b5461dbda2
        customerAccountId:
          type: string
          description: Merchant account ID that is used in `x-site-context`
          nullable: true
          example: 5f689caa4216e7000750d1ef
        customerName:
          $ref: '#/components/schemas/Name'
        customerEmail:
          type: string
          description: Email address of the customer
          nullable: true
          example: john.doe@gmail.com
        customerPhoneNumber:
          $ref: '#/components/schemas/CustomerPhone'
        paymentDetails:
          type: array
          items:
            $ref: '#/components/schemas/PaymentDetailsRequest'
        estimatedTax:
          $ref: '#/components/schemas/EstimatedTax'
        shipFrom:
          $ref: '#/components/schemas/ShipFrom'
        orderType:
          type: string
          description: Order Type (WEB, CSC, MOBILE_APP, POS etc)
          nullable: true
          example: WEB
        orderSubType:
          type: string
          description: OrderSubType (Android/IOS/International etc)
          nullable: true
          example: Android
        orderSequence:
          $ref: '#/components/schemas/orderSequence'
        employeeId:
          type: string
          description: employeeId who helped during Checkout
          nullable: true
          example: 43278
        notes:
          type: array
          items:
            $ref: '#/components/schemas/Note'
    CheckoutResponse:
      description: Checkout response details
      type: object
      properties:
        checkoutComplete:
          type: boolean
          description: >-
            Status of checkout.<br />true = Checkout is complete<br />false =
            Checkout is not complete
          example: true
        orderId:
          type: string
          description: Order ID
          nullable: true
          example: 111-123-4421
        pointOfFailure:
          $ref: '#/components/schemas/DependencyFailureEnum'
        paymentResp:
          $ref: '#/components/schemas/PaymentResponseData'
    ClientError:
      description: Client error
      type: object
      properties:
        code:
          description: Error code, meant for machine consumption
          type: string
          example: Bad request
        message:
          description: Human-readable error description
          type: string
          example: User ID or Cart ID does not exist
    NotFoundError:
      description: Not found error
      type: object
      properties:
        code:
          description: Error code, meant for machine consumption
          type: string
          example: Cart not found
        message:
          description: Human-readable error description
          type: string
          example: If the issue persists, please contact support@fabric.inc.
    ServerError:
      description: Server error
      type: object
      properties:
        code:
          description: Error code, meant for machine consumption
          type: string
          example: Internal server error
        message:
          description: Human-readable error description
          type: string
          example: >-
            An internal error occurred. If the issue persists please contact
            support@fabric.inc.
    Name:
      description: Name of the individual used for for billing address
      type: object
      properties:
        first:
          type: string
          description: First name
          example: John
        middle:
          type: string
          description: Middle name
          nullable: true
          example: Mae
        last:
          type: string
          description: Last name
          example: Doe
    CustomerPhone:
      description: Customer phone details
      type: object
      properties:
        number:
          type: string
          description: Phone number of the customer
          example: 123-456-7890
        kind:
          type: string
          description: Kind of number
          example: office
    PaymentDetailsRequest:
      description: >-
        Details of payment request. Depending on business use cases, it can also
        be empty for no payment configuration.
      type: object
      properties:
        connectorName:
          type: string
          description: Payment gateway service provider
          example: Authorizenet
        paymentMethod:
          type: string
          description: Payment method
          nullable: true
          example: card
        paymentMethodType:
          type: string
          description: payment method type
          nullable: true
          example: tamara, tabby
        paymentToken:
          type: string
          description: Payment token ID associated with the payment flow
          example: 534234543
        amount:
          type: number
          description: Amount to be paid
          format: double
          example: 100
        currency:
          type: string
          description: Currency type
          example: USD
        conversion:
          type: number
          description: >-
            Currency Conversion (For USD = 1, For Non-USD = conversion ratio to
            USD)
          format: double
          example: 1.1
        billToAddress:
          $ref: '#/components/schemas/BillToAddress'
        attributes:
          oneOf:
            - $ref: '#/components/schemas/PaymentDetailsAttributes'
            - $ref: >-
                #/components/schemas/PaymentDetailsAttributesChicosPayWithOmniToken
            - $ref: >-
                #/components/schemas/PaymentDetailsAttributesChicosPayWithPayPageRegId
    EstimatedTax:
      description: >-
        Estimated tax details imposed on cart-items and location to which the
        items are shipped.
      required:
        - itemsTaxes
        - shipToTaxes
      type: object
      properties:
        itemsTaxes:
          type: array
          items:
            $ref: '#/components/schemas/ItemsTaxes'
        shipToTaxes:
          type: array
          items:
            $ref: '#/components/schemas/ShipToTaxes'
    ShipFrom:
      description: shipping details for the cart
      type: object
      properties:
        street:
          type: string
          description: first line of address
          example: 100 NE 100th St
        city:
          type: string
          description: city name
          example: Seattle
        state:
          type: string
          description: state name
          example: Washington
        country:
          type: string
          description: country name
          example: USA
        zipCode:
          type: string
          description: zip code
          example: 98121
    orderSequence:
      description: Order sequence details
      type: object
      properties:
        sequenceName:
          type: string
          description: Sequence module name
          example: ORDER_SEQUENCE_NAME
        sequenceKey:
          type: string
          description: >-
            sequenceKey is used to identify prefixValue. If no prefix is needed,
            it can be null.
          nullable: true
          example: WHBM
    Note:
      description: Notes section to be used for CSR only
      type: object
      properties:
        timestamp:
          type: string
          description: timestamp
          nullable: true
          example: '2022-05-12T09:30:31.198Z'
        user:
          type: string
          description: user name
          nullable: true
          example: 62272e917b12209e68751d94
        notes:
          type: string
          description: notes
          nullable: true
          example: Type Anything
    DependencyFailureEnum:
      description: >-
        Checkout dependency failure if checkout is failed due to any of the
        reasons from the specified values.
      type: string
      enum:
        - CART
        - PAYMENT
        - ORDER
    PaymentResponseData:
      description: >-
        Payment mismatch response details. It is displayed when
        `totalAmountCapturable` and `orderTotal` are different. The user must
        authorize to pay total amount of the order.
      type: object
      properties:
        totalAmountCapturable:
          type: number
          description: Total amount the user has authorized to pay
          format: double
          example: 200.5
        orderTotal:
          type: number
          description: Total amount of the order. It includes `cart amount + taxes`
          format: double
          example: 200.5
    BillToAddress:
      description: Billing address
      type: object
      properties:
        name:
          $ref: '#/components/schemas/Name'
        phone:
          $ref: '#/components/schemas/Phone'
        email:
          type: string
          description: Email id of the receiver
          example: john.doe@gmail.com
        street1:
          type: string
          description: First line of address
          example: 100 NE 100th St
        street2:
          type: string
          description: Second line of address
          nullable: true
          example: Near landmark
        street3:
          type: string
          description: Third line of address
          nullable: true
          example: Near landmark
        street4:
          type: string
          description: Forth line of address
          nullable: true
          example: Near landmark
        city:
          type: string
          description: City name of address
          example: Seattle
        state:
          type: string
          description: State name of address
          example: Washington
        country:
          type: string
          description: Country name of address
          example: USA
        zipCode:
          type: string
          description: ZIP code of address
          example: 98121
        customerId:
          type: string
          description: >-
            Customer profile ID, created by the payment gateway, for payment
            instruction. This ID is very specific to payment flow.
          example: 98121
        type:
          type: string
          description: type of address
          nullable: true
          example: residence
        latitude:
          type: number
          description: latitude
          nullable: true
          example: 32.294952
        longitude:
          type: number
          description: longitude
          nullable: true
          example: 32.294952
    PaymentDetailsAttributes:
      type: object
      additionalProperties: true
      nullable: true
      example:
        Attribute1: Attribute1 Value
    PaymentDetailsAttributesChicosPayWithOmniToken:
      type: object
      additionalProperties: true
      nullable: false
      description: attributes for chicospay connector using Worldpay with omniToken
      required:
        - orderSource
        - channel
        - orderId
        - orderNumber
        - cardType
        - expirationDate
        - omniToken
      properties:
        orderSource:
          type: string
          example: ecommerce
          description: The order source (required for chicospay connector)
        channel:
          type: string
          example: WHBM
          description: the channel from Chicos (required for chicospay connector)
        orderId:
          type: string
          example: 455fa827-b
          description: Order Id from chicos side (required for chicospay connector)
        orderNumber:
          type: string
          example: 455fa827-b
          description: Order Number from chicos side (required for chicospay connector)
        cardType:
          type: string
          example: Visa
          description: The brancd of the card (required for chicospay connector)
        expirationDate:
          type: string
          description: expiration Date in formast MMYY (required for chicospay connector)
          example: '0224'
        omniToken:
          type: string
          example: 2223007338030011
          description: >-
            Token used to authorize a payment when the credit card is alreary
            stored(required for chicospay connector)
    PaymentDetailsAttributesChicosPayWithPayPageRegId:
      type: object
      additionalProperties: true
      nullable: false
      description: >-
        attributes for chicospay connector using using Worldpay with
        payPageRegId
      required:
        - orderSource
        - channel
        - orderId
        - orderNumber
        - cardType
        - expirationDate
        - payPageRegId
      properties:
        orderSource:
          type: string
          example: ecommerce
          description: The order source (required for chicospay connector)
        channel:
          type: string
          example: WHBM
          description: the channel from Chicos (required for chicospay connector)
        orderId:
          type: string
          example: 455fa827-b
          description: Order Id from chicos side (required for chicospay connector)
        orderNumber:
          type: string
          example: 455fa827-b
          description: Order Number from chicos side (required for chicospay connector)
        cardType:
          type: string
          example: Visa
          description: The brancd of the card (required for chicospay connector)
        expirationDate:
          type: string
          description: expiration Date in formast MMYY (required for chicospay connector)
          example: '0224'
        payPageRegId:
          type: string
          example: '2223007338030011'
          description: >-
            Token used to authorize a payment when the credit card is just
            informed (required for chicospay connector)
    ItemsTaxes:
      description: Tax imposed on cart line item
      required:
        - lineItemId
        - amount
        - type
      type: object
      properties:
        lineItemId:
          type: integer
          description: Sequence number of the item in the cart
          format: int32
          example: 1
        amount:
          type: number
          description: Tax amount that is imposed on the total amount
          format: double
          example: 1.5
        type:
          type: string
          description: tax-type
          example: state tax
    ShipToTaxes:
      description: Tax amount imposed on shipping
      required:
        - shipToId
        - amount
        - type
      type: object
      properties:
        shipToId:
          type: string
          description: Unique shipping  ID
          example: fef78121-bee3-4448-bf1c-d5b5461dbda2
        amount:
          type: number
          description: >-
            Tax amount imposed, based on the shipping location, to ship the
            items.
          format: double
          example: 2.5
        type:
          type: string
          description: tax-type
          example: state tax
    Phone:
      description: Phone details of the individual for billing purpose
      type: object
      properties:
        number:
          type: string
          description: Phone number
          example: 123-456-7890
        kind:
          type: string
          description: Kind of phone
          nullable: true
          example: office

````