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

# Add invoices



## OpenAPI

````yaml api.yaml POST /v1/invoices
openapi: 3.0.1
info:
  title: ingest/v1/ingest.proto
  version: version not set
  description: API for ingesting billing data into Slicker
servers:
  - url: https://api.slickerhq.com/ingest
security:
  - bearerAuth: []
tags:
  - name: IngestService
    description: Services for ingesting billing data into Slicker
paths:
  /v1/invoices:
    post:
      tags:
        - IngestService
      summary: Ingest invoices into the system
      description: |
        Upload one or more invoices to be processed by Slicker.
        Requires authentication with a valid API key passed as a Bearer token.
        Maximum of 200 invoices per request.
      operationId: IngestService_IngestInvoices
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoicesRequest'
            example:
              invoices:
                - id: inv_12345678
                  state: INVOICE_STATE_PAID
                  customerId: cus_87654321
                  subscriptionId: sub_12345678
                  businessEntity: ACME Inc.
                  amount: 2500
                  currency: USD
                  createdAt: '2023-01-15T10:00:00Z'
                  updatedAt: '2023-01-15T10:30:00Z'
                - id: inv_87654321
                  state: INVOICE_STATE_UNPAID
                  customerId: cus_12345678
                  subscriptionId: sub_87654321
                  businessEntity: ACME Inc.
                  amount: 5000
                  currency: USD
                  createdAt: '2023-01-20T09:00:00Z'
                  updatedAt: '2023-01-20T09:30:00Z'
        required: true
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoicesResponse'
        '400':
          description: Bad Request - The request contains invalid parameters or payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
              example:
                code: 400
                message: 'Invalid invoice data: missing required fields'
                details: []
        '401':
          description: Unauthorized - Authentication credentials are missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
              example:
                code: 401
                message: 'Unauthorized: missing or invalid API key in Bearer token'
                details: []
        '403':
          description: >-
            Forbidden - The authenticated user doesn't have permission to access
            this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
              example:
                code: 403
                message: 'Forbidden: insufficient permissions to ingest invoices'
                details: []
        '429':
          description: Too Many Requests - The rate limit has been exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
              example:
                code: 429
                message: 'Rate limit exceeded: try again later'
                details: []
        '500':
          description: Internal Server Error - An unexpected server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
              example:
                code: 500
                message: Internal server error
                details: []
        default:
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoicesResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    InvoicesRequest:
      type: object
      description: Request to ingest invoice data. Maximum of 200 invoices per request.
      properties:
        invoices:
          type: array
          items:
            $ref: '#/components/schemas/Invoice'
    InvoicesResponse:
      type: object
      properties:
        requestId:
          type: string
          description: Unique identifier for tracking the request through the system
          example: req_2uqkAo1bwllmzrgV2qtGv48DtGI
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    Invoice:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the invoice
          example: inv_12345678
        state:
          $ref: '#/components/schemas/InvoiceState'
          description: Current state of the invoice
          example: INVOICE_STATE_PAID
        customerId:
          type: string
          description: Unique identifier for the customer
          example: cus_87654321
        subscriptionId:
          type: string
          description: Unique identifier for the associated subscription
          example: sub_12345678
        businessEntity:
          type: string
          description: Business entity associated with this record
          example: ACME Inc.
        amount:
          type: integer
          format: int32
          description: Monetary amount in smallest unit (e.g., cents)
          example: 2500
        currency:
          type: string
          description: Three-letter ISO 4217 currency code
          example: USD
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the invoice was created
          example: '2023-01-15T10:00:00Z'
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the invoice was last updated
          example: '2023-01-15T10:30:00Z'
      required:
        - id
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties:
        type: object
    InvoiceState:
      type: string
      default: INVOICE_STATE_UNSPECIFIED
      enum:
        - INVOICE_STATE_UNSPECIFIED
        - INVOICE_STATE_PAID
        - INVOICE_STATE_UNPAID
        - INVOICE_STATE_OVERDUE
        - INVOICE_STATE_CANCELED
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: |
        API key authentication using a Bearer token in the Authorization header.
        Example: `Authorization: Bearer YOUR_API_KEY`

````