curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purchase_order_ids": [
1201,
1202
],
"attach_pdf": true,
"attach_data": true,
"data_format": "xlsx"
}
'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email"
payload = {
"purchase_order_ids": [1201, 1202],
"attach_pdf": True,
"attach_data": True,
"data_format": "xlsx"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purchase_order_ids: [1201, 1202],
attach_pdf: true,
attach_data: true,
data_format: 'xlsx'
})
};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email', 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://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'purchase_order_ids' => [
1201,
1202
],
'attach_pdf' => true,
'attach_data' => true,
'data_format' => 'xlsx'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email"
payload := strings.NewReader("{\n \"purchase_order_ids\": [\n 1201,\n 1202\n ],\n \"attach_pdf\": true,\n \"attach_data\": true,\n \"data_format\": \"xlsx\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"purchase_order_ids\": [\n 1201,\n 1202\n ],\n \"attach_pdf\": true,\n \"attach_data\": true,\n \"data_format\": \"xlsx\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purchase_order_ids\": [\n 1201,\n 1202\n ],\n \"attach_pdf\": true,\n \"attach_data\": true,\n \"data_format\": \"xlsx\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"batch_id": "<string>",
"total_items": 123,
"failed_items": 123
}
}{
"message": "<string>"
}{
"data": null,
"message": "Document email is not enabled for this tenant."
}{
"message": "<string>",
"errors": {}
}Email purchase orders to suppliers
Email up to 100 purchase orders to their suppliers, the same as sending them from the app. Purchase
orders are grouped by supplier, one email per supplier, addressed to that supplier’s contacts with
email addresses. Each email can attach the purchase order PDFs, a CSV or Excel file per purchase
order (attach_data), or both. Subject, body, CC/BCC and PDF layout come from the email template: the supplier’s own
purchase order template when it has one, otherwise template_id, otherwise your default purchase
order template. List templates with GET /purchase-orders/email-templates.
Emails are queued: a 202 returns the batch that was queued, not delivery results.
Suppliers without a contact email are skipped; if no purchase order can be emailed, the request
fails with 422. Returns 404 when document email is not enabled for your account.
curl --request POST \
--url https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purchase_order_ids": [
1201,
1202
],
"attach_pdf": true,
"attach_data": true,
"data_format": "xlsx"
}
'import requests
url = "https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email"
payload = {
"purchase_order_ids": [1201, 1202],
"attach_pdf": True,
"attach_data": True,
"data_format": "xlsx"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purchase_order_ids: [1201, 1202],
attach_pdf: true,
attach_data: true,
data_format: 'xlsx'
})
};
fetch('https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email', 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://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'purchase_order_ids' => [
1201,
1202
],
'attach_pdf' => true,
'attach_data' => true,
'data_format' => 'xlsx'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email"
payload := strings.NewReader("{\n \"purchase_order_ids\": [\n 1201,\n 1202\n ],\n \"attach_pdf\": true,\n \"attach_data\": true,\n \"data_format\": \"xlsx\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"purchase_order_ids\": [\n 1201,\n 1202\n ],\n \"attach_pdf\": true,\n \"attach_data\": true,\n \"data_format\": \"xlsx\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purchase_order_ids\": [\n 1201,\n 1202\n ],\n \"attach_pdf\": true,\n \"attach_data\": true,\n \"data_format\": \"xlsx\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"batch_id": "<string>",
"total_items": 123,
"failed_items": 123
}
}{
"message": "<string>"
}{
"data": null,
"message": "Document email is not enabled for this tenant."
}{
"message": "<string>",
"errors": {}
}Authorizations
Body
Purchase order data export template that controls the spreadsheet's columns, column order
and header names. Defaults to your default purchase order data template; with none, every
default column is included. Only used when attach_data is true.
x >= 1