• PXM Products/
    PXM Product Assets/
    Files API Overview

    Files API Overview

    You can upload image files or URLs by using multipart/form-data as the content type header. For example, "Content-Type: multipart/form-data" \. Elastic Path Commerce Cloud supports the following file types.

    File ExtensionDescription
    .gifGraphics Interchange Format (GIF)
    .jpg/jpegJoint Photographic Experts Group (JPEG) format
    .pngPortable graphics format
    .webpWeb picture format
    .mp4Moving Picture Experts Group (MPEG) format
    .movQuickTime Movie format
    .pdfPortable Document Format
    .svgScalable Vector Graphics format
    .usdzUniversal Scene Description Format
    .glbGlobal File format
    .jp2Compressed bitmap image saved in Joint Photographic Experts Group (JPEG) format
    .jxrExtended range for Joint Photographic Experts Group (JPEG) format
    .aacAdvanced Audio Coding (AAC) format
    .vrmlVirtual Reality Modelling Language (VRML) format
    .doc(x)Microsoft Word Open XML format
    .ppt(x)Microsoft PowerPoint Open XML format
    .xls(x)Microsoft Excel Open XML format

    By default, the maximum file size is 8 MB. If you need to support larger file sizes, contact your Elastic Path representative. Alternatively, store files somewhere else and reference them.

    The File object

    idstringThe unique identifier for this file.
    typestringThe type represents the object being returned.
    linkobjectThe file link object.
    file_namestringThe name of the file.
    mime_typestringThe mime type of the file.
    file_sizeintegerThe size of the file. Required when uploading files.
    DEPRECATED publicbooleanWhether the file public or not. Required when uploading files.
    file_locationstringThe URL that points to an image. Required when referencing files stored externally.
    metaobjectThe additional meta object.
    linksobjectThe file links object.
    link.hrefstringThe publicly available URL for this file.

    The file meta object

    meta.dimensions.widthintegerThe width of the file.
    meta.dimensions.heightintegerThe height of the file.
    meta.timestamps.created_atstringThe creation date of the file.
    links.selfstringThe URL of this file object.

    Response Example

      "data": {
        "id": "272d3ff0-5034-4986-8786-0ff97450745d",
        "type": "file",
        "link": {
          "href": "https://files-eu.epusercontent.com/2a85964e-cb3d-482a-ab02-0f0e47ab5662/273d3ff0-5034-4986-8786-0ff97450745.jpg"
        "file_name": "image.jpg",
        "mime_type": "image/jpeg",
        "file_size": 20953,
        "meta": {
          "dimensions": {
            "width": 1600,
            "height": 800
          "timestamps": {
            "created_at": "2017-08-14T10:47:45.191Z"
        "links": {
          "self": "https://api.moltin.com/v2/files/272d3ff0-5034-4986-8786-0ff97450745d"


    The following attributes are available for filtering files.

    file_namestringeq / likeeq(file_name, my_image.jpg)
    widthintegergt / ge / lt / legt(width,200)
    heightintegergt / ge / lt / lelt(height,500)
    DEPRECATED publicbooleaneqeq(public,true)
    file_sizeintegergt / ge / lt / lele(file_size,20953)

    Supported characters

    As filters are passed as URL query string parameters, we must ensure all filters are URL safe and are strict about the characters that can be used in a filter.

    CharactersCan be used in filter?
    A-Z (upper)No (must be lower case).
    " " (space)No

    Example string for filtering:

    const { MoltinClient } = require('@moltin/request')
    const client = new MoltinClient({
      client_id: 'X',
      client_secret: 'X'
    //Clean up the file name
    const filterName = fileName.replace(/[^A-Z0-9]/gi, "_")
      .then(product => {
        // Do something...

    Was this helpful?