Update a voucher group
curl --request PUT \
--url https://api.spirii.com/voucher-groups/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "4545",
"notes": "Voucher group notes",
"perKwh": 3,
"currency": "DKK",
"isSpotPriceBased": false,
"spotPriceMargin": 26,
"spotPriceMarginPct": 10,
"spotPriceMinimum": 24
}
'import requests
url = "https://api.spirii.com/voucher-groups/{id}"
payload = {
"name": "4545",
"notes": "Voucher group notes",
"perKwh": 3,
"currency": "DKK",
"isSpotPriceBased": False,
"spotPriceMargin": 26,
"spotPriceMarginPct": 10,
"spotPriceMinimum": 24
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '4545',
notes: 'Voucher group notes',
perKwh: 3,
currency: 'DKK',
isSpotPriceBased: false,
spotPriceMargin: 26,
spotPriceMarginPct: 10,
spotPriceMinimum: 24
})
};
fetch('https://api.spirii.com/voucher-groups/{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.spirii.com/voucher-groups/{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([
'name' => '4545',
'notes' => 'Voucher group notes',
'perKwh' => 3,
'currency' => 'DKK',
'isSpotPriceBased' => false,
'spotPriceMargin' => 26,
'spotPriceMarginPct' => 10,
'spotPriceMinimum' => 24
]),
CURLOPT_HTTPHEADER => [
"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.spirii.com/voucher-groups/{id}"
payload := strings.NewReader("{\n \"name\": \"4545\",\n \"notes\": \"Voucher group notes\",\n \"perKwh\": 3,\n \"currency\": \"DKK\",\n \"isSpotPriceBased\": false,\n \"spotPriceMargin\": 26,\n \"spotPriceMarginPct\": 10,\n \"spotPriceMinimum\": 24\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.spirii.com/voucher-groups/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"4545\",\n \"notes\": \"Voucher group notes\",\n \"perKwh\": 3,\n \"currency\": \"DKK\",\n \"isSpotPriceBased\": false,\n \"spotPriceMargin\": 26,\n \"spotPriceMarginPct\": 10,\n \"spotPriceMinimum\": 24\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/voucher-groups/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"4545\",\n \"notes\": \"Voucher group notes\",\n \"perKwh\": 3,\n \"currency\": \"DKK\",\n \"isSpotPriceBased\": false,\n \"spotPriceMargin\": 26,\n \"spotPriceMarginPct\": 10,\n \"spotPriceMinimum\": 24\n}"
response = http.request(request)
puts response.read_body{
"id": 24,
"name": "AKB2022",
"perKwh": 2.5,
"currency": "DKK",
"isSpotPriceBased": false,
"spotPriceMargin": null,
"spotPriceMarginPct": null,
"spotPriceMinimum": 0.5,
"createdAt": "2021-01-07T09:21:43.000Z",
"updatedAt": "2022-11-07T05:56:18.000Z",
"voucherCount": 1
}{
"error": {
"message": "Querystring parameter `id` is not allowed",
"statusCode": 400,
"code": "QueryParamNotAllowed"
}
}{
"error": {
"message": "Something went wroing, try again later",
"statusCode": 500
}
}Update a voucher group
PUT
/
voucher-groups
/
{id}
Update a voucher group
curl --request PUT \
--url https://api.spirii.com/voucher-groups/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "4545",
"notes": "Voucher group notes",
"perKwh": 3,
"currency": "DKK",
"isSpotPriceBased": false,
"spotPriceMargin": 26,
"spotPriceMarginPct": 10,
"spotPriceMinimum": 24
}
'import requests
url = "https://api.spirii.com/voucher-groups/{id}"
payload = {
"name": "4545",
"notes": "Voucher group notes",
"perKwh": 3,
"currency": "DKK",
"isSpotPriceBased": False,
"spotPriceMargin": 26,
"spotPriceMarginPct": 10,
"spotPriceMinimum": 24
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '4545',
notes: 'Voucher group notes',
perKwh: 3,
currency: 'DKK',
isSpotPriceBased: false,
spotPriceMargin: 26,
spotPriceMarginPct: 10,
spotPriceMinimum: 24
})
};
fetch('https://api.spirii.com/voucher-groups/{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.spirii.com/voucher-groups/{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([
'name' => '4545',
'notes' => 'Voucher group notes',
'perKwh' => 3,
'currency' => 'DKK',
'isSpotPriceBased' => false,
'spotPriceMargin' => 26,
'spotPriceMarginPct' => 10,
'spotPriceMinimum' => 24
]),
CURLOPT_HTTPHEADER => [
"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.spirii.com/voucher-groups/{id}"
payload := strings.NewReader("{\n \"name\": \"4545\",\n \"notes\": \"Voucher group notes\",\n \"perKwh\": 3,\n \"currency\": \"DKK\",\n \"isSpotPriceBased\": false,\n \"spotPriceMargin\": 26,\n \"spotPriceMarginPct\": 10,\n \"spotPriceMinimum\": 24\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.spirii.com/voucher-groups/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"4545\",\n \"notes\": \"Voucher group notes\",\n \"perKwh\": 3,\n \"currency\": \"DKK\",\n \"isSpotPriceBased\": false,\n \"spotPriceMargin\": 26,\n \"spotPriceMarginPct\": 10,\n \"spotPriceMinimum\": 24\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/voucher-groups/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"4545\",\n \"notes\": \"Voucher group notes\",\n \"perKwh\": 3,\n \"currency\": \"DKK\",\n \"isSpotPriceBased\": false,\n \"spotPriceMargin\": 26,\n \"spotPriceMarginPct\": 10,\n \"spotPriceMinimum\": 24\n}"
response = http.request(request)
puts response.read_body{
"id": 24,
"name": "AKB2022",
"perKwh": 2.5,
"currency": "DKK",
"isSpotPriceBased": false,
"spotPriceMargin": null,
"spotPriceMarginPct": null,
"spotPriceMinimum": 0.5,
"createdAt": "2021-01-07T09:21:43.000Z",
"updatedAt": "2022-11-07T05:56:18.000Z",
"voucherCount": 1
}{
"error": {
"message": "Querystring parameter `id` is not allowed",
"statusCode": 400,
"code": "QueryParamNotAllowed"
}
}{
"error": {
"message": "Something went wroing, try again later",
"statusCode": 500
}
}Path Parameters
Voucher Group ID
Body
application/json
Voucher group update data
name
Example:
"Kokbjerg"
Example:
"notes"
price per kwh
Example:
3
pricing currency
Example:
"DKK"
Example:
false
Example:
0.5
Example:
0.5
Example:
0.5
Response
Voucher Group update response
id
Example:
1
name
Example:
"Kokbjerg"
price per kwh
Example:
3
pricing currency
Example:
"DKK"
Example:
false
Example:
0.5
Example:
0.5
Example:
0.5
Created date
Example:
"2021-04-20T14:38:20.000Z"
Updated date
Example:
"2021-04-20T14:38:20.000Z"
Example:
1
Was this page helpful?