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

# Get Checkout Session

> Retrieve the full state of a checkout session by its ID.

Returns the complete session state — cart items with computed pricing, applied coupons, free-gift add-ons, loyalty coin balance, and payment/session lifecycle state.

<Note>
  Use the `session_id` returned by [Create Session](/api-reference/checkout/create-session). Monetary amounts in this response are in the **major** currency unit (e.g. `3595` = ₹3595).
</Note>

A few fields worth calling out:

* `pricing.shipping` is `-1` until a delivery address is provided, then it reflects the calculated charge.
* `add_ons` lists free-gift products unlocked once `pricing` crosses each offer's `target`.


## OpenAPI

````yaml GET /session/{id}
openapi: 3.0.1
info:
  title: FlexyPe Checkout API
  description: >-
    Public APIs for the FlexyPe checkout system: session creation, OTP-based
    authentication, and checkout flow management.
  version: 1.0.0
servers:
  - url: https://api.flexype.io
security:
  - bearerAuth: []
paths:
  /session/{id}:
    get:
      tags:
        - Checkout Session
      summary: Get Checkout Session
      description: >-
        Retrieves the full state of a checkout session by its ID, including cart
        items, computed pricing, applied coupons, free-gift add-ons,
        coin/loyalty balance, and payment/session state. Use this to render the
        checkout and to poll the session as the customer progresses.
      operationId: getSession
      parameters:
        - name: sessionId
          in: path
          required: true
          description: The session ID returned by Create Session.
          schema:
            type: string
            format: uuid
          example: 71ef30e1-85c8-4f7a-9e89-7691fd7c1bfb
      responses:
        '200':
          description: Session retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    $ref: '#/components/schemas/SessionDetail'
        '404':
          description: Session not found or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: FAILURE
                error:
                  code: error.session-not-found
                  message: Session not found
components:
  schemas:
    SessionDetail:
      type: object
      description: Full checkout session state.
      properties:
        id:
          type: string
          format: uuid
          description: Session ID.
          example: 71ef30e1-85c8-4f7a-9e89-7691fd7c1bfb
        items:
          type: array
          description: Cart items with computed per-line pricing.
          items:
            $ref: '#/components/schemas/SessionItem'
        pricing:
          $ref: '#/components/schemas/Pricing'
        merchant_id:
          type: string
          format: uuid
          example: c6e40fdc-3c66-4661-b909-65e8b1a68e5b
        payment_state:
          type: string
          description: Payment lifecycle state.
          enum:
            - DRAFT
            - PENDING
            - PAID
            - FAILED
          example: DRAFT
        session_state:
          type: string
          description: Checkout session lifecycle state.
          enum:
            - INITIATED
            - IN_PROGRESS
            - COMPLETED
            - ABANDONED
          example: INITIATED
        redirect_url:
          type: string
          description: URL to redirect to after checkout.
          example: https://my-store.com/cart
        coupons:
          type: array
          description: Applied coupons.
          items:
            $ref: '#/components/schemas/Coupon'
        add_ons:
          type: array
          description: Free-gift add-ons unlocked by coupon targets.
          items:
            $ref: '#/components/schemas/AddOn'
        country_code:
          type: string
          description: Customer country, ISO 3166-1 alpha-2.
          example: IN
        currency_code:
          type: string
          description: Checkout currency, ISO 4217.
          example: INR
        coin:
          $ref: '#/components/schemas/Coin'
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: FAILURE
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: error.invalid-request
            message:
              type: string
              description: Human-readable error message.
    SessionItem:
      type: object
      description: A cart line item in the session response.
      properties:
        title:
          type: string
          example: Charcoal Embroidered Ball Gown with Velvet Drape Neck
        handle:
          type: string
          example: charcoal-embroidered-ball-gown-with-velvet-drape-neck
        product_id:
          type: integer
          format: int64
          example: 8948397801608
        variant_id:
          type: integer
          format: int64
          example: 46107636203656
        quantity:
          type: integer
          example: 1
        properties:
          type: object
          description: Custom line-item properties.
          additionalProperties:
            type: string
          example: {}
        variant:
          type: object
          description: Selected variant details.
          properties:
            title:
              type: string
              example: 1-2Y(16)
            variant_id:
              type: integer
              format: int64
              example: 46107636203656
            compare_at_price:
              type: number
              nullable: true
              description: >-
                Strike-through price in major currency unit; null when not on
                sale.
              example: null
            price:
              type: number
              description: Unit price in major currency unit.
              example: 3595
        grams:
          type: integer
          description: Item weight in grams.
          example: 0
        single_variant:
          type: boolean
          description: True if the product has only the default variant.
          example: false
        item_price:
          type: number
          description: Unit price in major currency unit.
          example: 3595
        total_discount:
          type: number
          description: Total discount on this line.
          example: 359.5
        sub_total_price:
          type: number
          description: Line subtotal before discounts.
          example: 3595
        total_price:
          type: number
          description: Line total after discounts.
          example: 3235.5
        out_of_stock:
          type: boolean
          example: false
        taxable:
          type: boolean
          example: true
        image:
          type: string
          example: >-
            https://cdn.shopify.com/s/files/1/0572/8685/2744/files/1_c053a6bd-65f3-4c99-b181-bd799aaab917.jpg?v=1781354018
        source:
          type: string
          description: How the item entered the cart.
          enum:
            - MANUAL
            - UPSELL
            - ADD_ON
          example: MANUAL
    Pricing:
      type: object
      description: Computed cart pricing. All amounts are in the major currency unit.
      properties:
        cart_total:
          type: number
          description: Sum of item prices before discounts.
          example: 3595
        sub_total:
          type: number
          description: Subtotal before discounts.
          example: 3595
        discount:
          type: number
          description: Total discount applied.
          example: 359.5
        payment_offer_discount:
          type: number
          description: Discount from payment-method offers.
          example: 0
        shipping:
          type: number
          description: Shipping charge. -1 means not yet calculated (address pending).
          example: -1
        cod_price:
          type: number
          description: Cash-on-delivery fee.
          example: 0
        cod_available:
          type: boolean
          description: Whether COD is available for this cart.
          example: false
        cod_order:
          type: boolean
          description: Whether the customer selected COD.
          example: false
        total:
          type: number
          description: Total after discounts, before payable adjustments.
          example: 3235.5
        tax:
          type: number
          example: 0
        taxes_included:
          type: boolean
          description: Whether prices are tax-inclusive.
          example: true
        total_payable:
          type: number
          description: Final amount payable by the customer.
          example: 3235.5
        partial_cod_price:
          type: number
          description: Prepaid amount required for partial COD.
          example: 0
        is_partial_cod:
          type: boolean
          example: false
        amount_paid:
          type: number
          description: Amount already paid.
          example: 0
        coin_discount:
          type: number
          description: Discount from redeemed coins.
          example: 0
        coupon_discount:
          type: number
          description: Discount from applied coupons.
          example: 359.5
    Coupon:
      type: object
      description: An applied coupon.
      properties:
        coupon_id:
          type: string
          format: uuid
          example: 0745bfb2-7ae7-4447-942a-71b50084ed8b
        code:
          type: string
          example: SUMMER10
        application_type:
          type: string
          description: How the coupon is applied.
          enum:
            - CODE
            - AUTOMATIC
          example: CODE
        combine:
          type: boolean
          description: Whether it stacks with other coupons.
          example: true
        discount_type:
          type: string
          enum:
            - PERCENTAGE
            - FIXED
          example: PERCENTAGE
        discount_amount:
          type: number
          description: Discount value (percent for PERCENTAGE, amount for FIXED).
          example: 10
        discount_max_cap:
          type: number
          nullable: true
          description: Maximum discount cap; null when uncapped.
          example: null
        cart_discounted_amount:
          type: number
          description: Cart total after this coupon.
          example: 3235.5
        cart_discount_amount:
          type: number
          description: Amount this coupon discounts.
          example: 359.5
        previous_coupon_code:
          type: string
          nullable: true
          description: Code replaced by this coupon, if any.
          example: null
        coupon_type:
          type: string
          example: PRODUCT_AMOUNT
        coupon_platform:
          type: string
          enum:
            - SHOPIFY
            - FLEXYPE
          example: SHOPIFY
        applied_from:
          type: string
          description: Source of application.
          enum:
            - MANUAL
            - AUTOMATIC
          example: MANUAL
        disable_cod:
          type: boolean
          description: Whether the coupon disables COD.
          example: false
        id:
          type: string
          format: uuid
          example: 7ce1eabb-ccb2-441f-9d03-d5249291444b
        _id:
          type: string
          format: uuid
          description: Alias of `id`.
          example: 7ce1eabb-ccb2-441f-9d03-d5249291444b
    AddOn:
      type: object
      description: A free-gift offer and the products it unlocks.
      properties:
        coupon_id:
          type: string
          format: uuid
          example: 048c69c7-adc8-4cc0-b0ba-78e2f96868f5
        target_type:
          type: string
          description: Condition type that unlocks the gift.
          enum:
            - PURCHASE_AMOUNT
            - QUANTITY
          example: PURCHASE_AMOUNT
        target:
          type: number
          description: Threshold value for the target type.
          example: 3500
        max_quantity:
          type: integer
          description: Max free units the customer can add.
          example: 1
        products:
          type: array
          description: Eligible gift products.
          items:
            $ref: '#/components/schemas/AddOnProduct'
    Coin:
      type: object
      description: Loyalty coin balance and configuration for the cart.
      properties:
        coin_ratio:
          type: object
          description: Conversion between coins and currency.
          properties:
            base_currency_value:
              type: number
              description: Currency value of `coin_value` coins.
              example: 0
            coin_value:
              type: number
              description: Coins equal to `base_currency_value`.
              example: 0
        config:
          type: object
          description: Coin program configuration.
          properties:
            provider:
              type: string
              enum:
                - NONE
                - REELO
                - CUSTOM
              example: NONE
            name:
              type: string
              example: ''
            logo:
              type: string
              example: '-'
        coin_available:
          type: number
          description: Coins the customer holds.
          example: 0
        coin_redeemable:
          type: number
          description: Coins redeemable on this cart.
          example: 0
        coin_used:
          type: number
          description: Coins applied to this cart.
          example: 0
        coins_processing:
          type: number
          description: Coins pending settlement.
          example: 0
    AddOnProduct:
      type: object
      properties:
        product_id:
          type: integer
          format: int64
          example: 12184723390782
        status:
          type: string
          description: Shopify product status.
          enum:
            - active
            - unlisted
            - archived
            - draft
          example: active
        id:
          type: string
          format: uuid
          example: 9f4353e8-b833-453c-b1e8-7a9dd1365eb5
        title:
          type: string
          example: 2 Pairs Agate Earrings
        vendor:
          type: string
          example: Neidhal
        body_html:
          type: string
          description: Product description HTML.
          example: ''
        handle:
          type: string
          example: 2-pairs-agate-earrings
        image:
          type: string
          example: >-
            https://cdn.shopify.com/s/files/1/0906/1747/9486/files/2-Free_ae5cbe7d-b87d-44a9-bb39-af23c3360273.webp?v=1764495062
        single_variant:
          type: boolean
          example: true
        images:
          type: array
          description: Additional product images.
          items:
            type: object
            properties:
              src:
                type: string
                example: >-
                  https://cdn.shopify.com/s/files/1/0906/1747/9486/files/1-FREE_5290a646-3966-480e-9ad3-f1d8f0167fa6.webp?v=1764495009
              id:
                type: integer
                format: int64
                example: 52931670835518
          example: []
        variants:
          type: array
          items:
            $ref: '#/components/schemas/AddOnVariant'
    AddOnVariant:
      type: object
      properties:
        title:
          type: string
          example: Default Title
        variant_id:
          type: integer
          format: int64
          example: 52647247479102
        image_id:
          type: integer
          format: int64
          nullable: true
          example: null
        compare_at_price:
          type: number
          nullable: true
          example: null
        product_id:
          type: integer
          format: int64
          example: 12184723390782
        item_price:
          type: number
          example: 300
        price:
          type: number
          example: 300
        image:
          type: string
          example: >-
            https://cdn.shopify.com/s/files/1/0906/1747/9486/files/2-Free_ae5cbe7d-b87d-44a9-bb39-af23c3360273.webp?v=1764495062
        inventory_quantity:
          type: integer
          description: Available inventory; may be negative when oversold.
          example: -368
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key sent as a bearer token (`Bearer <token>`). Generate keys in the
        dashboard under Settings → API Keys.

````