# FeePolicy

Who pays the gateway and Whish cash-in fees for a fixed-price order.

[Definition in OpenAPI](https://api.cadmospay.com/static/api/gateway-machine-api.json#/components/schemas/FeePolicy)

## JSON schema

```json
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "gatewayFeePayer": {
      "type": "string",
      "enum": [
        "merchant"
      ]
    },
    "routeFeePayer": {
      "type": "string",
      "enum": [
        "customer",
        "merchant"
      ]
    },
    "maxRouteFeeUsd": {
      "type": "string",
      "pattern": "^\\d{1,7}(\\.\\d{1,2})?$",
      "description": "Required per-payment sponsorship cap in USD when the merchant covers Whish fees. Other routes and wallet gas stay customer-paid."
    }
  },
  "description": "Who pays the gateway and Whish cash-in fees for a fixed-price order.",
  "allOf": [
    {
      "if": {
        "required": [
          "routeFeePayer"
        ],
        "properties": {
          "routeFeePayer": {
            "const": "merchant"
          }
        }
      },
      "then": {
        "required": [
          "maxRouteFeeUsd"
        ]
      },
      "else": {
        "not": {
          "required": [
            "maxRouteFeeUsd"
          ]
        }
      }
    }
  ]
}
```
