{
  "openapi": "3.0.1",
  "info": {
    "title": "InvoiceFoundry",
    "description": "InvoiceFoundry turns your client, line item, and branding details into polished PDF invoices in seconds. It automates taxes and currencies, embeds QR codes for instant payment, and streams structured data to your CRM or BI tools so every invoice stays consistent and audit ready.",
    "version": "0.0",
    "x-build-id": "a1UeQub6EadHdQnGZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/krffl-llc~invoice-generator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-krffl-llc-invoice-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/krffl-llc~invoice-generator/runs": {
      "post": {
        "operationId": "runs-sync-krffl-llc-invoice-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/krffl-llc~invoice-generator/run-sync": {
      "post": {
        "operationId": "run-sync-krffl-llc-invoice-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "action"
        ],
        "properties": {
          "action": {
            "title": "Action",
            "enum": [
              "GENERATE",
              "UPDATE_STATUS",
              "PROCESS_PASTDUE",
              "UPSERT_DEFAULTS"
            ],
            "type": "string",
            "description": "Controls what the Actor does. Use GENERATE to create invoices or UPDATE_STATUS to update existing invoices.",
            "default": "GENERATE"
          },
          "statusUpdates": {
            "title": "Status Updates",
            "type": "array",
            "description": "Provide status transitions when action is UPDATE_STATUS.",
            "items": {
              "type": "object",
              "properties": {
                "invoiceNumber": {
                  "title": "Invoice Number",
                  "type": "string",
                  "description": "Target invoice number to update."
                },
                "status": {
                  "title": "New Status",
                  "type": "string",
                  "description": "One of draft, sent, viewed, partial_payment, paid, overdue, cancelled.",
                  "enum": [
                    "draft",
                    "sent",
                    "viewed",
                    "partial_payment",
                    "paid",
                    "overdue",
                    "cancelled"
                  ]
                },
                "note": {
                  "title": "Note",
                  "type": "string",
                  "description": "Optional reason or context for the status change."
                },
                "amountPaid": {
                  "title": "Amount Paid",
                  "type": "string",
                  "editor": "textfield",
                  "description": "Amount received so far when syncing payments (numeric value)."
                },
                "paymentReference": {
                  "title": "Payment Reference",
                  "type": "string",
                  "description": "Reference or transaction ID related to the payment."
                },
                "updatedAt": {
                  "title": "Updated At",
                  "type": "string",
                  "description": "ISO timestamp when the status was updated. Defaults to the Actor runtime."
                }
              },
              "required": [
                "invoiceNumber",
                "status"
              ]
            },
            "default": []
          },
          "invoices": {
            "title": "Invoices",
            "type": "array",
            "description": "Array of invoice objects to generate. Can contain one or multiple invoices for batch processing.",
            "default": [
              {
                "invoiceNumber": "INV-2025-001",
                "issueDate": "2025-01-15",
                "dueDate": "2025-02-15",
                "currency": "USD",
                "seller": {
                  "name": "Your Company Name",
                  "address": "123 Business St",
                  "city": "New York",
                  "state": "NY",
                  "zipCode": "10001",
                  "country": "USA",
                  "email": "billing@company.com",
                  "phone": "+1-555-0123"
                },
                "buyer": {
                  "name": "Client Company",
                  "address": "456 Client Ave",
                  "city": "Los Angeles",
                  "state": "CA",
                  "zipCode": "90001",
                  "country": "USA"
                },
                "items": [
                  {
                    "description": "Web Development Services",
                    "quantity": 40,
                    "unitPrice": 150,
                    "taxRate": 0.1
                  }
                ],
                "notes": "Payment due within 30 days. Thank you for your business!",
                "terms": "Net 30",
                "status": "SENT",
                "customFields": {
                  "PO Number": "PO-12345",
                  "Project Code": "PROJ-001"
                }
              }
            ]
          },
          "numberingScheme": {
            "title": "Invoice Numbering Scheme",
            "type": "string",
            "description": "Pattern for auto-generating invoice numbers. Use placeholders: {YYYY}, {MM}, {DD}, {####}, {SEQ}, {CLIENT}, {PREFIX}. Example: 'INV-{YYYY}-{MM}-{####}'",
            "default": "INV-{YYYY}-{MM}-{####}"
          },
          "allowDuplicates": {
            "title": "Allow Duplicate Invoice Numbers",
            "type": "boolean",
            "description": "If false, will error on duplicate invoice numbers",
            "default": false
          },
          "output": {
            "title": "Output Formats",
            "type": "object",
            "description": "Select which formats to generate for each invoice.",
            "properties": {
              "pdf": {
                "title": "Generate PDF",
                "type": "boolean",
                "editor": "checkbox",
                "description": "Tick to create PDF invoices."
              },
              "html": {
                "title": "Generate HTML",
                "type": "boolean",
                "editor": "checkbox",
                "description": "Tick to create HTML versions of each invoice."
              },
              "json": {
                "title": "Generate JSON",
                "type": "boolean",
                "editor": "checkbox",
                "description": "Tick to create JSON payloads for each invoice."
              }
            },
            "default": {
              "pdf": true,
              "html": false,
              "json": false
            }
          },
          "template": {
            "title": "Template Settings",
            "type": "object",
            "description": "Customization options for invoice appearance",
            "properties": {
              "layout": {
                "title": "Layout Style",
                "type": "string",
                "description": "Invoice layout style",
                "editor": "select",
                "enum": [
                  "standard",
                  "modern",
                  "minimal"
                ]
              },
              "primaryColor": {
                "title": "Primary Color",
                "type": "string",
                "description": "Primary color for invoice header and accents (hex format)",
                "editor": "textfield"
              },
              "secondaryColor": {
                "title": "Secondary Color",
                "type": "string",
                "description": "Secondary color for text and borders (hex format)",
                "editor": "textfield"
              },
              "logoUrl": {
                "title": "Logo URL",
                "type": "string",
                "description": "URL to company logo image (optional). For best results use a transparent PNG up to ~600px wide and ~200px tall.",
                "editor": "textfield"
              },
              "fontFamily": {
                "title": "Font Family",
                "type": "string",
                "description": "Font family for invoice text",
                "editor": "select",
                "enum": [
                  "Helvetica",
                  "Times-Roman",
                  "Courier"
                ]
              },
              "qrCode": {
                "title": "QR Code Settings",
                "type": "object",
                "editor": "json",
                "description": "QR code configuration",
                "properties": {
                  "enabled": {
                    "title": "Enable QR Code",
                    "type": "boolean",
                    "description": "Enable QR code on invoice",
                    "editor": "checkbox"
                  },
                  "content": {
                    "title": "QR Content",
                    "type": "string",
                    "description": "QR code content type",
                    "editor": "select",
                    "enum": [
                      "invoiceNumber",
                      "paymentLink",
                      "invoiceUrl"
                    ]
                  },
                  "paymentLink": {
                    "title": "Payment Link",
                    "type": "string",
                    "description": "Payment link URL (if content is 'paymentLink')",
                    "editor": "textfield"
                  }
                }
              }
            },
            "default": {
              "layout": "standard",
              "primaryColor": "#2563eb",
              "secondaryColor": "#64748b",
              "fontFamily": "Helvetica"
            }
          },
          "defaults": {
            "title": "Defaults",
            "type": "object",
            "description": "Optional defaults to upsert when action is UPSERT_DEFAULTS. These values will be merged with future runs.",
            "properties": {
              "seller": {
                "title": "Default Seller",
                "type": "object",
                "description": "Seller details to reuse across runs.",
                "properties": {
                  "name": {
                    "title": "Seller Name",
                    "type": "string",
                    "description": "Legal or trading name."
                  },
                  "address": {
                    "title": "Seller Address",
                    "type": "string",
                    "description": "Seller address."
                  },
                  "city": {
                    "title": "Seller City",
                    "type": "string",
                    "description": "Seller city."
                  },
                  "state": {
                    "title": "Seller State/Region",
                    "type": "string",
                    "description": "Seller state/region."
                  },
                  "zipCode": {
                    "title": "Seller Postal Code",
                    "type": "string",
                    "description": "Seller postal code."
                  },
                  "country": {
                    "title": "Seller Country",
                    "type": "string",
                    "description": "Seller country."
                  },
                  "email": {
                    "title": "Seller Email",
                    "type": "string",
                    "description": "Seller email address."
                  },
                  "phone": {
                    "title": "Seller Phone",
                    "type": "string",
                    "description": "Seller phone number."
                  }
                }
              },
              "template": {
                "title": "Default Template",
                "type": "object",
                "description": "Reusable template overrides (layout, colours, logo URL, etc.).",
                "properties": {
                  "layout": {
                    "title": "Layout",
                    "type": "string",
                    "description": "Layout style for invoices."
                  },
                  "primaryColor": {
                    "title": "Primary Colour",
                    "type": "string",
                    "description": "Primary color for invoice header and accents (hex format)."
                  },
                  "secondaryColor": {
                    "title": "Secondary Colour",
                    "type": "string",
                    "description": "Secondary color for text and borders (hex format)."
                  },
                  "logoUrl": {
                    "title": "Logo URL",
                    "type": "string",
                    "description": "URL to company logo image (optional). For best results use a transparent PNG up to ~600px wide and ~200px tall."
                  },
                  "fontFamily": {
                    "title": "Font Family",
                    "type": "string",
                    "description": "Font family for invoice text."
                  }
                }
              }
            },
            "default": {
              "seller": {
                "name": "Your Company Name",
                "address": "123 Business St",
                "city": "New York",
                "state": "NY",
                "zipCode": "10001",
                "country": "USA",
                "email": "billing@company.com",
                "phone": "+1-555-0123"
              },
              "template": {
                "layout": "standard",
                "primaryColor": "#2563eb",
                "secondaryColor": "#64748b",
                "logoUrl": "",
                "fontFamily": "Helvetica"
              }
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}