Criar/Atualizar Pedido
curl --request POST \
--url https://api.reportana.com/2022-05/orders \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"reference_id": "<string>",
"shopify_order_id": "<string>",
"number": "<string>",
"admin_url": "<string>",
"customer_name": "<string>",
"customer_phone": "<string>",
"customer_email": "<string>",
"customer_document": "<string>",
"billing_address": {
"name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"phone": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"latitude": 123,
"longitude": 123
},
"shipping_address": {
"name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"phone": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"latitude": "<string>",
"longitude": "<string>"
},
"line_items": [
{
"title": "<string>",
"variant_title": "<string>",
"quantity": 123,
"price": 123,
"path": "<string>",
"image_url": "<string>",
"tracking_number": "<string>"
}
],
"currency": "<string>",
"total_price": 123,
"subtotal_price": 123,
"delivery_price": 123,
"discount_price": 123,
"payment_status": "<string>",
"payment_method": "<string>",
"installments": 123,
"tracking_numbers": "<string>",
"referring_site": "<string>",
"status_url": "<string>",
"billet_url": "<string>",
"billet_line": "<string>",
"billet_expired_at": "<string>",
"original_created_at": "<string>"
}
'import requests
url = "https://api.reportana.com/2022-05/orders"
payload = {
"reference_id": "<string>",
"shopify_order_id": "<string>",
"number": "<string>",
"admin_url": "<string>",
"customer_name": "<string>",
"customer_phone": "<string>",
"customer_email": "<string>",
"customer_document": "<string>",
"billing_address": {
"name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"phone": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"latitude": 123,
"longitude": 123
},
"shipping_address": {
"name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"phone": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"latitude": "<string>",
"longitude": "<string>"
},
"line_items": [
{
"title": "<string>",
"variant_title": "<string>",
"quantity": 123,
"price": 123,
"path": "<string>",
"image_url": "<string>",
"tracking_number": "<string>"
}
],
"currency": "<string>",
"total_price": 123,
"subtotal_price": 123,
"delivery_price": 123,
"discount_price": 123,
"payment_status": "<string>",
"payment_method": "<string>",
"installments": 123,
"tracking_numbers": "<string>",
"referring_site": "<string>",
"status_url": "<string>",
"billet_url": "<string>",
"billet_line": "<string>",
"billet_expired_at": "<string>",
"original_created_at": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
reference_id: '<string>',
shopify_order_id: '<string>',
number: '<string>',
admin_url: '<string>',
customer_name: '<string>',
customer_phone: '<string>',
customer_email: '<string>',
customer_document: '<string>',
billing_address: {
name: '<string>',
first_name: '<string>',
last_name: '<string>',
company: '<string>',
phone: '<string>',
address1: '<string>',
address2: '<string>',
city: '<string>',
province: '<string>',
province_code: '<string>',
country: '<string>',
country_code: '<string>',
zip: '<string>',
latitude: 123,
longitude: 123
},
shipping_address: {
name: '<string>',
first_name: '<string>',
last_name: '<string>',
company: '<string>',
phone: '<string>',
address1: '<string>',
address2: '<string>',
city: '<string>',
province: '<string>',
province_code: '<string>',
country: '<string>',
country_code: '<string>',
zip: '<string>',
latitude: '<string>',
longitude: '<string>'
},
line_items: [
{
title: '<string>',
variant_title: '<string>',
quantity: 123,
price: 123,
path: '<string>',
image_url: '<string>',
tracking_number: '<string>'
}
],
currency: '<string>',
total_price: 123,
subtotal_price: 123,
delivery_price: 123,
discount_price: 123,
payment_status: '<string>',
payment_method: '<string>',
installments: 123,
tracking_numbers: '<string>',
referring_site: '<string>',
status_url: '<string>',
billet_url: '<string>',
billet_line: '<string>',
billet_expired_at: '<string>',
original_created_at: '<string>'
})
};
fetch('https://api.reportana.com/2022-05/orders', 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.reportana.com/2022-05/orders",
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([
'reference_id' => '<string>',
'shopify_order_id' => '<string>',
'number' => '<string>',
'admin_url' => '<string>',
'customer_name' => '<string>',
'customer_phone' => '<string>',
'customer_email' => '<string>',
'customer_document' => '<string>',
'billing_address' => [
'name' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'company' => '<string>',
'phone' => '<string>',
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'province' => '<string>',
'province_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'zip' => '<string>',
'latitude' => 123,
'longitude' => 123
],
'shipping_address' => [
'name' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'company' => '<string>',
'phone' => '<string>',
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'province' => '<string>',
'province_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'zip' => '<string>',
'latitude' => '<string>',
'longitude' => '<string>'
],
'line_items' => [
[
'title' => '<string>',
'variant_title' => '<string>',
'quantity' => 123,
'price' => 123,
'path' => '<string>',
'image_url' => '<string>',
'tracking_number' => '<string>'
]
],
'currency' => '<string>',
'total_price' => 123,
'subtotal_price' => 123,
'delivery_price' => 123,
'discount_price' => 123,
'payment_status' => '<string>',
'payment_method' => '<string>',
'installments' => 123,
'tracking_numbers' => '<string>',
'referring_site' => '<string>',
'status_url' => '<string>',
'billet_url' => '<string>',
'billet_line' => '<string>',
'billet_expired_at' => '<string>',
'original_created_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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://api.reportana.com/2022-05/orders"
payload := strings.NewReader("{\n \"reference_id\": \"<string>\",\n \"shopify_order_id\": \"<string>\",\n \"number\": \"<string>\",\n \"admin_url\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"customer_phone\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"customer_document\": \"<string>\",\n \"billing_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"shipping_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\"\n },\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"path\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tracking_number\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"total_price\": 123,\n \"subtotal_price\": 123,\n \"delivery_price\": 123,\n \"discount_price\": 123,\n \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"installments\": 123,\n \"tracking_numbers\": \"<string>\",\n \"referring_site\": \"<string>\",\n \"status_url\": \"<string>\",\n \"billet_url\": \"<string>\",\n \"billet_line\": \"<string>\",\n \"billet_expired_at\": \"<string>\",\n \"original_created_at\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reportana.com/2022-05/orders")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"reference_id\": \"<string>\",\n \"shopify_order_id\": \"<string>\",\n \"number\": \"<string>\",\n \"admin_url\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"customer_phone\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"customer_document\": \"<string>\",\n \"billing_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"shipping_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\"\n },\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"path\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tracking_number\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"total_price\": 123,\n \"subtotal_price\": 123,\n \"delivery_price\": 123,\n \"discount_price\": 123,\n \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"installments\": 123,\n \"tracking_numbers\": \"<string>\",\n \"referring_site\": \"<string>\",\n \"status_url\": \"<string>\",\n \"billet_url\": \"<string>\",\n \"billet_line\": \"<string>\",\n \"billet_expired_at\": \"<string>\",\n \"original_created_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reportana.com/2022-05/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"reference_id\": \"<string>\",\n \"shopify_order_id\": \"<string>\",\n \"number\": \"<string>\",\n \"admin_url\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"customer_phone\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"customer_document\": \"<string>\",\n \"billing_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"shipping_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\"\n },\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"path\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tracking_number\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"total_price\": 123,\n \"subtotal_price\": 123,\n \"delivery_price\": 123,\n \"discount_price\": 123,\n \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"installments\": 123,\n \"tracking_numbers\": \"<string>\",\n \"referring_site\": \"<string>\",\n \"status_url\": \"<string>\",\n \"billet_url\": \"<string>\",\n \"billet_line\": \"<string>\",\n \"billet_expired_at\": \"<string>\",\n \"original_created_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": null
}
{
"success": false,
"message": "Verifique o preenchimento dos campos.",
"errors": {
"reference_id": [
"O campo reference id é obrigatório."
],
"number": [
"O campo number é obrigatório."
],
"customer_name": [
"O campo customer name é obrigatório."
],
"customer_email": [
"O campo customer email é obrigatório."
],
"customer_phone": [
"O campo customer phone é obrigatório."
],
"currency": [
"O campo currency é obrigatório."
],
"total_price": [
"O campo total price é obrigatório."
],
"subtotal_price": [
"O campo subtotal price é obrigatório."
],
"original_created_at": [
"O campo original created at é obrigatório."
]
}
}
Referência de API
Criar/Atualizar Pedido
Utilize este endpoint para criar um pedido.
POST
/
2022-05
/
orders
Criar/Atualizar Pedido
curl --request POST \
--url https://api.reportana.com/2022-05/orders \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"reference_id": "<string>",
"shopify_order_id": "<string>",
"number": "<string>",
"admin_url": "<string>",
"customer_name": "<string>",
"customer_phone": "<string>",
"customer_email": "<string>",
"customer_document": "<string>",
"billing_address": {
"name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"phone": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"latitude": 123,
"longitude": 123
},
"shipping_address": {
"name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"phone": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"latitude": "<string>",
"longitude": "<string>"
},
"line_items": [
{
"title": "<string>",
"variant_title": "<string>",
"quantity": 123,
"price": 123,
"path": "<string>",
"image_url": "<string>",
"tracking_number": "<string>"
}
],
"currency": "<string>",
"total_price": 123,
"subtotal_price": 123,
"delivery_price": 123,
"discount_price": 123,
"payment_status": "<string>",
"payment_method": "<string>",
"installments": 123,
"tracking_numbers": "<string>",
"referring_site": "<string>",
"status_url": "<string>",
"billet_url": "<string>",
"billet_line": "<string>",
"billet_expired_at": "<string>",
"original_created_at": "<string>"
}
'import requests
url = "https://api.reportana.com/2022-05/orders"
payload = {
"reference_id": "<string>",
"shopify_order_id": "<string>",
"number": "<string>",
"admin_url": "<string>",
"customer_name": "<string>",
"customer_phone": "<string>",
"customer_email": "<string>",
"customer_document": "<string>",
"billing_address": {
"name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"phone": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"latitude": 123,
"longitude": 123
},
"shipping_address": {
"name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"company": "<string>",
"phone": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"province": "<string>",
"province_code": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"latitude": "<string>",
"longitude": "<string>"
},
"line_items": [
{
"title": "<string>",
"variant_title": "<string>",
"quantity": 123,
"price": 123,
"path": "<string>",
"image_url": "<string>",
"tracking_number": "<string>"
}
],
"currency": "<string>",
"total_price": 123,
"subtotal_price": 123,
"delivery_price": 123,
"discount_price": 123,
"payment_status": "<string>",
"payment_method": "<string>",
"installments": 123,
"tracking_numbers": "<string>",
"referring_site": "<string>",
"status_url": "<string>",
"billet_url": "<string>",
"billet_line": "<string>",
"billet_expired_at": "<string>",
"original_created_at": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
reference_id: '<string>',
shopify_order_id: '<string>',
number: '<string>',
admin_url: '<string>',
customer_name: '<string>',
customer_phone: '<string>',
customer_email: '<string>',
customer_document: '<string>',
billing_address: {
name: '<string>',
first_name: '<string>',
last_name: '<string>',
company: '<string>',
phone: '<string>',
address1: '<string>',
address2: '<string>',
city: '<string>',
province: '<string>',
province_code: '<string>',
country: '<string>',
country_code: '<string>',
zip: '<string>',
latitude: 123,
longitude: 123
},
shipping_address: {
name: '<string>',
first_name: '<string>',
last_name: '<string>',
company: '<string>',
phone: '<string>',
address1: '<string>',
address2: '<string>',
city: '<string>',
province: '<string>',
province_code: '<string>',
country: '<string>',
country_code: '<string>',
zip: '<string>',
latitude: '<string>',
longitude: '<string>'
},
line_items: [
{
title: '<string>',
variant_title: '<string>',
quantity: 123,
price: 123,
path: '<string>',
image_url: '<string>',
tracking_number: '<string>'
}
],
currency: '<string>',
total_price: 123,
subtotal_price: 123,
delivery_price: 123,
discount_price: 123,
payment_status: '<string>',
payment_method: '<string>',
installments: 123,
tracking_numbers: '<string>',
referring_site: '<string>',
status_url: '<string>',
billet_url: '<string>',
billet_line: '<string>',
billet_expired_at: '<string>',
original_created_at: '<string>'
})
};
fetch('https://api.reportana.com/2022-05/orders', 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.reportana.com/2022-05/orders",
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([
'reference_id' => '<string>',
'shopify_order_id' => '<string>',
'number' => '<string>',
'admin_url' => '<string>',
'customer_name' => '<string>',
'customer_phone' => '<string>',
'customer_email' => '<string>',
'customer_document' => '<string>',
'billing_address' => [
'name' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'company' => '<string>',
'phone' => '<string>',
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'province' => '<string>',
'province_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'zip' => '<string>',
'latitude' => 123,
'longitude' => 123
],
'shipping_address' => [
'name' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'company' => '<string>',
'phone' => '<string>',
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'province' => '<string>',
'province_code' => '<string>',
'country' => '<string>',
'country_code' => '<string>',
'zip' => '<string>',
'latitude' => '<string>',
'longitude' => '<string>'
],
'line_items' => [
[
'title' => '<string>',
'variant_title' => '<string>',
'quantity' => 123,
'price' => 123,
'path' => '<string>',
'image_url' => '<string>',
'tracking_number' => '<string>'
]
],
'currency' => '<string>',
'total_price' => 123,
'subtotal_price' => 123,
'delivery_price' => 123,
'discount_price' => 123,
'payment_status' => '<string>',
'payment_method' => '<string>',
'installments' => 123,
'tracking_numbers' => '<string>',
'referring_site' => '<string>',
'status_url' => '<string>',
'billet_url' => '<string>',
'billet_line' => '<string>',
'billet_expired_at' => '<string>',
'original_created_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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://api.reportana.com/2022-05/orders"
payload := strings.NewReader("{\n \"reference_id\": \"<string>\",\n \"shopify_order_id\": \"<string>\",\n \"number\": \"<string>\",\n \"admin_url\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"customer_phone\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"customer_document\": \"<string>\",\n \"billing_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"shipping_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\"\n },\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"path\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tracking_number\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"total_price\": 123,\n \"subtotal_price\": 123,\n \"delivery_price\": 123,\n \"discount_price\": 123,\n \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"installments\": 123,\n \"tracking_numbers\": \"<string>\",\n \"referring_site\": \"<string>\",\n \"status_url\": \"<string>\",\n \"billet_url\": \"<string>\",\n \"billet_line\": \"<string>\",\n \"billet_expired_at\": \"<string>\",\n \"original_created_at\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reportana.com/2022-05/orders")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"reference_id\": \"<string>\",\n \"shopify_order_id\": \"<string>\",\n \"number\": \"<string>\",\n \"admin_url\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"customer_phone\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"customer_document\": \"<string>\",\n \"billing_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"shipping_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\"\n },\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"path\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tracking_number\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"total_price\": 123,\n \"subtotal_price\": 123,\n \"delivery_price\": 123,\n \"discount_price\": 123,\n \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"installments\": 123,\n \"tracking_numbers\": \"<string>\",\n \"referring_site\": \"<string>\",\n \"status_url\": \"<string>\",\n \"billet_url\": \"<string>\",\n \"billet_line\": \"<string>\",\n \"billet_expired_at\": \"<string>\",\n \"original_created_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reportana.com/2022-05/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"reference_id\": \"<string>\",\n \"shopify_order_id\": \"<string>\",\n \"number\": \"<string>\",\n \"admin_url\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"customer_phone\": \"<string>\",\n \"customer_email\": \"<string>\",\n \"customer_document\": \"<string>\",\n \"billing_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"shipping_address\": {\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"company\": \"<string>\",\n \"phone\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"province\": \"<string>\",\n \"province_code\": \"<string>\",\n \"country\": \"<string>\",\n \"country_code\": \"<string>\",\n \"zip\": \"<string>\",\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\"\n },\n \"line_items\": [\n {\n \"title\": \"<string>\",\n \"variant_title\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123,\n \"path\": \"<string>\",\n \"image_url\": \"<string>\",\n \"tracking_number\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"total_price\": 123,\n \"subtotal_price\": 123,\n \"delivery_price\": 123,\n \"discount_price\": 123,\n \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"installments\": 123,\n \"tracking_numbers\": \"<string>\",\n \"referring_site\": \"<string>\",\n \"status_url\": \"<string>\",\n \"billet_url\": \"<string>\",\n \"billet_line\": \"<string>\",\n \"billet_expired_at\": \"<string>\",\n \"original_created_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": null
}
{
"success": false,
"message": "Verifique o preenchimento dos campos.",
"errors": {
"reference_id": [
"O campo reference id é obrigatório."
],
"number": [
"O campo number é obrigatório."
],
"customer_name": [
"O campo customer name é obrigatório."
],
"customer_email": [
"O campo customer email é obrigatório."
],
"customer_phone": [
"O campo customer phone é obrigatório."
],
"currency": [
"O campo currency é obrigatório."
],
"total_price": [
"O campo total price é obrigatório."
],
"subtotal_price": [
"O campo subtotal price é obrigatório."
],
"original_created_at": [
"O campo original created at é obrigatório."
]
}
}
Utilize este endpoint para criar ou atualizar um pedido em sua loja Reportana. O atributo
reference_id é obrigatório e deve corresponder ao id ou à identificação única do pedido em seu sistema, garantindo a correta associação entre os dados de seu sistema e nossa plataforma.
Headers
string
obrigatório
Basic base64(client_id + ’:’ + client_secret)
string
obrigatório
Content-Type:application/json
Body
string
obrigatório
Insira o ID de referência.Exemplo: “123456789”.
string
Insira o ID do pedido na Shopify.Exemplo: “4567890123456”.Observação: Este campo serve para atualizar os dados de um pedido existente que foi integrado através da nossa integração oficial com a Shopify, sendo
shopify_order_id o mesmo ID do pedido na API da Shopify. Serão aceitos os seguintes campos para atualização: total_price, delivery_price, discount_price, payment_status, payment_method, installments, billet_url, billet_line e billet_expired_at em nosso sistema.string
obrigatório
Insira o número do pedido.Exemplo: “1234”.
string
Insira a URL de acesso do pedido no painel de administração.Exemplo: “https://example.com/admin/orders/123456789”.
string
obrigatório
Insira o nome do cliente.Exemplo: “João Moraes”.
string
obrigatório
Insira o telefone do cliente.Exemplo: “+5511911111111”.
string
obrigatório
Insira o e-mail do cliente.Exemplo: “joaomoraes@gmail.com”.
string
Insira o documento do cliente.Exemplo: “099.999.999-99”.
Billing Adress
object
obrigatório
Insira as informações de endereço de cobrança.
string
Insira o nome do cliente.Exemplo: “João Moraes”.
string
Insira o primeiro nome do cliente.Exemplo: “João”.
string
Insira o sobrenome do cliente.Exemplo: “Moraes”.
string
Insira o nome da empresa.Exemplo: “João Moraes Ltda”.
string
Insira o telefone do cliente.Exemplo: “+5511911111111”.
string
Insira o endereço do cliente.Exemplo: “Av Belisário Ramos, 3735”.
string
Insira o bairro do cliente.Exemplo: “Sagrado Coração Jesus”.
string
Insira a cidade do cliente.Exemplo: “Lages”.
string
Insira o estado do cliente.Exemplo: “Santa Catarina”.
string
Insira o código do estado do cliente.Exemplo: “SC”.
string
Insira o país do cliente.Exemplo: “Brazil”.
string
Insira o código do país do cliente.Exemplo: “BR”.
string
Insira o CEP do cliente.Exemplo: “88508100”.
number
Insira a latitude do cliente.Exemplo: -27.807915923881836
number
Insira a longitude do cliente.Exemplo: -50.3183162423294
Shipping Adress
object
obrigatório
Insira as informações de endereço de entrega.
string
Insira o nome do cliente.Exemplo: “João Moraes”.
string
Insira o primeiro nome do cliente.Exemplo: “João”.
string
Insira o sobrenome do cliente.Exemplo: “Moraes”.
string
Insira o nome da empresa.Exemplo: “João Moraes Ltda”.
string
Insira o telefone do cliente.Exemplo: “+5511911111111”.
string
Insira o endereço do cliente.Exemplo: “Av Belisário Ramos, 3735”.
string
Insira o bairro do cliente.Exemplo: “Sagrado Coração Jesus”.
string
Insira a cidade do cliente.Exemplo: “Lages”.
string
Insira o estado do cliente.Exemplo: “Santa Catarina”.
string
Insira o código do estado do cliente.Exemplo: “SC”.
string
Insira o país do cliente.Exemplo: “Brazil”.
string
Insira o código do país.Exemplo: “BR”.
string
Insira o CEP do cliente.Exemplo: “88508100”.
string
Insira a latitude do cliente.Exemplo: -27.807915923881836
string
Insira a longitude do cliente.Exemplo: -50.3183162423294
Line Items
object[]
obrigatório
Clique em “Add an item” para adicionar um produto.
string
Insira o título do produto.Exemplo: “Óculos”.
string
Insira o título da variante do produto.Exemplo: “Preto”.
number
Insira a quantidade de produtos no pedido.Exemplo: 1
number
Insira o preço do produto.Exemplo: 49.9
string
Insira a URL de acesso público do produto.Exemplo: “https://example.com/products/1234”.
string
Insira a URL da imagem do produto.Exemplo: “https://example.com/products/1234/image.jpg”.
string
Insira o número de rastreio do produto.Exemplo: “LB123456789BR”.
Payment & More Info
string
obrigatório
Insira a moeda utilizada.Exemplo: “BRL”.
number
obrigatório
Insira o valor total.Exemplo: 124.8
number
obrigatório
Insira o valor subtotal.Exemplo: 109.8
number
Insira o valor do frete.Exemplo: 15.0
number
Insira o valor do desconto.Exemplo: 10.0
string
Insira o status de pagamento.Exemplo: “PAID”.Opções disponíveis:
PAID, PENDING, NOT_PAID.string
Insira o método de pagamento.Exemplo: “PIX”.Opções disponíveis:
BOLETO, CREDIT_CARD, DEPOSIT, PIX, OTHER.number
Insira o número de parcelas do pagamento.Exemplo: 3
string
Insira os números de rastreio do pedido.Exemplo: “LB123456789BR,LB987654321BR”.
string
Insira a URL do site.Exemplo: “https://www.facebook.com/”.
string
Insira a URL de status do pedido.Exemplo: “https://example.com/orders/123456789”.
string
Insira a URL de pagamento do pedido.Exemplo: “https://example.com/orders/123456789/boleto.pdf”.
string
Insira a linha digitável do boleto ou Pix Copia e Cola.
string
Insira a data de expiração do pagamento.Exemplo: “2022-05-31”.
string
obrigatório
Insira a data de criação do pedido.Exemplo: “2022-05-27 12:00”.
{
"success": true,
"data": null
}
{
"success": false,
"message": "Verifique o preenchimento dos campos.",
"errors": {
"reference_id": [
"O campo reference id é obrigatório."
],
"number": [
"O campo number é obrigatório."
],
"customer_name": [
"O campo customer name é obrigatório."
],
"customer_email": [
"O campo customer email é obrigatório."
],
"customer_phone": [
"O campo customer phone é obrigatório."
],
"currency": [
"O campo currency é obrigatório."
],
"total_price": [
"O campo total price é obrigatório."
],
"subtotal_price": [
"O campo subtotal price é obrigatório."
],
"original_created_at": [
"O campo original created at é obrigatório."
]
}
}
⌘I