SkyHub API

variations

Variações de produto

variations Overview

{
  "variation": {
  "variation": { ... }
Object
    "sku": "foo",
String
    "qty": 0,
Integer
    "ean": "foo",
String
    "images": [
    "foo",
    "foo",
    "foo"
  ],
Array
    specifications: [
Array
      {
      { ... }
Object

Specifications

        "key": "foo",
String
        "value": "foo"
String
      }
    ]
  },
  "product": {
  "product": { ... }
Object
    "sku": "foo"
String
  }
}

List variations

Open in API Explorer
GET /variations/{sku}

Consultar lista de variação

Example Request

Format:
curl --request GET \
  --url https://desenvolvedores.skyhub.com.br/variations/foo \
  --header 'accept: application/json' \
  --header 'content-type: foo' \
  --header 'x-accountmanager-key: foo' \
  --header 'x-api-key: YOUR API KEY HERE' \
  --header 'x-user-email: seu@email.com'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.br/variations/foo")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["x-api-key"] = 'YOUR API KEY HERE'
request["accept"] = 'application/json'
request["content-type"] = 'foo'
request["x-user-email"] = 'seu@email.com'
request["x-accountmanager-key"] = 'foo'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "desenvolvedores.skyhub.com.br",
  "port": null,
  "path": "/variations/foo",
  "headers": {
    "x-api-key": "YOUR API KEY HERE",
    "accept": "application/json",
    "content-type": "foo",
    "x-user-email": "seu@email.com",
    "x-accountmanager-key": "foo"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("desenvolvedores.skyhub.com.br")

headers = {
    'x-api-key': "YOUR API KEY HERE",
    'accept': "application/json",
    'content-type': "foo",
    'x-user-email': "seu@email.com",
    'x-accountmanager-key': "foo"
    }

conn.request("GET", "/variations/foo", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://desenvolvedores.skyhub.com.br/variations/foo",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: foo",
    "x-accountmanager-key: foo",
    "x-api-key: YOUR API KEY HERE",
    "x-user-email: seu@email.com"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://desenvolvedores.skyhub.com.br/variations/foo"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "YOUR API KEY HERE")
	req.Header.Add("accept", "application/json")
	req.Header.Add("content-type", "foo")
	req.Header.Add("x-user-email", "seu@email.com")
	req.Header.Add("x-accountmanager-key", "foo")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
sku String Required

SKU do produto

foo

Request Headers

Name Type Required Description Example
Accept String Required application/json
Content-Type String Required foo
X-User-Email String Required seu@email.com
x-accountmanager-key String Required

Identificador da sua integração com a SkyHub

foo

Responses

200 Success variations Sku variação
{
  "variation": {
  "variation": { ... }
Object
    "sku": "foo",
String
    "qty": 0,
Integer
    "ean": "foo",
String
    "images": [
    "foo",
    "foo",
    "foo"
  ],
Array
    specifications: [
Array
      {
      { ... }
Object

Specifications

        "key": "foo",
String
        "value": "foo"
String
      }
    ]
  },
  "product": {
  "product": { ... }
Object
    "sku": "foo"
String
  }
}

Atualizar uma variação

Open in API Explorer
PUT /variations/{sku}

Atualiza uma variação cadastrada no sistema

Example Request

Format:
curl --request PUT \
  --url https://desenvolvedores.skyhub.com.br/variations/foo \
  --header 'accept: application/json' \
  --header 'content-type: foo' \
  --header 'x-accountmanager-key: foo' \
  --header 'x-api-key: YOUR API KEY HERE' \
  --header 'x-user-email: seu@email.com' \
  --data '{"variation":{"qty":10000,"ean":"foo","images":["foo","foo","foo"],"specifications":[{"key":"price","value":"350.00"}]}}'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.br/variations/foo")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["x-api-key"] = 'YOUR API KEY HERE'
request["accept"] = 'application/json'
request["content-type"] = 'foo'
request["x-user-email"] = 'seu@email.com'
request["x-accountmanager-key"] = 'foo'
request.body = "{\"variation\":{\"qty\":10000,\"ean\":\"foo\",\"images\":[\"foo\",\"foo\",\"foo\"],\"specifications\":[{\"key\":\"price\",\"value\":\"350.00\"}]}}"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "desenvolvedores.skyhub.com.br",
  "port": null,
  "path": "/variations/foo",
  "headers": {
    "x-api-key": "YOUR API KEY HERE",
    "accept": "application/json",
    "content-type": "foo",
    "x-user-email": "seu@email.com",
    "x-accountmanager-key": "foo"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ variation: 
   { qty: 10000,
     ean: 'foo',
     images: [ 'foo', 'foo', 'foo' ],
     specifications: [ { key: 'price', value: '350.00' } ] } }));
req.end();
import http.client

conn = http.client.HTTPSConnection("desenvolvedores.skyhub.com.br")

payload = "{\"variation\":{\"qty\":10000,\"ean\":\"foo\",\"images\":[\"foo\",\"foo\",\"foo\"],\"specifications\":[{\"key\":\"price\",\"value\":\"350.00\"}]}}"

headers = {
    'x-api-key': "YOUR API KEY HERE",
    'accept': "application/json",
    'content-type': "foo",
    'x-user-email': "seu@email.com",
    'x-accountmanager-key': "foo"
    }

conn.request("PUT", "/variations/foo", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://desenvolvedores.skyhub.com.br/variations/foo",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"variation\":{\"qty\":10000,\"ean\":\"foo\",\"images\":[\"foo\",\"foo\",\"foo\"],\"specifications\":[{\"key\":\"price\",\"value\":\"350.00\"}]}}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: foo",
    "x-accountmanager-key: foo",
    "x-api-key: YOUR API KEY HERE",
    "x-user-email: seu@email.com"
  ),
));

$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/ioutil"
)

func main() {

	url := "https://desenvolvedores.skyhub.com.br/variations/foo"

	payload := strings.NewReader("{\"variation\":{\"qty\":10000,\"ean\":\"foo\",\"images\":[\"foo\",\"foo\",\"foo\"],\"specifications\":[{\"key\":\"price\",\"value\":\"350.00\"}]}}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("x-api-key", "YOUR API KEY HERE")
	req.Header.Add("accept", "application/json")
	req.Header.Add("content-type", "foo")
	req.Header.Add("x-user-email", "seu@email.com")
	req.Header.Add("x-accountmanager-key", "foo")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Request Body

Name Type Required Description Example
body Object Required

Atributos para atualizar em uma variação

{
  "variation": {
  "variation": { ... }
Object
    "qty": 10000,
Integer
    "ean": "foo",
String
    "images": [
    "foo",
    "foo",
    "foo"
  ],
Array
    specifications: [
Array
      {
      { ... }
Object

Specifications

        "key": "price",
String
        "value": "350.00"
String
      }
    ]
  }
}

Request Headers

Name Type Required Description Example
Accept String Required application/json
Content-Type String Required foo
X-User-Email String Required seu@email.com
x-accountmanager-key String Required

Identificador da sua integração com a SkyHub

foo

Path Parameters

Name Type Required Description Example
sku String Required foo

Apagar uma variação

Open in API Explorer
DELETE /variations/{sku}

Apaga uma variação caso o item esteja desconectado na Skyhub

Example Request

Format:
curl --request DELETE \
  --url https://desenvolvedores.skyhub.com.br/variations/%7Bsku%7D \
  --header 'accept: application/json' \
  --header 'content-type: foo' \
  --header 'x-accountmanager-key: foo' \
  --header 'x-api-key: YOUR API KEY HERE' \
  --header 'x-user-email: seu@email.com'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.br/variations/%7Bsku%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["x-api-key"] = 'YOUR API KEY HERE'
request["accept"] = 'application/json'
request["content-type"] = 'foo'
request["x-user-email"] = 'seu@email.com'
request["x-accountmanager-key"] = 'foo'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "DELETE",
  "hostname": "desenvolvedores.skyhub.com.br",
  "port": null,
  "path": "/variations/%7Bsku%7D",
  "headers": {
    "x-api-key": "YOUR API KEY HERE",
    "accept": "application/json",
    "content-type": "foo",
    "x-user-email": "seu@email.com",
    "x-accountmanager-key": "foo"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("desenvolvedores.skyhub.com.br")

headers = {
    'x-api-key': "YOUR API KEY HERE",
    'accept': "application/json",
    'content-type': "foo",
    'x-user-email': "seu@email.com",
    'x-accountmanager-key': "foo"
    }

conn.request("DELETE", "/variations/%7Bsku%7D", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://desenvolvedores.skyhub.com.br/variations/%7Bsku%7D",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: foo",
    "x-accountmanager-key: foo",
    "x-api-key: YOUR API KEY HERE",
    "x-user-email: seu@email.com"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://desenvolvedores.skyhub.com.br/variations/%7Bsku%7D"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("x-api-key", "YOUR API KEY HERE")
	req.Header.Add("accept", "application/json")
	req.Header.Add("content-type", "foo")
	req.Header.Add("x-user-email", "seu@email.com")
	req.Header.Add("x-accountmanager-key", "foo")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Request Headers

Name Type Required Description Example
Accept String Required application/json
Content-Type String Required foo
X-User-Email String Required seu@email.com
x-accountmanager-key String Required

Identificador da sua integração com a SkyHub

foo

Responses

204 Success (Empty Response)

Atualizar Preço da Variação

Open in API Explorer
PUT /variations/{SKU}

Example Request

Format:
curl --request PUT \
  --url https://desenvolvedores.skyhub.com.br/variations/%7BSKU%7D \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-accountmanager-key: foo' \
  --header 'x-api-key: suaChaveDeApi' \
  --header 'x-user-email: seu@email.com' \
  --data '{"variation":{"specifications":[{"key":"price","value":"1.00"}]}}'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.br/variations/%7BSKU%7D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request["x-user-email"] = 'seu@email.com'
request["x-api-key"] = 'suaChaveDeApi'
request["x-accountmanager-key"] = 'foo'
request.body = "{\"variation\":{\"specifications\":[{\"key\":\"price\",\"value\":\"1.00\"}]}}"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "desenvolvedores.skyhub.com.br",
  "port": null,
  "path": "/variations/%7BSKU%7D",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json",
    "x-user-email": "seu@email.com",
    "x-api-key": "suaChaveDeApi",
    "x-accountmanager-key": "foo"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ variation: { specifications: [ { key: 'price', value: '1.00' } ] } }));
req.end();
import http.client

conn = http.client.HTTPSConnection("desenvolvedores.skyhub.com.br")

payload = "{\"variation\":{\"specifications\":[{\"key\":\"price\",\"value\":\"1.00\"}]}}"

headers = {
    'accept': "application/json",
    'content-type': "application/json",
    'x-user-email': "seu@email.com",
    'x-api-key': "suaChaveDeApi",
    'x-accountmanager-key': "foo"
    }

conn.request("PUT", "/variations/%7BSKU%7D", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://desenvolvedores.skyhub.com.br/variations/%7BSKU%7D",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"variation\":{\"specifications\":[{\"key\":\"price\",\"value\":\"1.00\"}]}}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json",
    "x-accountmanager-key: foo",
    "x-api-key: suaChaveDeApi",
    "x-user-email: seu@email.com"
  ),
));

$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/ioutil"
)

func main() {

	url := "https://desenvolvedores.skyhub.com.br/variations/%7BSKU%7D"

	payload := strings.NewReader("{\"variation\":{\"specifications\":[{\"key\":\"price\",\"value\":\"1.00\"}]}}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("content-type", "application/json")
	req.Header.Add("x-user-email", "seu@email.com")
	req.Header.Add("x-api-key", "suaChaveDeApi")
	req.Header.Add("x-accountmanager-key", "foo")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Request Headers

Name Type Required Description Example
accept String Required application/json
content-type String Required application/json
x-user-email String Required seu@email.com
x-api-key String Required suaChaveDeApi
x-accountmanager-key String Required

Código Identificador da sua integração

foo

Request Body

Name Type Required Description Example
Atualizar Preço de Variação Object Required
{
  "variation": {
  "variation": { ... }
Object
    specifications: [
Array
      {
      { ... }
Object

Specifications

        "key": "price",
String
        "value": "1.00"
String
      }
    ]
  }
}