Create/Update Order
curl --request POST \
--url https://api.reportana.com/2022-05/orders \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"reference_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,
"payment_status": "<string>",
"payment_method": "<string>",
"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>",
"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,
"payment_status": "<string>",
"payment_method": "<string>",
"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>',
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,
payment_status: '<string>',
payment_method: '<string>',
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>',
'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,
'payment_status' => '<string>',
'payment_method' => '<string>',
'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 \"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 \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\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 \"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 \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\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 \"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 \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\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": "Check the required fields.",
"errors": {
"reference_id": [
"The reference_id field is required."
],
"number": [
"The number field is required."
],
"customer_name": [
"The customer_name field is required."
],
"customer_email": [
"The customer_email field is required."
],
"customer_phone": [
"The customer_phone field is required."
],
"currency": [
"The currency field is required."
],
"total_price": [
"The total_price field is required."
],
"subtotal_price": [
"The subtotal_price field is required."
],
"original_created_at": [
"The original_created_at field is required."
]
}
}
API Reference
Create/Update Order
Use this endpoint to create an order.
POST
/
2022-05
/
orders
Create/Update Order
curl --request POST \
--url https://api.reportana.com/2022-05/orders \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"reference_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,
"payment_status": "<string>",
"payment_method": "<string>",
"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>",
"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,
"payment_status": "<string>",
"payment_method": "<string>",
"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>',
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,
payment_status: '<string>',
payment_method: '<string>',
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>',
'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,
'payment_status' => '<string>',
'payment_method' => '<string>',
'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 \"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 \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\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 \"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 \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\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 \"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 \"payment_status\": \"<string>\",\n \"payment_method\": \"<string>\",\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": "Check the required fields.",
"errors": {
"reference_id": [
"The reference_id field is required."
],
"number": [
"The number field is required."
],
"customer_name": [
"The customer_name field is required."
],
"customer_email": [
"The customer_email field is required."
],
"customer_phone": [
"The customer_phone field is required."
],
"currency": [
"The currency field is required."
],
"total_price": [
"The total_price field is required."
],
"subtotal_price": [
"The subtotal_price field is required."
],
"original_created_at": [
"The original_created_at field is required."
]
}
}
Use this endpoint to create or update an order in your Reportana store. The
reference_id attribute is required and must correspond to the id or unique identifier of the order in your system, ensuring proper association between your system’s data and our platform.
Headers
Basic base64(client_id + ’:’ + client_secret)
Content-Type:application/json
Body
Enter the reference ID.Example: “123456789”.
Enter the order number.Example: “1234”.
Enter the admin panel URL for accessing the order.Example: “https://example.com/admin/orders/123456789”.
Enter the customer’s name.Example: “John Doe”.
Enter the customer’s phone number.Example: “+5511911111111”.
Enter the customer’s email address.Example: “johndoe@gmail.com”.
Enter the customer’s document number.Example: “123456789”.
Billing Adress
Enter the billing address information.
Enter the customer’s name.Example: “John Doe”.
Enter the customer’s first name.Example: “John”.
Enter the customer’s last name.Example: “Doe”.
Enter the company name.Example: “John Doe Ltda”.
Enter the customer’s phone number.Example: “+5511911111111”.
Enter the customer’s address.Example: “6925 Hollywood Blvd”.
Enter the customer’s neighborhood.Example: “Times Square”.
Enter the customer’s city.Example: “New York”.
Enter the customer’s state.Example: “North Carolina”.
Enter the customer’s state code.Example: “NC”.
Enter the customer’s country.Example: “United States of America”.
Enter the customer’s country code.Example: “USA”.
Enter the customer’s ZIP code.Example: “90213”.
Enter the customer’s latitude.Example: -27.807915923881836
Enter the customer’s longitude.Example: -50.3183162423294
Shipping Adress
Enter the shipping address information.
Enter the customer’s name.Example: “John Doe”.
Enter the customer’s first name.Example: “John”.
Enter the customer’s last name.Example: “Doe”.
Enter the company name.Example: “John Doe Ltda”.
Enter the customer’s phone number.Example: “+5511911111111”.
Enter the customer’s address.Example: “6925 Hollywood Blvd”.
Enter the customer’s neighborhood.Example: “Times Square”.
Enter the customer’s city.Example: “New York”.
Enter the customer’s state.Example: “North Carolina”.
Enter the customer’s state code.Example: “NC”.
Enter the customer’s country.Example: “United States of America”.
Enter the customer’s country code.Example: “USA”.
Enter the customer’s ZIP code.Example: “88508100”.
Enter the customer’s latitude.Example: -27.807915923881836
Enter the customer’s longitude.Example: -50.3183162423294
Line Items
Click on “Add an item” to add a product.
Enter the product title.Example: “Sunglasses”.
Enter the product variant title.Example: “Black”.
Enter the quantity of products in the order.Example: 1
Enter the product price.Example: 49.9
Enter the public access URL of the product.Example: “https://example.com/products/1234”.
Enter the product image URL.Example: “https://example.com/products/1234/image.jpg”.
Enter the product tracking number.Example: “LB123456789BR”.
Payment & More Info
Enter the currency used.Example: “USD”.
Enter the total amount.Example: 124.8
Enter the subtotal amount.Example: 109.8
Enter the payment status.Example: “PAID”.Available options:
PAID, PENDING, NOT_PAID.Enter the payment method.Example: “CREDIT_CARD”.Available options:
CREDIT_CARD, PIX, DEPOSIT, BOLETO, OTHER.Enter the order tracking numbers.Example: “LB123456789BR,LB987654321BR”.
Enter the site URL.Example: “https://www.facebook.com/”.
Enter the order status URL.Example: “https://example.com/orders/123456789”.
Enter the payment URL.Example: “https://example.com/orders/123456789/creditcard.pdf”.
Enter the billet barcode or Pix “Copy and Paste” string.
Enter the payment expiration date.Example: “2022-05-31”.
Enter the order creation date.Example: “2022-05-27 12:00”.
{
"success": true,
"data": null
}
{
"success": false,
"message": "Check the required fields.",
"errors": {
"reference_id": [
"The reference_id field is required."
],
"number": [
"The number field is required."
],
"customer_name": [
"The customer_name field is required."
],
"customer_email": [
"The customer_email field is required."
],
"customer_phone": [
"The customer_phone field is required."
],
"currency": [
"The currency field is required."
],
"total_price": [
"The total_price field is required."
],
"subtotal_price": [
"The subtotal_price field is required."
],
"original_created_at": [
"The original_created_at field is required."
]
}
}
⌘I