{
  "title": "Store BuyProduct Resp",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "pings": {
      "type": "array",
      "items": {
        "type": ["number","string","boolean","object","array", "null"]
      }
    },
    "jingleDocType": {
      "type": "string"
    },
    "jingleAction": {
      "type": "string"
    },
    "status": {
      "type": "integer"
    },
    "dsPersonId": {
      "type": "string"
    },
    "creditDisplay": {
      "type": "string"
    },
    "creditBalance": {
      "type": "string"
    },
    "freeSongBalance": {
      "type": "string"
    },
    "creditDisplayInternal": {
      "type": "string"
    },
    "authorized": {
      "type": "boolean"
    },
    "download-queue-item-count": {
      "type": "integer"
    },
    "songList": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "songId": {
            "type": "integer"
          },
          "URL": {
            "type": "string"
          },
          "downloadKey": {
            "type": "string"
          },
          "artworkURL": {
            "type": "string"
          },
          "artwork-urls": {
            "type": "object",
            "properties": {
              "image-type": {
                "type": "string"
              },
              "default": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  }
                },
                "required": [
                  "url"
                ]
              }
            },
            "required": [
              "image-type",
              "default"
            ]
          },
          "md5": {
            "type": "string"
          },
          "chunks": {
            "type": "object",
            "properties": {
              "chunkSize": {
                "type": "integer"
              },
              "hashes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "chunkSize",
              "hashes"
            ]
          },
          "isStreamable": {
            "type": "boolean"
          },
          "uncompressedSize": {
            "type": "integer"
          },
          "sinfs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "sinf": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "sinf"
              ]
            }
          },
          "purchaseDate": {
            "type": "string"
          },
          "download-id": {
            "type": "string"
          },
          "is-in-queue": {
            "type": "boolean"
          },
          "asset-info": {
            "type": "object",
            "properties": {
              "file-size": {
                "type": "integer"
              },
              "flavor": {
                "type": "string"
              }
            },
            "required": [
              "file-size",
              "flavor"
            ]
          },
          "metadata": {
            "type": "object",
            "properties": {
              "MacUIRequiredDeviceCapabilities": {
                "type": "object",
                "properties": {
                  "arm64": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "arm64"
                ]
              },
              "UIRequiredDeviceCapabilities": {
                "type": "object",
                "properties": {
                  "arm64": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "arm64"
                ]
              },
              "WKRunsIndependentlyOfCompanionApp": {
                "type": "boolean"
              },
              "WKWatchOnly": {
                "type": "boolean"
              },
              "appleWatchEnabled": {
                "type": "boolean"
              },
              "artistId": {
                "type": "integer"
              },
              "artistName": {
                "type": "string"
              },
              "bundleDisplayName": {
                "type": "string"
              },
              "bundleShortVersionString": {
                "type": "string"
              },
              "bundleVersion": {
                "type": "string"
              },
              "copyright": {
                "type": "string"
              },
              "fileExtension": {
                "type": "string"
              },
              "gameCenterEnabled": {
                "type": "boolean"
              },
              "gameCenterEverEnabled": {
                "type": "boolean"
              },
              "genre": {
                "type": "string"
              },
              "genreId": {
                "type": "integer"
              },
              "itemId": {
                "type": "integer"
              },
              "itemName": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              },
              "nameTranscriptions": {
                "type": "object",
                "properties": {
                  "zh-Hans-CN": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "zh-Hans-CN"
                ]
              },
              "playlistName": {
                "type": "string"
              },
              "product-type": {
                "type": "string"
              },
              "rating": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "rank": {
                    "type": "integer"
                  },
                  "system": {
                    "type": "string"
                  }
                },
                "required": [
                  "content",
                  "label",
                  "rank",
                  "system"
                ]
              },
              "releaseDate": {
                "type": "string"
              },
              "requiresRosetta": {
                "type": "boolean"
              },
              "runsOnAppleSilicon": {
                "type": "boolean"
              },
              "runsOnIntel": {
                "type": "boolean"
              },
              "s": {
                "type": "integer"
              },
              "software-platform": {
                "type": "string"
              },
              "softwareIcon57x57URL": {
                "type": "string"
              },
              "softwareIconNeedsShine": {
                "type": "boolean"
              },
              "softwareSupportedDeviceIds": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "softwareVersionBundleId": {
                "type": "string"
              },
              "softwareVersionExternalIdentifier": {
                "type": "integer"
              },
              "softwareVersionExternalIdentifiers": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "vendorId": {
                "type": "integer"
              },
              "drmVersionNumber": {
                "type": "integer"
              },
              "versionRestrictions": {
                "type": "integer"
              },
              "storeCohort": {
                "type": "string"
              },
              "hasOrEverHasHadIAP": {
                "type": "boolean"
              }
            },
            "required": [
              "MacUIRequiredDeviceCapabilities",
              "UIRequiredDeviceCapabilities",
              "WKRunsIndependentlyOfCompanionApp",
              "WKWatchOnly",
              "appleWatchEnabled",
              "artistId",
              "artistName",
              "bundleDisplayName",
              "bundleShortVersionString",
              "bundleVersion",
              "copyright",
              "fileExtension",
              "gameCenterEnabled",
              "gameCenterEverEnabled",
              "genre",
              "genreId",
              "itemId",
              "itemName",
              "kind",
              "nameTranscriptions",
              "playlistName",
              "product-type",
              "rating",
              "releaseDate",
              "requiresRosetta",
              "runsOnAppleSilicon",
              "runsOnIntel",
              "s",
              "software-platform",
              "softwareIcon57x57URL",
              "softwareIconNeedsShine",
              "softwareSupportedDeviceIds",
              "softwareVersionBundleId",
              "softwareVersionExternalIdentifier",
              "softwareVersionExternalIdentifiers",
              "vendorId",
              "drmVersionNumber",
              "versionRestrictions",
              "storeCohort",
              "hasOrEverHasHadIAP"
            ]
          }
        },
        "required": [
          "songId",
          "URL",
          "downloadKey",
          "artworkURL",
          "artwork-urls",
          "md5",
          "chunks",
          "isStreamable",
          "uncompressedSize",
          "sinfs",
          "purchaseDate",
          "download-id",
          "is-in-queue",
          "asset-info",
          "metadata"
        ]
      }
    },
    "download-queue-info": {
      "type": "object",
      "properties": {
        "download-queue-item-count": {
          "type": "integer"
        },
        "dsid": {
          "type": "integer"
        },
        "is-auto-download-machine": {
          "type": "boolean"
        }
      },
      "required": [
        "download-queue-item-count",
        "dsid",
        "is-auto-download-machine"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "itemIds": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "price": {
          "type": "integer"
        },
        "priceType": {
          "type": "string"
        },
        "productTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "mtApp": {
          "type": "string"
        },
        "mtClientId": {
          "type": "string"
        },
        "mtEventTime": {
          "type": "string"
        },
        "mtPageId": {
          "type": "string"
        },
        "mtPageType": {
          "type": "string"
        },
        "mtPrevPage": {
          "type": "string"
        },
        "mtRequestId": {
          "type": "string"
        },
        "mtTopic": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        },
        "exchangeRateToUSD": {
          "type": "number"
        },
        "commerceEvent_purchase_priceType": {
          "type": "string"
        },
        "commerceEvent_storeFrontId": {
          "type": "string"
        },
        "commerceEvent_result_resultType": {
          "type": "integer"
        },
        "commerceEvent_flowType": {
          "type": "integer"
        },
        "commerceEvent_flowStep": {
          "type": "integer"
        },

        "dialogId": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "messageCode": {
          "type": "string"
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "actionUrl": {
          "type": "string"
        },
        "asnState": {
          "type": "integer"
        },
        "eventType": {
          "type": "string"
        }
      },
      "required": [
        "mtApp",
        "mtClientId",
        "mtEventTime",
        "mtPageId",
        "mtPageType",
        "mtPrevPage",
        "mtRequestId",
        "mtTopic"
      ],
      "optional": [
        "itemIds",
        "price",
        "priceType",
        "productTypes",
        "currency",
        "exchangeRateToUSD",
        "commerceEvent_purchase_priceType",
        "commerceEvent_storeFrontId",
        "commerceEvent_result_resultType",
        "commerceEvent_flowType",
        "commerceEvent_flowStep",

        "dialogId",
        "message",
        "messageCode",
        "options",
        "actionUrl",
        "asnState",
        "eventType"
      ]
    },
    "duAnonymousPings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "subscriptionStatus": {
      "type": "object",
      "properties": {
        "music": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            },
            "isAdmin": {
              "type": "boolean"
            },
            "isNotEligibleForFreeTrial": {
              "type": "boolean"
            }
          },
          "required": [
            "status",
            "reason",
            "isAdmin",
            "isNotEligibleForFreeTrial"
          ]
        },
        "terms": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "latestTerms": {
                "type": "integer"
              },
              "agreedToTerms": {
                "type": "integer"
              },
              "source": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "latestTerms",
              "agreedToTerms",
              "source"
            ]
          }
        },
        "account": {
          "type": "object",
          "properties": {
            "isMinor": {
              "type": "boolean"
            },
            "suspectUnderage": {
              "type": "boolean"
            }
          },
          "required": [
            "isMinor",
            "suspectUnderage"
          ]
        },
        "family": {
          "type": "object",
          "properties": {
            "hasFamily": {
              "type": "boolean"
            }
          },
          "required": [
            "hasFamily"
          ]
        }
      },
      "required": [
        "music",
        "terms",
        "account",
        "family"
      ]
    },
    "cancel-purchase-batch": {
      "type": "boolean"
    },
    "failureType": {
      "type": "string"
    },
    "customerMessage": {
      "type": "string"
    },
    "m-allowed": {
      "type": "boolean"
    },
    "dialog": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string"
        },
        "m-allowed": {
          "type": "boolean"
        },
        "use-keychain": {
          "type": "boolean"
        },
        "isFree": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "explanation": {
          "type": "string"
        },
        "defaultButton": {
          "type": "string"
        },
        "okButtonString": {
          "type": "string"
        },
        "okButtonAction": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string"
            },
            "buyParams": {
              "type": "string"
            },
            "itemName": {
              "type": "string"
            }
          },
          "required": [
            "kind",
            "buyParams",
            "itemName"
          ]
        },
        "cancelButtonString": {
          "type": "string"
        },
        "initialCheckboxValue": {
          "type": "boolean"
        }
      },
      "required": [
        "kind",
        "m-allowed",
        "use-keychain",
        "isFree",
        "message",
        "explanation",
        "defaultButton",
        "okButtonString",
        "okButtonAction",
        "cancelButtonString",
        "initialCheckboxValue"
      ]
    }
  },
  "required": [
    "pings",
    "metrics"
  ],
  "optional": [
    "jingleDocType",
    "jingleAction",
    "status",
    "dsPersonId",
    "creditDisplay",
    "creditBalance",
    "freeSongBalance",
    "creditDisplayInternal",
    "authorized",
    "download-queue-item-count",
    "songList",
    "download-queue-info",
    "duAnonymousPings",
    "subscriptionStatus",

    "failureType",
    "customerMessage",
    "m-allowed",
    "dialog",
    "cancel-purchase-batch"
  ]
}