{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/monacloud/json-schema/monacloud-credit-code-upsert-request-schema.json",
  "title": "CreditCodeUpsertRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/monacloud-billing-api-openapi.yml#/components/schemas/CreditCodeUpsertRequest",
  "properties": {
    "code": {
      "type": "string",
      "maxLength": 64,
      "minLength": 2,
      "title": "Code"
    },
    "amount": {
      "type": "integer",
      "maximum": 500000000,
      "exclusiveMinimum": 0,
      "title": "Amount"
    },
    "max_uses": {
      "type": "integer",
      "maximum": 1000000,
      "minimum": 1,
      "title": "Max Uses"
    },
    "expires": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Expires"
    },
    "tag": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 120
        },
        {
          "type": "null"
        }
      ],
      "title": "Tag"
    },
    "active": {
      "type": "boolean",
      "title": "Active",
      "default": true
    }
  },
  "type": "object",
  "required": [
    "code",
    "amount",
    "max_uses"
  ]
}