{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fedex/json-schema/fedex-v3-subscriptions-body-schema.json",
  "title": "v3_subscriptions_body",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fedex-account-number-subscription-api-openapi.yml#/components/schemas/v3_subscriptions_body",
  "oneOf": [
    {
      "$ref": "#/$defs/UpdateSubscriptionInputVO"
    },
    {
      "$ref": "#/$defs/MinimumSamplePayloadForUpdateSubscription"
    },
    {
      "$ref": "#/$defs/UPDATE_ALL"
    },
    {
      "$ref": "#/$defs/ADD_ACCOUNTS"
    },
    {
      "$ref": "#/$defs/DELETE_ACCOUNTS"
    },
    {
      "$ref": "#/$defs/MinimumSamplePayloadForUPDATE_ALL_Subscription"
    }
  ],
  "$defs": {
    "ADD_ACCOUNTS": {},
    "Account": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "description": "Required to put account number"
        }
      },
      "description": "This specifies the associated Account number."
    },
    "DELETE_ACCOUNTS": {},
    "MinimumSamplePayloadForUPDATE_ALL_Subscription": {},
    "MinimumSamplePayloadForUpdateSubscription": {},
    "NotificationDetails": {
      "type": "object",
      "properties": {
        "countryCode": {
          "type": "string",
          "description": "Specifies the country code  in which the email needs to be sent.<br>Example: US"
        },
        "emailAddresses": {
          "type": "array",
          "description": "Specifies an email address.<br>Example: abc@gmail.com",
          "items": {
            "type": "string"
          }
        },
        "languageCode": {
          "type": "string",
          "description": "Specifies the language in which the email needs to be sent.<br>Example: en"
        }
      },
      "description": "Specifies an email address and language in which user wants to receive email notifications any action gets performed on subscription."
    },
    "SubscriptionDetails": {
      "properties": {
        "accounts": {
          "type": "array",
          "description": "This is required when subscribeAllAccounts flag is false or request type is ADD_ACCOUNTS or DELETE_ACCOUNTS. It specifies the list of account(s) for which user wants to subscribe for webhook notifications. User has to provide at least one account number to update a subscription.",
          "items": {
            "$ref": "#/$defs/Account"
          }
        },
        "callbackData": {
          "$ref": "#/$defs/SubscriptionDetails_callbackData"
        },
        "features": {
          "type": "array",
          "description": "This is to configure the project by selecting from a number of features.",
          "items": {
            "$ref": "#/$defs/featureDetail"
          }
        },
        "notificationDetails": {
          "$ref": "#/$defs/NotificationDetails"
        },
        "responseType": {
          "type": "string",
          "description": "Specifies the type of the response user/customer wants to be receive i.e either detailed or event specific.This is required when request type is not provided or has value UPDATE_ALL or RESUBMIT.",
          "enum": [
            "DETAILED",
            "EVENT_SPECIFIC"
          ]
        },
        "tier": {
          "type": "string",
          "description": "Specifies the tier information for the subscription. BASIC tier has retry policy upto 6 hours.",
          "enum": [
            "BASIC"
          ]
        },
        "type": {
          "type": "string",
          "description": "Specifies the type of Subscription. TRACKING is the only supported subscription type for now. This will be defaulted to TRACKING if not provided in the request."
        },
        "subType": {
          "type": "string",
          "description": "Specifies the subtype of Subscription. This is opitonal. ACCOUNT is the default if no values given This is to enable the subscription for the tracking number",
          "enum": [
            "ACCOUNT",
            "TRACKINGNUMBER_ANON"
          ]
        },
        "billingAccountNumber": {
          "$ref": "#/$defs/Account"
        }
      },
      "description": "Describes the information related to the subscription such as subscription type, response type, events and accounts"
    },
    "SubscriptionDetails_callbackData": {
      "properties": {
        "destinationURL": {
          "type": "string",
          "description": "Specifies the server or destination URL where near real-time shipment updates will get pushed.This is required when request type is not provided or has value UPDATE_ALL or RESUBMIT."
        },
        "name": {
          "type": "string",
          "description": "Specifies the unique name of the subscription.This is required when request type is not provided or has value UPDATE_ALL or RESUBMIT."
        },
        "securityToken": {
          "type": "string",
          "description": "Specifies the customers security token.It should be minimum length of 25 characters.Must contain at least one (1) upper case, one (1) lower case (not applicable for mainframe applications) and one (1) numeric character."
        }
      },
      "description": "Describes subscription callback data such as URL, subscriptionName and securityToken"
    },
    "UPDATE_ALL": {},
    "UpdateSubscriptionInputVO": {
      "type": "object",
      "properties": {
        "requestType": {
          "type": "string",
          "description": "This specifies the type of the request. Request type \"ADD_ACCOUNTS\" will be used to add new accounts in existing subscription when any organization has subscribed for all accounts. \"DELETE_ACCOUNTS\" will be used to delete account from the subscription. \"UPDATE_ALL\" is for regular subscription update. This is optional element and defaulted to \"UPDATE_ALL\" if not provided by client.",
          "enum": [
            "ADD_ACCOUNTS",
            "DELETE_ACCOUNTS",
            "UPDATE_ALL"
          ]
        },
        "subscriptionId": {
          "type": "integer",
          "description": "Specifies the unique identifier for subscription. This is required when request type is not provided or has value \"UPDATE_ALL\"."
        },
        "subscription": {
          "$ref": "#/$defs/SubscriptionDetails"
        },
        "fdplaAccepted": {
          "type": "boolean",
          "description": "If set to true, indicates FedEx developer Portal License agreement is accepted. This is required when request type is not provided or has value UPDATE_ALL or RESUBMIT."
        },
        "softwareDistributionTermsAccepted": {
          "type": "boolean",
          "description": "If set to true, indicates the client agrees to not distribute or allow access to his solution.This is required when request type is not provided or has value UPDATE_ALL or RESUBMIT."
        },
        "pricingAccepted": {
          "type": "boolean",
          "description": "If set to true, indicates the client agrees to the pricing information."
        }
      },
      "description": "Request Model for updating a subscription"
    },
    "featureDetail": {
      "required": [
        "category",
        "subCategories"
      ],
      "type": "object",
      "properties": {
        "category": {
          "type": "string",
          "description": "This field and will allow the customer to request inclusion of proof of delivery, Estimated Delivery, event, filter category in webhook push.",
          "enum": [
            "RETRY_POLICY",
            "PROOF_OF_DELIVERY",
            "ESTIMATED_DELIVERY",
            "TRACKING_EVENTS",
            "EVENT_BASED_FILTERING"
          ]
        },
        "subCategories": {
          "type": "array",
          "description": "Sub Category specifies Individual selectable  features within a category such as Picture Proof of Delivery, Signature Proof of Delivery, Estimated delivery-Estimated Delivery Date and  Estimated Delivery time Window, events such as -Ship, in transit, delivery, exceptions and filters such as- inbound,outbound and Third Party",
          "items": {
            "type": "string",
            "enum": [
              "BASIC_HRS",
              "ADVANCED_HRS",
              "PPOD",
              "SPOD",
              "EDD",
              "EDTW",
              "SHIP",
              "FPOS",
              "NEWS",
              "TRAN",
              "DEL",
              "DCIF",
              "COMM",
              "EXC",
              "CDO",
              "INBOUND",
              "OUTBOUND",
              "THIRD_PARTY"
            ]
          }
        }
      }
    }
  }
}