SkyHub API

Fulfillment

Fulfillment é o serviço armazenamento dos produtos e envio do pedido através do CD B2W, ou seja, o lojista utilizada a armazém da B2W. Portanto foi disponibilizado via API a possibilidade da loja enviar o XML da nota em 2 formatos, tanto o arquivo quanto o caminho onde o XML se encontra. Além disto é possível efetuar a consulta (GET) do estoque que possui no CD.

Envio do arquivo XML

Open in API Explorer
POST /fulfillment/b2w/delivery

Envio da NFe e venda do Seller

Example Request

Format:
curl --request POST \
  --url https://desenvolvedores.skyhub.com.br/fulfillment/b2w/delivery \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-accountmanager-key: SUAXACCOUNT' \
  --header 'x-api-key: YOUR API KEY HERE' \
  --header 'x-user-email: MUDAR@SEU_EMAIL.COM' \
  --data '{"recipient_document":"cnpj do CD","invoice":{"payload":"...insert XML body here..."}}'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.br/fulfillment/b2w/delivery")

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["content-type"] = 'application/json'
request["x-user-email"] = 'MUDAR@SEU_EMAIL.COM'
request["accept"] = 'application/json'
request["x-accountmanager-key"] = 'SUAXACCOUNT'
request["x-api-key"] = 'YOUR API KEY HERE'
request.body = "{\"recipient_document\":\"cnpj do CD\",\"invoice\":{\"payload\":\"...insert XML body here...\"}}"

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

var options = {
  "method": "POST",
  "hostname": "desenvolvedores.skyhub.com.br",
  "port": null,
  "path": "/fulfillment/b2w/delivery",
  "headers": {
    "content-type": "application/json",
    "x-user-email": "MUDAR@SEU_EMAIL.COM",
    "accept": "application/json",
    "x-accountmanager-key": "SUAXACCOUNT",
    "x-api-key": "YOUR API KEY HERE"
  }
};

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({ recipient_document: 'cnpj do CD',
  invoice: { payload: '...insert XML body here...' } }));
req.end();
import http.client

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

payload = "{\"recipient_document\":\"cnpj do CD\",\"invoice\":{\"payload\":\"...insert XML body here...\"}}"

headers = {
    'content-type': "application/json",
    'x-user-email': "MUDAR@SEU_EMAIL.COM",
    'accept': "application/json",
    'x-accountmanager-key': "SUAXACCOUNT",
    'x-api-key': "YOUR API KEY HERE"
    }

conn.request("POST", "/fulfillment/b2w/delivery", 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/fulfillment/b2w/delivery",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"recipient_document\":\"cnpj do CD\",\"invoice\":{\"payload\":\"...insert XML body here...\"}}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json",
    "x-accountmanager-key: SUAXACCOUNT",
    "x-api-key: YOUR API KEY HERE",
    "x-user-email: MUDAR@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/fulfillment/b2w/delivery"

	payload := strings.NewReader("{\"recipient_document\":\"cnpj do CD\",\"invoice\":{\"payload\":\"...insert XML body here...\"}}")

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("x-user-email", "MUDAR@SEU_EMAIL.COM")
	req.Header.Add("accept", "application/json")
	req.Header.Add("x-accountmanager-key", "SUAXACCOUNT")
	req.Header.Add("x-api-key", "YOUR API KEY HERE")

	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
Content-Type String Required application/json
X-User-Email String Required MUDAR@SEU_EMAIL.COM
Accept String Required application/json
x-accountmanager-key String Optional SUAXACCOUNT
X-Api-Key String Required YOUR API KEY HERE

Request Body

Name Type Required Description Example
body Object Required

inserção do arquivo XML

{
  "recipient_document": "cnpj do CD",
String
  "invoice": {
  "invoice": { ... }
Object
    "payload": "...insert XML body here..."
String
  }
}

Responses

204 Success (Empty Response)

Envio do caminho do arquivo XML

Open in API Explorer
POST /fulfillment/b2w/delivery

Example Request

Format:
curl --request POST \
  --url https://desenvolvedores.skyhub.com.br/fulfillment/b2w/delivery \
  --header 'accept: application/json' \
  --header 'content-type: multipart/form-data' \
  --header 'x-accountmanager-key: SUAXACCOUNT' \
  --header 'x-api-key: YOUR API KEY HERE' \
  --header 'x-user-email: MUDAR@SEU_EMAIL.COM' \
  --data '{"invoice[payload]=caminho do arquivo XML":null,"recipient_document":"cnpj CD"}'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.br/fulfillment/b2w/delivery")

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["content-type"] = 'multipart/form-data'
request["x-user-email"] = 'MUDAR@SEU_EMAIL.COM'
request["accept"] = 'application/json'
request["x-accountmanager-key"] = 'SUAXACCOUNT'
request["x-api-key"] = 'YOUR API KEY HERE'
request.body = "{\"invoice[payload]=caminho do arquivo XML\":null,\"recipient_document\":\"cnpj CD\"}"

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

var options = {
  "method": "POST",
  "hostname": "desenvolvedores.skyhub.com.br",
  "port": null,
  "path": "/fulfillment/b2w/delivery",
  "headers": {
    "content-type": "multipart/form-data",
    "x-user-email": "MUDAR@SEU_EMAIL.COM",
    "accept": "application/json",
    "x-accountmanager-key": "SUAXACCOUNT",
    "x-api-key": "YOUR API KEY HERE"
  }
};

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({ 'invoice[payload]=caminho do arquivo XML': null,
  recipient_document: 'cnpj CD' }));
req.end();
import http.client

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

payload = "{\"invoice[payload]=caminho do arquivo XML\":null,\"recipient_document\":\"cnpj CD\"}"

headers = {
    'content-type': "multipart/form-data",
    'x-user-email': "MUDAR@SEU_EMAIL.COM",
    'accept': "application/json",
    'x-accountmanager-key': "SUAXACCOUNT",
    'x-api-key': "YOUR API KEY HERE"
    }

conn.request("POST", "/fulfillment/b2w/delivery", 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/fulfillment/b2w/delivery",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"invoice[payload]=caminho do arquivo XML\":null,\"recipient_document\":\"cnpj CD\"}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: multipart/form-data",
    "x-accountmanager-key: SUAXACCOUNT",
    "x-api-key: YOUR API KEY HERE",
    "x-user-email: MUDAR@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/fulfillment/b2w/delivery"

	payload := strings.NewReader("{\"invoice[payload]=caminho do arquivo XML\":null,\"recipient_document\":\"cnpj CD\"}")

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

	req.Header.Add("content-type", "multipart/form-data")
	req.Header.Add("x-user-email", "MUDAR@SEU_EMAIL.COM")
	req.Header.Add("accept", "application/json")
	req.Header.Add("x-accountmanager-key", "SUAXACCOUNT")
	req.Header.Add("x-api-key", "YOUR API KEY HERE")

	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
Content-Type String Required multipart/form-data
X-User-Email String Required MUDAR@SEU_EMAIL.COM
Accept String Required application/json
x-accountmanager-key String Optional SUAXACCOUNT
X-Api-Key String Required YOUR API KEY HERE

Request Body

Name Type Required Description Example
body Object Required
{
  "invoice[payload]=caminho do arquivo XML": null,
File
  "recipient_document": "cnpj CD"
String
}

Responses

204 Success (Empty Response)

Consulta do Estoque

Open in API Explorer
GET /fulfillment/b2w/stock?recipient_document=cnpjdoCD&sku=SKU

Consulta do estoque no CD

  • É possivel paginar utilizando os parâmetros "page" e "per_page".
    page: identifica qual página será solicitada.
    per_page: quantidade de registro, sendo que o limite por pagina é 100.

Example Request

Format:
curl --request GET \
  --url 'https://desenvolvedores.skyhub.com.br/fulfillment/b2w/stock?recipient_document=cnpjdoCD&sku=SKU&page=1&per_page=100' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-api-key: YOUR API KEY HERE' \
  --header 'x-user-email: MUDAR@SEU_EMAIL.COM'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.br/fulfillment/b2w/stock?recipient_document=cnpjdoCD&sku=SKU&page=1&per_page=100")

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-user-email"] = 'MUDAR@SEU_EMAIL.COM'
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request["x-api-key"] = 'YOUR API KEY HERE'

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

var options = {
  "method": "GET",
  "hostname": "desenvolvedores.skyhub.com.br",
  "port": null,
  "path": "/fulfillment/b2w/stock?recipient_document=cnpjdoCD&sku=SKU&page=1&per_page=100",
  "headers": {
    "x-user-email": "MUDAR@SEU_EMAIL.COM",
    "accept": "application/json",
    "content-type": "application/json",
    "x-api-key": "YOUR API KEY HERE"
  }
};

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-user-email': "MUDAR@SEU_EMAIL.COM",
    'accept': "application/json",
    'content-type': "application/json",
    'x-api-key': "YOUR API KEY HERE"
    }

conn.request("GET", "/fulfillment/b2w/stock?recipient_document=cnpjdoCD&sku=SKU&page=1&per_page=100", 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/fulfillment/b2w/stock?recipient_document=cnpjdoCD&sku=SKU&page=1&per_page=100",
  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: application/json",
    "x-api-key: YOUR API KEY HERE",
    "x-user-email: MUDAR@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/fulfillment/b2w/stock?recipient_document=cnpjdoCD&sku=SKU&page=1&per_page=100"

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

	req.Header.Add("x-user-email", "MUDAR@SEU_EMAIL.COM")
	req.Header.Add("accept", "application/json")
	req.Header.Add("content-type", "application/json")
	req.Header.Add("x-api-key", "YOUR API KEY HERE")

	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
X-User-Email String Required MUDAR@SEU_EMAIL.COM
Accept String Optional application/json
Content-Type String Optional application/json
X-Api-Key String Required YOUR API KEY HERE

Query Parameters

Name Type Required Description Example
recipient_document String Optional cnpj+do+CD
sku String Optional

sku do produto

123
page Integer Optional

Página da requisição de pedidos

1
per_page Integer Optional

Quantidade de pedidos por página (máximo = 100)

100

Responses

200 Success Fulfillment Get estoque fulfillment
{
  stock: [
Array
    {
    { ... }
Object

Stocks

      "sku": "SKU",
String
      "recipient_document": "776574000741",
String
      "deposit_type": "3022 SB Revenda Outlet",
String
      "stock": "2",
String
      "reserved_stock": "0"
String
    }
  ]
}

Download das Notas de Retorno Simbólico

Open in API Explorer
GET fulfillment/b2w/delivery/nfe?cd_vat_number=05886614004476&delivery=12345678

Essa função será utilizado para que o seller tenha o retorno das baixas de estoque que ocorreram no CD. Por exemplo:
A loja enviou a quantidade de 100 itens para o CD. A cada pedido que ocorre é emitido a Nota, e a loja pode baixa-la, para que auxilie em sua contabilidade.
IMPORTANTE
delivery e order_access_key: Estes dois parâmetros são opcionais, porém um deles deve ser informado para efetuar a busca, ou seja é obrigatório informar ou um ou outro

Example Request

Format:
curl --request GET \
  --url 'https://desenvolvedores.skyhub.com.brfulfillment/b2w/delivery/nfe?cd_vat_number%20=05886614004476&delivery=12345678&order_access_key=foo&cd_vat_number=05886614004476' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-api-key: YOUR API KEY HERE' \
  --header 'x-user-email: foo'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.brfulfillment/b2w/delivery/nfe?cd_vat_number%20=05886614004476&delivery=12345678&order_access_key=foo&cd_vat_number=05886614004476")

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["content-type"] = 'application/json'
request["accept"] = 'application/json'
request["x-api-key"] = 'YOUR API KEY HERE'
request["x-user-email"] = 'foo'

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

var options = {
  "method": "GET",
  "hostname": "desenvolvedores.skyhub.com.brfulfillment",
  "port": null,
  "path": "/b2w/delivery/nfe?cd_vat_number%20=05886614004476&delivery=12345678&order_access_key=foo&cd_vat_number=05886614004476",
  "headers": {
    "content-type": "application/json",
    "accept": "application/json",
    "x-api-key": "YOUR API KEY HERE",
    "x-user-email": "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.brfulfillment")

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

conn.request("GET", "/b2w/delivery/nfe?cd_vat_number%20=05886614004476&delivery=12345678&order_access_key=foo&cd_vat_number=05886614004476", 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.brfulfillment/b2w/delivery/nfe?cd_vat_number%20=05886614004476&delivery=12345678&order_access_key=foo&cd_vat_number=05886614004476",
  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: application/json",
    "x-api-key: YOUR API KEY HERE",
    "x-user-email: foo"
  ),
));

$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.brfulfillment/b2w/delivery/nfe?cd_vat_number%20=05886614004476&delivery=12345678&order_access_key=foo&cd_vat_number=05886614004476"

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

	req.Header.Add("content-type", "application/json")
	req.Header.Add("accept", "application/json")
	req.Header.Add("x-api-key", "YOUR API KEY HERE")
	req.Header.Add("x-user-email", "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
Content-Type String Optional application/json
Accept String Optional application/json
X-Api-Key String Required YOUR API KEY HERE
X-User-Email String Required foo

Query Parameters

Name Type Required Description Example
cd_vat_number String Required

CNPJ do CD

05886614004476
delivery String Optional

Numero da Entrega

12345678
order_access_key String Optional

Chave de Acesso da Venda

foo

Responses

200 Success Fulfillment Get retorno da nota- sucesso
{
  nfes: [
Array
    {
    { ... }
Object

Nfes

      "id": "NFe35190105886614004476550030000537481149312314",
String
      "xml_content": "CONTEUDO DA NFE XML AQUI"
String
    }
  ]
}
422 erro 422

por exemplo se fizermos a chamada com um CNPJ errado

Fulfillment Get retorno da nota- erro
{
  "error": "ORA-20000:  [PC_NFCA_WS.CONSULTA_XML_NF_POST] - ORA-20101: [PC_NFCA_CON.obtem_xml_nf_cnpj] Erro ao obter lista NFe (id_cia/entrega/chave)  123456  ORA-20000: pc_fire.obtem_filial: CNPJ 7123456000123 nao encontrado.\nPC_FILI.Registro 2"
String
}

Lista de Pedidos para Notas de Retorno

Open in API Explorer
GET https://api.skyhub.com.br/fulfillment/b2w/delivery

Possibilidade de listar as entregas e fazer o download das notas de retorno simbólico, para cada entrega com status finalizado.

Example Request

Format:
curl --request GET \
  --url 'https://desenvolvedores.skyhub.com.brhttps//api.skyhub.com.br/fulfillment/b2w/delivery?from_date=DD%2FMM%2FAAAA&to_date=DD%2FMM%2FAAAA&status=finished%20&cd_vat_number=05886614004476&page=1&per_page=50' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-api-key: YOUR API KEY HERE' \
  --header 'x-user-email: YOUR@EMAIL.HERE'
require 'uri'
require 'net/http'

url = URI("https://desenvolvedores.skyhub.com.brhttps//api.skyhub.com.br/fulfillment/b2w/delivery?from_date=DD%2FMM%2FAAAA&to_date=DD%2FMM%2FAAAA&status=finished%20&cd_vat_number=05886614004476&page=1&per_page=50")

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["x-user-email"] = 'YOUR@EMAIL.HERE'
request["accept"] = 'application/json'
request["content-type"] = 'application/json'

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

var options = {
  "method": "GET",
  "hostname": "desenvolvedores.skyhub.com.brhttps",
  "port": null,
  "path": "//api.skyhub.com.br/fulfillment/b2w/delivery?from_date=DD%2FMM%2FAAAA&to_date=DD%2FMM%2FAAAA&status=finished%20&cd_vat_number=05886614004476&page=1&per_page=50",
  "headers": {
    "x-api-key": "YOUR API KEY HERE",
    "x-user-email": "YOUR@EMAIL.HERE",
    "accept": "application/json",
    "content-type": "application/json"
  }
};

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.brhttps")

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

conn.request("GET", "//api.skyhub.com.br/fulfillment/b2w/delivery?from_date=DD%2FMM%2FAAAA&to_date=DD%2FMM%2FAAAA&status=finished%20&cd_vat_number=05886614004476&page=1&per_page=50", 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.brhttps//api.skyhub.com.br/fulfillment/b2w/delivery?from_date=DD%2FMM%2FAAAA&to_date=DD%2FMM%2FAAAA&status=finished%20&cd_vat_number=05886614004476&page=1&per_page=50",
  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: application/json",
    "x-api-key: YOUR API KEY HERE",
    "x-user-email: YOUR@EMAIL.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.brhttps//api.skyhub.com.br/fulfillment/b2w/delivery?from_date=DD%2FMM%2FAAAA&to_date=DD%2FMM%2FAAAA&status=finished%20&cd_vat_number=05886614004476&page=1&per_page=50"

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

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

	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
X-Api-Key String Required YOUR API KEY HERE
x-user-email String Required YOUR@EMAIL.HERE
Accept String Required application/json
Content-Type String Required application/json

Query Parameters

Name Type Required Description Example
from_date String Required

Data de inicio para o filtro dos pedidos

DD%2FMM%2FAAAA
to_date String Required

Data final para o filtro dos pedidos

DD%2FMM%2FAAAA
status String Optional

As opçoes são: finished (Entregas Liquidadas), open (em aberto), canceled (Cancelados), all ou se não passar esse parâmetro virá todas. Lembrando que apenas as Entregas Liquidadas(finished) terão Nota Fiscal disponível para download.

finished+
cd_vat_number String Optional

CNPJ do CD: quando informado irá trazer apenas as entregas do CD Informado.

05886614004476
page String Optional

Numero da página,. Caso não informe retornará a primeira página que é a 0

1
per_page String Optional

Quantidade de registros por página. Caso não informe retornará 50 por padrão.

50

Responses

200 Success Fulfillment Lista - retorno da nota sucesso
{
  deliveries: [
Array
    {
    { ... }
Object

Deliveries

      "cd_vat_number": "5886614004476",
String
      "delivery": "107209378701",
String
      "status": "Finalizada",
String
      "order_access_key": "35190133014556138384550010000499781579904321",
String
      "invoice_sent_at": "10/01/2019 00:00:00",
String
      "xml_nfes_path": "/fulfillment/b2w/delivery/nfe?cd_vat_number=5886614004476&order_access_key=35190133014556138384550010000499781579904321"
String
    }
  ]
  "total_items": 7,
Integer
  "next_page_path": "/fulfillment/b2w/delivery?from_date=10%2F01%2F2019&page=1&status=finished&to_date=10%2F01%2F2019"
String
}
404 error (Empty Response)
422 error Fulfillment Lista - retorno da nota erro
{
  "error": "ORA-20000: pc_pedc_ag_con.lista_pedidos  - erro: ORA-20000: Informe o periodo De, para lista de pedidos."
String
}