Retrieve a merchant invoice
curl --request GET \
--url https://api.parceltracer.com/v1/external/invoices/{invoice_number}/ \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.parceltracer.com/v1/external/invoices/{invoice_number}/"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.parceltracer.com/v1/external/invoices/{invoice_number}/', 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.parceltracer.com/v1/external/invoices/{invoice_number}/",
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-Api-Key: <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.parceltracer.com/v1/external/invoices/{invoice_number}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<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.parceltracer.com/v1/external/invoices/{invoice_number}/")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.parceltracer.com/v1/external/invoices/{invoice_number}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"number": 123,
"status": "<string>",
"issued_at": "2023-11-07T05:31:56Z",
"cod": [
[
"<string>"
]
],
"delivery_fee": [
[
"<string>"
]
],
"net_due_to_merchant": [
[
"<string>"
]
],
"orders": [
{
"order_id": "<string>",
"reference_id": "<string>",
"workflow": "<string>",
"delivery_state": "<string>",
"payment_state": "<string>",
"cod": [
[
"<string>"
]
],
"delivery_fee": [
[
"<string>"
]
]
}
]
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}Invoices
Retrieve a merchant invoice
Retrieve a merchant invoice by its number, with its orders and their financial state (COD to collect from the customer, delivery fee, delivery state, payment state) for reconciliation. The number is the invoice id shown to merchants as “Invoice #”.
GET
/
invoices
/
{invoice_number}
/
Retrieve a merchant invoice
curl --request GET \
--url https://api.parceltracer.com/v1/external/invoices/{invoice_number}/ \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.parceltracer.com/v1/external/invoices/{invoice_number}/"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.parceltracer.com/v1/external/invoices/{invoice_number}/', 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.parceltracer.com/v1/external/invoices/{invoice_number}/",
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-Api-Key: <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.parceltracer.com/v1/external/invoices/{invoice_number}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<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.parceltracer.com/v1/external/invoices/{invoice_number}/")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.parceltracer.com/v1/external/invoices/{invoice_number}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"number": 123,
"status": "<string>",
"issued_at": "2023-11-07T05:31:56Z",
"cod": [
[
"<string>"
]
],
"delivery_fee": [
[
"<string>"
]
],
"net_due_to_merchant": [
[
"<string>"
]
],
"orders": [
{
"order_id": "<string>",
"reference_id": "<string>",
"workflow": "<string>",
"delivery_state": "<string>",
"payment_state": "<string>",
"cod": [
[
"<string>"
]
],
"delivery_fee": [
[
"<string>"
]
]
}
]
}{
"error": true,
"message": "<string>",
"details": "<unknown>"
}Authorizations
Path Parameters
Response
The invoice and its orders.
A merchant invoice and its orders, for reconciliation by the merchant's systems.
Required array length:
2 elementsRequired array length:
2 elementsRequired array length:
2 elementsShow child attributes
Show child attributes
