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

# Org Pay Invoice

> Org variant of pay_invoice: settle an open org usage invoice in-app.

Owner/admin only. The paying user enters a card on our page billed to
their own Stripe customer (no org-level Stripe customer or pre-attached
card required); the seacobra_org_id metadata makes the invoice.paid
webhook record the payment against the ORG partner in Odoo, where it
FIFO-reconciles the open installment lines and clears org suspension.



## OpenAPI

````yaml /openapi.json post /api/organizations/{org_id}/billing/invoices/{invoice_ref}/pay
openapi: 3.1.0
info:
  description: >-
    Public CodeCobra API. Authenticate by sending a personal API key in the
    `Authorization: Bearer <key>` header. Generate keys from Settings → API keys
    in the CodeCobra dashboard.
  title: CodeCobra Public API
  version: 1.0.0
servers: []
security: []
paths:
  /api/organizations/{org_id}/billing/invoices/{invoice_ref}/pay:
    post:
      tags:
        - public
      summary: Org Pay Invoice
      description: |-
        Org variant of pay_invoice: settle an open org usage invoice in-app.

        Owner/admin only. The paying user enters a card on our page billed to
        their own Stripe customer (no org-level Stripe customer or pre-attached
        card required); the seacobra_org_id metadata makes the invoice.paid
        webhook record the payment against the ORG partner in Odoo, where it
        FIFO-reconciles the open installment lines and clears org suspension.
      operationId: >-
        org_pay_invoice_api_organizations__org_id__billing_invoices__invoice_ref__pay_post
      parameters:
        - in: path
          name: org_id
          required: true
          schema:
            format: uuid
            title: Org Id
            type: string
        - in: path
          name: invoice_ref
          required: true
          schema:
            title: Invoice Ref
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayInvoiceResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    PayInvoiceResponse:
      properties:
        amount:
          title: Amount
          type: number
        client_secret:
          title: Client Secret
          type: string
        payment_intent_id:
          title: Payment Intent Id
          type: string
        publishable_key:
          title: Publishable Key
          type: string
        saved_card_brand:
          anyOf:
            - type: string
            - type: 'null'
          title: Saved Card Brand
        saved_card_last4:
          anyOf:
            - type: string
            - type: 'null'
          title: Saved Card Last4
        saved_payment_method_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Saved Payment Method Id
      required:
        - client_secret
        - publishable_key
        - amount
        - payment_intent_id
      title: PayInvoiceResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````