Skip to main content
GET
/
api
/
v1
/
developer
/
vouchers
/
{code}
Get voucher
curl --request GET \
  --url https://api.example.com/api/v1/developer/vouchers/{code}
import requests

url = "https://api.example.com/api/v1/developer/vouchers/{code}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.example.com/api/v1/developer/vouchers/{code}', 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.example.com/api/v1/developer/vouchers/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$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.example.com/api/v1/developer/vouchers/{code}"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/developer/vouchers/{code}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/v1/developer/vouchers/{code}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
Required scope: vouchers:read Rate limit: 300 requests/minute

Path parameters

ParameterTypeNotes
codestringVoucher code, max 50 characters

Query parameters

ParameterTypeNotes
includestringSet to customer to embed the linked customer record

Response

{
  "id": "8d82f0d2-7f94-4a3b-8b55-1e2e3a4f5b6c",
  "code": "VG-EXAMPLE1",
  "amount": "100.00",
  "balance": "75.00",
  "status": "completed",
  "recipient_name": "Sam Recipient",
  "recipient_email": "sam@example.com",
  "expiry_date": "2029-04-26T00:00:00Z",
  "created_at": "2026-04-26T01:23:45Z",
  "updated_at": "2026-04-26T01:23:45Z",
  "location_id": null
}

Errors

  • 404 – Voucher with that code does not exist in your tenant (or is at a different location than your location-scoped key).
  • 422include is set to anything other than customer.

Examples

curl \
  -H "X-API-Key: vg_live_EXAMPLEdoNotUseThis123456" \
  "https://api.vouchergrid.com/api/v1/developer/vouchers/VG-EXAMPLE1?include=customer"
const res = await fetch(
  "https://api.vouchergrid.com/api/v1/developer/vouchers/VG-EXAMPLE1?include=customer",
  { headers: { "X-API-Key": process.env.VOUCHERGRID_API_KEY! } },
);
const voucher = await res.json();