Disable a voucher (sets it as expired)
curl --request DELETE \
--url https://api.spirii.com/vouchers/{id}import requests
url = "https://api.spirii.com/vouchers/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.spirii.com/vouchers/{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/vouchers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.spirii.com/vouchers/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.spirii.com/vouchers/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/vouchers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"id": 1,
"groupId": 141,
"code": "sp1r112020",
"maxUsers": 6,
"createdAt": "2020-10-20T04:19:03.000Z",
"updatedAt": "2022-09-29T03:57:50.000Z",
"expiresAt": "2024-07-22T05:26:16.000Z"
}{
"error": {
"message": "Querystring parameter `id` is not allowed",
"statusCode": 400,
"code": "QueryParamNotAllowed"
}
}{
"error": {
"message": "Something went wroing, try again later",
"statusCode": 500
}
}Disable a voucher (sets it as expired)
DELETE
/
vouchers
/
{id}
Disable a voucher (sets it as expired)
curl --request DELETE \
--url https://api.spirii.com/vouchers/{id}import requests
url = "https://api.spirii.com/vouchers/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.spirii.com/vouchers/{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/vouchers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.spirii.com/vouchers/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.spirii.com/vouchers/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/vouchers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"id": 1,
"groupId": 141,
"code": "sp1r112020",
"maxUsers": 6,
"createdAt": "2020-10-20T04:19:03.000Z",
"updatedAt": "2022-09-29T03:57:50.000Z",
"expiresAt": "2024-07-22T05:26:16.000Z"
}{
"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 Id
Response
Voucher delete response
id
Example:
1
Example:
5
Example:
"code123"
Example:
5
Created date
Example:
"2021-04-20T14:38:20.000Z"
Updated date
Example:
"2021-04-20T14:38:20.000Z"
Updated date
Example:
"2021-04-20T14:38:20.000Z"
Was this page helpful?