curl --request PUT \
--url https://api.invopop.com/sequence/v1/series/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "SALES-2020",
"description": "This series is used for sales.",
"name": "My Series",
"padding": 5,
"prefix": "INV-",
"sig": "<string>",
"start": 1,
"suffix": "-F1"
}
'import requests
url = "https://api.invopop.com/sequence/v1/series/{id}"
payload = {
"code": "SALES-2020",
"description": "This series is used for sales.",
"name": "My Series",
"padding": 5,
"prefix": "INV-",
"sig": "<string>",
"start": 1,
"suffix": "-F1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: 'SALES-2020',
description: 'This series is used for sales.',
name: 'My Series',
padding: 5,
prefix: 'INV-',
sig: '<string>',
start: 1,
suffix: '-F1'
})
};
fetch('https://api.invopop.com/sequence/v1/series/{id}', 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.invopop.com/sequence/v1/series/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'code' => 'SALES-2020',
'description' => 'This series is used for sales.',
'name' => 'My Series',
'padding' => 5,
'prefix' => 'INV-',
'sig' => '<string>',
'start' => 1,
'suffix' => '-F1'
]),
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.invopop.com/sequence/v1/series/{id}"
payload := strings.NewReader("{\n \"code\": \"SALES-2020\",\n \"description\": \"This series is used for sales.\",\n \"name\": \"My Series\",\n \"padding\": 5,\n \"prefix\": \"INV-\",\n \"sig\": \"<string>\",\n \"start\": 1,\n \"suffix\": \"-F1\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.invopop.com/sequence/v1/series/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"SALES-2020\",\n \"description\": \"This series is used for sales.\",\n \"name\": \"My Series\",\n \"padding\": 5,\n \"prefix\": \"INV-\",\n \"sig\": \"<string>\",\n \"start\": 1,\n \"suffix\": \"-F1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/sequence/v1/series/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"SALES-2020\",\n \"description\": \"This series is used for sales.\",\n \"name\": \"My Series\",\n \"padding\": 5,\n \"prefix\": \"INV-\",\n \"sig\": \"<string>\",\n \"start\": 1,\n \"suffix\": \"-F1\"\n}"
response = http.request(request)
puts response.read_body{
"id": "835bb1ca-e7c4-41e6-9e88-464de54cc08e",
"name": "Testing",
"prefix": "TEST1",
"padding": 5,
"suffix": "-2022",
"created_at": "2022-03-03T22:18:50Z",
"updated_at": "2022-03-03T22:18:50Z"
}
Create a series
Create a new series idempotently with the given UUID (any version).
curl --request PUT \
--url https://api.invopop.com/sequence/v1/series/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "SALES-2020",
"description": "This series is used for sales.",
"name": "My Series",
"padding": 5,
"prefix": "INV-",
"sig": "<string>",
"start": 1,
"suffix": "-F1"
}
'import requests
url = "https://api.invopop.com/sequence/v1/series/{id}"
payload = {
"code": "SALES-2020",
"description": "This series is used for sales.",
"name": "My Series",
"padding": 5,
"prefix": "INV-",
"sig": "<string>",
"start": 1,
"suffix": "-F1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: 'SALES-2020',
description: 'This series is used for sales.',
name: 'My Series',
padding: 5,
prefix: 'INV-',
sig: '<string>',
start: 1,
suffix: '-F1'
})
};
fetch('https://api.invopop.com/sequence/v1/series/{id}', 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.invopop.com/sequence/v1/series/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'code' => 'SALES-2020',
'description' => 'This series is used for sales.',
'name' => 'My Series',
'padding' => 5,
'prefix' => 'INV-',
'sig' => '<string>',
'start' => 1,
'suffix' => '-F1'
]),
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.invopop.com/sequence/v1/series/{id}"
payload := strings.NewReader("{\n \"code\": \"SALES-2020\",\n \"description\": \"This series is used for sales.\",\n \"name\": \"My Series\",\n \"padding\": 5,\n \"prefix\": \"INV-\",\n \"sig\": \"<string>\",\n \"start\": 1,\n \"suffix\": \"-F1\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.invopop.com/sequence/v1/series/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"SALES-2020\",\n \"description\": \"This series is used for sales.\",\n \"name\": \"My Series\",\n \"padding\": 5,\n \"prefix\": \"INV-\",\n \"sig\": \"<string>\",\n \"start\": 1,\n \"suffix\": \"-F1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invopop.com/sequence/v1/series/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"SALES-2020\",\n \"description\": \"This series is used for sales.\",\n \"name\": \"My Series\",\n \"padding\": 5,\n \"prefix\": \"INV-\",\n \"sig\": \"<string>\",\n \"start\": 1,\n \"suffix\": \"-F1\"\n}"
response = http.request(request)
puts response.read_body{
"id": "835bb1ca-e7c4-41e6-9e88-464de54cc08e",
"name": "Testing",
"prefix": "TEST1",
"padding": 5,
"suffix": "-2022",
"created_at": "2022-03-03T22:18:50Z",
"updated_at": "2022-03-03T22:18:50Z"
}
{
"id": "835bb1ca-e7c4-41e6-9e88-464de54cc08e",
"name": "Testing",
"prefix": "TEST1",
"padding": 5,
"suffix": "-2022",
"created_at": "2022-03-03T22:18:50Z",
"updated_at": "2022-03-03T22:18:50Z"
}
Authorizations
Use the Bearer scheme with a valid JWT token to authenticate requests. Example: Authorization: Bearer <token>
Path Parameters
The UUID (any version) of the series to create.
"a8904315-3d16-4a95-91c1-30d6cdde553e"
Body
A code that can be used to identify the series.
"SALES-2020"
A description of the series.
"This series is used for sales."
The name of the series.
"My Series"
The number of 0s to pad the generated codes with.
5
A prefix that will be prepended to all entries.
"INV-"
JSON Web Signature of the key properties used to create the series.
The starting index for the series.
1
A suffix that will be appended to all entries.
"-F1"
Response
OK
A code that can be used to identify the series.
"SALES-2020"
The date and time the series was created.
"2020-10-01T00:00:00Z"
A description of the series.
"This series is used for sales."
The UUID (any version) of the series.
"a8904315-3d16-4a95-91c1-30d6cdde553e"
The name of the series.
"My Series"
The number of 0s to pad the generated codes with.
5
A prefix that will be prepended to all entries.
"INV-"
A suffix that will be appended to all entries.
"-F1"
The date and time the series was last updated.
"2020-10-01T00:00:00Z"
Was this page helpful?