{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sellerassistant-app/json-schema/sellerassistant-app-product-profit-schema.json",
  "title": "ProductProfit",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sellerassistant-app-openapi.json#/components/schemas/ProductProfit",
  "required": [
    "currency",
    "calculations",
    "profit",
    "estimate"
  ],
  "properties": {
    "currency": {
      "description": "Currency information",
      "required": [
        "code",
        "symbol"
      ],
      "properties": {
        "code": {
          "description": "Currency code",
          "type": "string"
        },
        "symbol": {
          "description": "Currency symbol",
          "type": "string"
        }
      },
      "type": "object"
    },
    "calculations": {
      "description": "Calculation details",
      "required": [
        "fba",
        "fbm"
      ],
      "properties": {
        "fba": {
          "description": "FBA calculation details",
          "required": [
            "price",
            "cog",
            "referralFee",
            "fbaFee",
            "storageFee",
            "variableClosingFee",
            "fba3pl",
            "profit"
          ],
          "properties": {
            "price": {
              "description": "Selling price. Can be overridden by `overridePrice`.",
              "type": "string",
              "format": "decimal"
            },
            "cog": {
              "description": "Cost of goods",
              "type": "string",
              "format": "decimal"
            },
            "referralFee": {
              "description": "Referral fee",
              "type": "string",
              "format": "decimal"
            },
            "fbaFee": {
              "description": "FBA fee",
              "type": "string",
              "format": "decimal"
            },
            "storageFee": {
              "description": "Storage fee for FBA",
              "type": "string",
              "format": "decimal"
            },
            "variableClosingFee": {
              "description": "Variable closing fee",
              "type": "string",
              "format": "decimal"
            },
            "fba3pl": {
              "description": "Third-party logistics expenses for FBA",
              "type": "string",
              "format": "decimal"
            },
            "profit": {
              "description": "Profit for FBA, also represented as `profit.fba.amount` for summary purposes. Calculated as: `= price - cog - referralFee - fbaFee - storageFee - variableClosingFee - fba3pl`.",
              "type": "string",
              "format": "decimal"
            }
          },
          "type": "object"
        },
        "fbm": {
          "description": "FBM calculation details",
          "required": [
            "price",
            "cog",
            "referralFee",
            "variableClosingFee",
            "fbm3pl",
            "profit"
          ],
          "properties": {
            "price": {
              "description": "Selling price. Can be overridden by `overridePrice`.",
              "type": "string",
              "format": "decimal"
            },
            "cog": {
              "description": "Cost of goods",
              "type": "string",
              "format": "decimal"
            },
            "referralFee": {
              "description": "Referral fee",
              "type": "string",
              "format": "decimal"
            },
            "variableClosingFee": {
              "description": "Variable closing fee",
              "type": "string",
              "format": "decimal"
            },
            "fbm3pl": {
              "description": "Third-party logistics expenses for FBM",
              "type": "string",
              "format": "decimal"
            },
            "profit": {
              "description": "Profit for FBM, also represented as `profit.fbm.amount` for summary purposes. Calculated as: `= price - cog - referralFee - variableClosingFee - fbm3pl`.",
              "type": "string",
              "format": "decimal"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "profit": {
      "description": "Profit details",
      "required": [
        "fba",
        "fbm"
      ],
      "properties": {
        "fba": {
          "description": "FBA profit details",
          "required": [
            "amount",
            "breakEven",
            "roi10",
            "roi20",
            "roi",
            "margin"
          ],
          "properties": {
            "amount": {
              "description": "Profit amount for FBA. The value is the same as `calculations.fba.profit`.",
              "type": "string",
              "format": "decimal"
            },
            "breakEven": {
              "description": "Break-even details for FBA",
              "required": [
                "price",
                "profit"
              ],
              "properties": {
                "price": {
                  "description": "Price at which total revenue equals total costs for FBA",
                  "type": "string",
                  "format": "decimal"
                },
                "profit": {
                  "description": "Break-even profit for FBA (always 0, as break-even means no profit and ROI is 0%)",
                  "type": "string",
                  "format": "decimal"
                }
              },
              "type": "object"
            },
            "roi10": {
              "description": "ROI 10% details for FBA",
              "required": [
                "price",
                "profit"
              ],
              "properties": {
                "price": {
                  "description": "Price to achieve a 10% ROI for FBA",
                  "type": "string",
                  "format": "decimal"
                },
                "profit": {
                  "description": "Profit at 10% ROI for FBA",
                  "type": "string",
                  "format": "decimal"
                }
              },
              "type": "object"
            },
            "roi20": {
              "description": "ROI 20% details for FBA",
              "required": [
                "price",
                "profit"
              ],
              "properties": {
                "price": {
                  "description": "Price to achieve a 20% ROI for FBA",
                  "type": "string",
                  "format": "decimal"
                },
                "profit": {
                  "description": "Profit at 20% ROI for FBA",
                  "type": "string",
                  "format": "decimal"
                }
              },
              "type": "object"
            },
            "roi": {
              "description": "Return on investment for FBA is calculated as: ` = (fba.profit / (cog + fba3pl)) x 100`",
              "type": "number",
              "format": "float"
            },
            "margin": {
              "description": "Profit margin for FBA is calculated as: ` = (fba.profit / price) x 100`",
              "type": "number",
              "format": "float"
            }
          },
          "type": "object"
        },
        "fbm": {
          "description": "FBM profit details",
          "required": [
            "amount",
            "breakEven",
            "roi10",
            "roi20",
            "roi",
            "margin"
          ],
          "properties": {
            "amount": {
              "description": "Profit amount for FBM. The value is the same as `calculations.fbm.profit`.",
              "type": "string",
              "format": "decimal"
            },
            "breakEven": {
              "description": "Break-even details for FBM",
              "required": [
                "price",
                "profit"
              ],
              "properties": {
                "price": {
                  "description": "Price at which total revenue equals total costs for FBM",
                  "type": "string",
                  "format": "decimal"
                },
                "profit": {
                  "description": "Break-even profit for FBM (always 0, as break-even means no profit and ROI is 0%)",
                  "type": "string",
                  "format": "decimal"
                }
              },
              "type": "object"
            },
            "roi10": {
              "description": "ROI 10% details for FBM",
              "required": [
                "price",
                "profit"
              ],
              "properties": {
                "price": {
                  "description": "Price to achieve a 10% ROI for FBM",
                  "type": "string",
                  "format": "decimal"
                },
                "profit": {
                  "description": "Profit at 10% ROI for FBM",
                  "type": "string",
                  "format": "decimal"
                }
              },
              "type": "object"
            },
            "roi20": {
              "description": "ROI 20% details for FBM",
              "required": [
                "price",
                "profit"
              ],
              "properties": {
                "price": {
                  "description": "Price to achieve a 20% ROI for FBM",
                  "type": "string",
                  "format": "decimal"
                },
                "profit": {
                  "description": "Profit at 20% ROI for FBM",
                  "type": "string",
                  "format": "decimal"
                }
              },
              "type": "object"
            },
            "roi": {
              "description": "Return on investment for FBM is calculated as: ` = (fbm.profit / (cog + fbm3pl)) x 100`.",
              "type": "number",
              "format": "float"
            },
            "margin": {
              "description": "Profit margin for FBM is calculated as: ` = (fbm.profit / price) x 100`",
              "type": "number",
              "format": "float"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "estimate": {
      "description": "Estimate details",
      "required": [
        "sales",
        "revenue"
      ],
      "properties": {
        "sales": {
          "description": "Estimated sales (pieces per month)",
          "type": "integer"
        },
        "revenue": {
          "description": "Estimated revenue is calculated as: ` = sales x price` (per month).",
          "type": "string",
          "format": "decimal"
        }
      },
      "type": "object"
    },
    "cogSteps": {
      "description": "How the cost of one listing comes from `cog`: `listingCost` = `unitCost` x `packageQuantity`.",
      "required": [
        "enteredCost",
        "priceType",
        "unitCost",
        "packageQuantity",
        "packageQuantitySource",
        "listingCost"
      ],
      "properties": {
        "enteredCost": {
          "description": "The `cog` of the request.",
          "type": "string",
          "format": "decimal"
        },
        "priceType": {
          "description": "The unit of `enteredCost`.",
          "type": "string",
          "enum": [
            "each",
            "case"
          ]
        },
        "caseQuantity": {
          "description": "The items in one case. Null for `each`.",
          "type": [
            "integer",
            "null"
          ]
        },
        "unitCost": {
          "description": "The cost of one item, with 4 decimals.",
          "type": "string",
          "format": "decimal"
        },
        "packageQuantity": {
          "description": "The package quantity (PQ) that the calculation used.",
          "type": "integer"
        },
        "packageQuantitySource": {
          "description": "Where the PQ came from. `not_applied`: the request has no `priceType`, `caseQuantity` or `packageQuantity`, so the calculation used PQ 1 as before. `productsDbPackageQuantity` and `amazonPackageQuantity` then show the PQ of the product.",
          "type": "string",
          "enum": [
            "request",
            "products_db",
            "amazon",
            "default",
            "not_applied"
          ]
        },
        "productsDbPackageQuantity": {
          "description": "The PQ in your Products DB. Null when the product is not in it.",
          "type": [
            "integer",
            "null"
          ]
        },
        "amazonPackageQuantity": {
          "description": "The PQ in the Amazon catalog. Null when Amazon does not give it.",
          "type": [
            "integer",
            "null"
          ]
        },
        "listingCost": {
          "description": "The cost of one listing. `calculations.fba.cog` and `calculations.fbm.cog` show the same value.",
          "type": "string",
          "format": "decimal"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}