Skip to main content
GET
/
orders
/
{id}
Get Order
curl --request GET \
  --url https://api.loopreturns.com/api/v1/orders/{id} \
  --header 'X-Authorization: <api-key>'
import requests

url = "https://api.loopreturns.com/api/v1/orders/{id}"

headers = {"X-Authorization": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-Authorization': '<api-key>'}};

fetch('https://api.loopreturns.com/api/v1/orders/{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://api.loopreturns.com/api/v1/orders/{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 => [
    "X-Authorization: <api-key>"
  ],
]);

$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.loopreturns.com/api/v1/orders/{id}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Authorization", "<api-key>")

	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.loopreturns.com/api/v1/orders/{id}")
  .header("X-Authorization", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.loopreturns.com/api/v1/orders/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Authorization"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "order": {
    "id": 2,
    "external_id": "<string>",
    "name": "<string>",
    "secondary_identifier": "<string>",
    "source": "<string>",
    "sales_channel": "<string>",
    "customer": {
      "id": 123,
      "external_id": "<string>",
      "sales_channel": "<string>",
      "first_name": "<string>",
      "last_name": "<string>",
      "email": "<string>",
      "phone": "<string>"
    },
    "shipping_address": {
      "address1": "<string>",
      "city": "<string>",
      "country_code": "<string>",
      "name": "<string>",
      "company": "<string>",
      "address2": "<string>",
      "region": "<string>",
      "postal_code": "<string>"
    },
    "billing_address": {
      "address1": "<string>",
      "city": "<string>",
      "country_code": "<string>",
      "name": "<string>",
      "company": "<string>",
      "address2": "<string>",
      "region": "<string>",
      "postal_code": "<string>"
    },
    "taxes_included": true,
    "total_price": {
      "amount": 123,
      "currency_code": "USD"
    },
    "total_price_presentment": {
      "amount": 123,
      "currency_code": "USD"
    },
    "total_discounts": {
      "amount": 123,
      "currency_code": "USD"
    },
    "total_discounts_presentment": {
      "amount": 123,
      "currency_code": "USD"
    },
    "shipping_lines": [
      {
        "title": "<string>",
        "price": {
          "amount": 123,
          "currency_code": "USD"
        },
        "discounts": {
          "external_id": "<string>",
          "name": "<string>",
          "code": "<string>",
          "reason": "<string>",
          "rate": 123,
          "net_adjustment_money": {
            "amount": 123,
            "currency_code": "USD"
          },
          "tax_adjustment_money": {
            "amount": 123,
            "currency_code": "USD"
          }
        },
        "tax_lines": [
          {
            "title": "<string>",
            "rate": 123,
            "price": {
              "amount": 123,
              "currency_code": "USD"
            }
          }
        ]
      }
    ],
    "order_discounts": [
      {
        "external_id": "<string>",
        "name": "<string>",
        "code": "<string>",
        "reason": "<string>",
        "rate": 123,
        "tax_adjustment_money": {
          "amount": 123,
          "currency_code": "USD"
        },
        "net_adjustment_money": {
          "amount": 123,
          "currency_code": "USD"
        }
      }
    ],
    "total_taxes": {
      "amount": 123,
      "currency_code": "USD"
    },
    "total_taxes_presentment": {
      "amount": 123,
      "currency_code": "USD"
    },
    "tags": [
      "<string>"
    ],
    "refunds": [
      [
        [
          {
            "amount": {
              "amount": 123,
              "currency_code": "USD"
            },
            "external_id": "<string>",
            "line_item": {
              "id": 123,
              "quantity": 123,
              "restock": true
            },
            "created_at": "2023-04-25T13:25:00-05:00",
            "updated_at": "2023-04-25T13:25:00-05:00"
          }
        ]
      ]
    ],
    "line_items": [
      {
        "id": 2,
        "external_id": "<string>",
        "product": {
          "id": 123
        },
        "product_variant": {
          "id": 123
        },
        "quantity": 123,
        "unit_price": {
          "amount": 123,
          "currency_code": "USD"
        },
        "unit_price_presentment": {
          "amount": 50000,
          "currency_code": "USD"
        },
        "unit_discounts": {
          "amount": 50000,
          "currency_code": "USD"
        },
        "unit_discounts_presentment": {
          "amount": 50000,
          "currency_code": "USD"
        },
        "taxable": true,
        "tax_lines": [
          {
            "title": "<string>",
            "rate": 123,
            "price": {
              "amount": 123,
              "currency_code": "USD"
            }
          }
        ],
        "refunds": [
          {
            "amount": {
              "amount": 123,
              "currency_code": "USD"
            },
            "external_id": "<string>",
            "line_item": {
              "id": 123,
              "quantity": 123,
              "restock": true
            },
            "created_at": "2023-04-25T13:25:00-05:00",
            "updated_at": "2023-04-25T13:25:00-05:00"
          }
        ],
        "discounts": [
          {
            "external_id": "<string>",
            "name": "<string>",
            "code": "<string>",
            "reason": "<string>",
            "rate": 123,
            "tax_adjustment_money": {
              "amount": 123,
              "currency_code": "USD"
            },
            "net_adjustment_money": {
              "amount": 123,
              "currency_code": "USD"
            }
          }
        ],
        "duties": [
          {
            "hs_code": "<string>",
            "country_of_origin": "<string>",
            "price": {
              "amount": 123,
              "currency_code": "USD"
            },
            "tax_lines": [
              {
                "title": "<string>",
                "rate": 123,
                "price": {
                  "amount": 123,
                  "currency_code": "USD"
                }
              }
            ]
          }
        ]
      }
    ],
    "fulfillments": [
      {
        "external_id": "<string>",
        "fulfilled_at": "2023-11-07T05:31:56Z",
        "shipping_carrier": "<string>",
        "location": {
          "id": 123
        },
        "fulfillment_line_items": [
          {
            "external_id": "<string>",
            "order_line_item_external_id": "<string>",
            "quantity": 123
          }
        ],
        "tracking_numbers": [
          "<string>"
        ]
      }
    ],
    "created_at": "2023-04-25T13:25:00-05:00",
    "updated_at": "2023-04-25T13:25:00-05:00",
    "processed_at": "2023-04-25T13:25:00-05:00",
    "browser_ip": "127.0.0.1",
    "client_details_user_agent": "<string>",
    "total_tip_received": {
      "amount": 50000,
      "currency_code": "USD"
    },
    "warnings": [
      {
        "code": "<string>",
        "message": "<string>"
      }
    ]
  }
}
{
  "errors": "<string>"
}
{
  "message": "<string>"
}

Authorizations

X-Authorization
string
header
required

API Scope: "Order (read)"

Path Parameters

id
integer
required

Identifier of the order.

Response

OK

order
OrderResponse · object