Validate Purchase Code
curl --request POST \
--url https://api.hexclave.com/api/v1/payments/purchases/validate-code \
--header 'Content-Type: application/json' \
--data '
{
"full_code": "proj_abc123_def456ghi789",
"return_url": "https://myapp.com/purchase-success"
}
'import requests
url = "https://api.hexclave.com/api/v1/payments/purchases/validate-code"
payload = {
"full_code": "proj_abc123_def456ghi789",
"return_url": "https://myapp.com/purchase-success"
}
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({
full_code: 'proj_abc123_def456ghi789',
return_url: 'https://myapp.com/purchase-success'
})
};
fetch('https://api.hexclave.com/api/v1/payments/purchases/validate-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.hexclave.com/api/v1/payments/purchases/validate-code",
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([
'full_code' => 'proj_abc123_def456ghi789',
'return_url' => 'https://myapp.com/purchase-success'
]),
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.hexclave.com/api/v1/payments/purchases/validate-code"
payload := strings.NewReader("{\n \"full_code\": \"proj_abc123_def456ghi789\",\n \"return_url\": \"https://myapp.com/purchase-success\"\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.hexclave.com/api/v1/payments/purchases/validate-code")
.header("Content-Type", "application/json")
.body("{\n \"full_code\": \"proj_abc123_def456ghi789\",\n \"return_url\": \"https://myapp.com/purchase-success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hexclave.com/api/v1/payments/purchases/validate-code")
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 \"full_code\": \"proj_abc123_def456ghi789\",\n \"return_url\": \"https://myapp.com/purchase-success\"\n}"
response = http.request(request)
puts response.read_body{
"project_id": "<string>",
"already_bought_non_stackable": true,
"conflicting_products": [
{
"product_id": "<string>",
"display_name": "<string>"
}
],
"test_mode": true,
"product": {
"display_name": "<string>",
"free_trial": [
123
],
"server_only": true,
"stackable": false,
"prices": {},
"included_items": {},
"client_metadata": {
"featureFlag": true,
"source": "marketing-campaign"
},
"client_read_only_metadata": {
"featureFlag": true,
"source": "marketing-campaign"
},
"server_metadata": {
"featureFlag": true,
"source": "marketing-campaign"
}
},
"stripe_account_id": "<string>",
"project_logo_url": "<string>",
"charges_enabled": true
}Payments
Validate Purchase Code
Validates a purchase verification code and returns purchase details including available prices.
POST
/
payments
/
purchases
/
validate-code
Validate Purchase Code
curl --request POST \
--url https://api.hexclave.com/api/v1/payments/purchases/validate-code \
--header 'Content-Type: application/json' \
--data '
{
"full_code": "proj_abc123_def456ghi789",
"return_url": "https://myapp.com/purchase-success"
}
'import requests
url = "https://api.hexclave.com/api/v1/payments/purchases/validate-code"
payload = {
"full_code": "proj_abc123_def456ghi789",
"return_url": "https://myapp.com/purchase-success"
}
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({
full_code: 'proj_abc123_def456ghi789',
return_url: 'https://myapp.com/purchase-success'
})
};
fetch('https://api.hexclave.com/api/v1/payments/purchases/validate-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.hexclave.com/api/v1/payments/purchases/validate-code",
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([
'full_code' => 'proj_abc123_def456ghi789',
'return_url' => 'https://myapp.com/purchase-success'
]),
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.hexclave.com/api/v1/payments/purchases/validate-code"
payload := strings.NewReader("{\n \"full_code\": \"proj_abc123_def456ghi789\",\n \"return_url\": \"https://myapp.com/purchase-success\"\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.hexclave.com/api/v1/payments/purchases/validate-code")
.header("Content-Type", "application/json")
.body("{\n \"full_code\": \"proj_abc123_def456ghi789\",\n \"return_url\": \"https://myapp.com/purchase-success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hexclave.com/api/v1/payments/purchases/validate-code")
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 \"full_code\": \"proj_abc123_def456ghi789\",\n \"return_url\": \"https://myapp.com/purchase-success\"\n}"
response = http.request(request)
puts response.read_body{
"project_id": "<string>",
"already_bought_non_stackable": true,
"conflicting_products": [
{
"product_id": "<string>",
"display_name": "<string>"
}
],
"test_mode": true,
"product": {
"display_name": "<string>",
"free_trial": [
123
],
"server_only": true,
"stackable": false,
"prices": {},
"included_items": {},
"client_metadata": {
"featureFlag": true,
"source": "marketing-campaign"
},
"client_read_only_metadata": {
"featureFlag": true,
"source": "marketing-campaign"
},
"server_metadata": {
"featureFlag": true,
"source": "marketing-campaign"
}
},
"stripe_account_id": "<string>",
"project_logo_url": "<string>",
"charges_enabled": true
}Body
application/json
Response
200 - application/json
Successful response
⌘I