---
title: "Create egress invoice"
method: POST
path: "/invoices/egress"
tags: ["Invoices"]
---

# Create egress invoice

`POST /invoices/egress`

Create a new egress invoice (expense/credit note) with CFDI 4.0 compliance.

**gigstack Connect:** Create invoices for other teams using the `team` parameter.

## Query parameters

- `team` string

## Request body

- InvoiceEgressInput
  - `automation_type` 'none' — Payment automation type: - `none`: No automation, create invoice only
  - `client_id` string, nullable — Optional client ID, if provided will use this client instead of creating/searching
  - `client` object, required
    - `id` string
    - `search` object
      - `on_key` string
      - `on_value` string
      - `auto_create` boolean
    - `address` ClientAddress, nullable
      - `country` string, nullable
      - `street` string, nullable
      - `zip` string, nullable
      - `city` string, nullable
      - `state` string, nullable
      - `exterior` string, nullable
      - `interior` string, nullable
      - `municipality` string, nullable
      - `neighborhood` string, nullable
    - `name` string, nullable
    - `company` string, nullable
    - `phone` string, nullable
    - `email` string, email, nullable
    - `bcc` string[]
    - `metadata` object
    - `legal_name` string, nullable
    - `tax_id` string, nullable
    - `use` string, nullable
    - `tax_system` string, nullable
  - `complements` object[]
    - `type` string
    - `data` string
  - `currency` string, required
  - `exchange_rate` number, nullable — Exchange rate for currency conversion. If not provided, the latest rate from our rates collection will be used automatically.
  - `folio_number` number
  - `series` string
  - `idempotency_key` string, nullable — Optional idempotency key to prevent duplicate invoices
  - `items` object[], required
    - `id` string
    - `search` object
      - `on_key` string
      - `on_value` string
      - `auto_create` boolean
    - `description` string, nullable
    - `sku` string, nullable
    - `product_key` string, nullable
    - `unit_key` string, nullable
    - `unit_name` string, nullable
    - `unit_price` number, nullable
    - `taxes` TaxSchema[]
      - `base` union — Taxable base amount. Accepts number or numeric string. If null, calculated automatically from item price.
        - number
        - string
      - `factor` string, nullable
      - `inclusive` boolean, nullable
      - `rate` number, nullable
      - `type` 'IVA' | 'ISR' | 'IEPS', nullable
      - `withholding` boolean, nullable
    - `taxability` '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08'
    - `third_party` object
      - `tax_system` string
      - `legal_name` string
      - `zip` string
      - `tax_id` string
  - `use` string, required
  - `related_documents` object[]
    - `relationship` string
    - `documents` string[]
  - `global` object
    - `periodicity` string
    - `months` string
    - `year` integer
  - `exports` '01' | '02' | '03' | '04'
  - `payment_form` string, required
  - `invoice_pdf_notes` string
  - `addenda` string
  - `return_files` boolean — Return base64 encoded PDF and XML files in response
  - `metadata` object
  - `date` number — Unix timestamp for invoice date
  - `send_emails` boolean
  - `emails` string[]

## Response `200`

Invoice created successfully

- object
  - `message` string
  - `data` ApiPublicIncomeInvoice
    - `uuid` string — Invoice UUID
    - `client` ApiPublicClient
      - `id` string, required — Unique client identifier
      - `address` ClientAddress, nullable
        - `country` string, nullable
        - `street` string, nullable
        - `zip` string, nullable
        - `city` string, nullable
        - `state` string, nullable
        - `exterior` string, nullable
        - `interior` string, nullable
        - `municipality` string, nullable
        - `neighborhood` string, nullable
      - `name` string, nullable — Client name
      - `company` string, nullable — Client company name
      - `phone` string, nullable — Client phone number
      - `email` string, email, nullable, required — Client email address
      - `bcc` string[], nullable — BCC email addresses for client communications
      - `metadata` object, nullable — Additional metadata for the client
      - `is_valid` boolean, nullable — Whether the client data is valid
      - `from` string, required — Source of client creation
      - `legal_name` string, nullable — Legal name for tax purposes
      - `livemode` boolean, required — Whether this client is in live mode
      - `owner` string, required — User ID who owns this client
      - `tax_id` string, nullable — RFC (Tax ID) for Mexican tax compliance
      - `use` string, nullable — CFDI use code
      - `tax_system` string, nullable — SAT tax system code
      - `team` string, required — Team ID this client belongs to
      - `created_at` number, required — Unix timestamp of client creation
      - `efos` object, nullable — EFOS (SAT blacklist) validation status
        - `is_valid` boolean, nullable — Whether the client is valid according to SAT EFOS list
      - `defaults` object, nullable — Client default settings
        - `keep_full_legal_name` boolean, nullable — Keep full legal name in documents
        - `issue_automatic_invoices` boolean, nullable — Issue automatic invoices
        - `issue_invoiceable_receipts` boolean, nullable — Issue invoiceable receipts
    - `created_at` number — Invoice creation timestamp
    - `currency` string — Invoice currency
    - `exchange_rate` number — Exchange rate used
    - `total` number — Total invoice amount
    - `subtotal` number — Subtotal before taxes
    - `taxes` number — Total tax amount
    - `discount` number — Total discount amount
    - `withholding_taxes` number — Total withholding tax amount
    - `series` string — Invoice series
    - `folio_number` number — Invoice folio number
    - `invoice_type` 'I' | 'E' | 'P' | 'N' — Invoice type (I=Income, E=Egress, P=Payment, N=Nomina)
    - `use` string — Mexican SAT usage code
    - `payment_form` string — Mexican SAT payment form code
    - `payment_method` string — Payment method (PUE/PPD)
    - `status` 'draft' | 'pending' | 'stamped' | 'cancelled' — Invoice status
    - `livemode` boolean — Whether this is a live invoice
    - `owner` string — User who created the invoice
    - `from` string — Source of invoice creation
    - `items` object[]
      - `id` string
      - `description` string
      - `product_key` string
      - `quantity` number
      - `unit_price` number
      - `unit_key` string
      - `unit_name` string
      - `sku` string
      - `taxability` '01' | '02'
      - `taxes` TaxSchema[]
        - `base` union — Taxable base amount. Accepts number or numeric string. If null, calculated automatically from item price.
          - number
          - string
        - `factor` string, nullable
        - `inclusive` boolean, nullable
        - `rate` number, nullable
        - `type` 'IVA' | 'ISR' | 'IEPS', nullable
        - `withholding` boolean, nullable
    - `payments` string[] — Associated payment IDs
    - `invoices` string[] — Related invoice IDs
    - `stamp` object, nullable
      - `sello` string
      - `stamp_at` number
    - `cancellation` object, nullable
      - `cancellation_status` string
      - `cancelled_at` number
      - `motive` string
      - `code` string
    - `verification_url` string — SAT verification URL
    - `exports` string — Export indicator
    - `addenda` string — Additional XML addenda
    - `invoice_pdf_notes` string — Custom notes for PDF generation
    - `files` object, nullable — Base64 encoded files (only returned when return_files=true)
      - `pdf` string — Base64 encoded PDF file
      - `xml` string — Base64 encoded XML file

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal Server Error

---

[API](https://skmtc.net/disruptive-learning/apis/gigstack-api-v2.md) · [All operations](https://skmtc.net/disruptive-learning/apis/gigstack-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/disruptive-learning/gigstack-api-v2/versions/5cf53ffd7580/schema)
