Create Product Link
curl --request POST \
--url https://app.levanta.io/api/creator/v2/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product": {
"primary_id": "<string>"
},
"subid1": "<string>",
"subid2": "<string>",
"sharedid": "<string>"
}
'import requests
url = "https://app.levanta.io/api/creator/v2/links"
payload = {
"product": { "primary_id": "<string>" },
"subid1": "<string>",
"subid2": "<string>",
"sharedid": "<string>"
}
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({
product: {primary_id: '<string>'},
subid1: '<string>',
subid2: '<string>',
sharedid: '<string>'
})
};
fetch('https://app.levanta.io/api/creator/v2/links', 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/v2/links",
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([
'product' => [
'primary_id' => '<string>'
],
'subid1' => '<string>',
'subid2' => '<string>',
'sharedid' => '<string>'
]),
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/v2/links"
payload := strings.NewReader("{\n \"product\": {\n \"primary_id\": \"<string>\"\n },\n \"subid1\": \"<string>\",\n \"subid2\": \"<string>\",\n \"sharedid\": \"<string>\"\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/v2/links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product\": {\n \"primary_id\": \"<string>\"\n },\n \"subid1\": \"<string>\",\n \"subid2\": \"<string>\",\n \"sharedid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.levanta.io/api/creator/v2/links")
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 \"product\": {\n \"primary_id\": \"<string>\"\n },\n \"subid1\": \"<string>\",\n \"subid2\": \"<string>\",\n \"sharedid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"mobileOptimizedUrl": "<string>"
}{
"status": 400,
"message": "You do not have permission to create a link for this product"
}{
"status": 401,
"message": "Unauthorized"
}{
"status": 404,
"message": "Product Not Found"
}{
"status": 415,
"message": "Invalid Content Type: Must be \"application/json\" for post requests"
}{
"status": 422,
"message": "Input Validation Failed"
}Links
Create Product Link
POST
/
links
Create Product Link
curl --request POST \
--url https://app.levanta.io/api/creator/v2/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product": {
"primary_id": "<string>"
},
"subid1": "<string>",
"subid2": "<string>",
"sharedid": "<string>"
}
'import requests
url = "https://app.levanta.io/api/creator/v2/links"
payload = {
"product": { "primary_id": "<string>" },
"subid1": "<string>",
"subid2": "<string>",
"sharedid": "<string>"
}
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({
product: {primary_id: '<string>'},
subid1: '<string>',
subid2: '<string>',
sharedid: '<string>'
})
};
fetch('https://app.levanta.io/api/creator/v2/links', 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/v2/links",
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([
'product' => [
'primary_id' => '<string>'
],
'subid1' => '<string>',
'subid2' => '<string>',
'sharedid' => '<string>'
]),
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/v2/links"
payload := strings.NewReader("{\n \"product\": {\n \"primary_id\": \"<string>\"\n },\n \"subid1\": \"<string>\",\n \"subid2\": \"<string>\",\n \"sharedid\": \"<string>\"\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/v2/links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product\": {\n \"primary_id\": \"<string>\"\n },\n \"subid1\": \"<string>\",\n \"subid2\": \"<string>\",\n \"sharedid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.levanta.io/api/creator/v2/links")
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 \"product\": {\n \"primary_id\": \"<string>\"\n },\n \"subid1\": \"<string>\",\n \"subid2\": \"<string>\",\n \"sharedid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"mobileOptimizedUrl": "<string>"
}{
"status": 400,
"message": "You do not have permission to create a link for this product"
}{
"status": 401,
"message": "Unauthorized"
}{
"status": 404,
"message": "Product 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.
Body
application/json
The product link to create
Show child attributes
Show child attributes
An ID that identifies where the created link will be used. Allowed characters: [a-zA-Z0-9-_@./ ]
Required string length:
1 - 256Pattern:
^[a-zA-Z0-9-_@./ ]*$An ID that identifies where the created link will be used. Allowed characters: [a-zA-Z0-9-_@./ ]
Required string length:
1 - 256Pattern:
^[a-zA-Z0-9-_@./ ]*$Will be added to the link parameters as sharedid. NOTE: only supported when product.marketplace is shopify.com, otherwise an 422 error will be thrown.
Response
Success
Available options:
product, storefront The marketplace the link is associated with
Available options:
amazon.com, amazon.com.mx, amazon.co.uk, amazon.ca, amazon.de, amazon.es, amazon.fr, amazon.it, amazon.nl, walmart.com, shopify.com ⌘I