{
  "openapi": "3.0.1",
  "info": {
    "title": "Refund Hunter: UPS & FedEx Late Delivery Refund Finder",
    "description": "Audits your UPS and FedEx invoices for guaranteed-service late deliveries, duplicate charges, labels billed but never shipped, and wrong residential fees. Outputs a ready-to-file claim list with deadlines.",
    "version": "0.0",
    "x-build-id": "5ZJQEAahx8hnxiJWY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/the100~refund-hunter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-the100-refund-hunter",
        "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/the100~refund-hunter/runs": {
      "post": {
        "operationId": "runs-sync-the100-refund-hunter",
        "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/the100~refund-hunter/run-sync": {
      "post": {
        "operationId": "run-sync-the100-refund-hunter",
        "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",
        "properties": {
          "invoiceUrls": {
            "title": "Invoice / shipping report CSV URLs",
            "type": "array",
            "description": "Direct links to CSV exports from UPS Billing Center, FedEx Billing Online, or your shipping software (ShipStation, Shippo, etc.). One row per package or one row per charge line both work. Leave empty (or tick 'Try with sample data') for a free demo.",
            "items": {
              "type": "string"
            }
          },
          "useSampleData": {
            "title": "Try with sample data (free)",
            "type": "boolean",
            "description": "Runs on bundled sample UPS + FedEx invoices so you can see the report. Never charged. Also used automatically when no invoice data is given.",
            "default": false
          },
          "invoiceCsv": {
            "title": "...or paste CSV here",
            "type": "string",
            "description": "Paste CSV text directly instead of a URL."
          },
          "upsClientId": {
            "title": "UPS API Client ID",
            "type": "string",
            "description": "From your free app at developer.ups.com (Tracking API enabled)."
          },
          "upsClientSecret": {
            "title": "UPS API Client Secret",
            "type": "string",
            "description": "Stored encrypted. Used only to read tracking."
          },
          "fedexClientId": {
            "title": "FedEx API Key",
            "type": "string",
            "description": "From your free project at developer.fedex.com (Track API)."
          },
          "fedexClientSecret": {
            "title": "FedEx Secret Key",
            "type": "string",
            "description": "Stored encrypted. Used only to read tracking."
          },
          "fetchTracking": {
            "title": "Look up tracking when the invoice lacks delivery times",
            "type": "boolean",
            "description": "Fills in guaranteed and actual delivery times when the CSV doesn't have them.",
            "default": true
          },
          "includeBillingErrors": {
            "title": "Also check billing errors",
            "type": "boolean",
            "description": "Duplicate charges, labels billed but never shipped, residential fees on business addresses.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (only new claims)",
            "type": "boolean",
            "description": "For scheduled daily runs: skip claims already reported on earlier runs.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor state key",
            "type": "string",
            "description": "Use a different key per shipping account if you monitor several.",
            "default": "default"
          },
          "fedexPaysByCard": {
            "title": "FedEx account pays by credit card / in advance",
            "type": "boolean",
            "description": "FedEx then counts the 15-day claim window from the ship date instead of the invoice date.",
            "default": false
          },
          "minClaimAmount": {
            "title": "Minimum claim amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum claim amount (USD)",
            "default": 0
          },
          "includeExpired": {
            "title": "Show missed (expired) claims",
            "type": "boolean",
            "description": "Lists refunds whose deadline already passed so you can see what you lost. Never charged.",
            "default": true
          },
          "defaultCarrier": {
            "title": "Default carrier",
            "enum": [
              "",
              "UPS",
              "FEDEX"
            ],
            "type": "string",
            "description": "Used only when the CSV has no carrier column and the tracking number format is ambiguous.",
            "default": ""
          },
          "extraEligibleServices": {
            "title": "Extra guaranteed services",
            "type": "array",
            "description": "Add service names covered by your negotiated contract guarantee.",
            "items": {
              "type": "string"
            }
          },
          "auditDate": {
            "title": "Audit as of date (YYYY-MM-DD)",
            "type": "string",
            "description": "Leave empty for today. Used to compute days left."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}