customer_portal
Get Order Invoice
Get an order’s invoice data.
GET
/
v1
/
customer-portal
/
orders
/
{id}
/
invoice
Python
from ourpay.v2026_10 import OurPay
ourpay = OurPay("ourpay_oat_xxx")
response = ourpay.customer_portal.orders.invoice(
'00000000-0000-4000-8000-000000000000',
)
print(response)import { createOurPay } from "@ourpay-dev/sdk/2026-10";
const ourpay = createOurPay({
accessToken: "ourpay_oat_xxx",
});
const response = await ourpay.customerPortal.orders.invoice(
"00000000-0000-4000-8000-000000000000",
);
console.log(response);
curl --request GET \
--url https://api.ourpay.dev/v1/customer-portal/orders/{id}/invoice \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ourpay.dev/v1/customer-portal/orders/{id}/invoice', 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.ourpay.dev/v1/customer-portal/orders/{id}/invoice",
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.ourpay.dev/v1/customer-portal/orders/{id}/invoice"
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.ourpay.dev/v1/customer-portal/orders/{id}/invoice")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ourpay.dev/v1/customer-portal/orders/{id}/invoice")
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{
"url": "<string>"
}{
"error": "ResourceNotFound",
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}The invoice must be generated first before it can be retrieved. You should call the
POST /v1/customer-portal/orders/{id}/invoice endpoint to generate the invoice.If the invoice is not generated, you will receive a 404 error.Authorizations
customer_sessionmember_session
Customer session tokens are specific tokens that are used to authenticate customers on your organization. You can create those sessions programmatically using the Create Customer Session endpoint.
Path Parameters
The order ID.
Response
Successful Response
Order's invoice data.
The URL to the invoice.
⌘I
Python
from ourpay.v2026_10 import OurPay
ourpay = OurPay("ourpay_oat_xxx")
response = ourpay.customer_portal.orders.invoice(
'00000000-0000-4000-8000-000000000000',
)
print(response)import { createOurPay } from "@ourpay-dev/sdk/2026-10";
const ourpay = createOurPay({
accessToken: "ourpay_oat_xxx",
});
const response = await ourpay.customerPortal.orders.invoice(
"00000000-0000-4000-8000-000000000000",
);
console.log(response);
curl --request GET \
--url https://api.ourpay.dev/v1/customer-portal/orders/{id}/invoice \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ourpay.dev/v1/customer-portal/orders/{id}/invoice', 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.ourpay.dev/v1/customer-portal/orders/{id}/invoice",
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.ourpay.dev/v1/customer-portal/orders/{id}/invoice"
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.ourpay.dev/v1/customer-portal/orders/{id}/invoice")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ourpay.dev/v1/customer-portal/orders/{id}/invoice")
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{
"url": "<string>"
}{
"error": "ResourceNotFound",
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}