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

# Upgrade or switch the organisation subscription plan through the billing provider abstraction.



## OpenAPI

````yaml /openapi/v1.yaml post /billing/checkout
openapi: 3.1.0
info:
  title: Attexra API
  version: 0.1.0
  description: >-
    Identity, scoped authorization, and auditable action evidence for autonomous
    agents. The MVP is non-custodial and does not execute payments.
servers:
  - url: /v1
    description: Current API server
  - url: https://api.attexra.tech/v1
    description: Production example
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /billing/checkout:
    post:
      summary: >-
        Upgrade or switch the organisation subscription plan through the billing
        provider abstraction.
      operationId: createBillingCheckout
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingCheckoutRequest'
      responses:
        '200':
          description: Subscription updated or checkout session created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingCheckoutResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    IdempotencyKey:
      in: header
      name: Idempotency-Key
      required: true
      description: Unique key ensuring safe retries on write endpoints.
      schema:
        type: string
        minLength: 1
        maxLength: 255
  schemas:
    BillingCheckoutRequest:
      type: object
      required:
        - planSlug
      properties:
        planSlug:
          type: string
        billingInterval:
          type: string
          enum:
            - monthly
            - annual
            - custom
        paymentMode:
          type: string
          enum:
            - recurring_card
            - one_time
          description: >-
            Recurring billing uses USD cards only. One-time checkout never
            enables auto-renewal.
        paymentMethodTypes:
          type: array
          description: Optional Bachs payment corridors for one-time checkout.
          items:
            type: string
            enum:
              - USD_CARD
              - NGN_CARD
              - NGN_BANK_TRANSFER
              - MOMO_GHS
              - MOMO_KES
              - MOMO_TZS
              - MOMO_UGX
              - MOMO_XAF
              - MOMO_XOF
              - MOMO_RWF
              - MOMO_MWK
              - MOMO_ZMW
              - CRYPTO
        successUrl:
          type: string
        cancelUrl:
          type: string
    BillingCheckoutResponse:
      type: object
      required:
        - subscription
        - checkoutSession
      properties:
        subscription:
          $ref: '#/components/schemas/BillingSubscription'
        checkoutSession:
          type: object
          required:
            - sessionId
            - provider
            - mode
            - subscriptionStatus
            - provisioned
          properties:
            sessionId:
              type: string
            provider:
              type: string
            mode:
              type: string
            paymentMode:
              type: string
              enum:
                - recurring_card
                - one_time
            checkoutUrl:
              type: string
            subscriptionStatus:
              type: string
            externalCustomerId:
              type: string
            externalSubscriptionId:
              type: string
            provisioned:
              type: boolean
    BillingSubscription:
      type: object
      required:
        - id
        - organisationId
        - planId
        - plan
        - status
        - provider
        - paymentMethodType
        - autoRenew
        - billingInterval
        - currentPeriodStart
        - currentPeriodEnd
        - cancelAtPeriodEnd
      properties:
        id:
          type: string
          format: uuid
        organisationId:
          type: string
          format: uuid
        planId:
          type: string
          format: uuid
        plan:
          $ref: '#/components/schemas/BillingPlan'
        status:
          type: string
          enum:
            - active
            - trialing
            - past_due
            - canceled
            - expired
        provider:
          type: string
        paymentMethodType:
          type: string
        autoRenew:
          type: boolean
        billingInterval:
          type: string
          enum:
            - monthly
            - annual
            - custom
        currentPeriodStart:
          type: string
          format: date-time
        currentPeriodEnd:
          type: string
          format: date-time
        cancelAtPeriodEnd:
          type: boolean
        externalCustomerId:
          type: string
          nullable: true
        externalSubscriptionId:
          type: string
          nullable: true
    BillingPlan:
      type: object
      required:
        - id
        - name
        - slug
        - description
        - currency
        - isActive
        - entitlements
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        slug:
          type: string
        description:
          type: string
        monthlyPrice:
          type: integer
          nullable: true
        currency:
          type: string
        isActive:
          type: boolean
        sortOrder:
          type: integer
        entitlements:
          type: object
          additionalProperties:
            type: string
  responses:
    ValidationError:
      description: The request failed validation.
    NotFound:
      description: The requested resource does not exist in this tenant.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Console session token (also supported via attexra_session HttpOnly
        cookie).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.