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

# Get an invoice

> One invoice with its lines.

Requires the `invoices:read` scope.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/invoices/{id}
openapi: 3.1.0
info:
  title: BrandGate API
  version: 1.0.0
  description: >-
    Read orders, products, stock, customers and invoices, acknowledge orders and
    set stock from your ERP. Authenticate with an organization API key or an
    OAuth access token as `Authorization: Bearer <token>`.
servers:
  - url: https://api.brandgate.dev
security:
  - apiKey: []
  - oauth2: []
tags:
  - name: orders
    description: Orders placed by resellers.
  - name: products
    description: The product catalogue.
  - name: inventory
    description: Stock levels per SKU.
  - name: customers
    description: Resellers buying from the organization.
  - name: invoices
    description: Invoices sent to resellers.
  - name: webhook_endpoints
    description: Where BrandGate sends events.
paths:
  /v1/invoices/{id}:
    get:
      tags:
        - invoices
      summary: Get an invoice
      description: |-
        One invoice with its lines.

        Requires the `invoices:read` scope.
      operationId: invoicesGet
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Success.
          headers:
            Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  object:
                    const: invoice
                  number:
                    type: string
                    maxLength: 100
                  status:
                    type: string
                    enum:
                      - pending
                      - paid
                      - overdue
                      - credited
                  invoice_date:
                    type: string
                    pattern: ^\d{4}-\d{2}-\d{2}$
                  due_date:
                    type:
                      - string
                      - 'null'
                    pattern: ^\d{4}-\d{2}-\d{2}$
                  paid_date:
                    type:
                      - string
                      - 'null'
                    pattern: ^\d{4}-\d{2}-\d{2}$
                  currency:
                    type: string
                    maxLength: 3
                  total:
                    type: string
                    pattern: ^-?\d{1,15}(\.\d{1,6})?$
                  vat:
                    type: string
                    pattern: ^-?\d{1,15}(\.\d{1,6})?$
                  ocr_reference:
                    type:
                      - string
                      - 'null'
                    maxLength: 100
                  order_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                  customer_id:
                    type: string
                    format: uuid
                  lines:
                    type: array
                    items:
                      type: object
                      properties:
                        product_name:
                          type: string
                          maxLength: 500
                        sku:
                          type:
                            - string
                            - 'null'
                          maxLength: 200
                        quantity:
                          type: string
                          pattern: ^-?\d{1,15}(\.\d{1,6})?$
                        unit_price:
                          type: string
                          pattern: ^-?\d{1,15}(\.\d{1,6})?$
                        vat_rate:
                          type: string
                          pattern: ^-?\d{1,15}(\.\d{1,6})?$
                        line_total:
                          type: string
                          pattern: ^-?\d{1,15}(\.\d{1,6})?$
                      required:
                        - product_name
                        - sku
                        - quantity
                        - unit_price
                        - vat_rate
                        - line_total
                      additionalProperties: false
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
                required:
                  - id
                  - object
                  - number
                  - status
                  - invoice_date
                  - due_date
                  - paid_date
                  - currency
                  - total
                  - vat
                  - ocr_reference
                  - order_id
                  - customer_id
                  - lines
                  - created_at
                  - updated_at
                additionalProperties: false
        '400':
          description: The request is invalid. `error.message` says which field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, unknown, expired or revoked credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The credentials lack the scope this operation needs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found in your organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limited. Wait until `X-RateLimit-Reset` (or `Retry-After`
            seconds).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
        - oauth2:
            - invoices:read
components:
  headers:
    RequestId:
      description: Quote this when contacting support.
      schema:
        type: string
        format: uuid
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An organization API key (`bg_live_…`), created in BrandGate under
        Settings → Developers.
    oauth2:
      type: oauth2
      description: >-
        For partner apps acting for many organizations. Authorization code with
        PKCE (S256).
      flows:
        authorizationCode:
          authorizationUrl: https://api.brandgate.dev/oauth/authorize
          tokenUrl: https://api.brandgate.dev/oauth/token
          refreshUrl: https://api.brandgate.dev/oauth/token
          scopes:
            orders:read: Read orders and their lines
            orders:write: Acknowledge orders with the ERP's own order number
            products:read: Read products and prices
            inventory:read: Read stock levels
            inventory:write: Update stock levels by SKU
            customers:read: Read customers (resellers), including contact details
            invoices:read: Read invoices
            webhooks:read: List webhook endpoints
            webhooks:write: Create and delete webhook endpoints

````

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