{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Shop Fee Calculator: Seller Fees, Profit & Margin",
    "description": "Paste TikTok Shop product links or enter price and category to calculate seller fees and profit, e.g. a phone case or serum. About $0.008 per link or $0.002 per manual product. Referral fee, affiliate commission, shipping, profit, margin, ROI and break-even. No login.",
    "version": "1.0",
    "x-build-id": "aYJtIIDZEjKtuYT7i"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/moggedhq~tiktok-shop-fee-calculator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-moggedhq-tiktok-shop-fee-calculator",
        "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/moggedhq~tiktok-shop-fee-calculator/runs": {
      "post": {
        "operationId": "runs-sync-moggedhq-tiktok-shop-fee-calculator",
        "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/moggedhq~tiktok-shop-fee-calculator/run-sync": {
      "post": {
        "operationId": "run-sync-moggedhq-tiktok-shop-fee-calculator",
        "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": {
          "urls": {
            "title": "TikTok Shop US product links",
            "type": "array",
            "description": "Paste full US TikTok Shop /pdp/ links. $0.008 per successful product. Reads the public default SKU, price, category, sold count and shop. A sku_id query parameter selects a specific SKU. Failures and duplicates are free.",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "title": "Manual products (optional)",
            "type": "array",
            "description": "$0.002 per product. Enter objects with name or id, price, category, cost, shipping and affiliateRate, e.g. [{\"name\":\"Phone case\",\"price\":19.99,\"category\":\"phone case\",\"cost\":6,\"shipping\":4,\"affiliateRate\":15}]. Per-item values override shared inputs. Price excludes buyer shipping and tax. Use saleVolume for projected totals; one row and one charge per scenario, not per unit sold."
          },
          "costPerUnit": {
            "title": "Your product cost per unit (USD)",
            "type": "number",
            "description": "Required for URL calculations unless costPerUnitByItem has that product ID. Enter 0 only for a deliberately free product. Manual items may use cost or costPerUnit. Cost must match the selected product variant."
          },
          "costPerUnitByItem": {
            "title": "Cost per product ID or manual item ID",
            "type": "object",
            "description": "Optional map overriding the shared cost, e.g. {\"1729389546229108745\":2,\"phone-case\":6}. Use the numeric product ID from the URL or an item id/name."
          },
          "shippingCostPerUnit": {
            "title": "Your shipping cost per sale (USD)",
            "type": "number",
            "description": "Seller-paid postage and delivery cost. Default 0. This is an expense, separate from customerShippingPerUnit. For FBT use fbtCostPerUnit instead unless these are distinct costs.",
            "default": 0
          },
          "affiliateCommissionRate": {
            "title": "Affiliate commission (%)",
            "type": "number",
            "description": "Enter 15 for 15%, not 0.15. Default 0. Applied to the buyer-paid product price, excluding shipping, tax and platform-funded discount reimbursement. 0 to 100 with at most two decimals.",
            "default": 0
          },
          "customerShippingPerUnit": {
            "title": "Shipping paid by customer (USD)",
            "type": "number",
            "description": "Revenue paid by the buyer for shipping. Added to revenue and the referral-fee base. Default 0.",
            "default": 0
          },
          "platformDiscountPerUnit": {
            "title": "Platform-funded discount reimbursed to you (USD)",
            "type": "number",
            "description": "Add only a confirmed TikTok-funded product discount, where price is the buyer-paid product amount after that discount. Added back to revenue and referral base, not affiliate base. Do not add a seller-funded discount. Default 0.",
            "default": 0
          },
          "fbtCostPerUnit": {
            "title": "FBT fulfillment cost per sale (USD)",
            "type": "number",
            "description": "Your known Fulfilled by TikTok cost per unit. This Actor does not estimate an FBT rate from weight. Default 0; entered in addition to shippingCostPerUnit.",
            "default": 0
          },
          "otherCostsPerUnit": {
            "title": "Other costs per sale (USD)",
            "type": "number",
            "description": "Optional advertising, packaging, storage, expected returns or other per-sale expenses. Default 0.",
            "default": 0
          },
          "saleVolume": {
            "title": "Expected number of sales",
            "type": "integer",
            "description": "Optional sales volume for projected revenue and profit. Default 1. Does not multiply Actor charges or change the per-sale fee threshold.",
            "default": 1
          },
          "referralFeeRateOverride": {
            "title": "Your confirmed promotional referral rate (%)",
            "type": "number",
            "description": "Optional. Enter only a confirmed seller-specific/new-seller/LIVE promotional rate. Replaces the standard category schedule and disables its $10,000 tier. Eligibility, campaign dates and seller-wide limits are not inferred."
          },
          "referralFeeCapPerUnit": {
            "title": "Confirmed referral fee cap per sale (USD)",
            "type": "number",
            "description": "Optional cap on the calculated referral fee for this one sale, only with referralFeeRateOverride. Not a campaign-wide savings cap or weekly GMV limit."
          },
          "marketplace": {
            "title": "Marketplace",
            "type": "string",
            "description": "US only; all prices and costs are USD. Other marketplaces produce a free note.",
            "default": "US"
          },
          "startUrls": {
            "title": "Product URL objects (optional alias)",
            "type": "array",
            "description": "Alternative agent input: [{\"url\":\"https://shop.tiktok.com/us/pdp/.../product-id\"}]. Same behavior as urls."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}