{
  "openapi": "3.1.0",
  "info": {
    "title": "Maker Numbers Etsy profit API",
    "version": "1.0.0",
    "summary": "Estimate what an Etsy order leaves after fees, materials, shipping and time.",
    "description": "Free, anonymous and unauthenticated. No account, no key, no request body is stored or logged. Estimate for planning, not a reproduction of Etsy's ledger. Etsy rates vary by country and by order, and this is not tax, accounting or legal advice. Maker Numbers is not affiliated with Etsy, Inc.",
    "license": {
      "name": "Free to use",
      "url": "https://makernumbers.com/terms"
    },
    "contact": {
      "url": "https://makernumbers.com/api-docs"
    }
  },
  "servers": [
    {
      "url": "https://makernumbers.com"
    }
  ],
  "externalDocs": {
    "url": "https://makernumbers.com/methodology",
    "description": "Every formula and its source."
  },
  "security": [],
  "paths": {
    "/api/calculate": {
      "get": {
        "operationId": "calculateEtsyProfitByQuery",
        "summary": "Calculate the profit of one Etsy order",
        "description": "Same fields as the POST body. The two nested objects are sent as dotted keys — `batch.unitsProduced=40`, `fees.transactionRate=0.065`. The response is a pure function of the query and the fee table, so it is cacheable.",
        "parameters": [
          {
            "name": "itemPrice",
            "in": "query",
            "required": true,
            "description": "Price of one item before any discount.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Price of one item before any discount."
            }
          },
          {
            "name": "quantity",
            "in": "query",
            "required": false,
            "description": "How many of the item the order contains.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 999,
              "default": 1,
              "description": "How many of the item the order contains."
            }
          },
          {
            "name": "discount",
            "in": "query",
            "required": false,
            "description": "Shop discount applied to the item subtotal.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Shop discount applied to the item subtotal."
            }
          },
          {
            "name": "shippingCharged",
            "in": "query",
            "required": false,
            "description": "Shipping the buyer paid.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Shipping the buyer paid."
            }
          },
          {
            "name": "giftWrapCharged",
            "in": "query",
            "required": false,
            "description": "Gift wrap the buyer paid.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Gift wrap the buyer paid."
            }
          },
          {
            "name": "salesTaxCollected",
            "in": "query",
            "required": false,
            "description": "Sales tax collected. Not revenue, but part of the payment processing base.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Sales tax collected. Not revenue, but part of the payment processing base."
            }
          },
          {
            "name": "materialsPerItem",
            "in": "query",
            "required": false,
            "description": "Materials consumed by one item.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Materials consumed by one item."
            }
          },
          {
            "name": "packagingPerItem",
            "in": "query",
            "required": false,
            "description": "Packaging used by one item.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Packaging used by one item."
            }
          },
          {
            "name": "otherPerItem",
            "in": "query",
            "required": false,
            "description": "Any other per-item cost.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Any other per-item cost."
            }
          },
          {
            "name": "orderPackaging",
            "in": "query",
            "required": false,
            "description": "Packaging used once per order, never multiplied by quantity.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Packaging used once per order, never multiplied by quantity."
            }
          },
          {
            "name": "shippingPaid",
            "in": "query",
            "required": false,
            "description": "Shipping label the seller paid for.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Shipping label the seller paid for."
            }
          },
          {
            "name": "otherOrderCost",
            "in": "query",
            "required": false,
            "description": "Any other per-order cost.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Any other per-order cost."
            }
          },
          {
            "name": "laborMinutesPerItem",
            "in": "query",
            "required": false,
            "description": "Minutes of the seller's own work per item.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Minutes of the seller's own work per item."
            }
          },
          {
            "name": "targetHourlyPay",
            "in": "query",
            "required": false,
            "description": "What the seller's hour is priced at. Default 20.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "What the seller's hour is priced at. Default 20."
            }
          },
          {
            "name": "etsyAdsCost",
            "in": "query",
            "required": false,
            "description": "Etsy Ads budget attributed to this order.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Etsy Ads budget attributed to this order."
            }
          },
          {
            "name": "customFee",
            "in": "query",
            "required": false,
            "description": "Any additional flat fee to include.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Any additional flat fee to include."
            }
          },
          {
            "name": "targetMarginRate",
            "in": "query",
            "required": false,
            "description": "Target true profit margin as a fraction, used to solve for a price.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 1,
              "default": 0.2,
              "description": "Target true profit margin as a fraction, used to solve for a price."
            }
          },
          {
            "name": "desiredProfit",
            "in": "query",
            "required": false,
            "description": "Optional absolute profit target for the suggested price.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "description": "Optional absolute profit target for the suggested price."
            }
          },
          {
            "name": "offsiteAds",
            "in": "query",
            "required": false,
            "description": "Offsite Ads rate: 'off', 'under_10k' (Etsy's higher rate below $10,000 of sales in 365 days), 'over_10k', or a fraction for a custom rate.",
            "schema": {
              "default": "off",
              "description": "Offsite Ads rate: 'off', 'under_10k' (Etsy's higher rate below $10,000 of sales in 365 days), 'over_10k', or a fraction for a custom rate.",
              "oneOf": [
                {
                  "type": "string",
                  "enum": [
                    "off",
                    "under_10k",
                    "over_10k"
                  ]
                },
                {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              ]
            }
          },
          {
            "name": "currencyConversion",
            "in": "query",
            "required": false,
            "description": "Whether the order was converted from another currency.",
            "schema": {
              "type": "boolean",
              "default": false,
              "description": "Whether the order was converted from another currency."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The calculation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "units",
                    "rates",
                    "fees",
                    "kpis"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "units": {
                      "const": "USD"
                    },
                    "rates": {
                      "type": "object",
                      "description": "The fee table the calculation used, the date it was verified against Etsy's published pages, and those pages. Quote the date with any figure you cite.",
                      "properties": {
                        "market": {
                          "const": "US"
                        },
                        "currency": {
                          "const": "USD"
                        },
                        "verifiedOn": {
                          "type": "string",
                          "format": "date"
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uri"
                          }
                        },
                        "applied": {
                          "type": "object"
                        }
                      }
                    },
                    "input": {
                      "type": "object",
                      "description": "The normalised input, echoed back."
                    },
                    "revenue": {
                      "type": "object",
                      "properties": {
                        "itemSubtotal": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "discount": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "discountedItemSubtotal": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "shippingCharged": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "giftWrapCharged": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "salesTaxCollected": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "sellerRevenueBeforeFees": {
                          "type": "number",
                          "description": "US dollars."
                        }
                      }
                    },
                    "fees": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "lines": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string",
                                "enum": [
                                  "listing",
                                  "transaction",
                                  "payment_processing",
                                  "offsite_ads",
                                  "currency_conversion",
                                  "etsy_ads",
                                  "regulatory",
                                  "custom"
                                ]
                              },
                              "amount": {
                                "type": "number",
                                "description": "US dollars."
                              },
                              "base": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "The amount the rate was applied to. Null for a flat fee."
                              },
                              "rate": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Fraction, e.g. 0.065."
                              },
                              "fixed": {
                                "type": "number",
                                "description": "US dollars."
                              },
                              "perUnit": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "units": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "cap": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "capApplied": {
                                "type": "boolean"
                              }
                            }
                          }
                        }
                      }
                    },
                    "costs": {
                      "type": "object",
                      "properties": {
                        "materials": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "packaging": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "shipping": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "other": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "totalExcludingLabor": {
                          "type": "number",
                          "description": "US dollars."
                        }
                      }
                    },
                    "labor": {
                      "type": "object",
                      "properties": {
                        "totalHours": {
                          "type": "number"
                        },
                        "targetHourlyPay": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "targetLaborCost": {
                          "type": "number",
                          "description": "US dollars."
                        }
                      }
                    },
                    "kpis": {
                      "type": "object",
                      "properties": {
                        "cashLeftBeforeLabor": {
                          "type": "number",
                          "description": "Revenue minus fees and non-labour costs. Before paying yourself."
                        },
                        "trueBusinessProfit": {
                          "type": "number",
                          "description": "Cash left after the seller's own time is paid at the target rate."
                        },
                        "trueProfitMarginRate": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "effectiveHourlyPay": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "What the order actually paid per hour. Null when no time was entered."
                        },
                        "suggestedPrice": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "found",
                                "target_margin_too_high",
                                "unreachable"
                              ]
                            },
                            "price": {
                              "type": "number",
                              "description": "US dollars."
                            },
                            "achievedMarginRate": {
                              "type": "number"
                            },
                            "achievedProfit": {
                              "type": "number",
                              "description": "US dollars."
                            }
                          }
                        }
                      }
                    },
                    "breakdown": {
                      "type": "array",
                      "description": "Every line of the order, signed, in display order.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "revenue",
                              "fee",
                              "cost",
                              "labor",
                              "total"
                            ]
                          },
                          "amount": {
                            "type": "number",
                            "description": "US dollars."
                          },
                          "sign": {
                            "type": "integer",
                            "enum": [
                              -1,
                              0,
                              1
                            ]
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string",
                            "enum": [
                              "critical",
                              "caution",
                              "info"
                            ]
                          }
                        }
                      }
                    },
                    "disclaimer": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "One or more fields were unusable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string",
                            "description": "Dotted path into the request."
                          },
                          "code": {
                            "type": "string",
                            "description": "Stable machine-readable reason."
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry after the seconds in Retry-After."
          }
        }
      },
      "post": {
        "operationId": "calculateEtsyProfit",
        "summary": "Calculate the profit of one Etsy order",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "itemPrice"
                ],
                "description": "One Etsy order. Every money value is US dollars. Omitted fields default to 0, except quantity (1), targetHourlyPay (20) and targetMarginRate (0.2).",
                "properties": {
                  "itemPrice": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Price of one item before any discount."
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 999,
                    "default": 1,
                    "description": "How many of the item the order contains."
                  },
                  "discount": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Shop discount applied to the item subtotal."
                  },
                  "shippingCharged": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Shipping the buyer paid."
                  },
                  "giftWrapCharged": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Gift wrap the buyer paid."
                  },
                  "salesTaxCollected": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Sales tax collected. Not revenue, but part of the payment processing base."
                  },
                  "materialsPerItem": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Materials consumed by one item."
                  },
                  "packagingPerItem": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Packaging used by one item."
                  },
                  "otherPerItem": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Any other per-item cost."
                  },
                  "orderPackaging": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Packaging used once per order, never multiplied by quantity."
                  },
                  "shippingPaid": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Shipping label the seller paid for."
                  },
                  "otherOrderCost": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Any other per-order cost."
                  },
                  "laborMinutesPerItem": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Minutes of the seller's own work per item."
                  },
                  "targetHourlyPay": {
                    "type": "number",
                    "minimum": 0,
                    "description": "What the seller's hour is priced at. Default 20."
                  },
                  "etsyAdsCost": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Etsy Ads budget attributed to this order."
                  },
                  "customFee": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Any additional flat fee to include."
                  },
                  "targetMarginRate": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1,
                    "default": 0.2,
                    "description": "Target true profit margin as a fraction, used to solve for a price."
                  },
                  "desiredProfit": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Optional absolute profit target for the suggested price."
                  },
                  "offsiteAds": {
                    "default": "off",
                    "description": "Offsite Ads rate: 'off', 'under_10k' (Etsy's higher rate below $10,000 of sales in 365 days), 'over_10k', or a fraction for a custom rate.",
                    "oneOf": [
                      {
                        "type": "string",
                        "enum": [
                          "off",
                          "under_10k",
                          "over_10k"
                        ]
                      },
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      }
                    ]
                  },
                  "currencyConversion": {
                    "type": "boolean",
                    "default": false,
                    "description": "Whether the order was converted from another currency."
                  },
                  "batch": {
                    "type": "object",
                    "description": "Batch production. Spreads the run's materials, overhead and time across the units that came out sellable, so failed pieces are paid for by the ones sold.",
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "default": true
                      },
                      "totalBatchMaterials": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Materials for the whole run."
                      },
                      "unitsProduced": {
                        "type": "integer",
                        "minimum": 1,
                        "description": "Units the run produced."
                      },
                      "failedUnits": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Units that came out unsellable. Must be fewer than unitsProduced."
                      },
                      "batchOverhead": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Overhead for the whole run."
                      },
                      "batchLaborMinutes": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Minutes spent on the whole run."
                      }
                    }
                  },
                  "fees": {
                    "type": "object",
                    "description": "Overrides for the fee table. Defaults are Etsy's published US rates; see the `rates` block of the response for the values actually applied and their date.",
                    "properties": {
                      "listingFeePerUnit": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Flat listing fee per item sold."
                      },
                      "transactionRate": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "paymentProcessingRate": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "paymentProcessingFixed": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Flat per-order payment processing amount."
                      },
                      "offsiteAdsRate": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "offsiteAdsCap": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Per-order cap on the Offsite Ads fee."
                      },
                      "currencyConversionRate": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1
                      },
                      "regulatoryRate": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1,
                        "description": "Regulatory operating fee. 0 in the US, non-zero in some countries."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The calculation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "units",
                    "rates",
                    "fees",
                    "kpis"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "units": {
                      "const": "USD"
                    },
                    "rates": {
                      "type": "object",
                      "description": "The fee table the calculation used, the date it was verified against Etsy's published pages, and those pages. Quote the date with any figure you cite.",
                      "properties": {
                        "market": {
                          "const": "US"
                        },
                        "currency": {
                          "const": "USD"
                        },
                        "verifiedOn": {
                          "type": "string",
                          "format": "date"
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uri"
                          }
                        },
                        "applied": {
                          "type": "object"
                        }
                      }
                    },
                    "input": {
                      "type": "object",
                      "description": "The normalised input, echoed back."
                    },
                    "revenue": {
                      "type": "object",
                      "properties": {
                        "itemSubtotal": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "discount": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "discountedItemSubtotal": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "shippingCharged": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "giftWrapCharged": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "salesTaxCollected": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "sellerRevenueBeforeFees": {
                          "type": "number",
                          "description": "US dollars."
                        }
                      }
                    },
                    "fees": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "lines": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string",
                                "enum": [
                                  "listing",
                                  "transaction",
                                  "payment_processing",
                                  "offsite_ads",
                                  "currency_conversion",
                                  "etsy_ads",
                                  "regulatory",
                                  "custom"
                                ]
                              },
                              "amount": {
                                "type": "number",
                                "description": "US dollars."
                              },
                              "base": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "The amount the rate was applied to. Null for a flat fee."
                              },
                              "rate": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Fraction, e.g. 0.065."
                              },
                              "fixed": {
                                "type": "number",
                                "description": "US dollars."
                              },
                              "perUnit": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "units": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "cap": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "capApplied": {
                                "type": "boolean"
                              }
                            }
                          }
                        }
                      }
                    },
                    "costs": {
                      "type": "object",
                      "properties": {
                        "materials": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "packaging": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "shipping": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "other": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "totalExcludingLabor": {
                          "type": "number",
                          "description": "US dollars."
                        }
                      }
                    },
                    "labor": {
                      "type": "object",
                      "properties": {
                        "totalHours": {
                          "type": "number"
                        },
                        "targetHourlyPay": {
                          "type": "number",
                          "description": "US dollars."
                        },
                        "targetLaborCost": {
                          "type": "number",
                          "description": "US dollars."
                        }
                      }
                    },
                    "kpis": {
                      "type": "object",
                      "properties": {
                        "cashLeftBeforeLabor": {
                          "type": "number",
                          "description": "Revenue minus fees and non-labour costs. Before paying yourself."
                        },
                        "trueBusinessProfit": {
                          "type": "number",
                          "description": "Cash left after the seller's own time is paid at the target rate."
                        },
                        "trueProfitMarginRate": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "effectiveHourlyPay": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "What the order actually paid per hour. Null when no time was entered."
                        },
                        "suggestedPrice": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "enum": [
                                "found",
                                "target_margin_too_high",
                                "unreachable"
                              ]
                            },
                            "price": {
                              "type": "number",
                              "description": "US dollars."
                            },
                            "achievedMarginRate": {
                              "type": "number"
                            },
                            "achievedProfit": {
                              "type": "number",
                              "description": "US dollars."
                            }
                          }
                        }
                      }
                    },
                    "breakdown": {
                      "type": "array",
                      "description": "Every line of the order, signed, in display order.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "revenue",
                              "fee",
                              "cost",
                              "labor",
                              "total"
                            ]
                          },
                          "amount": {
                            "type": "number",
                            "description": "US dollars."
                          },
                          "sign": {
                            "type": "integer",
                            "enum": [
                              -1,
                              0,
                              1
                            ]
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "severity": {
                            "type": "string",
                            "enum": [
                              "critical",
                              "caution",
                              "info"
                            ]
                          }
                        }
                      }
                    },
                    "disclaimer": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "One or more fields were unusable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string",
                            "description": "Dotted path into the request."
                          },
                          "code": {
                            "type": "string",
                            "description": "Stable machine-readable reason."
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Body larger than 8 KB."
          },
          "415": {
            "description": "Content-Type was not application/json."
          },
          "429": {
            "description": "Rate limited. Retry after the seconds in Retry-After."
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness and the fee verification date",
        "responses": {
          "200": {
            "description": "The service is up.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "pass"
                    },
                    "version": {
                      "type": "string"
                    },
                    "feeRates": {
                      "type": "object",
                      "properties": {
                        "market": {
                          "type": "string"
                        },
                        "verifiedOn": {
                          "type": "string",
                          "format": "date"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
