{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/envato/main/json-schema/envato-market-purchase-for-buyer-schema.json",
  "title": "MarketPurchaseForBuyer",
  "x-generated": "2026-10-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/envato-openapi.yml#/components/schemas/MarketPurchaseForBuyer",
  "required": [
    "amount",
    "sold_at",
    "license",
    "support_amount",
    "supported_until",
    "item"
  ],
  "properties": {
    "amount": {
      "type": "string",
      "description": "Author earning amount"
    },
    "sold_at": {
      "type": "string",
      "format": "date",
      "description": "Purchase date"
    },
    "license": {
      "type": "string",
      "description": "License name"
    },
    "support_amount": {
      "type": "string",
      "description": "Included author support earning amounts"
    },
    "supported_until": {
      "type": "string",
      "description": "End of included support date"
    },
    "item": {
      "$ref": "#/$defs/PurchaseItem"
    },
    "code": {
      "type": "string",
      "description": "Purchase code"
    }
  },
  "$defs": {
    "ItemAttribute": {
      "required": [
        "name",
        "value",
        "label"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Attribute name"
        },
        "value": {
          "type": "string",
          "description": "Attribute value"
        },
        "label": {
          "type": "string",
          "description": "Attribute label"
        }
      }
    },
    "PurchaseItem": {
      "required": [
        "id",
        "name",
        "number_of_sales",
        "author_username",
        "author_url",
        "url",
        "attributes",
        "rating"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32",
          "description": "Item ID"
        },
        "name": {
          "type": "string",
          "description": "Item name"
        },
        "number_of_sales": {
          "type": "integer",
          "format": "int32"
        },
        "author_username": {
          "type": "string"
        },
        "author_url": {
          "type": "string",
          "description": "Author profile URL (e.g. https://themeforest.net/user/authorusername)"
        },
        "url": {
          "type": "string",
          "description": "Item URL (e.g. https://themeforest.net/item/item-name/12345)"
        },
        "attributes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ItemAttribute"
          }
        },
        "updated_at": {
          "type": "string",
          "format": "date",
          "description": "Date of last item update approval on Market"
        },
        "wordpress_theme_metadata": {
          "$ref": "#/$defs/WordpressThemeMetadata"
        },
        "wordpress_plugin_metadata": {
          "$ref": "#/$defs/WordpressPluginMetadata"
        }
      }
    },
    "WordpressPluginMetadata": {
      "required": [
        "plugin_name"
      ],
      "properties": {
        "plugin_name": {
          "type": "string"
        },
        "author": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "WordpressThemeMetadata": {
      "required": [
        "theme_name",
        "author",
        "version",
        "description"
      ],
      "properties": {
        "theme_name": {
          "type": "string"
        },
        "author": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      }
    }
  }
}