GET
/
v1
/
customer-portal
/
orders
/
{id}
/
invoice
Go (SDK)
package main

import(
	"context"
	polargo "github.com/polarsource/polar-go"
	"os"
	"github.com/polarsource/polar-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := polargo.New()

    res, err := s.CustomerPortal.Orders.Invoice(ctx, operations.CustomerPortalOrdersInvoiceSecurity{
        CustomerSession: os.Getenv("POLAR_CUSTOMER_SESSION"),
    }, "<value>")
    if err != nil {
        log.Fatal(err)
    }
    if res.CustomerOrderInvoice != nil {
        // handle response
    }
}
{
  "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
required

The order ID.

Response

200
application/json

Successful Response

Order's invoice data.