Obtener producto específico
curl --request GET \
--url https://tu-dominio.com/api/external/v1/inventory/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://tu-dominio.com/api/external/v1/inventory/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://tu-dominio.com/api/external/v1/inventory/{id}', 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://tu-dominio.com/api/external/v1/inventory/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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"
)
func main() {
url := "https://tu-dominio.com/api/external/v1/inventory/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://tu-dominio.com/api/external/v1/inventory/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tu-dominio.com/api/external/v1/inventory/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"meta": {
"empresa": "Mi Empresa S.A.",
"timestamp": "2023-11-07T05:31:56Z",
"filters_applied": {}
},
"data": {
"nombre": "Smartphone Samsung Galaxy",
"tipo": "Producto",
"enable": "1",
"descripcion": "Teléfono inteligente de última generación",
"codigo": "PHONE-001",
"barcode": "1234567890123",
"precio": 599.99,
"costo": 450,
"marca": "Samsung",
"nombre_categoria": "Electrónicos",
"img": "productos/smartphone.jpg",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"inventarios": [
{
"stock": 25,
"stock_minimo": 5,
"stock_maximo": 100,
"nombre_bodega": "Bodega Principal",
"nombre_sucursal": "Sucursal Centro",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
}Inventario
Obtener producto específico
Obtiene los detalles completos de un producto específico con su inventario
GET
/
inventory
/
{id}
Obtener producto específico
curl --request GET \
--url https://tu-dominio.com/api/external/v1/inventory/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://tu-dominio.com/api/external/v1/inventory/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://tu-dominio.com/api/external/v1/inventory/{id}', 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://tu-dominio.com/api/external/v1/inventory/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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"
)
func main() {
url := "https://tu-dominio.com/api/external/v1/inventory/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://tu-dominio.com/api/external/v1/inventory/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://tu-dominio.com/api/external/v1/inventory/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"meta": {
"empresa": "Mi Empresa S.A.",
"timestamp": "2023-11-07T05:31:56Z",
"filters_applied": {}
},
"data": {
"nombre": "Smartphone Samsung Galaxy",
"tipo": "Producto",
"enable": "1",
"descripcion": "Teléfono inteligente de última generación",
"codigo": "PHONE-001",
"barcode": "1234567890123",
"precio": 599.99,
"costo": 450,
"marca": "Samsung",
"nombre_categoria": "Electrónicos",
"img": "productos/smartphone.jpg",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"inventarios": [
{
"stock": 25,
"stock_minimo": 5,
"stock_maximo": 100,
"nombre_bodega": "Bodega Principal",
"nombre_sucursal": "Sucursal Centro",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
}Autorizaciones
API Key de la empresa en formato Bearer token.
Ejemplo: Authorization: Bearer G8RCjH11DabBNjnX7wO5
Parámetros de ruta
ID del producto
Ejemplo:
456
⌘I