Media API — client.commerce.media¶
Version v1_beta.5.1 · base path /commerce/media/v1_beta · async twin: the same methods on
AsyncEbayClient, awaited.
Operations¶
Bases: BaseResource
create_image_from_file ¶
create_image_from_file(*, files: Mapping[str, Any], x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> commerce_media_models.ImageResponse
create_image_from_file(*, files: Mapping[str, Any], x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
create_image_from_file(*, files: Mapping[str, Any], x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> commerce_media_models.ImageResponse | httpx.Response
This method uploads a picture file to eBay Picture Services (EPS) using multipart/form-data. All images must comply with eBay's picture requirements, such as dimension and file size restrictions. For more information, see Picture policy . The image formats supported are JPG , GIF , PNG , BMP , TIFF , AVIF , HEIC , and WEBP . For more information, see Image requirements .
create_image_from_url ¶
create_image_from_url(*, body: CreateImageFromUrlRequest, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> commerce_media_models.ImageResponse
create_image_from_url(*, body: CreateImageFromUrlRequest, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
create_image_from_url(*, body: CreateImageFromUrlRequest, x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> commerce_media_models.ImageResponse | httpx.Response
This method uploads a picture to eBay Picture Services (EPS) from the specified URL. Specify the location of the picture on an external web server through the imageUrl field. All images must comply with eBay’s picture requirements, such as dimension and file size restrictions. For more information, see Picture policy .
get_image ¶
get_image(image_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> commerce_media_models.ImageResponse
get_image(image_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
get_image(image_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> commerce_media_models.ImageResponse | httpx.Response
This method retrieves an EPS image URL and its expiration details for the unique identifier specified in the path parameter image_id . Use the retrieved EPS image URL to add the image to a listing through the Inventory API or the Trading API . See Managing images for additional details.
create_video ¶
create_video(*, body: CreateVideoRequest | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> None
create_video(*, body: CreateVideoRequest | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
create_video(*, body: CreateVideoRequest | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> None | httpx.Response
This method creates a video resource. When using this method, specify the title , size , and classification of the video resource to be created. Description is an optional field for this method.
get_video ¶
get_video(video_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> commerce_media_models.Video
get_video(video_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
get_video(video_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> commerce_media_models.Video | httpx.Response
This method retrieves a video's metadata and content given a specified video ID . The method returns the title , size , classification , description , video ID , playList , status , status message (if any), expiration date , and thumbnail image of the retrieved video. The video's title , size , classification , and description are set using the createVideo method.
upload_video ¶
upload_video(video_id: str, *, body: bytes | bytearray | memoryview, content_length: str | None = None, content_range: str | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> None
upload_video(video_id: str, *, body: bytes | bytearray | memoryview, content_length: str | None = None, content_range: str | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
upload_video(video_id: str, *, body: bytes | bytearray | memoryview, content_length: str | None = None, content_range: str | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> None | httpx.Response
This method associates the specified file with the specified video ID and uploads the input file. After the file has been uploaded the processing of the file begins. Note: The size of the video to be uploaded must exactly match the size of the video's input stream that was set in the createVideo method. If the sizes do not match, the video will not upload successfully.
create_document ¶
create_document(*, body: CreateDocumentRequest | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> commerce_media_models.CreateDocumentResponse
create_document(*, body: CreateDocumentRequest | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
create_document(*, body: CreateDocumentRequest | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> commerce_media_models.CreateDocumentResponse | httpx.Response
This method stages a document to be uploaded, and requires the type of document to be uploaded, and the language(s) that the document contains. A successful call returns a documentId value that is then used as a path parameter in an uploadDocument call. When a document is successfully created, the method returns the HTTP Status Code 201 Created.
create_document_from_url ¶
create_document_from_url(*, body: CreateDocumentFromUrlRequest | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> commerce_media_models.CreateDocumentResponse
create_document_from_url(*, body: CreateDocumentFromUrlRequest | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
create_document_from_url(*, body: CreateDocumentFromUrlRequest | None = None, x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> commerce_media_models.CreateDocumentResponse | httpx.Response
This method downloads a document from the provided URL and adds that document to the user's account. This method requires the URL of the document, the type of document to be uploaded, and the language(s) that the document contains. When a document is successfully created, the method returns the HTTP Status Code 201 Created.
get_document ¶
get_document(document_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> commerce_media_models.DocumentResponse
get_document(document_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
get_document(document_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> commerce_media_models.DocumentResponse | httpx.Response
This method retrieves the current status and metadata of the specified document. Important! The document ID value returned in the response payload of the createDocument or the createDocumentFromUrl method is a required input path parameter for this method. See Managing documents for additional information.
upload_document ¶
upload_document(document_id: str, *, files: Mapping[str, Any], x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> commerce_media_models.DocumentResponse
upload_document(document_id: str, *, files: Mapping[str, Any], x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
upload_document(document_id: str, *, files: Mapping[str, Any], x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> commerce_media_models.DocumentResponse | httpx.Response
This method associates the specified file with the specified document ID and uploads the input file. After the file has been uploaded, the processing of the file begins. Supported file types include .PDF, .JPEG/.JPG, and .PNG, with a maximum file size of 10 MB (10485760 bytes). Note: Animated and multi-page PNG files are not currently supported.
download_post_order_document ¶
download_post_order_document(document_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> bytes
download_post_order_document(document_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
download_post_order_document(document_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> bytes | httpx.Response
This method downloads the file associated with the specified document ID.
remove_post_order_document ¶
remove_post_order_document(document_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> None
remove_post_order_document(document_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
remove_post_order_document(document_id: str, *, x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> None | httpx.Response
This method deletes a previously uploaded document by its document ID. Only documents in SUBMITTED state can be removed; documents in the PUBLISHED state cannot be deleted. Note: This method is currently restricted and requires a special OAuth scope not available to all users. Note: After a document is uploaded (but not yet published), its status is SUBMITTED .
upload_post_order_document ¶
upload_post_order_document(*, files: Mapping[str, Any], x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[False] = False) -> dict[str, Any]
upload_post_order_document(*, files: Mapping[str, Any], x_ebay_c_marketplace_id: str | None = None, raw_response: Literal[True]) -> httpx.Response
upload_post_order_document(*, files: Mapping[str, Any], x_ebay_c_marketplace_id: str | None = None, raw_response: bool = False) -> dict[str, Any] | httpx.Response
This method uploads a document for post‑order processes (for example, a seller providing a return shipping label). Supported file types include .PDF, .JPEG/.JPG, .BMP, .GIF and .PNG, with a maximum file size of 5 MB (5,242,880 bytes). Note: This method is currently restricted and requires a special OAuth scope not available to all users.
Models¶
CreateImageFromUrlRequest ¶
Bases: EbayModel
image_url
class-attribute
instance-attribute
¶
image_url = Field(None, alias='imageUrl', description='The image URL of the self-hosted picture to upload to eBay Picture Services (EPS). In addition to the picture requirements in Picture policy , the provided URL must be secured using HTTPS (HTTP is not permitted). For more information, see Image requirements .')
CreateVideoRequest ¶
Bases: EbayModel
classification
class-attribute
instance-attribute
¶
classification = Field(None, description='The intended use for this video content. Currently, videos can only be added and associated with eBay listings, so the only supported value is ITEM .')
description
class-attribute
instance-attribute
¶
description = Field(None, description='The description of the video.')
size
class-attribute
instance-attribute
¶
size = Field(None, description='The size, in bytes, of the video content. Max: 157,286,400 bytes')
title
class-attribute
instance-attribute
¶
title = Field(None, description='The title of the video.')
DocumentMetadata ¶
Bases: EbayModel
file_name
class-attribute
instance-attribute
¶
file_name = Field(None, alias='fileName', description='The name of the file including its extension (for example, drone_user_warranty.pdf ).')
file_size
class-attribute
instance-attribute
¶
file_size = Field(None, alias='fileSize', description='The size, in bytes, of the document content.')
file_type
class-attribute
instance-attribute
¶
file_type = Field(None, alias='fileType', description='The type of the file uploaded. Supported file types include the following: pdf , jpeg , jpg , and png .')
DocumentStatusEnum ¶
Bases: OpenStrEnum
DocumentTypeEnum ¶
Bases: OpenStrEnum
certificate_of_analysis
class-attribute
instance-attribute
¶
certificate_of_analysis = 'CERTIFICATE_OF_ANALYSIS'
certificate_of_conformity
class-attribute
instance-attribute
¶
certificate_of_conformity = 'CERTIFICATE_OF_CONFORMITY'
declaration_of_conformity
class-attribute
instance-attribute
¶
declaration_of_conformity = 'DECLARATION_OF_CONFORMITY'
instructions_for_use
class-attribute
instance-attribute
¶
instructions_for_use = 'INSTRUCTIONS_FOR_USE'
other_safety_documents
class-attribute
instance-attribute
¶
other_safety_documents = 'OTHER_SAFETY_DOCUMENTS'
trouble_shooting_guide
class-attribute
instance-attribute
¶
trouble_shooting_guide = 'TROUBLE_SHOOTING_GUIDE'
user_guide_or_manual
class-attribute
instance-attribute
¶
user_guide_or_manual = 'USER_GUIDE_OR_MANUAL'
installation_instructions
class-attribute
instance-attribute
¶
installation_instructions = 'INSTALLATION_INSTRUCTIONS'
accessibility_information
class-attribute
instance-attribute
¶
accessibility_information = 'ACCESSIBILITY_INFORMATION'
safety_test_lab_reports
class-attribute
instance-attribute
¶
safety_test_lab_reports = 'SAFETY_TEST_LAB_REPORTS'
eek_product_information_sheet
class-attribute
instance-attribute
¶
eek_product_information_sheet = 'EEK_PRODUCT_INFORMATION_SHEET'
general_certificate_of_conformity
class-attribute
instance-attribute
¶
general_certificate_of_conformity = 'GENERAL_CERTIFICATE_OF_CONFORMITY'
childrens_product_certificate
class-attribute
instance-attribute
¶
childrens_product_certificate = 'CHILDRENS_PRODUCT_CERTIFICATE'
ErrorParameter ¶
FormDataContentDisposition ¶
Image ¶
Bases: EbayModel
image_url
class-attribute
instance-attribute
¶
image_url = Field(None, alias='imageUrl', description="The URL of the image's location.")
ImageResponse ¶
Bases: EbayModel
expiration_date
class-attribute
instance-attribute
¶
expiration_date = Field(None, alias='expirationDate', description='The date and time when an unused EPS image will expire and be removed from the EPS server, in Coordinated Universal Time (UTC). As long as an EPS image is being used in an active listing, that image will remain on the EPS server and be accessible.')
image_url
class-attribute
instance-attribute
¶
image_url = Field(None, alias='imageUrl', description='The EPS URL to access the uploaded image. This URL will be used in listing calls to add the image to a listing.')
max_dimension_image_url
class-attribute
instance-attribute
¶
max_dimension_image_url = Field(None, alias='maxDimensionImageUrl', description='The EPS URL to access the maximum dimension version of the uploaded image.')
LanguageEnum ¶
Bases: OpenStrEnum
ProtocolEnum ¶
RejectReasonEnum ¶
Bases: OpenStrEnum
max_length_exceeded
class-attribute
instance-attribute
¶
max_length_exceeded = 'MAX_LENGTH_EXCEEDED'
inappropriate_depiction
class-attribute
instance-attribute
¶
inappropriate_depiction = 'INAPPROPRIATE_DEPICTION'
other_policy_violation
class-attribute
instance-attribute
¶
other_policy_violation = 'OTHER_POLICY_VIOLATION'
VideoStatusEnum ¶
Bases: OpenStrEnum
CreateDocumentFromUrlRequest ¶
Bases: EbayModel
document_type
class-attribute
instance-attribute
¶
document_type = Field(None, alias='documentType', description='The type of the document being created. For example, a USER_GUIDE_OR_MANUAL or a SAFETY_DATA_SHEET .')
document_url
class-attribute
instance-attribute
¶
document_url = Field(None, alias='documentUrl', description='The URL of the document being created. The document referenced by the URL must be a .pdf, .png, .jpg, or .jpeg file, and must be no larger than 10 MB.')
languages
class-attribute
instance-attribute
¶
languages = Field(None, description='This array shows the language(s) used in the document.')
CreateDocumentRequest ¶
Bases: EbayModel
document_type
class-attribute
instance-attribute
¶
document_type = Field(None, alias='documentType', description='The type of the document being uploaded. For example, a USER_GUIDE_OR_MANUAL or a SAFETY_DATA_SHEET .')
languages
class-attribute
instance-attribute
¶
languages = Field(None, description='This array shows the language(s) used in the document.')
CreateDocumentResponse ¶
Bases: EbayModel
document_id
class-attribute
instance-attribute
¶
document_id = Field(None, alias='documentId', description='The unique identifier of the document to be uploaded. This value is returned in the response and location header of the createDocument and createDocumentFromUrl methods. This ID can be used with the getDocument and uploadDocument methods, and to add an uploaded document to a listing. See Adding documents to listings for more information.')
document_status
class-attribute
instance-attribute
¶
document_status = Field(None, alias='documentStatus', description='The status of the document resource. For example, the value PENDING_UPLOAD is the initial state when the reference to the document has been created using the createDocument method. When creating a document using the createDocumentFromUrl method, the initial state will be SUBMITTED .')
document_type
class-attribute
instance-attribute
¶
document_type = Field(None, alias='documentType', description='The type of the document uploaded. For example, USER_GUIDE_OR_MANUAL .')
languages
class-attribute
instance-attribute
¶
languages = Field(None, description='This array shows the language(s) used in the document.')
DocumentResponse ¶
Bases: EbayModel
document_id
class-attribute
instance-attribute
¶
document_id = Field(None, alias='documentId', description='The unique ID of the document.')
document_metadata
class-attribute
instance-attribute
¶
document_metadata = Field(None, alias='documentMetadata', description='This container provides the name, size, and type of the specified file.')
document_status
class-attribute
instance-attribute
¶
document_status = Field(None, alias='documentStatus', description='The status of the document resource. Once a document has been uploaded using the uploadDocument method, the documentStatus will be SUBMITTED . The document will then either be accepted or rejected. Only documents with the status of ACCEPTED are available to be added to a listing.')
document_type
class-attribute
instance-attribute
¶
document_type = Field(None, alias='documentType', description='The type of the document uploaded. For example, USER_GUIDE_OR_MANUAL .')
languages
class-attribute
instance-attribute
¶
languages = Field(None, description='This array shows the language(s) used in the document.')
Error ¶
Bases: EbayModel
category
class-attribute
instance-attribute
¶
category = Field(None, description='Identifies the type of erro.')
domain
class-attribute
instance-attribute
¶
domain = Field(None, description='Name for the primary system where the error occurred. This is relevant for application errors.')
error_id
class-attribute
instance-attribute
¶
error_id = Field(None, alias='errorId', description='A unique number to identify the error.')
input_ref_ids
class-attribute
instance-attribute
¶
input_ref_ids = Field(None, alias='inputRefIds', description='An array of request elements most closely associated to the error.')
long_message
class-attribute
instance-attribute
¶
long_message = Field(None, alias='longMessage', description='A more detailed explanation of the error.')
message
class-attribute
instance-attribute
¶
message = Field(None, description="Information on how to correct the problem, in the end user's terms and language where applicable.")
output_ref_ids
class-attribute
instance-attribute
¶
output_ref_ids = Field(None, alias='outputRefIds', description='An array of request elements most closely associated to the error.')
parameters
class-attribute
instance-attribute
¶
parameters = Field(None, description='An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned.')
subdomain
class-attribute
instance-attribute
¶
subdomain = Field(None, description='Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc.')
Moderation ¶
Bases: EbayModel
reject_reasons
class-attribute
instance-attribute
¶
reject_reasons = Field(None, alias='rejectReasons', description='The reason(s) why the specified video was blocked by moderators.')
Play ¶
Bases: EbayModel
play_url
class-attribute
instance-attribute
¶
play_url = Field(None, alias='playUrl', description='The playable URL for this video.')
protocol
class-attribute
instance-attribute
¶
protocol = Field(None, description='The protocol for the video playlist. Supported protocols are DASH (Dynamic Adaptive Streaming over HTTP) and HLS (HTTP Live Streaming).')
Video ¶
Bases: EbayModel
classification
class-attribute
instance-attribute
¶
classification = Field(None, description='The intended use for this video content. Currently, videos can only be added and associated with eBay listings, so the only supported value is ITEM . This array is always returned.')
description
class-attribute
instance-attribute
¶
description = Field(None, description='The description of the video. The video description is an optional field that can be set using the createVideo method.')
expiration_date
class-attribute
instance-attribute
¶
expiration_date = Field(None, alias='expirationDate', description="The date and time when an unused video will expire and be removed from the eBay Video Services server, in Coordinated Universal Time (UTC). As long as a video is being used in an active listing, that video will remain on the server and be accessible. If a video is not being used on an active listing, its expiration date is automatically set to 30 days after the video's initial upload.")
moderation
class-attribute
instance-attribute
¶
moderation = Field(None, description="The video moderation information that is returned if a video is blocked by moderators. Tip: See Video moderation and restrictions in the eBay Seller Center for details about video moderation. If the video status is BLOCKED , ensure that the video complies with eBay's video formatting and content guidelines.")
play_lists
class-attribute
instance-attribute
¶
play_lists = Field(None, alias='playLists', description='The playlist created for the uploaded video, which provides the streaming video URLs to play the video. The supported streaming video protocols are DASH (Dynamic Adaptive Streaming over HTTP) and HLS (HTTP Live Streaming). The playlist will only be generated if a video is successfully uploaded with a status of LIVE .')
size
class-attribute
instance-attribute
¶
size = Field(None, description='The size, in bytes, of the video content. This field is always returned.')
status
class-attribute
instance-attribute
¶
status = Field(None, description='The status of the current video resource.')
status_message
class-attribute
instance-attribute
¶
status_message = Field(None, alias='statusMessage', description='The statusMessage field contains additional information on the status. For example, information on why processing might have failed or if the video was blocked.')
thumbnail
class-attribute
instance-attribute
¶
thumbnail = Field(None, description="The URL of the thumbnail image of the video. The thumbnail image's URL must be an eBayPictureURL (EPS URL).")
title
class-attribute
instance-attribute
¶
title = Field(None, description='The title of the video. This field is always returned.')
video_id
class-attribute
instance-attribute
¶
video_id = Field(None, alias='videoId', description='The unique ID of the video.')