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

# Upload Invoice

> Upload an invoice document for an order.




## OpenAPI

````yaml /openapi/scx/channel.json post /v1/channel/order/invoice
openapi: 3.0.2
info:
  title: JTL-Channel API
  version: 1.0.0
  x-logo:
    url: https://scx-sandbox.ui.jtl-software.com/docs/scx.png
  description: >
    JTL-Channel API is a REST-based API that helps a Channel Integrator to
    connect Marketplace with the JTL-Wawi 

    ERP System.


    # Key Features


    With the JTL-Channel API, you can:

      * Describe connected Marketplace Data Structure by providing Category and Attribute Data
      * Manage Product and Offer Listings
      * Manage Orders 
      * Handle the Post Order Process

    # Development Guide


    There is a detailed development guide available at
    [developer.jtl-software.com](https://developer.jtl-software.com/products/marketplaces/scx-channel-api/change_log).
servers:
  - url: https://scx-sbx.api.jtl-software.com
    description: Sandbox
  - url: https://scx.api.jtl-software.com
    description: Production
security: []
tags:
  - name: Seller
    description: |
      Seller Management
  - name: Channel
    description: Meta channel routes
  - name: Notification
    description: Channel notifications
  - name: Supported Prices
    description: Price type management
  - name: Meta
    description: meta
  - name: Attributes
    description: Channel attributes
  - name: Categories
    description: Channel categories
  - name: Order
    description: Orders
  - name: Return
    description: Order returns
  - name: Events
    description: SCX events
  - name: Offer
    description: Channel offers
  - name: Report
    description: SCX reports
  - name: Ticket
    description: Channel tickets
  - name: Stock Updates
    description: Stock update operations
paths:
  /v1/channel/order/invoice:
    post:
      tags:
        - Order
      summary: Upload Invoice
      description: |
        Upload an invoice document for an order.
      operationId: UploadInvoice
      requestBody:
        $ref: '#/components/requestBodies/Invoice'
      responses:
        '201':
          description: Invoice received
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - SellerAuth: []
components:
  requestBodies:
    Invoice:
      description: >-
        Invoice metadata together with the binary PDF document for a marketplace
        order.
      content:
        multipart/x-www-form-urlencoded:
          schema:
            $ref: '#/components/schemas/InvoiceUpload'
          encoding:
            document:
              contentType: application/pdf
              explode: false
              allowReserved: true
  responses:
    AccessForbidden:
      description: Access forbidden, invalid or unknown Token was used.
    ResourceNotFound:
      description: Requested resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseList'
          example:
            errorList:
              - code: GEN404
                message: Not found
                severity: error
                hint: null
    ServerError:
      description: Unexpected Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseList'
          example:
            errorList:
              - code: GEN500
                message: Internal Server Error
                severity: error
                hint: null
  schemas:
    InvoiceUpload:
      description: >-
        Multipart payload combining invoice metadata with the binary PDF
        document for upload.
      type: object
      required:
        - invoice
        - document
      properties:
        invoice:
          $ref: '#/components/schemas/InvoiceMetaData'
        document:
          description: >-
            The Invoice document as binary data must be type of PDF and have a
            maximum size of 16 MB.
          type: string
          format: binary
    ErrorResponseList:
      type: object
      properties:
        errorList:
          nullable: true
          type: array
          example:
            - code: GEN700
              message: Seller SELLER_4711 does not exist on channel kaufland.
              severity: error
              hint: i9n-order22
          items:
            title: Error
            type: object
            properties:
              code:
                type: string
                example: GEN700
              message:
                type: string
                example: Seller SELLER_4711 does not exist on channel kaufland.
              severity:
                type: string
                enum:
                  - error
                  - warning
                  - info
                default: error
              hint:
                type: string
                nullable: true
                example: i9n-order22
    InvoiceMetaData:
      type: object
      required:
        - type
        - sellerId
        - orderId
        - invoiceNumber
        - billingAddress
        - currency
        - transactionDate
        - taxCalculationDate
      properties:
        type:
          $ref: '#/components/schemas/InvoiceDocumentType'
        sellerId:
          $ref: '#/components/schemas/SellerId'
        orderId:
          $ref: '#/components/schemas/ChannelOrderId'
        invoiceNumber:
          type: string
          minLength: 1
          maxLength: 256
        originalInvoiceNumber:
          type: string
          nullable: true
          description: |
            A original Invoice Number is required when type is CREDITNOTE
        transactionDate:
          type: string
          format: date-time
          description: |
            Date when the Invoice document was issued.
        taxCalculationDate:
          type: string
          format: date-time
          description: |
            Date when the tax in the Invoice document was calculated.
        transactionDetails:
          type: string
          nullable: true
        shipmentDate:
          type: string
          format: date-time
        taxAddressRole:
          type: string
          enum:
            - shipFrom
            - shipTo
        exportOutsideEu:
          type: boolean
        currency:
          type: string
        billingAddress:
          $ref: '#/components/schemas/Address'
        sellerVatNumber:
          type: string
          nullable: true
        buyerVatNumber:
          type: string
          nullable: true
        orderList:
          type: array
          minItems: 1
          description: >
            List of orders that are part of the invoice document. There must be
            at least one order on a document.  If the invoice document type is
            INVOICE, the shipping address is required and can not be empty or
            null.
          items:
            $ref: '#/components/schemas/OrderInvoice'
    InvoiceDocumentType:
      type: string
      enum:
        - INVOICE
        - CREDITNOTE
      default: INVOICE
    SellerId:
      description: >
        A unique Id identify a Seller on a specific SalesChannel. The SellerId
        is generated

        from the Channel itself during the Seller SignUp Process.
      type: string
      example: '4711'
      pattern: ^\w{1,50}$
    ChannelOrderId:
      type: string
      minLength: 1
      maxLength: 150
      example: 43523-43432-43532
    Address:
      type: object
      required:
        - lastName
        - street
        - city
        - country
      properties:
        firstName:
          type: string
          example: Arno
        lastName:
          type: string
          example: Nym
        gender:
          type: string
          enum:
            - male
            - female
            - diverse
        companyName:
          type: string
        street:
          type: string
          example: Leyboldstrasse
        houseNumber:
          type: string
          example: 14a
        addition:
          type: string
          example: 1. UG
        postcode:
          type: string
          example: '50354'
        city:
          type: string
          example: Hürth
        phone:
          type: string
          example: +49 0221 123456
        country:
          type: string
          example: DE
        state:
          type: string
          example: NRW
          nullable: true
    OrderInvoice:
      type: object
      required:
        - orderId
        - purchasedAt
      properties:
        orderId:
          $ref: '#/components/schemas/ChannelOrderId'
        purchasedAt:
          type: string
          format: date-time
        shippingAddress:
          $ref: '#/components/schemas/Address'
        transactionItemList:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/OrderInvoiceTransactionItem'
    OrderInvoiceTransactionItem:
      type: object
      required:
        - orderItemId
        - orderItemType
        - totalGrossPriceWithDiscounts
        - totalNetPriceWithDiscounts
        - totalVatAmountWithDiscounts
        - vatRate
      properties:
        orderItemId:
          type: string
        orderItemType:
          type: string
          enum:
            - ITEM
            - SHIPPING
            - PAYMENT
        sku:
          type: string
        title:
          type: string
        quantity:
          type: number
          format: float
          minimum: 0
          default: 1
        totalGrossPriceWithDiscounts:
          type: number
          minimum: 0
          format: float
        totalNetPriceWithDiscounts:
          type: number
          minimum: 0
          format: float
        totalVatAmountWithDiscounts:
          type: number
          minimum: 0
          format: float
        vatRate:
          type: number
          minimum: 0
          format: float
        discounts:
          type: array
          minItems: 0
          nullable: true
          items:
            $ref: '#/components/schemas/OrderInvoiceTransactionItemDiscounts'
    OrderInvoiceTransactionItemDiscounts:
      type: object
      required:
        - totalGrossPrice
        - totalNetPrice
        - totalVatAmount
      properties:
        name:
          description: Discount name
          type: string
          nullable: true
          example: 10% Winter Sale
        discountId:
          description: Channel Related Discount ID
          type: string
          nullable: true
          example: D1265327
        totalGrossPrice:
          type: number
          format: float
          minimum: 0
          default: 0
        totalNetPrice:
          type: number
          format: float
          minimum: 0
          default: 0
        totalVatAmount:
          type: number
          format: float
          minimum: 0
          default: 0
        vatRate:
          type: number
          format: float
          minimum: 0
          default: 0
  securitySchemes:
    SellerAuth:
      description: >
        Bearer JWT issued to a seller after they sign up for a JTL-Scx
        subscription via the JTL

        Customer Center. Usage format: `Bearer <JWT>`.
      type: http
      scheme: bearer
      bearerFormat: JWT

````