Send invoice email to contractor
curl --request POST \
--url https://api.altera.co/sales/invoice/send \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"invoiceId": 123,
"topic": "New invoice #123",
"content": "<string>",
"recipient": [
"jsmith@example.com"
],
"recipientFromSystem": true
}
'import requests
url = "https://api.altera.co/sales/invoice/send"
payload = {
"invoiceId": 123,
"topic": "New invoice #123",
"content": "<string>",
"recipient": ["jsmith@example.com"],
"recipientFromSystem": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoiceId: 123,
topic: 'New invoice #123',
content: '<string>',
recipient: ['jsmith@example.com'],
recipientFromSystem: true
})
};
fetch('https://api.altera.co/sales/invoice/send', 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.altera.co/sales/invoice/send",
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([
'invoiceId' => 123,
'topic' => 'New invoice #123',
'content' => '<string>',
'recipient' => [
'jsmith@example.com'
],
'recipientFromSystem' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.altera.co/sales/invoice/send"
payload := strings.NewReader("{\n \"invoiceId\": 123,\n \"topic\": \"New invoice #123\",\n \"content\": \"<string>\",\n \"recipient\": [\n \"jsmith@example.com\"\n ],\n \"recipientFromSystem\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.altera.co/sales/invoice/send")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"invoiceId\": 123,\n \"topic\": \"New invoice #123\",\n \"content\": \"<string>\",\n \"recipient\": [\n \"jsmith@example.com\"\n ],\n \"recipientFromSystem\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altera.co/sales/invoice/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoiceId\": 123,\n \"topic\": \"New invoice #123\",\n \"content\": \"<string>\",\n \"recipient\": [\n \"jsmith@example.com\"\n ],\n \"recipientFromSystem\": true\n}"
response = http.request(request)
puts response.read_bodySales
Send invoice email to contractor
This endpoint allows you to send an issued invoice to your contractor over email. In order use the endpoint, proper configuration of global reply-to email is required (Settings > Sales > E-mail messages)
POST
/
sales
/
invoice
/
send
Send invoice email to contractor
curl --request POST \
--url https://api.altera.co/sales/invoice/send \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"invoiceId": 123,
"topic": "New invoice #123",
"content": "<string>",
"recipient": [
"jsmith@example.com"
],
"recipientFromSystem": true
}
'import requests
url = "https://api.altera.co/sales/invoice/send"
payload = {
"invoiceId": 123,
"topic": "New invoice #123",
"content": "<string>",
"recipient": ["jsmith@example.com"],
"recipientFromSystem": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoiceId: 123,
topic: 'New invoice #123',
content: '<string>',
recipient: ['jsmith@example.com'],
recipientFromSystem: true
})
};
fetch('https://api.altera.co/sales/invoice/send', 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.altera.co/sales/invoice/send",
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([
'invoiceId' => 123,
'topic' => 'New invoice #123',
'content' => '<string>',
'recipient' => [
'jsmith@example.com'
],
'recipientFromSystem' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.altera.co/sales/invoice/send"
payload := strings.NewReader("{\n \"invoiceId\": 123,\n \"topic\": \"New invoice #123\",\n \"content\": \"<string>\",\n \"recipient\": [\n \"jsmith@example.com\"\n ],\n \"recipientFromSystem\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.altera.co/sales/invoice/send")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"invoiceId\": 123,\n \"topic\": \"New invoice #123\",\n \"content\": \"<string>\",\n \"recipient\": [\n \"jsmith@example.com\"\n ],\n \"recipientFromSystem\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altera.co/sales/invoice/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoiceId\": 123,\n \"topic\": \"New invoice #123\",\n \"content\": \"<string>\",\n \"recipient\": [\n \"jsmith@example.com\"\n ],\n \"recipientFromSystem\": true\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
OpenApi Key created within Altera.app for a certain company
Body
application/json
Either recipient array or recipientFromSystem is required in order to send the e-mail.
If not provided topic and/or content will be loaded dynamically from the company email configuration.
content accepts both raw text as well as HTML data that will be parsed and cleaned up before being added to the email content.
Response
200
OK
Was this page helpful?
⌘I

