Create folders for third-party files
Commerce includes a folder named /thirdparty
where you can upload files needed by
third-party services such as Apple Pay and Google Search.
Files stored in the /thirdparty
folder can be accessed on your
site. For example, if your site is www.example.com and you upload a file named
myfile.html
, the file can be viewed at the following URL:
http://www.example.com/myfile.html
You can create subfolders of /thirdparty
and upload files to
these subfolders using the Commerce Admin API. For example, you could create a subfolder named
/thirdparty/myfolder
, and upload the file
myfile.html
to this subfolder. The file would then be accessible at
this URL:
http://www.example.com/myfolder/myfile.html
To create a subfolder of /thirdparty
, issue a
POST
request to the /ccadmin/v1/files/createFolder
endpoint on the administration server. The request JSON for this endpoint includes a single
property, folder
, for specifying the pathname, which must begin with
/thirdparty
.
For example, the following request creates a /myfolder
subfolder of the /thirdparty
folder:
POST /ccadmin/v1/files/createFolder HTTP 1.1
Authorization: Bearer <access_token>
{
"folder": "/thirdparty/myfolder"
}
If the folder creation is successful, the JSON payload in the response is empty. To verify that the folder was created successfully, see View a list of files and folders.