Add a catalogue template
curl --request POST \
--url https://api.exowpee.com/v1/template/templates/{template}/purchase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/template/templates/{template}/purchase"
payload = { "name": "<string>" }
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({name: '<string>'})
};
fetch('https://api.exowpee.com/v1/template/templates/{template}/purchase', 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.exowpee.com/v1/template/templates/{template}/purchase",
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([
'name' => '<string>'
]),
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://api.exowpee.com/v1/template/templates/{template}/purchase"
payload := strings.NewReader("{\n \"name\": \"<string>\"\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://api.exowpee.com/v1/template/templates/{template}/purchase")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/template/templates/{template}/purchase")
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 \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"company_id": "<string>",
"template_id": "<string>",
"template_version_id": "<string>",
"template_type": "<string>",
"name": "<string>",
"is_active": true,
"settings": {},
"purchased_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"template": {
"id": "<string>",
"type": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"thumbnail": "<string>",
"status": "<string>",
"source_type": "<string>"
},
"template_version": {
"id": "<string>",
"version": "<string>"
},
"update_available": true
}
}{
"message": "<string>",
"errors": {}
}Invoice and document templates
Add a catalogue template
Adds a catalogue template to your company, pinned to its current version and inactive until you activate it. A previously deleted copy is restored.
POST
/
template
/
templates
/
{template}
/
purchase
Add a catalogue template
curl --request POST \
--url https://api.exowpee.com/v1/template/templates/{template}/purchase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/template/templates/{template}/purchase"
payload = { "name": "<string>" }
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({name: '<string>'})
};
fetch('https://api.exowpee.com/v1/template/templates/{template}/purchase', 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.exowpee.com/v1/template/templates/{template}/purchase",
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([
'name' => '<string>'
]),
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://api.exowpee.com/v1/template/templates/{template}/purchase"
payload := strings.NewReader("{\n \"name\": \"<string>\"\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://api.exowpee.com/v1/template/templates/{template}/purchase")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/template/templates/{template}/purchase")
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 \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"company_id": "<string>",
"template_id": "<string>",
"template_version_id": "<string>",
"template_type": "<string>",
"name": "<string>",
"is_active": true,
"settings": {},
"purchased_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"template": {
"id": "<string>",
"type": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"thumbnail": "<string>",
"status": "<string>",
"source_type": "<string>"
},
"template_version": {
"id": "<string>",
"version": "<string>"
},
"update_available": true
}
}{
"message": "<string>",
"errors": {}
}Company space
For: Administrator, Manager · Permission:
company_templates.create
Conditions
- Company-owned templates cannot be obtained this way.
- The template must be listed and have a published version.
- The company must not already own the template; a copy that was deleted does not count as owned and is restored instead.
- Creates a company template pinned to the template’s current version, inactive and with empty settings. No payment is taken.
- When the company had a deleted copy, it is restored, re-pinned to the current version, made inactive, its purchase date is reset and settings no longer in the schema are removed.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the template in the catalogue (27-character KSUID string).
Body
application/json
Name given to the company's copy, at most 255 characters. Defaults to the catalogue template's name. Ignored when a deleted copy is restored.
Maximum string length:
255Response
CompanyTemplateResource
Items of this page.
Show child attributes
Show child attributes