SkyHub API

statuses

Status dos pedidos

statuses Overview

{
  "code": "pending",
String

Código de identificação do status

  "label": "Aguardando pagamento",
String

Descrição do status

  "type": "NEW"
String

Tipo do status (StatusType)

}

Receber uma lista de status

Open in API Explorer
GET statuses

Recebe uma lista com os status de pedidos cadastrados em array

Example Request

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

url = URI("https://desenvolvedores.skyhub.com.brstatuses/")

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-accountmanager-key"] = 'foo'

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

var options = {
  "method": "GET",
  "hostname": "desenvolvedores.skyhub.com.brstatuses",
  "port": null,
  "path": "/",
  "headers": {
    "x-api-key": "YOUR API KEY HERE",
    "accept": "application/json",
    "content-type": "foo",
    "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.brstatuses")

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

conn.request("GET", "/", 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.brstatuses/",
  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"
  ),
));

$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.brstatuses/"

	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-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-accountmanager-key String Required

Identificador da sua integração com a SkyHub

foo

Responses

200 Success

Requisição executada com sucesso

statuses Statuses
[
  "code": "pending",
String

Código de identificação do status

  "label": "Aguardando pagamento",
String

Descrição do status

  "type": "NEW"
String

Tipo do status (StatusType)

]

Criar um status

Open in API Explorer
POST statuses

Criar um novo status de pedido

Example Request

Format:
curl --request POST \
  --url https://desenvolvedores.skyhub.com.brstatuses/ \
  --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 '{"status":{"code":"pending","label":"Aguardando pagamento","type":"NEW"}}'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.brstatuses/")

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

request = Net::HTTP::Post.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 = "{\"status\":{\"code\":\"pending\",\"label\":\"Aguardando pagamento\",\"type\":\"NEW\"}}"

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

var options = {
  "method": "POST",
  "hostname": "desenvolvedores.skyhub.com.brstatuses",
  "port": null,
  "path": "/",
  "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({ status: { code: 'pending', label: 'Aguardando pagamento', type: 'NEW' } }));
req.end();
import http.client

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

payload = "{\"status\":{\"code\":\"pending\",\"label\":\"Aguardando pagamento\",\"type\":\"NEW\"}}"

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("POST", "/", 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.brstatuses/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"status\":{\"code\":\"pending\",\"label\":\"Aguardando pagamento\",\"type\":\"NEW\"}}",
  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.brstatuses/"

	payload := strings.NewReader("{\"status\":{\"code\":\"pending\",\"label\":\"Aguardando pagamento\",\"type\":\"NEW\"}}")

	req, _ := http.NewRequest("POST", 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

Dados do status a ser criado

{
  "status": {
  "status": { ... }
Object
    "code": "pending",
String

Código de identificação do status

    "label": "Aguardando pagamento",
String

Descrição do status

    "type": "NEW"
String

Tipo do status (StatusType)

  }
}

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

Status criado com sucesso

(Empty Response)
400 StatusTypeNotFound

Tipo de status não encontrado

statuses Statustypenotfound
{
  "error": "Não foi possível encontrar StatusType: FOO"
String

StatusType não encontrado

}

Atualizar status

Open in API Explorer
PUT statuses/{code}

Atualizar status de pedido criado anteriormente

Example Request

Format:
curl --request PUT \
  --url https://desenvolvedores.skyhub.com.brstatuses/pending \
  --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 '{"status":{"label":"Pagamento pendente","type":"NEW"}}'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.brstatuses/pending")

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 = "{\"status\":{\"label\":\"Pagamento pendente\",\"type\":\"NEW\"}}"

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

var options = {
  "method": "PUT",
  "hostname": "desenvolvedores.skyhub.com.brstatuses",
  "port": null,
  "path": "/pending",
  "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({ status: { label: 'Pagamento pendente', type: 'NEW' } }));
req.end();
import http.client

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

payload = "{\"status\":{\"label\":\"Pagamento pendente\",\"type\":\"NEW\"}}"

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", "/pending", 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.brstatuses/pending",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"status\":{\"label\":\"Pagamento pendente\",\"type\":\"NEW\"}}",
  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.brstatuses/pending"

	payload := strings.NewReader("{\"status\":{\"label\":\"Pagamento pendente\",\"type\":\"NEW\"}}")

	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))

}

Path Parameters

Name Type Required Description Example
code String Required

Código de identificação do pedido a ser atualizado

pending

Request Body

Name Type Required Description Example
body Object Optional

Dados do status a ser atualizado

{
  "status": {
  "status": { ... }
Object
    "label": "Pagamento pendente",
String

Descrição do status

    "type": "NEW"
String

Tipo do status (StatusType)

  }
}

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

Status atualizado com sucesso

(Empty Response)
400 StatusTypeNotFound

Tipo de status não encontrado

statuses Statustypenotfound
{
  "error": "Não foi possível encontrar StatusType: FOO"
String

StatusType não encontrado

}
404 NotFound

Status não encontrado

statuses Statusnotfound
{
  "error": "Não foi possível encontrar Status: FOO"
String

Status não encontrado

}