GET
/
v1
/
customer-portal
/
orders
/
{id}
/
invoice
Typescript (SDK)
import { Polar } from "@polar-sh/sdk";

const polar = new Polar();

async function run() {
  const result = await polar.customerPortal.orders.invoice({
    customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
  }, {
    id: "<value>",
  });

  console.log(result);
}

run();
{
  "url": "<string>"
}
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

Authorization
string
header
required

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

id
string<uuid4>
required

The order ID.

Response

Successful Response

Order's invoice data.

url
string
required

The URL to the invoice.