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"
}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.
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"
}Path Parameters
The unique identifier of the voucher to update.
Body
The details of the voucher properties to be updated.
The new expiration date of the voucher in ISO 8601 format. If provided, this will extend or shorten the voucher's validity period.
The new status of the voucher. This allows for manual state transitions, e.g., cancelling a voucher.
ACTIVE, PARTIALLY_REDEEMED, FULLY_REDEEMED, EXPIRED, CANCELLED Additional metadata or properties that can be updated. This is a flexible field to allow for future extensions without changing the API structure.
Show child attributes
Show child attributes
Response
The updated Voucher object containing all relevant details.
Unique identifier for the voucher.
The value of the voucher.
Show child attributes
Show child attributes
The expiration date of the voucher in ISO 8601 format.
The name of the voucher provider or issuing system.
The account ID from which funds were sourced to back the voucher.
The current status of the voucher.
ACTIVE, PARTIALLY_REDEEMED, FULLY_REDEEMED, EXPIRED, CANCELLED