curl --request POST \
--url https://api.nxos.io/v1/service/voucher \
--header 'Content-Type: application/json' \
--data '
{
"value": {
"amount": "<string>",
"asset_code": "<string>"
},
"provider_name": "<string>",
"funding_source_account_id": "<string>",
"expires_at": "<string>"
}
'import requests
url = "https://api.nxos.io/v1/service/voucher"
payload = {
"value": {
"amount": "<string>",
"asset_code": "<string>"
},
"provider_name": "<string>",
"funding_source_account_id": "<string>",
"expires_at": "<string>"
}
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({
value: {amount: '<string>', asset_code: '<string>'},
provider_name: '<string>',
funding_source_account_id: '<string>',
expires_at: '<string>'
})
};
fetch('https://api.nxos.io/v1/service/voucher', 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",
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([
'value' => [
'amount' => '<string>',
'asset_code' => '<string>'
],
'provider_name' => '<string>',
'funding_source_account_id' => '<string>',
'expires_at' => '<string>'
]),
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"
payload := strings.NewReader("{\n \"value\": {\n \"amount\": \"<string>\",\n \"asset_code\": \"<string>\"\n },\n \"provider_name\": \"<string>\",\n \"funding_source_account_id\": \"<string>\",\n \"expires_at\": \"<string>\"\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")
.header("Content-Type", "application/json")
.body("{\n \"value\": {\n \"amount\": \"<string>\",\n \"asset_code\": \"<string>\"\n },\n \"provider_name\": \"<string>\",\n \"funding_source_account_id\": \"<string>\",\n \"expires_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nxos.io/v1/service/voucher")
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 \"value\": {\n \"amount\": \"<string>\",\n \"asset_code\": \"<string>\"\n },\n \"provider_name\": \"<string>\",\n \"funding_source_account_id\": \"<string>\",\n \"expires_at\": \"<string>\"\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"
}Mint Voucher
Mints a new voucher with specified parameters.
This operation creates a voucher by allocating funds from a specified source account. The voucher is assigned a unique identifier and can be redeemed before its expiration date.
curl --request POST \
--url https://api.nxos.io/v1/service/voucher \
--header 'Content-Type: application/json' \
--data '
{
"value": {
"amount": "<string>",
"asset_code": "<string>"
},
"provider_name": "<string>",
"funding_source_account_id": "<string>",
"expires_at": "<string>"
}
'import requests
url = "https://api.nxos.io/v1/service/voucher"
payload = {
"value": {
"amount": "<string>",
"asset_code": "<string>"
},
"provider_name": "<string>",
"funding_source_account_id": "<string>",
"expires_at": "<string>"
}
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({
value: {amount: '<string>', asset_code: '<string>'},
provider_name: '<string>',
funding_source_account_id: '<string>',
expires_at: '<string>'
})
};
fetch('https://api.nxos.io/v1/service/voucher', 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",
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([
'value' => [
'amount' => '<string>',
'asset_code' => '<string>'
],
'provider_name' => '<string>',
'funding_source_account_id' => '<string>',
'expires_at' => '<string>'
]),
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"
payload := strings.NewReader("{\n \"value\": {\n \"amount\": \"<string>\",\n \"asset_code\": \"<string>\"\n },\n \"provider_name\": \"<string>\",\n \"funding_source_account_id\": \"<string>\",\n \"expires_at\": \"<string>\"\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")
.header("Content-Type", "application/json")
.body("{\n \"value\": {\n \"amount\": \"<string>\",\n \"asset_code\": \"<string>\"\n },\n \"provider_name\": \"<string>\",\n \"funding_source_account_id\": \"<string>\",\n \"expires_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nxos.io/v1/service/voucher")
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 \"value\": {\n \"amount\": \"<string>\",\n \"asset_code\": \"<string>\"\n },\n \"provider_name\": \"<string>\",\n \"funding_source_account_id\": \"<string>\",\n \"expires_at\": \"<string>\"\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
The details required to mint a new voucher.
The value of the voucher to be minted.
Show child attributes
Show child attributes
The name of the voucher provider or issuing system.
The account ID from which funds will be sourced to back the voucher.
The expiration date of the voucher in ISO 8601 format. If not provided, a default expiration period may be applied.
Response
The minted 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