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

# Create a checkout session for an offer



## OpenAPI

````yaml /openapi.json post /v1/billing/checkout
openapi: 3.0.0
info:
  title: OneSubnet Core API
  description: >-
    OneSubnet hosting panel API. Toutes les routes sont préfixées par /v1/
    (versioning URI). Les routes Panel sont appelées par le daemon Wings, pas
    par les clients. Les routes Admin nécessitent le rôle admin.
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: Auth & Users
    description: Authentification, profil, gestion utilisateurs
  - name: Store
    description: 'Boutique: catégories, produits, panier'
  - name: Billing
    description: Facturation, checkout Stripe, webhooks
  - name: Services
    description: Services hébergés (enregistrements facturation)
  - name: Affiliation
    description: Parrainage et commissions
  - name: Notifications
    description: Notifications
  - name: Admin - RBAC
    description: Gestion des rôles, permissions, groupes
  - name: Admin - Store & Invoices
    description: CRUD produits, plans, coupons, factures
  - name: Admin - Settings & Tenants
    description: Configuration, multi-tenant, whitelabel
  - name: Admin - Audit
    description: Journal d'audit des requêtes
  - name: System
    description: Health, meta-info
paths:
  /v1/billing/checkout:
    post:
      tags:
        - Billing
      summary: Create a checkout session for an offer
      operationId: BillingController_createCheckout_v1
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCheckoutDto'
      responses:
        '201':
          description: ''
      security:
        - bearer: []
components:
  schemas:
    CreateCheckoutDto:
      type: object
      properties:
        sku:
          type: string
          example: mc-java-17
          description: Offer SKU to purchase.
        quantity:
          type: number
          example: 1
          minimum: 1
          maximum: 100
          default: 1
        planId:
          type: string
          description: >-
            ID of the billing Plan to use. If omitted, the first (cheapest)
            active plan is used.
        eggId:
          type: string
          description: >-
            Selected egg variant (software choice, e.g. Velocity instead of the
            default Bungeecord). Must be the product default egg or one of its
            `eggVariants`; otherwise the checkout is rejected with a 400.
        configs:
          type: object
          description: >-
            Selected config options, keyed by configOptionId → chosen value
            (matching a choice `value` in the option's `choices` JSON array).
          example:
            ram: '4096'
            disk: '50'
        couponCode:
          type: string
          description: >-
            Optional coupon code to apply at checkout. Validated against the
            Coupon table (must exist, be active, and not be expired).
          example: SUMMER25
        gatewayType:
          type: string
          description: >-
            Gateway type to use for this checkout (e.g. "stripe", "manual").
            When omitted, the default enabled gateway is used. A "manual"
            gateway leaves the invoice PENDING (awaiting payment) and returns no
            redirect URL.
          example: manual
        useCredits:
          type: boolean
          description: >-
            When true, apply the customer account credit balance to the order,
            capped at `loyalty.max_credit_usage_percent` (default 50%) of the
            post-coupon total. The credits are deducted atomically and the
            remaining balance is charged via the gateway. The customer always
            pays at least (100 − max)% out of pocket.
          default: false
          example: true
      required:
        - sku
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

## Related topics

- [Create a Stripe Customer Portal session](/api-reference/billing/create-a-stripe-customer-portal-session.md)
- [Create a SetupIntent to save a payment method](/api-reference/billing/create-a-setupintent-to-save-a-payment-method.md)
- [Checkout the entire cart (multi-item)](/api-reference/billing/checkout-the-entire-cart-multi-item.md)
- [List enabled payment gateways for checkout](/api-reference/billing/list-enabled-payment-gateways-for-checkout.md)
- [Create a gateway](/api-reference/admin--gateways/create-a-gateway.md)
