curl --request POST \
--url https://opendelivery.gohusky.net/logistic/v1/logistics/availability \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant": {
"id": "MERCHANT-001",
"name": "Restaurante Exemplo"
},
"pickupAddress": {
"country": "Brasil",
"state": "SP",
"city": "São Paulo",
"district": "Centro",
"street": "Rua Exemplo",
"number": "123",
"postalCode": "01310-100",
"latitude": -23.5505,
"longitude": -46.6333
},
"returnToMerchant": false,
"canCombine": false,
"deliveryAddress": {
"country": "Brasil",
"state": "SP",
"city": "São Paulo",
"district": "Pinheiros",
"street": "Av. Exemplo",
"number": "456",
"postalCode": "05433-000",
"latitude": -23.5675,
"longitude": -46.6925
},
"vehicle": {
"type": [
"MOTORBIKE_BAG"
],
"container": "NORMAL",
"containerSize": null,
"instruction": null
},
"limitTimes": {
"pickupLimit": 30,
"deliveryLimit": 60,
"orderCreatedAt": "2024-01-15T10:30:00.000Z"
},
"totalOrderPrice": {
"value": 45.5,
"currency": "BRL"
},
"orderDeliveryFee": {
"value": 8.5,
"currency": "BRL"
},
"totalWeight": 500,
"packageVolume": 2000,
"packageQuantity": 1,
"specialInstructions": null,
"additionalPricePercentual": null,
"onlinePayment": true
}
'import requests
url = "https://opendelivery.gohusky.net/logistic/v1/logistics/availability"
payload = {
"merchant": {
"id": "MERCHANT-001",
"name": "Restaurante Exemplo"
},
"pickupAddress": {
"country": "Brasil",
"state": "SP",
"city": "São Paulo",
"district": "Centro",
"street": "Rua Exemplo",
"number": "123",
"postalCode": "01310-100",
"latitude": -23.5505,
"longitude": -46.6333
},
"returnToMerchant": False,
"canCombine": False,
"deliveryAddress": {
"country": "Brasil",
"state": "SP",
"city": "São Paulo",
"district": "Pinheiros",
"street": "Av. Exemplo",
"number": "456",
"postalCode": "05433-000",
"latitude": -23.5675,
"longitude": -46.6925
},
"vehicle": {
"type": ["MOTORBIKE_BAG"],
"container": "NORMAL",
"containerSize": None,
"instruction": None
},
"limitTimes": {
"pickupLimit": 30,
"deliveryLimit": 60,
"orderCreatedAt": "2024-01-15T10:30:00.000Z"
},
"totalOrderPrice": {
"value": 45.5,
"currency": "BRL"
},
"orderDeliveryFee": {
"value": 8.5,
"currency": "BRL"
},
"totalWeight": 500,
"packageVolume": 2000,
"packageQuantity": 1,
"specialInstructions": None,
"additionalPricePercentual": None,
"onlinePayment": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchant: {id: 'MERCHANT-001', name: 'Restaurante Exemplo'},
pickupAddress: {
country: 'Brasil',
state: 'SP',
city: 'São Paulo',
district: 'Centro',
street: 'Rua Exemplo',
number: '123',
postalCode: '01310-100',
latitude: -23.5505,
longitude: -46.6333
},
returnToMerchant: false,
canCombine: false,
deliveryAddress: {
country: 'Brasil',
state: 'SP',
city: 'São Paulo',
district: 'Pinheiros',
street: 'Av. Exemplo',
number: '456',
postalCode: '05433-000',
latitude: -23.5675,
longitude: -46.6925
},
vehicle: {
type: ['MOTORBIKE_BAG'],
container: 'NORMAL',
containerSize: null,
instruction: null
},
limitTimes: {pickupLimit: 30, deliveryLimit: 60, orderCreatedAt: '2024-01-15T10:30:00.000Z'},
totalOrderPrice: {value: 45.5, currency: 'BRL'},
orderDeliveryFee: {value: 8.5, currency: 'BRL'},
totalWeight: 500,
packageVolume: 2000,
packageQuantity: 1,
specialInstructions: null,
additionalPricePercentual: null,
onlinePayment: true
})
};
fetch('https://opendelivery.gohusky.net/logistic/v1/logistics/availability', 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://opendelivery.gohusky.net/logistic/v1/logistics/availability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merchant' => [
'id' => 'MERCHANT-001',
'name' => 'Restaurante Exemplo'
],
'pickupAddress' => [
'country' => 'Brasil',
'state' => 'SP',
'city' => 'São Paulo',
'district' => 'Centro',
'street' => 'Rua Exemplo',
'number' => '123',
'postalCode' => '01310-100',
'latitude' => -23.5505,
'longitude' => -46.6333
],
'returnToMerchant' => false,
'canCombine' => false,
'deliveryAddress' => [
'country' => 'Brasil',
'state' => 'SP',
'city' => 'São Paulo',
'district' => 'Pinheiros',
'street' => 'Av. Exemplo',
'number' => '456',
'postalCode' => '05433-000',
'latitude' => -23.5675,
'longitude' => -46.6925
],
'vehicle' => [
'type' => [
'MOTORBIKE_BAG'
],
'container' => 'NORMAL',
'containerSize' => null,
'instruction' => null
],
'limitTimes' => [
'pickupLimit' => 30,
'deliveryLimit' => 60,
'orderCreatedAt' => '2024-01-15T10:30:00.000Z'
],
'totalOrderPrice' => [
'value' => 45.5,
'currency' => 'BRL'
],
'orderDeliveryFee' => [
'value' => 8.5,
'currency' => 'BRL'
],
'totalWeight' => 500,
'packageVolume' => 2000,
'packageQuantity' => 1,
'specialInstructions' => null,
'additionalPricePercentual' => null,
'onlinePayment' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://opendelivery.gohusky.net/logistic/v1/logistics/availability"
payload := strings.NewReader("{\n \"merchant\": {\n \"id\": \"MERCHANT-001\",\n \"name\": \"Restaurante Exemplo\"\n },\n \"pickupAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Centro\",\n \"street\": \"Rua Exemplo\",\n \"number\": \"123\",\n \"postalCode\": \"01310-100\",\n \"latitude\": -23.5505,\n \"longitude\": -46.6333\n },\n \"returnToMerchant\": false,\n \"canCombine\": false,\n \"deliveryAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Pinheiros\",\n \"street\": \"Av. Exemplo\",\n \"number\": \"456\",\n \"postalCode\": \"05433-000\",\n \"latitude\": -23.5675,\n \"longitude\": -46.6925\n },\n \"vehicle\": {\n \"type\": [\n \"MOTORBIKE_BAG\"\n ],\n \"container\": \"NORMAL\",\n \"containerSize\": null,\n \"instruction\": null\n },\n \"limitTimes\": {\n \"pickupLimit\": 30,\n \"deliveryLimit\": 60,\n \"orderCreatedAt\": \"2024-01-15T10:30:00.000Z\"\n },\n \"totalOrderPrice\": {\n \"value\": 45.5,\n \"currency\": \"BRL\"\n },\n \"orderDeliveryFee\": {\n \"value\": 8.5,\n \"currency\": \"BRL\"\n },\n \"totalWeight\": 500,\n \"packageVolume\": 2000,\n \"packageQuantity\": 1,\n \"specialInstructions\": null,\n \"additionalPricePercentual\": null,\n \"onlinePayment\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://opendelivery.gohusky.net/logistic/v1/logistics/availability")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant\": {\n \"id\": \"MERCHANT-001\",\n \"name\": \"Restaurante Exemplo\"\n },\n \"pickupAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Centro\",\n \"street\": \"Rua Exemplo\",\n \"number\": \"123\",\n \"postalCode\": \"01310-100\",\n \"latitude\": -23.5505,\n \"longitude\": -46.6333\n },\n \"returnToMerchant\": false,\n \"canCombine\": false,\n \"deliveryAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Pinheiros\",\n \"street\": \"Av. Exemplo\",\n \"number\": \"456\",\n \"postalCode\": \"05433-000\",\n \"latitude\": -23.5675,\n \"longitude\": -46.6925\n },\n \"vehicle\": {\n \"type\": [\n \"MOTORBIKE_BAG\"\n ],\n \"container\": \"NORMAL\",\n \"containerSize\": null,\n \"instruction\": null\n },\n \"limitTimes\": {\n \"pickupLimit\": 30,\n \"deliveryLimit\": 60,\n \"orderCreatedAt\": \"2024-01-15T10:30:00.000Z\"\n },\n \"totalOrderPrice\": {\n \"value\": 45.5,\n \"currency\": \"BRL\"\n },\n \"orderDeliveryFee\": {\n \"value\": 8.5,\n \"currency\": \"BRL\"\n },\n \"totalWeight\": 500,\n \"packageVolume\": 2000,\n \"packageQuantity\": 1,\n \"specialInstructions\": null,\n \"additionalPricePercentual\": null,\n \"onlinePayment\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://opendelivery.gohusky.net/logistic/v1/logistics/availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant\": {\n \"id\": \"MERCHANT-001\",\n \"name\": \"Restaurante Exemplo\"\n },\n \"pickupAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Centro\",\n \"street\": \"Rua Exemplo\",\n \"number\": \"123\",\n \"postalCode\": \"01310-100\",\n \"latitude\": -23.5505,\n \"longitude\": -46.6333\n },\n \"returnToMerchant\": false,\n \"canCombine\": false,\n \"deliveryAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Pinheiros\",\n \"street\": \"Av. Exemplo\",\n \"number\": \"456\",\n \"postalCode\": \"05433-000\",\n \"latitude\": -23.5675,\n \"longitude\": -46.6925\n },\n \"vehicle\": {\n \"type\": [\n \"MOTORBIKE_BAG\"\n ],\n \"container\": \"NORMAL\",\n \"containerSize\": null,\n \"instruction\": null\n },\n \"limitTimes\": {\n \"pickupLimit\": 30,\n \"deliveryLimit\": 60,\n \"orderCreatedAt\": \"2024-01-15T10:30:00.000Z\"\n },\n \"totalOrderPrice\": {\n \"value\": 45.5,\n \"currency\": \"BRL\"\n },\n \"orderDeliveryFee\": {\n \"value\": 8.5,\n \"currency\": \"BRL\"\n },\n \"totalWeight\": 500,\n \"packageVolume\": 2000,\n \"packageQuantity\": 1,\n \"specialInstructions\": null,\n \"additionalPricePercentual\": null,\n \"onlinePayment\": true\n}"
response = http.request(request)
puts response.read_body{
"deliveryPrice": {
"value": 8.5,
"currency": "BRL"
},
"vehicles": {
"availableVehicles": 15,
"vehiclesAvailable": {
"type": [
"MOTORBIKE_BAG",
"CAR"
],
"container": "NORMAL"
}
}
}{
"title": "Erro inesperado.",
"status": 400
}{
"title": "Não autorizado",
"status": 401
}Cotação de entrega
Verifica a disponibilidade de veículos e calcula os preços de entrega para uma rota específica.
curl --request POST \
--url https://opendelivery.gohusky.net/logistic/v1/logistics/availability \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant": {
"id": "MERCHANT-001",
"name": "Restaurante Exemplo"
},
"pickupAddress": {
"country": "Brasil",
"state": "SP",
"city": "São Paulo",
"district": "Centro",
"street": "Rua Exemplo",
"number": "123",
"postalCode": "01310-100",
"latitude": -23.5505,
"longitude": -46.6333
},
"returnToMerchant": false,
"canCombine": false,
"deliveryAddress": {
"country": "Brasil",
"state": "SP",
"city": "São Paulo",
"district": "Pinheiros",
"street": "Av. Exemplo",
"number": "456",
"postalCode": "05433-000",
"latitude": -23.5675,
"longitude": -46.6925
},
"vehicle": {
"type": [
"MOTORBIKE_BAG"
],
"container": "NORMAL",
"containerSize": null,
"instruction": null
},
"limitTimes": {
"pickupLimit": 30,
"deliveryLimit": 60,
"orderCreatedAt": "2024-01-15T10:30:00.000Z"
},
"totalOrderPrice": {
"value": 45.5,
"currency": "BRL"
},
"orderDeliveryFee": {
"value": 8.5,
"currency": "BRL"
},
"totalWeight": 500,
"packageVolume": 2000,
"packageQuantity": 1,
"specialInstructions": null,
"additionalPricePercentual": null,
"onlinePayment": true
}
'import requests
url = "https://opendelivery.gohusky.net/logistic/v1/logistics/availability"
payload = {
"merchant": {
"id": "MERCHANT-001",
"name": "Restaurante Exemplo"
},
"pickupAddress": {
"country": "Brasil",
"state": "SP",
"city": "São Paulo",
"district": "Centro",
"street": "Rua Exemplo",
"number": "123",
"postalCode": "01310-100",
"latitude": -23.5505,
"longitude": -46.6333
},
"returnToMerchant": False,
"canCombine": False,
"deliveryAddress": {
"country": "Brasil",
"state": "SP",
"city": "São Paulo",
"district": "Pinheiros",
"street": "Av. Exemplo",
"number": "456",
"postalCode": "05433-000",
"latitude": -23.5675,
"longitude": -46.6925
},
"vehicle": {
"type": ["MOTORBIKE_BAG"],
"container": "NORMAL",
"containerSize": None,
"instruction": None
},
"limitTimes": {
"pickupLimit": 30,
"deliveryLimit": 60,
"orderCreatedAt": "2024-01-15T10:30:00.000Z"
},
"totalOrderPrice": {
"value": 45.5,
"currency": "BRL"
},
"orderDeliveryFee": {
"value": 8.5,
"currency": "BRL"
},
"totalWeight": 500,
"packageVolume": 2000,
"packageQuantity": 1,
"specialInstructions": None,
"additionalPricePercentual": None,
"onlinePayment": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchant: {id: 'MERCHANT-001', name: 'Restaurante Exemplo'},
pickupAddress: {
country: 'Brasil',
state: 'SP',
city: 'São Paulo',
district: 'Centro',
street: 'Rua Exemplo',
number: '123',
postalCode: '01310-100',
latitude: -23.5505,
longitude: -46.6333
},
returnToMerchant: false,
canCombine: false,
deliveryAddress: {
country: 'Brasil',
state: 'SP',
city: 'São Paulo',
district: 'Pinheiros',
street: 'Av. Exemplo',
number: '456',
postalCode: '05433-000',
latitude: -23.5675,
longitude: -46.6925
},
vehicle: {
type: ['MOTORBIKE_BAG'],
container: 'NORMAL',
containerSize: null,
instruction: null
},
limitTimes: {pickupLimit: 30, deliveryLimit: 60, orderCreatedAt: '2024-01-15T10:30:00.000Z'},
totalOrderPrice: {value: 45.5, currency: 'BRL'},
orderDeliveryFee: {value: 8.5, currency: 'BRL'},
totalWeight: 500,
packageVolume: 2000,
packageQuantity: 1,
specialInstructions: null,
additionalPricePercentual: null,
onlinePayment: true
})
};
fetch('https://opendelivery.gohusky.net/logistic/v1/logistics/availability', 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://opendelivery.gohusky.net/logistic/v1/logistics/availability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'merchant' => [
'id' => 'MERCHANT-001',
'name' => 'Restaurante Exemplo'
],
'pickupAddress' => [
'country' => 'Brasil',
'state' => 'SP',
'city' => 'São Paulo',
'district' => 'Centro',
'street' => 'Rua Exemplo',
'number' => '123',
'postalCode' => '01310-100',
'latitude' => -23.5505,
'longitude' => -46.6333
],
'returnToMerchant' => false,
'canCombine' => false,
'deliveryAddress' => [
'country' => 'Brasil',
'state' => 'SP',
'city' => 'São Paulo',
'district' => 'Pinheiros',
'street' => 'Av. Exemplo',
'number' => '456',
'postalCode' => '05433-000',
'latitude' => -23.5675,
'longitude' => -46.6925
],
'vehicle' => [
'type' => [
'MOTORBIKE_BAG'
],
'container' => 'NORMAL',
'containerSize' => null,
'instruction' => null
],
'limitTimes' => [
'pickupLimit' => 30,
'deliveryLimit' => 60,
'orderCreatedAt' => '2024-01-15T10:30:00.000Z'
],
'totalOrderPrice' => [
'value' => 45.5,
'currency' => 'BRL'
],
'orderDeliveryFee' => [
'value' => 8.5,
'currency' => 'BRL'
],
'totalWeight' => 500,
'packageVolume' => 2000,
'packageQuantity' => 1,
'specialInstructions' => null,
'additionalPricePercentual' => null,
'onlinePayment' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://opendelivery.gohusky.net/logistic/v1/logistics/availability"
payload := strings.NewReader("{\n \"merchant\": {\n \"id\": \"MERCHANT-001\",\n \"name\": \"Restaurante Exemplo\"\n },\n \"pickupAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Centro\",\n \"street\": \"Rua Exemplo\",\n \"number\": \"123\",\n \"postalCode\": \"01310-100\",\n \"latitude\": -23.5505,\n \"longitude\": -46.6333\n },\n \"returnToMerchant\": false,\n \"canCombine\": false,\n \"deliveryAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Pinheiros\",\n \"street\": \"Av. Exemplo\",\n \"number\": \"456\",\n \"postalCode\": \"05433-000\",\n \"latitude\": -23.5675,\n \"longitude\": -46.6925\n },\n \"vehicle\": {\n \"type\": [\n \"MOTORBIKE_BAG\"\n ],\n \"container\": \"NORMAL\",\n \"containerSize\": null,\n \"instruction\": null\n },\n \"limitTimes\": {\n \"pickupLimit\": 30,\n \"deliveryLimit\": 60,\n \"orderCreatedAt\": \"2024-01-15T10:30:00.000Z\"\n },\n \"totalOrderPrice\": {\n \"value\": 45.5,\n \"currency\": \"BRL\"\n },\n \"orderDeliveryFee\": {\n \"value\": 8.5,\n \"currency\": \"BRL\"\n },\n \"totalWeight\": 500,\n \"packageVolume\": 2000,\n \"packageQuantity\": 1,\n \"specialInstructions\": null,\n \"additionalPricePercentual\": null,\n \"onlinePayment\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://opendelivery.gohusky.net/logistic/v1/logistics/availability")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant\": {\n \"id\": \"MERCHANT-001\",\n \"name\": \"Restaurante Exemplo\"\n },\n \"pickupAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Centro\",\n \"street\": \"Rua Exemplo\",\n \"number\": \"123\",\n \"postalCode\": \"01310-100\",\n \"latitude\": -23.5505,\n \"longitude\": -46.6333\n },\n \"returnToMerchant\": false,\n \"canCombine\": false,\n \"deliveryAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Pinheiros\",\n \"street\": \"Av. Exemplo\",\n \"number\": \"456\",\n \"postalCode\": \"05433-000\",\n \"latitude\": -23.5675,\n \"longitude\": -46.6925\n },\n \"vehicle\": {\n \"type\": [\n \"MOTORBIKE_BAG\"\n ],\n \"container\": \"NORMAL\",\n \"containerSize\": null,\n \"instruction\": null\n },\n \"limitTimes\": {\n \"pickupLimit\": 30,\n \"deliveryLimit\": 60,\n \"orderCreatedAt\": \"2024-01-15T10:30:00.000Z\"\n },\n \"totalOrderPrice\": {\n \"value\": 45.5,\n \"currency\": \"BRL\"\n },\n \"orderDeliveryFee\": {\n \"value\": 8.5,\n \"currency\": \"BRL\"\n },\n \"totalWeight\": 500,\n \"packageVolume\": 2000,\n \"packageQuantity\": 1,\n \"specialInstructions\": null,\n \"additionalPricePercentual\": null,\n \"onlinePayment\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://opendelivery.gohusky.net/logistic/v1/logistics/availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant\": {\n \"id\": \"MERCHANT-001\",\n \"name\": \"Restaurante Exemplo\"\n },\n \"pickupAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Centro\",\n \"street\": \"Rua Exemplo\",\n \"number\": \"123\",\n \"postalCode\": \"01310-100\",\n \"latitude\": -23.5505,\n \"longitude\": -46.6333\n },\n \"returnToMerchant\": false,\n \"canCombine\": false,\n \"deliveryAddress\": {\n \"country\": \"Brasil\",\n \"state\": \"SP\",\n \"city\": \"São Paulo\",\n \"district\": \"Pinheiros\",\n \"street\": \"Av. Exemplo\",\n \"number\": \"456\",\n \"postalCode\": \"05433-000\",\n \"latitude\": -23.5675,\n \"longitude\": -46.6925\n },\n \"vehicle\": {\n \"type\": [\n \"MOTORBIKE_BAG\"\n ],\n \"container\": \"NORMAL\",\n \"containerSize\": null,\n \"instruction\": null\n },\n \"limitTimes\": {\n \"pickupLimit\": 30,\n \"deliveryLimit\": 60,\n \"orderCreatedAt\": \"2024-01-15T10:30:00.000Z\"\n },\n \"totalOrderPrice\": {\n \"value\": 45.5,\n \"currency\": \"BRL\"\n },\n \"orderDeliveryFee\": {\n \"value\": 8.5,\n \"currency\": \"BRL\"\n },\n \"totalWeight\": 500,\n \"packageVolume\": 2000,\n \"packageQuantity\": 1,\n \"specialInstructions\": null,\n \"additionalPricePercentual\": null,\n \"onlinePayment\": true\n}"
response = http.request(request)
puts response.read_body{
"deliveryPrice": {
"value": 8.5,
"currency": "BRL"
},
"vehicles": {
"availableVehicles": 15,
"vehiclesAvailable": {
"type": [
"MOTORBIKE_BAG",
"CAR"
],
"container": "NORMAL"
}
}
}{
"title": "Erro inesperado.",
"status": 400
}{
"title": "Não autorizado",
"status": 401
}- Preço de entrega calculado
- Veículos disponíveis e seus tipos
- Quantidade total de veículos disponíveis
Authorizations
Token de acesso OAuth 2.0 obtido através do endpoint /oauth/token.
Use o formato: Authorization: Bearer {access_token}
O token deve ser incluído em todas as requisições aos endpoints protegidos.
Body
Endereço de coleta do pedido.
Show child attributes
Show child attributes
Informa se o entregador deve retornar ao endereço de coleta após a entrega ter sido efetuada.
false
Se a entrega pode ser combinada com outras
false
Endereço de entrega do pedido.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Peso total do pedido em gramas
x >= 0500
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Volume do pacote em centímetros cúbicos
x >= 02000
Quantidade de pacotes
x >= 11
Instruções especiais para a entrega
"Produto frágil"
Percentual adicional no preço (0-100)
0 <= x <= 10010.5
Se o pagamento é online
true
Was this page helpful?

