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

# Post v1credit notes



## OpenAPI

````yaml /api-reference/openapi.json post /v1/credit-notes
openapi: 3.0.1
info:
  title: Fatorly Integration
  version: v1
servers:
  - url: https://integration.fatorly.com
    description: Production
  - url: https://integration.sandbox.fatorly.com
    description: Sandbox
security:
  - ApiKey: []
tags:
  - name: CreditNotes
  - name: Customers
  - name: Invoices
  - name: Items
  - name: PurchaseCreditNotes
  - name: PurchaseInvoices
  - name: Vendors
  - name: Webhooks
  - name: WhoAmi
  - name: EchoTest
  - name: ThrowTest
paths:
  /v1/credit-notes:
    post:
      tags:
        - CreditNotes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1CreateInvoiceRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/V1CreateInvoiceRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/V1CreateInvoiceRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/V1InvoiceResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/V1InvoiceResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/V1InvoiceResponse'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '401':
          description: Unauthorized — Missing or invalid X-Api-Key.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '403':
          description: Forbidden — The API key lacks the scope this operation requires.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '422':
          description: Unprocessable Entity
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '429':
          description: >-
            Too Many Requests — Rate limit exceeded; retry after the Retry-After
            interval.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in the current window (0 when rejected).
              schema:
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '500':
          description: Internal Server Error — Unexpected server error; report the traceId.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '502':
          description: Bad Gateway
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
components:
  schemas:
    V1CreateInvoiceRequest:
      required:
        - documentType
        - invoiceNumber
        - issueDate
        - dueDate
        - currency
        - seller
        - buyer
        - lines
        - references
        - notes
        - precedingInvoiceNumber
      type: object
      properties:
        documentType:
          enum:
            - Invoice
            - CreditNote
            - SelfBillingInvoice
            - SelfBillingCreditNote
          type: string
          description: >-
            Document identity. Invoice and CreditNote are standard tax
            documents; the SelfBilling* variants are issued by the buyer on the
            supplier's behalf. On /v1/credit-notes endpoints, CreditNote is
            applied regardless of the value sent.
          example: Invoice
        invoiceNumber:
          type: string
          nullable: true
        issueDate:
          type: string
          format: date
        dueDate:
          type: string
          format: date
          nullable: true
        currency:
          type: string
          nullable: true
        seller:
          $ref: '#/components/schemas/V1Party'
        buyer:
          $ref: '#/components/schemas/V1Party'
        lines:
          type: array
          items:
            $ref: '#/components/schemas/V1InvoiceLine'
        references:
          $ref: '#/components/schemas/V1References'
        notes:
          type: string
          nullable: true
        precedingInvoiceNumber:
          type: string
          nullable: true
        taxTotal:
          $ref: '#/components/schemas/V1TaxTotal'
        legalMonetaryTotal:
          $ref: '#/components/schemas/V1LegalMonetaryTotal'
        allowancesCharges:
          type: array
          items: {}
          default: null
          nullable: true
        additionalDocuments:
          type: array
          items:
            $ref: '#/components/schemas/V1AdditionalDocument'
          default: null
          nullable: true
        delivery:
          $ref: '#/components/schemas/V1Delivery'
        transactionType:
          $ref: '#/components/schemas/V1TransactionType'
        beneficiaryId:
          type: string
          default: null
          nullable: true
        principalId:
          type: string
          default: null
          nullable: true
        billingFrequencyCode:
          type: string
          default: null
          nullable: true
        taxCurrencyCode:
          type: string
          default: null
          nullable: true
        currencyExchangeRate:
          type: number
          format: double
          default: null
          nullable: true
        paymentMode:
          type: string
          description: >-
            Payment means: a UNCL4461 code (e.g. 10 = cash, 20 = cheque, 30 =
            credit transfer, 48 = bank card, 49 = direct debit) or one of the
            aliases "cash", "cheque", "card", "debit". Defaults to 30 (credit
            transfer); without a paymentBankAccount, 30 falls back to 1
            (instrument not defined).
          default: null
          nullable: true
          example: '30'
        paymentTerms:
          type: string
          default: null
          nullable: true
        paymentBankAccount:
          type: string
          default: null
          nullable: true
        vatPointDate:
          type: string
          format: date
          default: null
          nullable: true
        billingPeriodStart:
          type: string
          format: date
          default: null
          nullable: true
        billingPeriodEnd:
          type: string
          format: date
          default: null
          nullable: true
        precedingInvoiceIssueDate:
          type: string
          format: date
          default: null
          nullable: true
        prepaidAmount:
          type: number
          format: double
          default: null
          nullable: true
    V1InvoiceResponse:
      required:
        - id
        - invoiceNumber
        - status
        - participantDelivery
        - createdAt
        - links
      type: object
      properties:
        id:
          type: string
        invoiceNumber:
          type: string
        status:
          enum:
            - Draft
            - Pending
            - Sent
            - DeliveryFailed
            - Received
          type: string
          description: >-
            Document status: Draft (created, not submitted), Pending (queued or
            being delivered over Peppol), Sent (delivered), DeliveryFailed
            (submission failed — see submissionError), Received (inbound
            purchase document).
          example: Draft
        participantDelivery:
          enum:
            - Pending
            - Failed
            - NotApplicable
          type: string
          description: >-
            Peppol delivery indicator: Pending (delivery in flight or awaiting
            confirmation), Failed (delivery failed), NotApplicable (not
            submitted, e.g. a Draft).
          example: NotApplicable
        createdAt:
          type: string
        links:
          $ref: '#/components/schemas/V1Links'
        submissionError:
          type: string
          default: null
          nullable: true
    ProblemPayload:
      required:
        - type
        - title
        - status
      type: object
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
          format: int32
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        traceId:
          type: string
          nullable: true
        errors:
          type: array
          nullable: true
    V1Party:
      required:
        - name
        - trn
        - participantId
        - address
      type: object
      properties:
        name:
          type: string
        trn:
          type: string
          nullable: true
        participantId:
          type: string
          nullable: true
        address:
          $ref: '#/components/schemas/V1Address'
        contactPhone:
          type: string
          default: null
          nullable: true
        contactEmail:
          type: string
          default: null
          nullable: true
        contactName:
          type: string
          default: null
          nullable: true
        legalRegistrationNumber:
          type: string
          default: null
          nullable: true
        legalRegistrationType:
          type: string
          default: null
          nullable: true
        authorityName:
          type: string
          default: null
          nullable: true
    V1InvoiceLine:
      required:
        - id
        - description
        - quantity
        - unitCode
        - unitPrice
        - lineExtensionAmount
        - vatCategory
        - vatRate
      type: object
      properties:
        id:
          type: string
          nullable: true
        description:
          type: string
        quantity:
          type: number
          format: double
        unitCode:
          type: string
          nullable: true
        unitPrice:
          type: number
          format: double
        lineExtensionAmount:
          type: number
          format: double
          nullable: true
        vatCategory:
          enum:
            - S
            - Z
            - E
            - O
            - AE
          type: string
          description: >-
            UAE VAT category code: S = Standard rate (5%), Z = Zero-rated, E =
            Exempt (requires exemptionReasonCode), O = Out of scope, AE =
            Reverse charge (requires goodsNatureCode on the line). Defaults to S
            when omitted.
          nullable: true
          example: S
        vatRate:
          type: number
          format: double
        exemptionReasonCode:
          type: string
          default: null
          nullable: true
        allowancesCharges:
          type: array
          items:
            $ref: '#/components/schemas/V1AllowanceCharge'
          default: null
          nullable: true
        buyersItemId:
          type: string
          default: null
          nullable: true
        sellersItemId:
          type: string
          default: null
          nullable: true
        standardItemId:
          type: string
          default: null
          nullable: true
        standardItemSchemeId:
          type: string
          default: null
          nullable: true
        classifications:
          type: array
          items:
            $ref: '#/components/schemas/V1ItemClassification'
          default: null
          nullable: true
        itemTypeCode:
          enum:
            - G
            - S
            - B
          type: string
          description: >-
            Nature of the line item (BTAE-13): G = Goods, S = Services, B =
            Both. When S or B, serviceAccountingCode is required.
          default: null
          nullable: true
          example: G
        serviceAccountingCode:
          type: string
          default: null
          nullable: true
        goodsNatureCode:
          type: string
          default: null
          nullable: true
    V1References:
      required:
        - purchaseOrderId
        - contractId
      type: object
      properties:
        purchaseOrderId:
          type: string
          nullable: true
        contractId:
          type: string
          nullable: true
        salesOrderId:
          type: string
          default: null
          nullable: true
        projectId:
          type: string
          default: null
          nullable: true
        despatchId:
          type: string
          default: null
          nullable: true
        receiptId:
          type: string
          default: null
          nullable: true
        buyerReference:
          type: string
          default: null
          nullable: true
        purchaseOrderSchemeId:
          type: string
          default: null
          nullable: true
        contractSchemeId:
          type: string
          default: null
          nullable: true
        salesOrderSchemeId:
          type: string
          default: null
          nullable: true
        projectSchemeId:
          type: string
          default: null
          nullable: true
        despatchSchemeId:
          type: string
          default: null
          nullable: true
        receiptSchemeId:
          type: string
          default: null
          nullable: true
      nullable: true
    V1TaxTotal:
      required:
        - taxAmount
      type: object
      properties:
        taxAmount:
          type: number
          format: double
      default: null
      nullable: true
    V1LegalMonetaryTotal:
      required:
        - lineExtensionAmount
        - taxExclusiveAmount
        - taxInclusiveAmount
        - payableAmount
      type: object
      properties:
        lineExtensionAmount:
          type: number
          format: double
        taxExclusiveAmount:
          type: number
          format: double
        taxInclusiveAmount:
          type: number
          format: double
        payableAmount:
          type: number
          format: double
      default: null
      nullable: true
    V1AdditionalDocument:
      required:
        - documentId
      type: object
      properties:
        documentId:
          type: string
        documentTypeCode:
          type: string
          default: null
          nullable: true
        description:
          type: string
          default: null
          nullable: true
        externalUri:
          type: string
          default: null
          nullable: true
        embeddedBase64:
          type: string
          default: null
          nullable: true
        mimeCode:
          type: string
          default: null
          nullable: true
        fileName:
          type: string
          default: null
          nullable: true
    V1Delivery:
      type: object
      properties:
        actualDeliveryDate:
          type: string
          format: date
          default: null
          nullable: true
        streetName:
          type: string
          default: null
          nullable: true
        city:
          type: string
          default: null
          nullable: true
        countrySubentity:
          type: string
          default: null
          nullable: true
        addressLine:
          type: string
          default: null
          nullable: true
        countryCode:
          type: string
          default: null
          nullable: true
        incoterms:
          type: string
          default: null
          nullable: true
      default: null
      nullable: true
    V1TransactionType:
      type: object
      properties:
        freeTradeZone:
          type: boolean
          default: false
        deemedSupply:
          type: boolean
          default: false
        profitMargin:
          type: boolean
          default: false
        summaryInvoice:
          type: boolean
          default: false
        continuousSupply:
          type: boolean
          default: false
        disclosedAgentBilling:
          type: boolean
          default: false
        ecommerce:
          type: boolean
          default: false
        exports:
          type: boolean
          default: false
      default: null
      nullable: true
    V1Links:
      required:
        - self
      type: object
      properties:
        self:
          type: string
    V1Address:
      required:
        - line1
        - city
        - countryCode
      type: object
      properties:
        line1:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        countryCode:
          type: string
          nullable: true
        line2:
          type: string
          default: null
          nullable: true
        countrySubentity:
          type: string
          default: null
          nullable: true
        postalCode:
          type: string
          default: null
          nullable: true
      nullable: true
    V1AllowanceCharge:
      required:
        - isCharge
        - amount
      type: object
      properties:
        isCharge:
          type: boolean
        amount:
          type: number
          format: double
        reasonCode:
          type: string
          default: null
          nullable: true
        reason:
          type: string
          default: null
          nullable: true
        baseAmount:
          type: number
          format: double
          default: null
          nullable: true
        multiplierPercent:
          type: number
          format: double
          default: null
          nullable: true
        vatCategory:
          enum:
            - S
            - Z
            - E
            - O
            - AE
          type: string
          description: >-
            UAE VAT category code: S = Standard rate (5%), Z = Zero-rated, E =
            Exempt (requires exemptionReasonCode), O = Out of scope, AE =
            Reverse charge (requires goodsNatureCode on the line). Defaults to S
            when omitted.
          default: null
          nullable: true
          example: S
        vatRate:
          type: number
          format: double
          default: null
          nullable: true
        exemptionReasonCode:
          type: string
          default: null
          nullable: true
    V1ItemClassification:
      required:
        - code
      type: object
      properties:
        code:
          type: string
        listId:
          type: string
          default: null
          nullable: true
        listVersion:
          type: string
          default: null
          nullable: true
  securitySchemes:
    ApiKey:
      type: apiKey
      description: >-
        Your fat_… integration key. Create one in Settings → Integrations → API
        Keys.
      name: X-Api-Key
      in: header

````