{
 "openapi": "3.1.0",
 "info": {
  "title": "Invoice Capture (Supply Chain)",
  "version": "20261030b",
  "description": "An invoice however it arrived — scanned, emailed, EDI or keyed. Capture finds the supplier and the order, and flags a duplicate before it becomes a double payment."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "invoice-captures": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "capture_no": {
      "type": "string",
      "description": "Capture no",
      "readOnly": true
     },
     "source": {
      "type": "string",
      "description": "Source",
      "readOnly": true
     },
     "file_name": {
      "type": "string",
      "description": "File name",
      "readOnly": true
     },
     "content_hash": {
      "type": "string",
      "description": "Content hash",
      "readOnly": true
     },
     "provider": {
      "type": "string",
      "description": "Provider",
      "readOnly": true
     },
     "model": {
      "type": "string",
      "description": "Model",
      "readOnly": true
     },
     "extraction": {
      "type": "object",
      "description": "Extraction",
      "readOnly": true
     },
     "confidence": {
      "type": "string",
      "format": "decimal",
      "description": "Confidence",
      "readOnly": true
     },
     "supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplier"
     },
     "supplier_name_raw": {
      "type": "string",
      "description": "Supplier name raw",
      "readOnly": true
     },
     "invoice_no": {
      "type": "string",
      "description": "Invoice number"
     },
     "invoice_date": {
      "type": "string",
      "format": "date",
      "description": "Invoice date"
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "description": "Due date"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "subtotal": {
      "type": "string",
      "format": "decimal",
      "description": "Subtotal"
     },
     "tax": {
      "type": "string",
      "format": "decimal",
      "description": "Tax"
     },
     "total": {
      "type": "string",
      "format": "decimal",
      "description": "Total"
     },
     "po_reference": {
      "type": "string",
      "description": "Order quoted"
     },
     "po_id": {
      "type": "string",
      "format": "uuid",
      "description": "Order"
     },
     "ap_invoice_id": {
      "type": "string",
      "format": "uuid",
      "description": "Ap invoice id",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "exceptions": {
      "type": "object",
      "description": "Exceptions",
      "readOnly": true
     },
     "reviewed_by": {
      "type": "string",
      "format": "uuid",
      "description": "Reviewed by",
      "readOnly": true
     },
     "reviewed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Reviewed at",
      "readOnly": true
     },
     "captured_at": {
      "type": "string",
      "format": "date-time",
      "description": "Captured at",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/scm/invoice-captures": {
   "get": {
    "summary": "list invoice-captures",
    "operationId": "list_invoice_captures_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create invoice-captures",
    "operationId": "create_invoice_captures_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/invoice-captures/{id}": {
   "get": {
    "summary": "get invoice-captures",
    "operationId": "get_invoice_captures_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change invoice-captures",
    "operationId": "change_invoice_captures_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete invoice-captures",
    "operationId": "delete_invoice_captures_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/invoice-captures/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_invoice_captures_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/invoice-captures/capture": {
   "post": {
    "summary": "Capture",
    "operationId": "action_invoice_captures_0_5",
    "description": "Body keys: source, fileName, supplierName, invoiceNo*, invoiceDate, dueDate, currency, subtotal, tax, total, poReference, lines, confidence; source one of upload|email|scan|edi|portal|api",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/invoice-captures/{id}/match": {
   "post": {
    "summary": "Match",
    "operationId": "action_invoice_captures_0_6",
    "description": "Body keys: priceTolerancePct, quantityTolerancePct",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/invoice-captures/{id}/post": {
   "post": {
    "summary": "Post",
    "operationId": "action_invoice_captures_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}