Validate and apply loyalty vouchers to the current user's cart
curl --request POST \
--url https://{merchant_site_domain}/ClientApplyLoyaltyVouchers \
--header 'Content-Type: application/json' \
--data '
{
"LoyaltyVouchers": [
"123456",
"123467"
]
}
'import requests
url = "https://{merchant_site_domain}/ClientApplyLoyaltyVouchers"
payload = { "LoyaltyVouchers": ["123456", "123467"] }
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({LoyaltyVouchers: ['123456', '123467']})
};
fetch('https://{merchant_site_domain}/ClientApplyLoyaltyVouchers', 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}/ClientApplyLoyaltyVouchers",
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([
'LoyaltyVouchers' => [
'123456',
'123467'
]
]),
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}/ClientApplyLoyaltyVouchers"
payload := strings.NewReader("{\n \"LoyaltyVouchers\": [\n \"123456\",\n \"123467\"\n ]\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}/ClientApplyLoyaltyVouchers")
.header("Content-Type", "application/json")
.body("{\n \"LoyaltyVouchers\": [\n \"123456\",\n \"123467\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{merchant_site_domain}/ClientApplyLoyaltyVouchers")
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 \"LoyaltyVouchers\": [\n \"123456\",\n \"123467\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"Description": "<string>",
"ErrorCode": "<string>",
"InternalOrderId": "<string>",
"Message": "<string>",
"OrderId": "<string>",
"PaymentAmount": "<string>",
"PaymentCurrencyCode": "<string>",
"StatusCode": "<string>",
"Success": true
}Client apply loyalty vouchers (Global-e to Merchant)
Validates the Loyalty Vouchers selected by the user and applies them to the current user’s cart if all vouchers in the list are valid and applicable.
POST
/
ClientApplyLoyaltyVouchers
Validate and apply loyalty vouchers to the current user's cart
curl --request POST \
--url https://{merchant_site_domain}/ClientApplyLoyaltyVouchers \
--header 'Content-Type: application/json' \
--data '
{
"LoyaltyVouchers": [
"123456",
"123467"
]
}
'import requests
url = "https://{merchant_site_domain}/ClientApplyLoyaltyVouchers"
payload = { "LoyaltyVouchers": ["123456", "123467"] }
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({LoyaltyVouchers: ['123456', '123467']})
};
fetch('https://{merchant_site_domain}/ClientApplyLoyaltyVouchers', 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}/ClientApplyLoyaltyVouchers",
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([
'LoyaltyVouchers' => [
'123456',
'123467'
]
]),
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}/ClientApplyLoyaltyVouchers"
payload := strings.NewReader("{\n \"LoyaltyVouchers\": [\n \"123456\",\n \"123467\"\n ]\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}/ClientApplyLoyaltyVouchers")
.header("Content-Type", "application/json")
.body("{\n \"LoyaltyVouchers\": [\n \"123456\",\n \"123467\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{merchant_site_domain}/ClientApplyLoyaltyVouchers")
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 \"LoyaltyVouchers\": [\n \"123456\",\n \"123467\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"Description": "<string>",
"ErrorCode": "<string>",
"InternalOrderId": "<string>",
"Message": "<string>",
"OrderId": "<string>",
"PaymentAmount": "<string>",
"PaymentCurrencyCode": "<string>",
"StatusCode": "<string>",
"Success": true
}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.
loyaltyVouchersList argument of the SendCart API call for the current user’s checkout page. This method can only be executed from within the context of the current user’s client session. Validates Loyalty Vouchers and applies them to the current user’s cart if all the vouchers in the list are valid and applicable.
- If at least one Loyalty Voucher in the list is invalid,
Merchant.ResponseInfo.Successis set toFALSE. - If all Loyalty Vouchers are valid, the Merchant’s server should re-calculate the cart pricing and execute before returning a response, the
SendCartAPI call with theCartTokenargument value returned from the previous call toSendCartfor the current user.
Body
application/json
Response
200 - application/json
Response Parameters
Describes the response to the API call. In case of an error, indicates the error.

