cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/invoices/{id}/email \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cc": [
"<string>"
],
"idempotency_key": "<string>",
"to": [
"<string>"
]
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.invoices.send_invoice_email(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.invoices.sendInvoiceEmail("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Invoices.SendInvoiceEmail(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res.EmailLogResponse != nil {
// handle response
}
}{
"cc_addresses": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"customer_id": "<string>",
"delivered_at": "2023-11-07T05:31:56Z",
"delivery_status": "queued",
"entity_id": "<string>",
"entity_type": "feature",
"environment_id": "<string>",
"from_address": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"metadata": {},
"provider": "resend",
"provider_message_id": "<string>",
"reply_to": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"status": "published",
"status_reason": "<string>",
"subject": "<string>",
"template_key": "invoice_finalized",
"tenant_id": "<string>",
"to_addresses": [
"<string>"
],
"trigger": "auto",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Invoices
Email invoice to customer
Use when you want Flexprice to email a finalized invoice to the customer, with a link to the hosted invoice and the PDF attached. Sends to the customer’s email unless to is given. Returns the queued email; delivery happens in the background.
POST
/
invoices
/
{id}
/
email
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/invoices/{id}/email \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cc": [
"<string>"
],
"idempotency_key": "<string>",
"to": [
"<string>"
]
}
'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.invoices.send_invoice_email(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.invoices.sendInvoiceEmail("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Invoices.SendInvoiceEmail(ctx, "<id>", nil)
if err != nil {
log.Fatal(err)
}
if res.EmailLogResponse != nil {
// handle response
}
}{
"cc_addresses": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"customer_id": "<string>",
"delivered_at": "2023-11-07T05:31:56Z",
"delivery_status": "queued",
"entity_id": "<string>",
"entity_type": "feature",
"environment_id": "<string>",
"from_address": "<string>",
"id": "<string>",
"idempotency_key": "<string>",
"metadata": {},
"provider": "resend",
"provider_message_id": "<string>",
"reply_to": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"status": "published",
"status_reason": "<string>",
"subject": "<string>",
"template_key": "invoice_finalized",
"tenant_id": "<string>",
"to_addresses": [
"<string>"
],
"trigger": "auto",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Body
application/json
Recipients overriding the customer's email
Response
OK

