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

# Prepare hosted card session

> Returns processor config for CyberSource Flex or MPGS hosted fields.



## OpenAPI

````yaml /openapi.yaml post /payment/checkout/card/session
openapi: 3.1.0
info:
  title: Vestrapay Payments API
  version: '1.0'
  description: >
    Initialize payments, collect card or bank transfer at checkout, and verify
    transactions. Amounts are major units as strings (100 naira is "100.00").
    Successful HTTP JSON is always `{ "status": "success", "data": … }`.
    Failures are `{ "status": "failed", "error", "message" }`. Webhook bodies
    are `{ "event", "data", "timestamp" }` and are not wrapped.
servers:
  - url: https://server.staging.vestrapay.app/v1
    description: Staging
  - url: https://api.vestrapay.com/v1
    description: Production
security:
  - SecretKey: []
tags:
  - name: Payments
    description: Server-to-server initialize and verify
  - name: Checkout
    description: Customer checkout session (access code)
paths:
  /payment/checkout/card/session:
    post:
      tags:
        - Checkout
      summary: Prepare hosted card session
      description: Returns processor config for CyberSource Flex or MPGS hosted fields.
      operationId: create-card-session
      responses:
        '201':
          description: Hosted card session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardSessionResponse'
      security:
        - AccessCode: []
components:
  schemas:
    CardSessionResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: string
          enum:
            - success
        data:
          type: object
          properties:
            reference:
              type: string
            sessionId:
              type: string
            orderId:
              type: string
            status:
              type: string
            hostedCard:
              type: object
              properties:
                provider:
                  type: string
                  enum:
                    - cybersource
                    - mpgs
                captureContext:
                  type: string
                scriptUrl:
                  type: string
  securitySchemes:
    SecretKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Secret key (sk_test_ or sk_live_). Authorization Bearer with the same
        value is also accepted.
    AccessCode:
      type: apiKey
      in: header
      name: x-access-code
      description: Access code from initialize. Query access_code is also accepted.

````