Obter ordem de compra
curl --request GET \
--url https://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}', 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://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}",
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://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}"
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://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}")
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{
"id": 123,
"numeroPedido": "<string>",
"data": "2024-01-01",
"desconto": "<string>",
"frete": 123,
"totalProdutos": 123,
"totalPedidoCompra": 123,
"dataPrevista": "2024-01-01",
"itens": [
{
"produto": {
"id": 123,
"sku": "<string>",
"descricao": "<string>"
},
"gtin": "<string>",
"quantidade": 123,
"preco": 123,
"ipi": 123
}
],
"contato": {
"nome": "<string>",
"codigo": "<string>",
"fantasia": "<string>",
"cpfCnpj": "<string>",
"inscricaoEstadual": "<string>",
"rg": "<string>",
"telefone": "<string>",
"celular": "<string>",
"email": "<string>",
"endereco": {
"endereco": "<string>",
"numero": "<string>",
"complemento": "<string>",
"bairro": "<string>",
"municipio": "<string>",
"cep": "<string>",
"uf": "<string>",
"pais": "<string>"
},
"id": 123
},
"categoria": {
"id": 123,
"nome": "<string>",
"caminhoCompleto": "<string>"
},
"notaFiscal": {
"id": 123,
"numero": "<string>",
"dataEmissao": "2024-01-01",
"valor": "<string>",
"natureza": "<string>"
},
"parcelas": [
{
"id": 123,
"numero": 123,
"dias": 123,
"dataVencimento": "<string>",
"valor": 123,
"contaContabil": {
"id": 123
},
"observacoes": "<string>"
}
],
"observacoes": "<string>",
"observacoesInternas": "<string>",
"pvFrete": 123
}{
"mensagem": "Ocorreram erros de validação",
"detalhes": [
{
"campo": "codigo",
"mensagem": "O campo código é obrigatório"
}
]
}Ordem de Compra
Obter ordem de compra
GET
/
ordem-compra
/
{idOrdemCompra}
Obter ordem de compra
curl --request GET \
--url https://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}', 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://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}",
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://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}"
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://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tiny.com.br/public-api/v3/ordem-compra/{idOrdemCompra}")
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{
"id": 123,
"numeroPedido": "<string>",
"data": "2024-01-01",
"desconto": "<string>",
"frete": 123,
"totalProdutos": 123,
"totalPedidoCompra": 123,
"dataPrevista": "2024-01-01",
"itens": [
{
"produto": {
"id": 123,
"sku": "<string>",
"descricao": "<string>"
},
"gtin": "<string>",
"quantidade": 123,
"preco": 123,
"ipi": 123
}
],
"contato": {
"nome": "<string>",
"codigo": "<string>",
"fantasia": "<string>",
"cpfCnpj": "<string>",
"inscricaoEstadual": "<string>",
"rg": "<string>",
"telefone": "<string>",
"celular": "<string>",
"email": "<string>",
"endereco": {
"endereco": "<string>",
"numero": "<string>",
"complemento": "<string>",
"bairro": "<string>",
"municipio": "<string>",
"cep": "<string>",
"uf": "<string>",
"pais": "<string>"
},
"id": 123
},
"categoria": {
"id": 123,
"nome": "<string>",
"caminhoCompleto": "<string>"
},
"notaFiscal": {
"id": 123,
"numero": "<string>",
"dataEmissao": "2024-01-01",
"valor": "<string>",
"natureza": "<string>"
},
"parcelas": [
{
"id": 123,
"numero": 123,
"dias": 123,
"dataVencimento": "<string>",
"valor": 123,
"contaContabil": {
"id": 123
},
"observacoes": "<string>"
}
],
"observacoes": "<string>",
"observacoesInternas": "<string>",
"pvFrete": 123
}{
"mensagem": "Ocorreram erros de validação",
"detalhes": [
{
"campo": "codigo",
"mensagem": "O campo código é obrigatório"
}
]
}Path Parameters
Response
OK
Example:
"2024-01-01"
- 0 - Em Aberto
- 1 - Atendido
- 2 - Cancelado
- 3 - Em Andamento
Available options:
0, 1, 2, 3 Example:
"2024-01-01"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
- R - Remetente
- D - Destinatario
- T - Terceiros
- 3 - Proprio Remetente
- 4 - Proprio Destinatario
- S - Sem Transporte
Available options:
R, D, T, 3, 4, S ⌘I
