ValidateVoucher (Global-e to Merchant)
curl --request POST \
--url https://{merchant_site_domain}/checkout-validate-cart-voucher-url \
--header 'Content-Type: application/json' \
--data '
{
"CartHash": "",
"CartId": "36048",
"CartToken": "f8a78edd-7cea-4cb7-835c-57c7f0b13c56",
"CountryCode": "IL",
"CurrencyCode": "ILS",
"Discounts": [],
"FreeShippingCouponCode": "",
"IsFreeShipping": false,
"MerchantGUID": "<MERCHANT_GUID>",
"Products": [],
"UserId": null,
"VoucherCode": "10Perc",
"VoucherType": 1,
"WebStoreCode": null,
"WebStoreInstanceCode": "GlobalEDefaultStoreInstance"
}
'import requests
url = "https://{merchant_site_domain}/checkout-validate-cart-voucher-url"
payload = {
"CartHash": "",
"CartId": "36048",
"CartToken": "f8a78edd-7cea-4cb7-835c-57c7f0b13c56",
"CountryCode": "IL",
"CurrencyCode": "ILS",
"Discounts": [],
"FreeShippingCouponCode": "",
"IsFreeShipping": False,
"MerchantGUID": "<MERCHANT_GUID>",
"Products": [],
"UserId": None,
"VoucherCode": "10Perc",
"VoucherType": 1,
"WebStoreCode": None,
"WebStoreInstanceCode": "GlobalEDefaultStoreInstance"
}
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({
CartHash: '',
CartId: '36048',
CartToken: 'f8a78edd-7cea-4cb7-835c-57c7f0b13c56',
CountryCode: 'IL',
CurrencyCode: 'ILS',
Discounts: [],
FreeShippingCouponCode: '',
IsFreeShipping: false,
MerchantGUID: '<MERCHANT_GUID>',
Products: [],
UserId: null,
VoucherCode: '10Perc',
VoucherType: 1,
WebStoreCode: null,
WebStoreInstanceCode: 'GlobalEDefaultStoreInstance'
})
};
fetch('https://{merchant_site_domain}/checkout-validate-cart-voucher-url', 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://{merchant_site_domain}/checkout-validate-cart-voucher-url",
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([
'CartHash' => '',
'CartId' => '36048',
'CartToken' => 'f8a78edd-7cea-4cb7-835c-57c7f0b13c56',
'CountryCode' => 'IL',
'CurrencyCode' => 'ILS',
'Discounts' => [
],
'FreeShippingCouponCode' => '',
'IsFreeShipping' => false,
'MerchantGUID' => '<MERCHANT_GUID>',
'Products' => [
],
'UserId' => null,
'VoucherCode' => '10Perc',
'VoucherType' => 1,
'WebStoreCode' => null,
'WebStoreInstanceCode' => 'GlobalEDefaultStoreInstance'
]),
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://{merchant_site_domain}/checkout-validate-cart-voucher-url"
payload := strings.NewReader("{\n \"CartHash\": \"\",\n \"CartId\": \"36048\",\n \"CartToken\": \"f8a78edd-7cea-4cb7-835c-57c7f0b13c56\",\n \"CountryCode\": \"IL\",\n \"CurrencyCode\": \"ILS\",\n \"Discounts\": [],\n \"FreeShippingCouponCode\": \"\",\n \"IsFreeShipping\": false,\n \"MerchantGUID\": \"<MERCHANT_GUID>\",\n \"Products\": [],\n \"UserId\": null,\n \"VoucherCode\": \"10Perc\",\n \"VoucherType\": 1,\n \"WebStoreCode\": null,\n \"WebStoreInstanceCode\": \"GlobalEDefaultStoreInstance\"\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://{merchant_site_domain}/checkout-validate-cart-voucher-url")
.header("Content-Type", "application/json")
.body("{\n \"CartHash\": \"\",\n \"CartId\": \"36048\",\n \"CartToken\": \"f8a78edd-7cea-4cb7-835c-57c7f0b13c56\",\n \"CountryCode\": \"IL\",\n \"CurrencyCode\": \"ILS\",\n \"Discounts\": [],\n \"FreeShippingCouponCode\": \"\",\n \"IsFreeShipping\": false,\n \"MerchantGUID\": \"<MERCHANT_GUID>\",\n \"Products\": [],\n \"UserId\": null,\n \"VoucherCode\": \"10Perc\",\n \"VoucherType\": 1,\n \"WebStoreCode\": null,\n \"WebStoreInstanceCode\": \"GlobalEDefaultStoreInstance\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{merchant_site_domain}/checkout-validate-cart-voucher-url")
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 \"CartHash\": \"\",\n \"CartId\": \"36048\",\n \"CartToken\": \"f8a78edd-7cea-4cb7-835c-57c7f0b13c56\",\n \"CountryCode\": \"IL\",\n \"CurrencyCode\": \"ILS\",\n \"Discounts\": [],\n \"FreeShippingCouponCode\": \"\",\n \"IsFreeShipping\": false,\n \"MerchantGUID\": \"<MERCHANT_GUID>\",\n \"Products\": [],\n \"UserId\": null,\n \"VoucherCode\": \"10Perc\",\n \"VoucherType\": 1,\n \"WebStoreCode\": null,\n \"WebStoreInstanceCode\": \"GlobalEDefaultStoreInstance\"\n}"
response = http.request(request)
puts response.read_body{
"IsVoucherValid": true,
"VoucherType": 1,
"CartToken": "f8a78edd-7cea-4cb7-835c-57c7f0b13c56",
"VoucherValidationRestriction": [],
"ValidationFaliureMessage": ""
}ValidateVoucher (Global-e to Merchant)
This API returns new CartToken in the CartToken attribute. The API call is used to help validate vouchers/coupons used on the Checkout page.
POST
/
checkout-validate-cart-voucher-url
ValidateVoucher (Global-e to Merchant)
curl --request POST \
--url https://{merchant_site_domain}/checkout-validate-cart-voucher-url \
--header 'Content-Type: application/json' \
--data '
{
"CartHash": "",
"CartId": "36048",
"CartToken": "f8a78edd-7cea-4cb7-835c-57c7f0b13c56",
"CountryCode": "IL",
"CurrencyCode": "ILS",
"Discounts": [],
"FreeShippingCouponCode": "",
"IsFreeShipping": false,
"MerchantGUID": "<MERCHANT_GUID>",
"Products": [],
"UserId": null,
"VoucherCode": "10Perc",
"VoucherType": 1,
"WebStoreCode": null,
"WebStoreInstanceCode": "GlobalEDefaultStoreInstance"
}
'import requests
url = "https://{merchant_site_domain}/checkout-validate-cart-voucher-url"
payload = {
"CartHash": "",
"CartId": "36048",
"CartToken": "f8a78edd-7cea-4cb7-835c-57c7f0b13c56",
"CountryCode": "IL",
"CurrencyCode": "ILS",
"Discounts": [],
"FreeShippingCouponCode": "",
"IsFreeShipping": False,
"MerchantGUID": "<MERCHANT_GUID>",
"Products": [],
"UserId": None,
"VoucherCode": "10Perc",
"VoucherType": 1,
"WebStoreCode": None,
"WebStoreInstanceCode": "GlobalEDefaultStoreInstance"
}
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({
CartHash: '',
CartId: '36048',
CartToken: 'f8a78edd-7cea-4cb7-835c-57c7f0b13c56',
CountryCode: 'IL',
CurrencyCode: 'ILS',
Discounts: [],
FreeShippingCouponCode: '',
IsFreeShipping: false,
MerchantGUID: '<MERCHANT_GUID>',
Products: [],
UserId: null,
VoucherCode: '10Perc',
VoucherType: 1,
WebStoreCode: null,
WebStoreInstanceCode: 'GlobalEDefaultStoreInstance'
})
};
fetch('https://{merchant_site_domain}/checkout-validate-cart-voucher-url', 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://{merchant_site_domain}/checkout-validate-cart-voucher-url",
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([
'CartHash' => '',
'CartId' => '36048',
'CartToken' => 'f8a78edd-7cea-4cb7-835c-57c7f0b13c56',
'CountryCode' => 'IL',
'CurrencyCode' => 'ILS',
'Discounts' => [
],
'FreeShippingCouponCode' => '',
'IsFreeShipping' => false,
'MerchantGUID' => '<MERCHANT_GUID>',
'Products' => [
],
'UserId' => null,
'VoucherCode' => '10Perc',
'VoucherType' => 1,
'WebStoreCode' => null,
'WebStoreInstanceCode' => 'GlobalEDefaultStoreInstance'
]),
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://{merchant_site_domain}/checkout-validate-cart-voucher-url"
payload := strings.NewReader("{\n \"CartHash\": \"\",\n \"CartId\": \"36048\",\n \"CartToken\": \"f8a78edd-7cea-4cb7-835c-57c7f0b13c56\",\n \"CountryCode\": \"IL\",\n \"CurrencyCode\": \"ILS\",\n \"Discounts\": [],\n \"FreeShippingCouponCode\": \"\",\n \"IsFreeShipping\": false,\n \"MerchantGUID\": \"<MERCHANT_GUID>\",\n \"Products\": [],\n \"UserId\": null,\n \"VoucherCode\": \"10Perc\",\n \"VoucherType\": 1,\n \"WebStoreCode\": null,\n \"WebStoreInstanceCode\": \"GlobalEDefaultStoreInstance\"\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://{merchant_site_domain}/checkout-validate-cart-voucher-url")
.header("Content-Type", "application/json")
.body("{\n \"CartHash\": \"\",\n \"CartId\": \"36048\",\n \"CartToken\": \"f8a78edd-7cea-4cb7-835c-57c7f0b13c56\",\n \"CountryCode\": \"IL\",\n \"CurrencyCode\": \"ILS\",\n \"Discounts\": [],\n \"FreeShippingCouponCode\": \"\",\n \"IsFreeShipping\": false,\n \"MerchantGUID\": \"<MERCHANT_GUID>\",\n \"Products\": [],\n \"UserId\": null,\n \"VoucherCode\": \"10Perc\",\n \"VoucherType\": 1,\n \"WebStoreCode\": null,\n \"WebStoreInstanceCode\": \"GlobalEDefaultStoreInstance\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{merchant_site_domain}/checkout-validate-cart-voucher-url")
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 \"CartHash\": \"\",\n \"CartId\": \"36048\",\n \"CartToken\": \"f8a78edd-7cea-4cb7-835c-57c7f0b13c56\",\n \"CountryCode\": \"IL\",\n \"CurrencyCode\": \"ILS\",\n \"Discounts\": [],\n \"FreeShippingCouponCode\": \"\",\n \"IsFreeShipping\": false,\n \"MerchantGUID\": \"<MERCHANT_GUID>\",\n \"Products\": [],\n \"UserId\": null,\n \"VoucherCode\": \"10Perc\",\n \"VoucherType\": 1,\n \"WebStoreCode\": null,\n \"WebStoreInstanceCode\": \"GlobalEDefaultStoreInstance\"\n}"
response = http.request(request)
puts response.read_body{
"IsVoucherValid": true,
"VoucherType": 1,
"CartToken": "f8a78edd-7cea-4cb7-835c-57c7f0b13c56",
"VoucherValidationRestriction": [],
"ValidationFaliureMessage": ""
}This API is part of Global-e’s extensions and plug-ins. Merchants do not need to implement this API unless a custom integration is required.
CartToken in the CartToken attribute. The API call is used to help validate vouchers/coupons used on the Checkout page. If the voucher is valid, the merchant’s platform is responsible for applying this voucher to the shopper’s basket and executing a new SendCart / SendCartV2 API call to Global‑e, with an indication of the newly generated discount for this voucher or coupon. The new CartToken returned from this call is returned in the CartToken attribute.Body
application/json
Provides information related to validating a voucher in a cart.
Response
200 - application/json
Response Parameters
Provides information related to the voucher validation.

