{
  "openapi": "3.0.1",
  "info": {
    "title": "Cost Sheet Generator",
    "description": "Cloud-native version of the Art Pro Sublimation desktop cost sheet tool. Provide image URLs, set your rate, and get back a branded Excel invoice — ready to download and print on A4.",
    "version": "0.0",
    "x-build-id": "QfOpP2D0Ig8EDpNeC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/moving_beacon-owner1~my-actor-75/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-moving_beacon-owner1-my-actor-75",
        "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/moving_beacon-owner1~my-actor-75/runs": {
      "post": {
        "operationId": "runs-sync-moving_beacon-owner1-my-actor-75",
        "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/moving_beacon-owner1~my-actor-75/run-sync": {
      "post": {
        "operationId": "run-sync-moving_beacon-owner1-my-actor-75",
        "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": [
          "images",
          "rate"
        ],
        "properties": {
          "images": {
            "title": "Images",
            "type": "array",
            "description": "Print-ready images to include on the cost sheet. Each item needs a 'url' and an optional 'filename' override. Filenames should follow the convention {number}{separator}{quantity} {description}.ext — e.g. '1-2 Banner Design.jpg' means line #1, print 2 copies, description 'Banner Design'. The actor parses this format to extract quantity and description automatically.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "title": "Image URL",
                  "description": "Direct download URL of the image file (JPEG, PNG, etc.)."
                },
                "filename": {
                  "type": "string",
                  "title": "Filename Override",
                  "description": "Override the filename used for parsing. Must follow the convention '{n}-{qty} {description}.ext' for auto-detection of quantity and description."
                }
              },
              "required": [
                "url"
              ]
            }
          },
          "rate": {
            "title": "Rate (PKR per sqft)",
            "minimum": 1,
            "type": "integer",
            "description": "Price per square foot, in the chosen Currency. Multiplied by each image's computed sqft (and quantity) to produce the line total.",
            "default": 35
          },
          "lengthOverride": {
            "title": "Width Override (inches)",
            "minimum": 0,
            "type": "integer",
            "description": "Force every image to this width in inches instead of reading width from image DPI metadata. Set to 0 to auto-detect per image.",
            "default": 0
          },
          "heightOverride": {
            "title": "Height Override (inches)",
            "minimum": 0,
            "type": "integer",
            "description": "Force every image to this height in inches instead of reading height from image DPI metadata. Set to 0 to auto-detect per image.",
            "default": 0
          },
          "defaultDpi": {
            "title": "Default DPI",
            "minimum": 1,
            "maximum": 1200,
            "type": "integer",
            "description": "Fallback resolution used when an image's metadata doesn't include DPI. 72 is screen-default, 150 is decent print, 300 is high-quality print.",
            "default": 72
          },
          "currency": {
            "title": "Currency",
            "enum": [
              "PKR",
              "USD",
              "EUR",
              "GBP",
              "AED",
              "SAR"
            ],
            "type": "string",
            "description": "Currency symbol displayed on the cost sheet. Note: this is cosmetic — it does not convert the Rate value.",
            "default": "PKR"
          },
          "taxRate": {
            "title": "Tax Rate (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Tax percentage applied to the post-discount subtotal. Set to 0 for no tax.",
            "default": 0
          },
          "discountPercent": {
            "title": "Discount (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Flat discount percentage applied to the subtotal before tax is calculated.",
            "default": 0
          },
          "invoiceNo": {
            "title": "Invoice Number",
            "type": "string",
            "description": "Reference number printed at the top of the invoice. Examples: 'INV-2026-0042', 'AP-1001'.",
            "default": ""
          },
          "invoiceDate": {
            "title": "Invoice Date",
            "pattern": "^\\s*$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Date printed on the invoice, in YYYY-MM-DD format. Leave empty to use today's date automatically.",
            "default": ""
          },
          "dueDate": {
            "title": "Due Date",
            "pattern": "^\\s*$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Payment due date in YYYY-MM-DD format. Leave empty to omit the due-date line entirely.",
            "default": ""
          },
          "customerName": {
            "title": "Customer Name",
            "type": "string",
            "description": "Customer's full name or company name, shown in the 'Bill To' section.",
            "default": ""
          },
          "customerPhone": {
            "title": "Customer Phone",
            "type": "string",
            "description": "Customer contact number printed on the invoice. Leave empty to omit.",
            "default": ""
          },
          "customerAddress": {
            "title": "Customer Address",
            "type": "string",
            "description": "Multi-line customer address printed on the invoice. Leave empty to omit.",
            "default": ""
          },
          "folderName": {
            "title": "Folder / Order Name",
            "type": "string",
            "description": "Order or folder label printed on the invoice — useful when one customer has multiple jobs in flight.",
            "default": ""
          },
          "designer": {
            "title": "Designer",
            "type": "string",
            "description": "Name of the designer or operator who handled the job. Printed for internal tracking.",
            "default": ""
          },
          "comments": {
            "title": "Comments",
            "type": "string",
            "description": "Free-text notes printed on the invoice — terms, special instructions, thank-you message, etc.",
            "default": ""
          },
          "printType": {
            "title": "Print Type",
            "type": "string",
            "description": "Type of print job. Examples: 'CHINA', 'NORMAL', 'FLU' (fluorescent), or any custom label.",
            "default": "CHINA/NORMAL/FLU"
          },
          "paperStock": {
            "title": "Paper / Material",
            "type": "string",
            "description": "Paper stock or material used. Examples: '170gsm Matte', 'Vinyl', 'Canvas', 'PVC Banner'.",
            "default": ""
          },
          "finishing": {
            "title": "Finishing Options",
            "type": "string",
            "description": "Finishing details printed on the invoice. Examples: 'Lamination', 'Mounting', 'Eyelets every 50cm', 'Hemming + ropes'.",
            "default": ""
          },
          "logoUrl": {
            "title": "Logo Image URL",
            "pattern": "^\\s*$|^https?://.+",
            "type": "string",
            "description": "Direct URL to a logo image (JPEG or PNG) embedded in the invoice header. Leave empty for a text-only header.",
            "default": ""
          },
          "companyName": {
            "title": "Company Name",
            "type": "string",
            "description": "Your business name shown prominently in the invoice header.",
            "default": "Art Pro"
          },
          "companyTagline": {
            "title": "Company Tagline",
            "type": "string",
            "description": "Short tagline or slogan shown under the company name. Examples: 'Quality Print Solutions', 'Since 1998'.",
            "default": ""
          },
          "companyContact": {
            "title": "Company Contact Info",
            "type": "string",
            "description": "One-line contact block in the header — typically phone, email, or address. Examples: '+92-300-1234567 | info@artpro.pk'.",
            "default": ""
          },
          "outputFilename": {
            "title": "Output Filename",
            "pattern": "^[^\\\\/:*?\"<>|]+$",
            "type": "string",
            "description": "Name of the generated file. Include the extension (.xlsx or .pdf) — when Output Format is 'Both', the extension is replaced as needed for each version.",
            "default": "cost_sheet.xlsx"
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "xlsx",
              "pdf",
              "both"
            ],
            "type": "string",
            "description": "File format(s) to generate. Excel is editable and good for internal use; PDF is locked-down and best for sending to customers.",
            "default": "xlsx"
          },
          "includeThumbnails": {
            "title": "Include Thumbnails",
            "type": "boolean",
            "description": "Embed a small preview of each image in its row on the cost sheet. Helps the customer match line items to artwork.",
            "default": true
          },
          "thumbnailMaxHeight": {
            "title": "Thumbnail Max Height (px)",
            "minimum": 30,
            "maximum": 300,
            "type": "integer",
            "description": "Maximum height of embedded thumbnails in pixels. Width scales proportionally to preserve aspect ratio. Only used when Include Thumbnails is on.",
            "default": 80
          },
          "roundUpDimensions": {
            "title": "Round Up Dimensions",
            "type": "boolean",
            "description": "Round each computed dimension up to the nearest whole inch before calculating area. Useful when print stock is sold by whole inches and you want billing to match.",
            "default": false
          },
          "minimumSqft": {
            "title": "Minimum Billable Sqft",
            "minimum": 0,
            "type": "number",
            "description": "Floor for billable area per line item — anything smaller is charged at this minimum. Set to 0 for no minimum.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Apify Proxy settings for downloading remote images. Useful when image hosts are slow, geo-restricted, or rate-limit by IP.",
            "default": {
              "useApifyProxy": false
            }
          },
          "requestTimeoutSecs": {
            "title": "Image Download Timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "How long to wait for each image to download before giving up on it. Increase for large images or slow hosts.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}