Update an existing voucher
curl --request PATCH \
--url https://api.nxos.io/v1/service/voucher/{voucherId} \
--header 'Content-Type: application/json' \
--data '
{
"expires_at": "<string>",
"metadata": {}
}
'import requests
url = "https://api.nxos.io/v1/service/voucher/{voucherId}"
payload = {
"expires_at": "<string>",
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({expires_at: '<string>', metadata: {}})
};
fetch('https://api.nxos.io/v1/service/voucher/{voucherId}', 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.nxos.io/v1/service/voucher/{voucherId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expires_at' => '<string>',
'metadata' => [
]
]),
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.nxos.io/v1/service/voucher/{voucherId}"
payload := strings.NewReader("{\n \"expires_at\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.nxos.io/v1/service/voucher/{voucherId}")
.header("Content-Type", "application/json")
.body("{\n \"expires_at\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nxos.io/v1/service/voucher/{voucherId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_at\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"voucher_id": "<string>",
"value": {
"amount": "<string>",
"asset_code": "<string>"
},
"expires_at": "<string>",
"provider_name": "<string>",
"funding_source_account": "<string>",
"status": "ACTIVE"
}Wallets and Vouchers
Update Voucher
Updates an existing voucher with new parameters.
This operation allows modification of certain voucher properties. Typically, this might include extending the expiration date or changing the status.
PATCH
/
v1
/
service
/
voucher
/
{voucherId}
Update an existing voucher
curl --request PATCH \
--url https://api.nxos.io/v1/service/voucher/{voucherId} \
--header 'Content-Type: application/json' \
--data '
{
"expires_at": "<string>",
"metadata": {}
}
'import requests
url = "https://api.nxos.io/v1/service/voucher/{voucherId}"
payload = {
"expires_at": "<string>",
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({expires_at: '<string>', metadata: {}})
};
fetch('https://api.nxos.io/v1/service/voucher/{voucherId}', 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.nxos.io/v1/service/voucher/{voucherId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expires_at' => '<string>',
'metadata' => [
]
]),
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.nxos.io/v1/service/voucher/{voucherId}"
payload := strings.NewReader("{\n \"expires_at\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.nxos.io/v1/service/voucher/{voucherId}")
.header("Content-Type", "application/json")
.body("{\n \"expires_at\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nxos.io/v1/service/voucher/{voucherId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"expires_at\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"voucher_id": "<string>",
"value": {
"amount": "<string>",
"asset_code": "<string>"
},
"expires_at": "<string>",
"provider_name": "<string>",
"funding_source_account": "<string>",
"status": "ACTIVE"
}Body
application/json
The details of the voucher properties to be updated.
Response
200 - application/json
The updated Voucher object containing all relevant details.