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

# Get a Session

> Retrieves the details of a payment session by its ID. This is the recommended way to check 
the final status of a payment after the customer is redirected back to your site.


Retrieve the current state and details of a payment session. This is the recommended way to verify payment completion after a customer is redirected back to your site.

## Common Use Cases

* **Post-Payment Verification**: When a customer returns to your `success_url`, retrieve the session to confirm the payment was actually completed.
* **Reconciliation**: Check the status of sessions for orders that may have been abandoned or are in an unknown state.
* **Status Polling**: If you're not using webhooks, you can poll this endpoint to check for payment completion.

## Key Fields to Check

* **status**: The overall session state (`pending`, `completed`, `expired`, `cancelled`).
* **payment\_id**: If present and status is `completed`, this is the ID of the successful payment transaction.
* **transaction\_status**: The status of the actual payment transaction (e.g., `Success`, `Declined`).

## Related Resources

* [How to Manually Check Payment Status](/hosted-checkout/guides/manually-check-payment-status): Integration guide for checking payment status.
* [Status Reference](/hosted-checkout/reference/status-reference): Complete list of all status values.
* [Key Identifiers](/hosted-checkout/reference/key-identifiers): Understanding session IDs, payment IDs, and external IDs.


## OpenAPI

````yaml GET /checkout/v1/sessions/{id}
openapi: 3.0.3
info:
  title: Tonder
  description: Tonder API
  termsOfService: https://www.google.com/policies/terms/
  contact:
    email: hello@tonder.io
  version: v1
servers:
  - url: https://api-stage.tonder.io/api/v1
    description: Staging
  - url: https://api.tonder.io/api/v1
    description: Production
security: []
paths:
  /checkout/v1/sessions/{id}:
    get:
      tags:
        - Hosted Checkout
      summary: Get a Session
      description: >
        Retrieves the details of a payment session by its ID. This is the
        recommended way to check 

        the final status of a payment after the customer is redirected back to
        your site.
      operationId: getCheckoutSession
      parameters:
        - name: id
          in: path
          required: true
          description: The Session ID (e.g., sess_a1b2c3d4e5f6)
          schema:
            type: string
            example: sess_a1b2c3d4e5f6
      responses:
        '200':
          description: Session retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSession'
              example:
                id: cs_97_41521_d11ba771527b4056c7f85786cfbb980bc105efaf42af113d
                url: >-
                  https://stage-payflow.tonder.io/checkout/cs_97_41521_d11ba771527b4056c7f85786cfbb980bc105efaf42af113d
                status: completed
                payment_id: 41521
                amount_total: 35000
                currency: MXN
                expires_at: 1751564943
                external_id: ORD-12345
                session_type: payment
                checkout_type: hosted
                return_url: https://my-store.com/checkout/complete
                metadata: {}
                payment_method_types:
                  - card
                ui_config: {}
                ui_config_version: V1
                created_at: 1751478543567
                modified_at: 1751478550234
                paid_at: 1751478550234
                customer:
                  first_name: John
                  last_name: Doe
                  email: john.doe@example.com
                line_items:
                  - name: Product 1
                    quantity: 1
                    unit_price: 35000
                    product_id: prod-001
                transaction_status: Success
                provider: tonder
      security:
        - Authorization: []
components:
  schemas:
    CheckoutSession:
      type: object
      properties:
        id:
          type: string
          description: Unique session identifier
          example: cs_97_41521_d11ba771527b4056c7f85786cfbb980bc105efaf42af113d
        url:
          type: string
          format: uri
          description: Redirect your customer to this URL to begin the payment
          example: >-
            https://stage-payflow.tonder.io/checkout/cs_97_41521_d11ba771527b4056c7f85786cfbb980bc105efaf42af113d
        status:
          type: string
          enum:
            - pending
            - completed
            - expired
          description: Session status
          example: pending
        payment_id:
          type: number
          description: Associated payment ID
          example: 41521
        amount_total:
          type: number
          description: Total amount to be charged
          example: 35000
        currency:
          type: string
          description: Currency used
          example: MXN
        expires_at:
          type: integer
          description: Expiration time (Unix timestamp in seconds)
          example: 1751564943
        external_id:
          type: string
          description: Order reference from the merchant
          example: ORD-12345
        session_type:
          type: string
          description: Type of session
          example: payment
        checkout_type:
          type: string
          description: Checkout method
          example: hosted
        success_url:
          type: string
          format: uri
          nullable: true
          description: Success redirect URL
        return_url:
          type: string
          format: uri
          description: Return/fallback redirect URL
        pending_url:
          type: string
          format: uri
          nullable: true
          description: Pending redirect URL
        metadata:
          type: object
          description: Custom data sent by the merchant
        payment_method_types:
          type: array
          items:
            type: string
          description: Allowed payment methods
          example:
            - card
        ui_config:
          type: object
          description: UI configuration applied
        ui_config_version:
          type: string
          description: Version of UI config
          example: V1
        created_at:
          type: integer
          description: Creation timestamp in milliseconds
          example: 1751478543567
        modified_at:
          type: integer
          description: Last modification timestamp in milliseconds
          example: 1751478543567
        paid_at:
          type: integer
          nullable: true
          description: Payment completion timestamp in milliseconds
        customer:
          type: object
          properties:
            first_name:
              type: string
              example: John
            last_name:
              type: string
              example: Doe
            email:
              type: string
              example: john.doe@example.com
        line_items:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              quantity:
                type: number
              unit_price:
                type: number
              product_id:
                type: string
        transaction_status:
          type: string
          enum:
            - Pending
            - Success
            - Declined
            - Expired
          description: Result of transaction
          example: Pending
        provider:
          type: string
          description: Gateway used
          example: tonder
  securitySchemes:
    Authorization:
      type: apiKey
      name: Authorization
      in: header

````