{
 "openapi": "3.1.0",
 "info": {
  "title": "Fliprofit reseller fee API",
  "version": "1.0.0",
  "description": "Free, read-only fee and profit calculations for US resale marketplaces, using the same engine as https://www.fliprofit.com. No key needed. Rates last checked 2026-10-24. Not tax advice; link the calculator page when citing.",
  "contact": {
   "name": "Fliprofit",
   "url": "https://www.fliprofit.com/contact",
   "email": "hello@fliprofit.com"
  }
 },
 "servers": [
  {
   "url": "https://www.fliprofit.com"
  }
 ],
 "paths": {
  "/api/v1/fees": {
   "get": {
    "operationId": "listPlatforms",
    "summary": "List supported platforms, their options and categories",
    "responses": {
     "200": {
      "description": "Platform list"
     }
    }
   }
  },
  "/api/v1/fees/{platform}": {
   "get": {
    "operationId": "calculateFees",
    "summary": "Fees, payout and profit for one sale on one platform",
    "parameters": [
     {
      "name": "platform",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "ebay",
        "poshmark",
        "mercari",
        "whatnot",
        "depop",
        "etsy",
        "facebook",
        "amazon",
        "grailed",
        "reverb",
        "tcgplayer",
        "tiktok"
       ]
      }
     },
     {
      "name": "price",
      "required": true,
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "Sale price in USD"
     },
     {
      "name": "shipCharged",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "Shipping the buyer paid you, USD"
     },
     {
      "name": "taxRate",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "Buyer sales tax %, e.g. 8 (used where the platform charges fees on tax)"
     },
     {
      "name": "itemCost",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "What you paid for the item, USD"
     },
     {
      "name": "shipCost",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "Your label/postage cost, USD"
     },
     {
      "name": "otherCost",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "Packaging, promotion and other costs, USD"
     },
     {
      "name": "category",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "adRate",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "tier",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "highValue",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "boost",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "ownLabel",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "offsiteAds",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "mode",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "plan",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "fbaFee",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "grailedLabel",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "processing",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "preferred",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     },
     {
      "name": "sellerType",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "Platform-specific option; see /api/v1/fees for allowed values"
     }
    ],
    "responses": {
     "200": {
      "description": "Fee breakdown",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Result"
        }
       }
      }
     },
     "404": {
      "description": "Unknown platform"
     }
    }
   }
  },
  "/api/v1/compare": {
   "get": {
    "operationId": "comparePlatforms",
    "summary": "One sale on every platform, ranked by profit (default options)",
    "parameters": [
     {
      "name": "price",
      "required": true,
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "Sale price in USD"
     },
     {
      "name": "shipCharged",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "Shipping the buyer paid you, USD"
     },
     {
      "name": "taxRate",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "Buyer sales tax %, e.g. 8 (used where the platform charges fees on tax)"
     },
     {
      "name": "itemCost",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "What you paid for the item, USD"
     },
     {
      "name": "shipCost",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "Your label/postage cost, USD"
     },
     {
      "name": "otherCost",
      "in": "query",
      "schema": {
       "type": "number",
       "minimum": 0
      },
      "description": "Packaging, promotion and other costs, USD"
     }
    ],
    "responses": {
     "200": {
      "description": "Ranked list"
     },
     "400": {
      "description": "price missing"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Result": {
    "type": "object",
    "properties": {
     "platform": {
      "type": "string"
     },
     "fees": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "label": {
         "type": "string"
        },
        "amount": {
         "type": "number"
        }
       }
      }
     },
     "totalFees": {
      "type": "number"
     },
     "gross": {
      "type": "number"
     },
     "payout": {
      "type": "number"
     },
     "profit": {
      "type": "number"
     },
     "margin": {
      "type": [
       "number",
       "null"
      ]
     },
     "roi": {
      "type": [
       "number",
       "null"
      ]
     },
     "calculator": {
      "type": "string"
     },
     "officialSource": {
      "type": "string"
     },
     "lastChecked": {
      "type": "string"
     }
    }
   }
  }
 }
}