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

# Create payment session

> To get paid in cryptocurrency, you need to create a payment session object with the details of the purchase.



## OpenAPI

````yaml POST /api/checkout/v2/payment_session
openapi: 3.0.1
info:
  title: Sprintcheckout API
  description: API to process payments with Sprintcheckout
  contact:
    name: Sprintcheckout Team
    url: https://sprintcheckout.com
    email: support@sprintcheckout.com
  version: '2.0'
servers:
  - url: https://api.sprintcheckout.com
    description: Production server
security: []
paths:
  /api/checkout/v2/payment_session:
    post:
      tags:
        - Session
      summary: Creates a payment session
      description: >-
        To get paid in cryptocurrency, you need to create a payment session
        object with the details of the purchase.
      operationId: createSessionFromApi
      parameters:
        - name: X-SC-ApiKey
          in: header
          required: true
          description: Get an Api Key from Sprintcheckout Dashboard > Get paid
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewPaymentSession'
        required: true
      responses:
        '201':
          description: Payment session created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentSessionResponse'
        '401':
          description: Unauthorized
        '500':
          description: Server error
components:
  schemas:
    NewPaymentSession:
      required:
        - amount
        - currency
      type: object
      properties:
        orderType:
          pattern: STATIC|TRANSIENT
          type: string
          description: >-
            An order can be STATIC or TRANSIENT (default behavior). A static
            order will not expire. A typical example could be a donation
            scenario. A transient order will not be reusable once is paid.
          nullable: true
          example: STATIC
        amount:
          type: number
          description: Amount of the purchase
          format: double
          example: 100.5
        minAmount:
          type: number
          description: Minimum amount of the payment
          format: double
          nullable: true
          example: 100.5
        editable:
          type: boolean
          description: Is the payment input editable in UI?
          nullable: true
        currency:
          type: string
          description: Three letter FIAT currency code
          example: USD
        orderId:
          type: string
          description: Unique reference of the order on your ecommerce platform
          nullable: true
          example: inv-00010
        successUrl:
          type: string
          description: >-
            URL where the user will be redirected from the hosted payment page
            on a successful payment
          nullable: true
        cancelUrl:
          type: string
          description: >-
            URL where the user will be redirected from the hosted payment page
            on a canceled payment
          nullable: true
    PaymentSessionResponse:
      type: object
      properties:
        sessionId:
          type: string
          description: Session unique identifier
        redirectUrl:
          type: string
          description: Payment session URL that will redirect to the Sprintcheckout dApp

````