curl --request PUT \
--url https://api.speedsellx.io/v2/public/products/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"image": "<string>",
"category_id": 2,
"language_id": 2,
"price": 1,
"is_free": true,
"convert_currency": true,
"is_encapsulated": true,
"has_speed_recovery": true,
"attachment_url": "<string>",
"landing_page": "<string>",
"support_email": "jsmith@example.com",
"author": "<string>",
"shipping_cost": 1,
"sku": "<string>",
"deliverable_content": "<string>"
}
'import requests
url = "https://api.speedsellx.io/v2/public/products/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"image": "<string>",
"category_id": 2,
"language_id": 2,
"price": 1,
"is_free": True,
"convert_currency": True,
"is_encapsulated": True,
"has_speed_recovery": True,
"attachment_url": "<string>",
"landing_page": "<string>",
"support_email": "jsmith@example.com",
"author": "<string>",
"shipping_cost": 1,
"sku": "<string>",
"deliverable_content": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
image: '<string>',
category_id: 2,
language_id: 2,
price: 1,
is_free: true,
convert_currency: true,
is_encapsulated: true,
has_speed_recovery: true,
attachment_url: '<string>',
landing_page: '<string>',
support_email: 'jsmith@example.com',
author: '<string>',
shipping_cost: 1,
sku: '<string>',
deliverable_content: '<string>'
})
};
fetch('https://api.speedsellx.io/v2/public/products/{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://api.speedsellx.io/v2/public/products/{id}",
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([
'name' => '<string>',
'description' => '<string>',
'image' => '<string>',
'category_id' => 2,
'language_id' => 2,
'price' => 1,
'is_free' => true,
'convert_currency' => true,
'is_encapsulated' => true,
'has_speed_recovery' => true,
'attachment_url' => '<string>',
'landing_page' => '<string>',
'support_email' => 'jsmith@example.com',
'author' => '<string>',
'shipping_cost' => 1,
'sku' => '<string>',
'deliverable_content' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.speedsellx.io/v2/public/products/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"category_id\": 2,\n \"language_id\": 2,\n \"price\": 1,\n \"is_free\": true,\n \"convert_currency\": true,\n \"is_encapsulated\": true,\n \"has_speed_recovery\": true,\n \"attachment_url\": \"<string>\",\n \"landing_page\": \"<string>\",\n \"support_email\": \"jsmith@example.com\",\n \"author\": \"<string>\",\n \"shipping_cost\": 1,\n \"sku\": \"<string>\",\n \"deliverable_content\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.put("https://api.speedsellx.io/v2/public/products/{id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"category_id\": 2,\n \"language_id\": 2,\n \"price\": 1,\n \"is_free\": true,\n \"convert_currency\": true,\n \"is_encapsulated\": true,\n \"has_speed_recovery\": true,\n \"attachment_url\": \"<string>\",\n \"landing_page\": \"<string>\",\n \"support_email\": \"jsmith@example.com\",\n \"author\": \"<string>\",\n \"shipping_cost\": 1,\n \"sku\": \"<string>\",\n \"deliverable_content\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.speedsellx.io/v2/public/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"category_id\": 2,\n \"language_id\": 2,\n \"price\": 1,\n \"is_free\": true,\n \"convert_currency\": true,\n \"is_encapsulated\": true,\n \"has_speed_recovery\": true,\n \"attachment_url\": \"<string>\",\n \"landing_page\": \"<string>\",\n \"support_email\": \"jsmith@example.com\",\n \"author\": \"<string>\",\n \"shipping_cost\": 1,\n \"sku\": \"<string>\",\n \"deliverable_content\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"seller_id": 123,
"name": "<string>",
"description": "<string>",
"price": "<string>",
"currency": "<string>",
"type": "<string>",
"payment_type": "<string>",
"publish_status": "<string>",
"is_free": true,
"approved": true,
"sku": "<string>",
"recurrence_interval": "<string>",
"recurrence_interval_count": 123,
"trial_days": 123,
"category_id": 123,
"language_id": 123,
"image": "<string>",
"image_url": "<string>",
"delivery": "<string>",
"deliverable_content": "<string>",
"attachment_url": "<string>",
"landing_page": "<string>",
"support_email": "<string>",
"author": "<string>",
"warranty_time": 123,
"shipping_cost": "<string>",
"is_encapsulated": true,
"convert_currency": true,
"has_speed_recovery": true
}
}{
"status": "error",
"error": "unauthenticated"
}{
"status": "error",
"error": "insufficient_scope"
}{
"status": "error",
"error": "not_found"
}{
"status": "error",
"error": "idempotency_in_progress"
}{
"message": "<string>",
"errors": {}
}Substituir produto
Substitui a representação completa de um produto
curl --request PUT \
--url https://api.speedsellx.io/v2/public/products/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"image": "<string>",
"category_id": 2,
"language_id": 2,
"price": 1,
"is_free": true,
"convert_currency": true,
"is_encapsulated": true,
"has_speed_recovery": true,
"attachment_url": "<string>",
"landing_page": "<string>",
"support_email": "jsmith@example.com",
"author": "<string>",
"shipping_cost": 1,
"sku": "<string>",
"deliverable_content": "<string>"
}
'import requests
url = "https://api.speedsellx.io/v2/public/products/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"image": "<string>",
"category_id": 2,
"language_id": 2,
"price": 1,
"is_free": True,
"convert_currency": True,
"is_encapsulated": True,
"has_speed_recovery": True,
"attachment_url": "<string>",
"landing_page": "<string>",
"support_email": "jsmith@example.com",
"author": "<string>",
"shipping_cost": 1,
"sku": "<string>",
"deliverable_content": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
image: '<string>',
category_id: 2,
language_id: 2,
price: 1,
is_free: true,
convert_currency: true,
is_encapsulated: true,
has_speed_recovery: true,
attachment_url: '<string>',
landing_page: '<string>',
support_email: 'jsmith@example.com',
author: '<string>',
shipping_cost: 1,
sku: '<string>',
deliverable_content: '<string>'
})
};
fetch('https://api.speedsellx.io/v2/public/products/{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://api.speedsellx.io/v2/public/products/{id}",
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([
'name' => '<string>',
'description' => '<string>',
'image' => '<string>',
'category_id' => 2,
'language_id' => 2,
'price' => 1,
'is_free' => true,
'convert_currency' => true,
'is_encapsulated' => true,
'has_speed_recovery' => true,
'attachment_url' => '<string>',
'landing_page' => '<string>',
'support_email' => 'jsmith@example.com',
'author' => '<string>',
'shipping_cost' => 1,
'sku' => '<string>',
'deliverable_content' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.speedsellx.io/v2/public/products/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"category_id\": 2,\n \"language_id\": 2,\n \"price\": 1,\n \"is_free\": true,\n \"convert_currency\": true,\n \"is_encapsulated\": true,\n \"has_speed_recovery\": true,\n \"attachment_url\": \"<string>\",\n \"landing_page\": \"<string>\",\n \"support_email\": \"jsmith@example.com\",\n \"author\": \"<string>\",\n \"shipping_cost\": 1,\n \"sku\": \"<string>\",\n \"deliverable_content\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.put("https://api.speedsellx.io/v2/public/products/{id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"category_id\": 2,\n \"language_id\": 2,\n \"price\": 1,\n \"is_free\": true,\n \"convert_currency\": true,\n \"is_encapsulated\": true,\n \"has_speed_recovery\": true,\n \"attachment_url\": \"<string>\",\n \"landing_page\": \"<string>\",\n \"support_email\": \"jsmith@example.com\",\n \"author\": \"<string>\",\n \"shipping_cost\": 1,\n \"sku\": \"<string>\",\n \"deliverable_content\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.speedsellx.io/v2/public/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"image\": \"<string>\",\n \"category_id\": 2,\n \"language_id\": 2,\n \"price\": 1,\n \"is_free\": true,\n \"convert_currency\": true,\n \"is_encapsulated\": true,\n \"has_speed_recovery\": true,\n \"attachment_url\": \"<string>\",\n \"landing_page\": \"<string>\",\n \"support_email\": \"jsmith@example.com\",\n \"author\": \"<string>\",\n \"shipping_cost\": 1,\n \"sku\": \"<string>\",\n \"deliverable_content\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"seller_id": 123,
"name": "<string>",
"description": "<string>",
"price": "<string>",
"currency": "<string>",
"type": "<string>",
"payment_type": "<string>",
"publish_status": "<string>",
"is_free": true,
"approved": true,
"sku": "<string>",
"recurrence_interval": "<string>",
"recurrence_interval_count": 123,
"trial_days": 123,
"category_id": 123,
"language_id": 123,
"image": "<string>",
"image_url": "<string>",
"delivery": "<string>",
"deliverable_content": "<string>",
"attachment_url": "<string>",
"landing_page": "<string>",
"support_email": "<string>",
"author": "<string>",
"warranty_time": 123,
"shipping_cost": "<string>",
"is_encapsulated": true,
"convert_currency": true,
"has_speed_recovery": true
}
}{
"status": "error",
"error": "unauthenticated"
}{
"status": "error",
"error": "insufficient_scope"
}{
"status": "error",
"error": "not_found"
}{
"status": "error",
"error": "idempotency_in_progress"
}{
"message": "<string>",
"errors": {}
}products:write e o header HTTP Idempotency-Key.
price faz parte do corpo. Quando o valor enviado difere do que está gravado, ele é aplicado pela mesma operação de preço, que ressincroniza o produto com o adquirente.
O campo image segue a regra da criação: data URI base64 ou o caminho já gravado, devolvido como veio. Uma URL externa não é baixada.
Um produto de outra conta retorna 404 sem escrever nada.Authorizations
A chave de API da conta, no formato sk_{modo}_{prefixo}.{segredo}.
Headers
Chave única da operação. Obrigatória em toda requisição que altera dados; sem ela a resposta é 422 idempotency_key_required. Um reenvio com a mesma chave e o mesmo corpo repete a resposta guardada.
255Path Parameters
Body
Body of PUT /v2/public/products/{id}. A PUT replaces the whole representation, so it accepts exactly what a create accepts, price included; the source api declared its update request the same way (SHA 70cd772).
The price is not part of the attribute write in the core (it moves through its own operation so the acquirer is re-synced), so the controller applies it separately when it differs from what is stored.
255255Either a base64 data URI (uploaded to storage) or an already stored path echoed back. Which one it is, is Catalog's decision.
x >= 1x >= 1unique, recurring x >= 0brl, usd, eur physical, digital draft, published nothing, memberkit, cademi, rocketmember, astronmembers, download, external 7, 14, 21, 30 daily, weekly, fortnightly, monthly, twomonthly, quarterly, semiannual, yearly, null 255255255255x >= 0Three fields the source api never accepted, added because the read answers them: a product created here would otherwise come back with a sku, a trial and a deliverable the caller had no way to set.
2553, 7, 14, 30, null Response
ApiProductResource
Show child attributes
Show child attributes