Code Storefronts
Replace code storefront source
Developer API operation for PUT /dev/v1/code-storefronts//source.
PUT
/
dev
/
v1
/
code-storefronts
/
{id}
/
source
Replace code storefront source
curl --request PUT \
--url https://api.shoppex.io/dev/v1/code-storefronts/{id}/source \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"path": "<string>",
"content_base64": "<string>"
}
],
"expected_source_revision": "<string>",
"carry_over_unlisted": false
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [{path: '<string>', content_base64: '<string>'}],
expected_source_revision: '<string>',
carry_over_unlisted: false
})
};
fetch('https://api.shoppex.io/dev/v1/code-storefronts/{id}/source', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/code-storefronts/{id}/source"
payload = {
"files": [
{
"path": "<string>",
"content_base64": "<string>"
}
],
"expected_source_revision": "<string>",
"carry_over_unlisted": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/code-storefronts/{id}/source",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'path' => '<string>',
'content_base64' => '<string>'
]
],
'expected_source_revision' => '<string>',
'carry_over_unlisted' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoppex.io/dev/v1/code-storefronts/{id}/source"
payload := strings.NewReader("{\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content_base64\": \"<string>\"\n }\n ],\n \"expected_source_revision\": \"<string>\",\n \"carry_over_unlisted\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {}
}Authorizations
Use your Shoppex API key in the Authorization header.
Path Parameters
Body
application/json
Response
200 - application/json
Successful response
Previous
Get code storefront source fileDeveloper API operation for GET /dev/v1/code-storefronts/{id}/source/content.
Next
⌘I
Replace code storefront source
curl --request PUT \
--url https://api.shoppex.io/dev/v1/code-storefronts/{id}/source \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"path": "<string>",
"content_base64": "<string>"
}
],
"expected_source_revision": "<string>",
"carry_over_unlisted": false
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [{path: '<string>', content_base64: '<string>'}],
expected_source_revision: '<string>',
carry_over_unlisted: false
})
};
fetch('https://api.shoppex.io/dev/v1/code-storefronts/{id}/source', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/code-storefronts/{id}/source"
payload = {
"files": [
{
"path": "<string>",
"content_base64": "<string>"
}
],
"expected_source_revision": "<string>",
"carry_over_unlisted": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/code-storefronts/{id}/source",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'path' => '<string>',
'content_base64' => '<string>'
]
],
'expected_source_revision' => '<string>',
'carry_over_unlisted' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoppex.io/dev/v1/code-storefronts/{id}/source"
payload := strings.NewReader("{\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content_base64\": \"<string>\"\n }\n ],\n \"expected_source_revision\": \"<string>\",\n \"carry_over_unlisted\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {}
}