curl --request POST \
--url https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_id": "<string>",
"source_sub_id": "<string>",
"source_name": ""
}
'import requests
url = "https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}"
payload = {
"source_id": "<string>",
"source_sub_id": "<string>",
"source_name": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({source_id: '<string>', source_sub_id: '<string>', source_name: ''})
};
fetch('https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_id' => '<string>',
'source_sub_id' => '<string>',
'source_name' => ''
]),
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://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}"
payload := strings.NewReader("{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\"\n}")
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"sourceId": "<string>",
"sourceSubId": "<string>",
"sourceName": "<string>",
"url": "<string>",
"mobileOptimizedUrl": "<string>",
"active": true,
"type": "product",
"marketplace": "amazon.com",
"levantaProductCount": 123
}{
"status": 400,
"message": "You do not have permission to create a storefront link for this brand"
}{
"status": 401,
"message": "Unauthorized"
}{
"status": 404,
"message": "Storefront or Link Not Found"
}{
"status": 415,
"message": "Invalid Content Type: Must be \"application/json\" for post requests"
}{
"status": 422,
"message": "Input Validation Failed"
}Create Storefront Link by ID
Get a storefront link by its ID
curl --request POST \
--url https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_id": "<string>",
"source_sub_id": "<string>",
"source_name": ""
}
'import requests
url = "https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}"
payload = {
"source_id": "<string>",
"source_sub_id": "<string>",
"source_name": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({source_id: '<string>', source_sub_id: '<string>', source_name: ''})
};
fetch('https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_id' => '<string>',
'source_sub_id' => '<string>',
'source_name' => ''
]),
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://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}"
payload := strings.NewReader("{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\"\n}")
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.levanta.io/api/creator/v1/links/storefronts/{storefront_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"sourceId": "<string>",
"sourceSubId": "<string>",
"sourceName": "<string>",
"url": "<string>",
"mobileOptimizedUrl": "<string>",
"active": true,
"type": "product",
"marketplace": "amazon.com",
"levantaProductCount": 123
}{
"status": 400,
"message": "You do not have permission to create a storefront link for this brand"
}{
"status": 401,
"message": "Unauthorized"
}{
"status": 404,
"message": "Storefront or Link Not Found"
}{
"status": 415,
"message": "Invalid Content Type: Must be \"application/json\" for post requests"
}{
"status": 422,
"message": "Input Validation Failed"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
The storefront link to create
An ID that identifies where the created link will be used. Allowed characters: [a-zA-Z0-9-_@./ ]
1 - 256^[a-zA-Z0-9-_@./ ]*$An ID that identifies where the created link will be used. Allowed characters: [a-zA-Z0-9-_@./ ]
1 - 256^[a-zA-Z0-9-_@./ ]*$Display name for the source within Levanta
250Response
Success
An ID that identifies where the created link will be used. Allowed characters: [a-zA-Z0-9-_@./ ]
An ID to further identify the link underneath the source_id namespace. Allowed characters: [a-zA-Z0-9-_@./ ]
Display name for the source within Levanta
Whether or not the link is active. Inactive links do not earn commissions.
The type of the link. Product links are for amazon asin pages. Storefront links are for amazon storefront pages.
product, storefront The marketplace the link is associated with
amazon.com, amazon.co.uk, amazon.com.mx, amazon.ca, amazon.de, amazon.es, amazon.fr, amazon.it, amazon.nl