curl --request POST \
--url https://api.nxos.io/v1/service/voucher/{voucherId}/redeem \
--header 'Content-Type: application/json' \
--data '
{
"target_account_id": "<string>",
"metadata": {}
}
'import requests
url = "https://api.nxos.io/v1/service/voucher/{voucherId}/redeem"
payload = {
"target_account_id": "<string>",
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({target_account_id: '<string>', metadata: {}})
};
fetch('https://api.nxos.io/v1/service/voucher/{voucherId}/redeem', 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}/redeem",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_account_id' => '<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}/redeem"
payload := strings.NewReader("{\n \"target_account_id\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.nxos.io/v1/service/voucher/{voucherId}/redeem")
.header("Content-Type", "application/json")
.body("{\n \"target_account_id\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nxos.io/v1/service/voucher/{voucherId}/redeem")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_account_id\": \"<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",
"redeemed_at": "<string>",
"redeemed_to_account_id": "<string>",
"redemption_transaction_id": "<string>",
"redeemed_value": {
"amount": "<string>",
"asset_code": "<string>"
},
"remaining_value": {
"amount": "<string>",
"asset_code": "<string>"
}
}Redeem Voucher
Redeems a voucher, transferring all or part of its value to a specified target account.
This operation allows for full or partial redemption of a voucher. If the redeemed value is less than the total voucher value, the voucher remains active with the remaining balance. Once fully redeemed, a voucher cannot be used again.
curl --request POST \
--url https://api.nxos.io/v1/service/voucher/{voucherId}/redeem \
--header 'Content-Type: application/json' \
--data '
{
"target_account_id": "<string>",
"metadata": {}
}
'import requests
url = "https://api.nxos.io/v1/service/voucher/{voucherId}/redeem"
payload = {
"target_account_id": "<string>",
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({target_account_id: '<string>', metadata: {}})
};
fetch('https://api.nxos.io/v1/service/voucher/{voucherId}/redeem', 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}/redeem",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_account_id' => '<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}/redeem"
payload := strings.NewReader("{\n \"target_account_id\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.nxos.io/v1/service/voucher/{voucherId}/redeem")
.header("Content-Type", "application/json")
.body("{\n \"target_account_id\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nxos.io/v1/service/voucher/{voucherId}/redeem")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_account_id\": \"<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",
"redeemed_at": "<string>",
"redeemed_to_account_id": "<string>",
"redemption_transaction_id": "<string>",
"redeemed_value": {
"amount": "<string>",
"asset_code": "<string>"
},
"remaining_value": {
"amount": "<string>",
"asset_code": "<string>"
}
}Path Parameters
The unique identifier of the voucher to redeem.
Body
The details required for redeeming the voucher, including the target account and redemption value.
The ID of the account that will receive the redeemed value of the voucher.
The value to be redeemed from the voucher. If not specified, the entire remaining value of the voucher will be redeemed. For partial redemption, specify a value less than the voucher's current value.
Show child attributes
Show child attributes
Optional metadata to be associated with the redemption transaction.
Show child attributes
Show child attributes
Response
The updated Voucher object after redemption, including the new status and redemption 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 The timestamp when the voucher was last redeemed, in ISO 8601 format.
The ID of the account that received the redeemed voucher value.
The ID of the transaction created for this redemption.
The value that was redeemed in this transaction.
Show child attributes
Show child attributes
The remaining value on the voucher after this redemption.
Show child attributes
Show child attributes