SkyHub API

queues

Fila de integração

queues Overview

{
  "code": "foo",
String
  "channel": "foo",
String
  "placed_at": "datetime",
String
  "updated_at": "datetime",
String
  "total_ordered": 0,
Integer
  "interest": 0,
Integer
  "shipping_cost": 0,
Integer
  "shipping_method": "foo",
String
  "estimated_delivery": "datetime",
String
  "shipping_address": {
  "shipping_address": { ... }
Object
    "street": "foo",
String
    "number": "foo",
String
    "detail": "foo",
String
    "neighborhood": "foo",
String
    "city": "foo",
String
    "region": "foo",
String
    "country": "foo",
String
    "postcode": "foo"
String
  },
  "billing_address": {
  "billing_address": { ... }
Object
    "street": "foo",
String
    "number": "foo",
String
    "detail": "foo",
String
    "neighborhood": "foo",
String
    "city": "foo",
String
    "region": "foo",
String
    "country": "foo",
String
    "postcode": "foo"
String
  },
  "customer": {
  "customer": { ... }
Object
    "name": "foo",
String
    "email": "foo",
String
    "date_of_birth": "foo",
String
    "gender": "foo",
String
    "vat_number": "foo",
String
    "phones": [
    "foo",
    "foo",
    "foo"
  ]
Array
  },
  items: [
Array
    {
    { ... }
Object

Items

      "id": "foo",
String
      "product_id": "foo",
String
      "name": "foo",
String
      "qty": 0,
Integer
      "original_price": 0,
Integer
      "special_price": 0
Integer
    }
  ]
  "status": {
  "status": { ... }
Object
    "code": "foo",
String
    "label": "foo",
String
    "type": "foo"
String
  },
  "sync_status": "String",
String
  invoices: [
Array
    {
    { ... }
Object

Invoices

      "key": "foo",
String
      "number": "foo",
String
      "line": "foo",
String
      "issue_date": "datetime"
String
    }
  ]
  shipments: [
Array
    {
    { ... }
Object

Shipments

      "code": "foo",
String
      items: [
Array
        {
        { ... }
Object

Items

          "sku": "foo",
String
          "qty": 0
Integer
        }
      ]
      tracks: [
Array
        {
        { ... }
Object

Tracks

          "code": "foo",
String
          "carrier": "foo",
String
          "method": "foo"
String
        }
      ]
    }
  ]
  payments: [
Array
    {
    { ... }
Object

Payments

      "method": "foo",
String
      "description": "foo",
String
      "parcels": 0,
Integer
      "value": 0
Integer
    }
  ]
}

Consumir um pedido

Open in API Explorer
GET /queues/orders

Recupera o primeiro pedido disponível na fila de integração. Após o processamento do pedido, o mesmo deve ser removido da fila de integração em até 5 minutos (ou retornará para o início da fila)

[Importante] Será retornado um 'body' vazio caso não exista pedido disponível na fila!

Para maiores informações acesse o nosso Guia

https://skyhub.gelato.io/guides/queues-fila-de-integracao

Example Request

Format:
curl --request GET \
  --url https://desenvolvedores.skyhub.com.br/queues/orders \
  --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/queues/orders")

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": "/queues/orders",
  "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", "/queues/orders", 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/queues/orders",
  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/queues/orders"

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

}

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 queues List orders
{
  "code": "foo",
String
  "channel": "foo",
String
  "placed_at": "datetime",
String
  "updated_at": "datetime",
String
  "total_ordered": 0,
Integer
  "interest": 0,
Integer
  "shipping_cost": 0,
Integer
  "shipping_method": "foo",
String
  "estimated_delivery": "datetime",
String
  "shipping_address": {
  "shipping_address": { ... }
Object
    "street": "foo",
String
    "number": "foo",
String
    "detail": "foo",
String
    "neighborhood": "foo",
String
    "city": "foo",
String
    "region": "foo",
String
    "country": "foo",
String
    "postcode": "foo"
String
  },
  "billing_address": {
  "billing_address": { ... }
Object
    "street": "foo",
String
    "number": "foo",
String
    "detail": "foo",
String
    "neighborhood": "foo",
String
    "city": "foo",
String
    "region": "foo",
String
    "country": "foo",
String
    "postcode": "foo"
String
  },
  "customer": {
  "customer": { ... }
Object
    "name": "foo",
String
    "email": "foo",
String
    "date_of_birth": "foo",
String
    "gender": "foo",
String
    "vat_number": "foo",
String
    "phones": [
    "foo",
    "foo",
    "foo"
  ]
Array
  },
  items: [
Array
    {
    { ... }
Object

Items

      "id": "foo",
String
      "product_id": "foo",
String
      "name": "foo",
String
      "qty": 0,
Integer
      "original_price": 0,
Integer
      "special_price": 0
Integer
    }
  ]
  "status": {
  "status": { ... }
Object
    "code": "foo",
String
    "label": "foo",
String
    "type": "foo"
String
  },
  "sync_status": "String",
String
  invoices: [
Array
    {
    { ... }
Object

Invoices

      "key": "foo",
String
      "number": "foo",
String
      "line": "foo",
String
      "issue_date": "datetime"
String
    }
  ]
  shipments: [
Array
    {
    { ... }
Object

Shipments

      "code": "foo",
String
      items: [
Array
        {
        { ... }
Object

Items

          "sku": "foo",
String
          "qty": 0
Integer
        }
      ]
      tracks: [
Array
        {
        { ... }
Object

Tracks

          "code": "foo",
String
          "carrier": "foo",
String
          "method": "foo"
String
        }
      ]
    }
  ]
  payments: [
Array
    {
    { ... }
Object

Payments

      "method": "foo",
String
      "description": "foo",
String
      "parcels": 0,
Integer
      "value": 0
Integer
    }
  ]
}

Remover um pedido da fila

Open in API Explorer
DELETE /queues/orders/{code}

Remover um pedido da fila de integração

Example Request

Format:
curl --request DELETE \
  --url https://desenvolvedores.skyhub.com.br/queues/orders/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/queues/orders/foo")

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": "/queues/orders/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("DELETE", "/queues/orders/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/queues/orders/foo",
  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/queues/orders/foo"

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

}

Path Parameters

Name Type Required Description Example
code String Required

Código do pedido

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

204 Success (Empty Response)