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

# Create a corrective document

> Generates a credit note, debit note, or other correction from an existing document. When the `schema` flag is set, returns the available correction options instead.



## OpenAPI

````yaml /openapi/v0.json post /correct
openapi: 3.1.0
info:
  title: GOBL API
  description: >-
    Go Business Language — build, validate, sign, and query tax-aware business
    documents.
  version: v0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  contact:
    name: Invopop
    url: https://gobl.org
servers:
  - url: https://gobl.dev/v0
    description: Production
  - url: /v0
    description: Local
security: []
tags:
  - name: Documents
    description: Build, validate, correct, and replicate GOBL documents.
  - name: Signing
    description: Sign and verify GOBL envelopes.
  - name: Reference
    description: JSON schemas, tax regimes, and format addons.
  - name: Meta
    description: Service metadata.
paths:
  /correct:
    post:
      tags:
        - Documents
      summary: Create a corrective document
      description: >-
        Generates a credit note, debit note, or other correction from an
        existing document. When the `schema` flag is set, returns the available
        correction options instead.
      operationId: correct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CorrectRequest'
      responses:
        '200':
          description: >-
            Corrected document, or correction options schema when `schema` is
            true
          content:
            application/json:
              schema: {}
        '400':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
components:
  schemas:
    CorrectRequest:
      type: object
      required:
        - data
      properties:
        data:
          description: Original document to correct.
        options:
          description: Correction options (method, reason, stamps, etc.).
        schema:
          type: boolean
          description: >-
            When true, returns the available correction options schema instead
            of correcting.
          default: false
    Error:
      type: object
      properties:
        code:
          type: integer
          description: HTTP status code.
          example: 422
        key:
          type: string
          description: Machine-readable error key.
        message:
          type: string
          description: Human-readable message.
        faults:
          type: array
          description: Validation faults.
          items:
            type: object
            properties:
              properties:
                type: array
                items:
                  type: string
                description: Property paths that failed.
              description:
                type: string
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

````