Admin API / Types

ProductMediaInput

Input

One listing photo or video. Set exactly one field. Send a video upload as video, with its poster image.

input ProductMediaInput

Input fields

FieldTypeDescription
fileUrlURLThe public URL of a PUBLIC District files image: File.url with access: PUBLIC in District API. Any last path segment is accepted. The listing stores its own copy of the 4096-pixel rendition on the marketplace image host, so a later change to the file in District files does not change the photo. A URL that is not on the District files image host of this environment gives MEDIA_NOT_A_DISTRICT_FILE. A file that is not public now gives MEDIA_FILE_NOT_PUBLIC. When District files does not answer the check or the copy fails, the mutation fails with error code MEDIA_FILE_CHECK_FAILED and writes nothing; send the same request again.
mediaIdIDAn image or video that the caller uploaded, or an item of this listing as Product.media returns it. An image upload is taken once it has its stored original, whatever its status. A video upload must have finished processing (status COMPLETED) and its upload metadata must record a duration of at most 91 seconds (90 seconds and 1 second of tolerance), else MEDIA_VIDEO_TOO_LONG. An unknown upload, an image upload with no stored original, an unfinished video upload, a video upload whose metadata records no duration, another user's upload, or an item of another listing gives MEDIA_NOT_FOUND. A video upload here has no poster image: readers that show the listing image get the video file. Send video instead.
videoProductVideoMediaInputA video that the caller uploaded, with an image upload of the caller as its poster. The listing shows the poster where it shows an image of the video, as for a video that the District app uploads. The item counts as one item toward the limit of 30. Each of its two IDs counts in the rule that an item occurs at most once in the list.