curl --request POST \
--url https://{globale_api_domain}/Checkout/SendCartV2 \
--header 'Content-Type: application/json' \
--data '
{
"CountryCode": "AU",
"ClientIP": "128.128.128.128",
"Currency": {
"OriginalCurrencyCode": "GBP",
"CurrencyCode": "AUD"
},
"PriceModification": {
"RoundingRuleId": 103,
"PriceCoefficientRate": 1,
"IncludeVAT": null
},
"Culture": {
"PreferedCultureCode": null,
"InputDataCultureCode": null,
"CultureCode": "en-GB"
},
"LocalShippingOptions": [
{
"Carrier": "globaleintegration_standard",
"CarrierTitle": "globaleintegration_standard",
"CarrierName": "globaleintegration_standard",
"Code": "globaleintegration_standard",
"Method": "globaleintegration_standard",
"MethodTitle": "globaleintegration_standard",
"MethodDescription": "globaleintegration_standard",
"Price": 0,
"IsPreferred": true
}
],
"MerchantCartToken": "21531332-b15f-4640-ad5e-60887271a89a",
"MerchantOrderId": "45345454",
"PlatformURLs": {
"SiteURL": "https://test.com/my_url.html",
"RedirectToCartURL": "https://test.com/callback_URL.html",
"PaymentCallbackURL": "https://test.com/paymentCallback_URL.html"
},
"Products": [
{
"ProductCode": "XE08801",
"ProductGroupCode": null,
"Name": "Socks",
"URL": "https://www.test.com/products/08801",
"Description": "Naturally Close 5 Pack White Value Trainer Liner Socks",
"ImageURL": "https://test.test.com/1.jpg",
"SalePrice": "8.95",
"OriginalSalePrice": "5",
"SalePriceBeforeRounding": "8.905175000000000000",
"LocalVATRateType": {
"VATRateTypeCode": "merchantVATRateType_20",
"Name": "merchantVATRateType_20",
"Rate": 20,
"InternalVATRateTypeId": 0
},
"OrderedQuantity": 1,
"CartItemId": "111",
"IsBackOrdered": false,
"IsFixedPrice": true,
"ListPrice": 58.2,
"Attributes": [
{
"AttributeCode": "color",
"Name": "WHITE",
"AttributeTypeCode": "color"
},
{
"AttributeCode": "size",
"Name": "ONE SIZE",
"AttributeTypeCode": "size"
}
],
"MetaData": {
"Attributes": [
{
"AttributeKey": "earliestDeliveryDate",
"AttributeValue": "1717763520"
},
{
"AttributeKey": "earliestShipDate",
"AttributeValue": "1716985920"
}
]
}
}
],
"CartToken": null,
"UserDetails": {
"UserId": 12345,
"AddressDetails": [
{
"UserId": 12345,
"FirstName": "Test",
"LastName": "Test-e",
"Phone1": "01234567",
"Email": "mmm.bbb@gmail.com",
"Address1": "2-4 Test St",
"City": "Alexandria",
"Zip": "2015",
"CountryCode": "AU",
"IsShipping": true,
"IsBilling": true,
"IsDefaultShipping": true,
"IsDefaultBilling": true
}
]
},
"Discounts": [],
"VATRegistration": {
"VatRegistrationNumber": null,
"DoNotChargeVAT": false
},
"rateData": "bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=",
"IsMoto": 1
}
'import requests
url = "https://{globale_api_domain}/Checkout/SendCartV2"
payload = {
"CountryCode": "AU",
"ClientIP": "128.128.128.128",
"Currency": {
"OriginalCurrencyCode": "GBP",
"CurrencyCode": "AUD"
},
"PriceModification": {
"RoundingRuleId": 103,
"PriceCoefficientRate": 1,
"IncludeVAT": None
},
"Culture": {
"PreferedCultureCode": None,
"InputDataCultureCode": None,
"CultureCode": "en-GB"
},
"LocalShippingOptions": [
{
"Carrier": "globaleintegration_standard",
"CarrierTitle": "globaleintegration_standard",
"CarrierName": "globaleintegration_standard",
"Code": "globaleintegration_standard",
"Method": "globaleintegration_standard",
"MethodTitle": "globaleintegration_standard",
"MethodDescription": "globaleintegration_standard",
"Price": 0,
"IsPreferred": True
}
],
"MerchantCartToken": "21531332-b15f-4640-ad5e-60887271a89a",
"MerchantOrderId": "45345454",
"PlatformURLs": {
"SiteURL": "https://test.com/my_url.html",
"RedirectToCartURL": "https://test.com/callback_URL.html",
"PaymentCallbackURL": "https://test.com/paymentCallback_URL.html"
},
"Products": [
{
"ProductCode": "XE08801",
"ProductGroupCode": None,
"Name": "Socks",
"URL": "https://www.test.com/products/08801",
"Description": "Naturally Close 5 Pack White Value Trainer Liner Socks",
"ImageURL": "https://test.test.com/1.jpg",
"SalePrice": "8.95",
"OriginalSalePrice": "5",
"SalePriceBeforeRounding": "8.905175000000000000",
"LocalVATRateType": {
"VATRateTypeCode": "merchantVATRateType_20",
"Name": "merchantVATRateType_20",
"Rate": 20,
"InternalVATRateTypeId": 0
},
"OrderedQuantity": 1,
"CartItemId": "111",
"IsBackOrdered": False,
"IsFixedPrice": True,
"ListPrice": 58.2,
"Attributes": [
{
"AttributeCode": "color",
"Name": "WHITE",
"AttributeTypeCode": "color"
},
{
"AttributeCode": "size",
"Name": "ONE SIZE",
"AttributeTypeCode": "size"
}
],
"MetaData": { "Attributes": [
{
"AttributeKey": "earliestDeliveryDate",
"AttributeValue": "1717763520"
},
{
"AttributeKey": "earliestShipDate",
"AttributeValue": "1716985920"
}
] }
}
],
"CartToken": None,
"UserDetails": {
"UserId": 12345,
"AddressDetails": [
{
"UserId": 12345,
"FirstName": "Test",
"LastName": "Test-e",
"Phone1": "01234567",
"Email": "mmm.bbb@gmail.com",
"Address1": "2-4 Test St",
"City": "Alexandria",
"Zip": "2015",
"CountryCode": "AU",
"IsShipping": True,
"IsBilling": True,
"IsDefaultShipping": True,
"IsDefaultBilling": True
}
]
},
"Discounts": [],
"VATRegistration": {
"VatRegistrationNumber": None,
"DoNotChargeVAT": False
},
"rateData": "bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=",
"IsMoto": 1
}
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({
CountryCode: 'AU',
ClientIP: '128.128.128.128',
Currency: {OriginalCurrencyCode: 'GBP', CurrencyCode: 'AUD'},
PriceModification: {RoundingRuleId: 103, PriceCoefficientRate: 1, IncludeVAT: null},
Culture: {PreferedCultureCode: null, InputDataCultureCode: null, CultureCode: 'en-GB'},
LocalShippingOptions: [
{
Carrier: 'globaleintegration_standard',
CarrierTitle: 'globaleintegration_standard',
CarrierName: 'globaleintegration_standard',
Code: 'globaleintegration_standard',
Method: 'globaleintegration_standard',
MethodTitle: 'globaleintegration_standard',
MethodDescription: 'globaleintegration_standard',
Price: 0,
IsPreferred: true
}
],
MerchantCartToken: '21531332-b15f-4640-ad5e-60887271a89a',
MerchantOrderId: '45345454',
PlatformURLs: {
SiteURL: 'https://test.com/my_url.html',
RedirectToCartURL: 'https://test.com/callback_URL.html',
PaymentCallbackURL: 'https://test.com/paymentCallback_URL.html'
},
Products: [
{
ProductCode: 'XE08801',
ProductGroupCode: null,
Name: 'Socks',
URL: 'https://www.test.com/products/08801',
Description: 'Naturally Close 5 Pack White Value Trainer Liner Socks',
ImageURL: 'https://test.test.com/1.jpg',
SalePrice: '8.95',
OriginalSalePrice: '5',
SalePriceBeforeRounding: '8.905175000000000000',
LocalVATRateType: {
VATRateTypeCode: 'merchantVATRateType_20',
Name: 'merchantVATRateType_20',
Rate: 20,
InternalVATRateTypeId: 0
},
OrderedQuantity: 1,
CartItemId: '111',
IsBackOrdered: false,
IsFixedPrice: true,
ListPrice: 58.2,
Attributes: [
{AttributeCode: 'color', Name: 'WHITE', AttributeTypeCode: 'color'},
{AttributeCode: 'size', Name: 'ONE SIZE', AttributeTypeCode: 'size'}
],
MetaData: {
Attributes: [
{AttributeKey: 'earliestDeliveryDate', AttributeValue: '1717763520'},
{AttributeKey: 'earliestShipDate', AttributeValue: '1716985920'}
]
}
}
],
CartToken: null,
UserDetails: {
UserId: 12345,
AddressDetails: [
{
UserId: 12345,
FirstName: 'Test',
LastName: 'Test-e',
Phone1: '01234567',
Email: 'mmm.bbb@gmail.com',
Address1: '2-4 Test St',
City: 'Alexandria',
Zip: '2015',
CountryCode: 'AU',
IsShipping: true,
IsBilling: true,
IsDefaultShipping: true,
IsDefaultBilling: true
}
]
},
Discounts: [],
VATRegistration: {VatRegistrationNumber: null, DoNotChargeVAT: false},
rateData: 'bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=',
IsMoto: 1
})
};
fetch('https://{globale_api_domain}/Checkout/SendCartV2', 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://{globale_api_domain}/Checkout/SendCartV2",
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([
'CountryCode' => 'AU',
'ClientIP' => '128.128.128.128',
'Currency' => [
'OriginalCurrencyCode' => 'GBP',
'CurrencyCode' => 'AUD'
],
'PriceModification' => [
'RoundingRuleId' => 103,
'PriceCoefficientRate' => 1,
'IncludeVAT' => null
],
'Culture' => [
'PreferedCultureCode' => null,
'InputDataCultureCode' => null,
'CultureCode' => 'en-GB'
],
'LocalShippingOptions' => [
[
'Carrier' => 'globaleintegration_standard',
'CarrierTitle' => 'globaleintegration_standard',
'CarrierName' => 'globaleintegration_standard',
'Code' => 'globaleintegration_standard',
'Method' => 'globaleintegration_standard',
'MethodTitle' => 'globaleintegration_standard',
'MethodDescription' => 'globaleintegration_standard',
'Price' => 0,
'IsPreferred' => true
]
],
'MerchantCartToken' => '21531332-b15f-4640-ad5e-60887271a89a',
'MerchantOrderId' => '45345454',
'PlatformURLs' => [
'SiteURL' => 'https://test.com/my_url.html',
'RedirectToCartURL' => 'https://test.com/callback_URL.html',
'PaymentCallbackURL' => 'https://test.com/paymentCallback_URL.html'
],
'Products' => [
[
'ProductCode' => 'XE08801',
'ProductGroupCode' => null,
'Name' => 'Socks',
'URL' => 'https://www.test.com/products/08801',
'Description' => 'Naturally Close 5 Pack White Value Trainer Liner Socks',
'ImageURL' => 'https://test.test.com/1.jpg',
'SalePrice' => '8.95',
'OriginalSalePrice' => '5',
'SalePriceBeforeRounding' => '8.905175000000000000',
'LocalVATRateType' => [
'VATRateTypeCode' => 'merchantVATRateType_20',
'Name' => 'merchantVATRateType_20',
'Rate' => 20,
'InternalVATRateTypeId' => 0
],
'OrderedQuantity' => 1,
'CartItemId' => '111',
'IsBackOrdered' => false,
'IsFixedPrice' => true,
'ListPrice' => 58.2,
'Attributes' => [
[
'AttributeCode' => 'color',
'Name' => 'WHITE',
'AttributeTypeCode' => 'color'
],
[
'AttributeCode' => 'size',
'Name' => 'ONE SIZE',
'AttributeTypeCode' => 'size'
]
],
'MetaData' => [
'Attributes' => [
[
'AttributeKey' => 'earliestDeliveryDate',
'AttributeValue' => '1717763520'
],
[
'AttributeKey' => 'earliestShipDate',
'AttributeValue' => '1716985920'
]
]
]
]
],
'CartToken' => null,
'UserDetails' => [
'UserId' => 12345,
'AddressDetails' => [
[
'UserId' => 12345,
'FirstName' => 'Test',
'LastName' => 'Test-e',
'Phone1' => '01234567',
'Email' => 'mmm.bbb@gmail.com',
'Address1' => '2-4 Test St',
'City' => 'Alexandria',
'Zip' => '2015',
'CountryCode' => 'AU',
'IsShipping' => true,
'IsBilling' => true,
'IsDefaultShipping' => true,
'IsDefaultBilling' => true
]
]
],
'Discounts' => [
],
'VATRegistration' => [
'VatRegistrationNumber' => null,
'DoNotChargeVAT' => false
],
'rateData' => 'bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=',
'IsMoto' => 1
]),
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://{globale_api_domain}/Checkout/SendCartV2"
payload := strings.NewReader("{\n \"CountryCode\": \"AU\",\n \"ClientIP\": \"128.128.128.128\",\n \"Currency\": {\n \"OriginalCurrencyCode\": \"GBP\",\n \"CurrencyCode\": \"AUD\"\n },\n \"PriceModification\": {\n \"RoundingRuleId\": 103,\n \"PriceCoefficientRate\": 1,\n \"IncludeVAT\": null\n },\n \"Culture\": {\n \"PreferedCultureCode\": null,\n \"InputDataCultureCode\": null,\n \"CultureCode\": \"en-GB\"\n },\n \"LocalShippingOptions\": [\n {\n \"Carrier\": \"globaleintegration_standard\",\n \"CarrierTitle\": \"globaleintegration_standard\",\n \"CarrierName\": \"globaleintegration_standard\",\n \"Code\": \"globaleintegration_standard\",\n \"Method\": \"globaleintegration_standard\",\n \"MethodTitle\": \"globaleintegration_standard\",\n \"MethodDescription\": \"globaleintegration_standard\",\n \"Price\": 0,\n \"IsPreferred\": true\n }\n ],\n \"MerchantCartToken\": \"21531332-b15f-4640-ad5e-60887271a89a\",\n \"MerchantOrderId\": \"45345454\",\n \"PlatformURLs\": {\n \"SiteURL\": \"https://test.com/my_url.html\",\n \"RedirectToCartURL\": \"https://test.com/callback_URL.html\",\n \"PaymentCallbackURL\": \"https://test.com/paymentCallback_URL.html\"\n },\n \"Products\": [\n {\n \"ProductCode\": \"XE08801\",\n \"ProductGroupCode\": null,\n \"Name\": \"Socks\",\n \"URL\": \"https://www.test.com/products/08801\",\n \"Description\": \"Naturally Close 5 Pack White Value Trainer Liner Socks\",\n \"ImageURL\": \"https://test.test.com/1.jpg\",\n \"SalePrice\": \"8.95\",\n \"OriginalSalePrice\": \"5\",\n \"SalePriceBeforeRounding\": \"8.905175000000000000\",\n \"LocalVATRateType\": {\n \"VATRateTypeCode\": \"merchantVATRateType_20\",\n \"Name\": \"merchantVATRateType_20\",\n \"Rate\": 20,\n \"InternalVATRateTypeId\": 0\n },\n \"OrderedQuantity\": 1,\n \"CartItemId\": \"111\",\n \"IsBackOrdered\": false,\n \"IsFixedPrice\": true,\n \"ListPrice\": 58.2,\n \"Attributes\": [\n {\n \"AttributeCode\": \"color\",\n \"Name\": \"WHITE\",\n \"AttributeTypeCode\": \"color\"\n },\n {\n \"AttributeCode\": \"size\",\n \"Name\": \"ONE SIZE\",\n \"AttributeTypeCode\": \"size\"\n }\n ],\n \"MetaData\": {\n \"Attributes\": [\n {\n \"AttributeKey\": \"earliestDeliveryDate\",\n \"AttributeValue\": \"1717763520\"\n },\n {\n \"AttributeKey\": \"earliestShipDate\",\n \"AttributeValue\": \"1716985920\"\n }\n ]\n }\n }\n ],\n \"CartToken\": null,\n \"UserDetails\": {\n \"UserId\": 12345,\n \"AddressDetails\": [\n {\n \"UserId\": 12345,\n \"FirstName\": \"Test\",\n \"LastName\": \"Test-e\",\n \"Phone1\": \"01234567\",\n \"Email\": \"mmm.bbb@gmail.com\",\n \"Address1\": \"2-4 Test St\",\n \"City\": \"Alexandria\",\n \"Zip\": \"2015\",\n \"CountryCode\": \"AU\",\n \"IsShipping\": true,\n \"IsBilling\": true,\n \"IsDefaultShipping\": true,\n \"IsDefaultBilling\": true\n }\n ]\n },\n \"Discounts\": [],\n \"VATRegistration\": {\n \"VatRegistrationNumber\": null,\n \"DoNotChargeVAT\": false\n },\n \"rateData\": \"bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=\",\n \"IsMoto\": 1\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://{globale_api_domain}/Checkout/SendCartV2")
.header("Content-Type", "application/json")
.body("{\n \"CountryCode\": \"AU\",\n \"ClientIP\": \"128.128.128.128\",\n \"Currency\": {\n \"OriginalCurrencyCode\": \"GBP\",\n \"CurrencyCode\": \"AUD\"\n },\n \"PriceModification\": {\n \"RoundingRuleId\": 103,\n \"PriceCoefficientRate\": 1,\n \"IncludeVAT\": null\n },\n \"Culture\": {\n \"PreferedCultureCode\": null,\n \"InputDataCultureCode\": null,\n \"CultureCode\": \"en-GB\"\n },\n \"LocalShippingOptions\": [\n {\n \"Carrier\": \"globaleintegration_standard\",\n \"CarrierTitle\": \"globaleintegration_standard\",\n \"CarrierName\": \"globaleintegration_standard\",\n \"Code\": \"globaleintegration_standard\",\n \"Method\": \"globaleintegration_standard\",\n \"MethodTitle\": \"globaleintegration_standard\",\n \"MethodDescription\": \"globaleintegration_standard\",\n \"Price\": 0,\n \"IsPreferred\": true\n }\n ],\n \"MerchantCartToken\": \"21531332-b15f-4640-ad5e-60887271a89a\",\n \"MerchantOrderId\": \"45345454\",\n \"PlatformURLs\": {\n \"SiteURL\": \"https://test.com/my_url.html\",\n \"RedirectToCartURL\": \"https://test.com/callback_URL.html\",\n \"PaymentCallbackURL\": \"https://test.com/paymentCallback_URL.html\"\n },\n \"Products\": [\n {\n \"ProductCode\": \"XE08801\",\n \"ProductGroupCode\": null,\n \"Name\": \"Socks\",\n \"URL\": \"https://www.test.com/products/08801\",\n \"Description\": \"Naturally Close 5 Pack White Value Trainer Liner Socks\",\n \"ImageURL\": \"https://test.test.com/1.jpg\",\n \"SalePrice\": \"8.95\",\n \"OriginalSalePrice\": \"5\",\n \"SalePriceBeforeRounding\": \"8.905175000000000000\",\n \"LocalVATRateType\": {\n \"VATRateTypeCode\": \"merchantVATRateType_20\",\n \"Name\": \"merchantVATRateType_20\",\n \"Rate\": 20,\n \"InternalVATRateTypeId\": 0\n },\n \"OrderedQuantity\": 1,\n \"CartItemId\": \"111\",\n \"IsBackOrdered\": false,\n \"IsFixedPrice\": true,\n \"ListPrice\": 58.2,\n \"Attributes\": [\n {\n \"AttributeCode\": \"color\",\n \"Name\": \"WHITE\",\n \"AttributeTypeCode\": \"color\"\n },\n {\n \"AttributeCode\": \"size\",\n \"Name\": \"ONE SIZE\",\n \"AttributeTypeCode\": \"size\"\n }\n ],\n \"MetaData\": {\n \"Attributes\": [\n {\n \"AttributeKey\": \"earliestDeliveryDate\",\n \"AttributeValue\": \"1717763520\"\n },\n {\n \"AttributeKey\": \"earliestShipDate\",\n \"AttributeValue\": \"1716985920\"\n }\n ]\n }\n }\n ],\n \"CartToken\": null,\n \"UserDetails\": {\n \"UserId\": 12345,\n \"AddressDetails\": [\n {\n \"UserId\": 12345,\n \"FirstName\": \"Test\",\n \"LastName\": \"Test-e\",\n \"Phone1\": \"01234567\",\n \"Email\": \"mmm.bbb@gmail.com\",\n \"Address1\": \"2-4 Test St\",\n \"City\": \"Alexandria\",\n \"Zip\": \"2015\",\n \"CountryCode\": \"AU\",\n \"IsShipping\": true,\n \"IsBilling\": true,\n \"IsDefaultShipping\": true,\n \"IsDefaultBilling\": true\n }\n ]\n },\n \"Discounts\": [],\n \"VATRegistration\": {\n \"VatRegistrationNumber\": null,\n \"DoNotChargeVAT\": false\n },\n \"rateData\": \"bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=\",\n \"IsMoto\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/Checkout/SendCartV2")
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 \"CountryCode\": \"AU\",\n \"ClientIP\": \"128.128.128.128\",\n \"Currency\": {\n \"OriginalCurrencyCode\": \"GBP\",\n \"CurrencyCode\": \"AUD\"\n },\n \"PriceModification\": {\n \"RoundingRuleId\": 103,\n \"PriceCoefficientRate\": 1,\n \"IncludeVAT\": null\n },\n \"Culture\": {\n \"PreferedCultureCode\": null,\n \"InputDataCultureCode\": null,\n \"CultureCode\": \"en-GB\"\n },\n \"LocalShippingOptions\": [\n {\n \"Carrier\": \"globaleintegration_standard\",\n \"CarrierTitle\": \"globaleintegration_standard\",\n \"CarrierName\": \"globaleintegration_standard\",\n \"Code\": \"globaleintegration_standard\",\n \"Method\": \"globaleintegration_standard\",\n \"MethodTitle\": \"globaleintegration_standard\",\n \"MethodDescription\": \"globaleintegration_standard\",\n \"Price\": 0,\n \"IsPreferred\": true\n }\n ],\n \"MerchantCartToken\": \"21531332-b15f-4640-ad5e-60887271a89a\",\n \"MerchantOrderId\": \"45345454\",\n \"PlatformURLs\": {\n \"SiteURL\": \"https://test.com/my_url.html\",\n \"RedirectToCartURL\": \"https://test.com/callback_URL.html\",\n \"PaymentCallbackURL\": \"https://test.com/paymentCallback_URL.html\"\n },\n \"Products\": [\n {\n \"ProductCode\": \"XE08801\",\n \"ProductGroupCode\": null,\n \"Name\": \"Socks\",\n \"URL\": \"https://www.test.com/products/08801\",\n \"Description\": \"Naturally Close 5 Pack White Value Trainer Liner Socks\",\n \"ImageURL\": \"https://test.test.com/1.jpg\",\n \"SalePrice\": \"8.95\",\n \"OriginalSalePrice\": \"5\",\n \"SalePriceBeforeRounding\": \"8.905175000000000000\",\n \"LocalVATRateType\": {\n \"VATRateTypeCode\": \"merchantVATRateType_20\",\n \"Name\": \"merchantVATRateType_20\",\n \"Rate\": 20,\n \"InternalVATRateTypeId\": 0\n },\n \"OrderedQuantity\": 1,\n \"CartItemId\": \"111\",\n \"IsBackOrdered\": false,\n \"IsFixedPrice\": true,\n \"ListPrice\": 58.2,\n \"Attributes\": [\n {\n \"AttributeCode\": \"color\",\n \"Name\": \"WHITE\",\n \"AttributeTypeCode\": \"color\"\n },\n {\n \"AttributeCode\": \"size\",\n \"Name\": \"ONE SIZE\",\n \"AttributeTypeCode\": \"size\"\n }\n ],\n \"MetaData\": {\n \"Attributes\": [\n {\n \"AttributeKey\": \"earliestDeliveryDate\",\n \"AttributeValue\": \"1717763520\"\n },\n {\n \"AttributeKey\": \"earliestShipDate\",\n \"AttributeValue\": \"1716985920\"\n }\n ]\n }\n }\n ],\n \"CartToken\": null,\n \"UserDetails\": {\n \"UserId\": 12345,\n \"AddressDetails\": [\n {\n \"UserId\": 12345,\n \"FirstName\": \"Test\",\n \"LastName\": \"Test-e\",\n \"Phone1\": \"01234567\",\n \"Email\": \"mmm.bbb@gmail.com\",\n \"Address1\": \"2-4 Test St\",\n \"City\": \"Alexandria\",\n \"Zip\": \"2015\",\n \"CountryCode\": \"AU\",\n \"IsShipping\": true,\n \"IsBilling\": true,\n \"IsDefaultShipping\": true,\n \"IsDefaultBilling\": true\n }\n ]\n },\n \"Discounts\": [],\n \"VATRegistration\": {\n \"VatRegistrationNumber\": null,\n \"DoNotChargeVAT\": false\n },\n \"rateData\": \"bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=\",\n \"IsMoto\": 1\n}"
response = http.request(request)
puts response.read_body{
"cartInfo": {
"CartToken": "<string>"
}
}SendCartV2
The method sends the end customer’s cart contents from the Merchant’s site to Global-e and returns a unique Cart Token to be further passed by the Merchant’s site to the Global-e checkout widget or to API checkout methods.
curl --request POST \
--url https://{globale_api_domain}/Checkout/SendCartV2 \
--header 'Content-Type: application/json' \
--data '
{
"CountryCode": "AU",
"ClientIP": "128.128.128.128",
"Currency": {
"OriginalCurrencyCode": "GBP",
"CurrencyCode": "AUD"
},
"PriceModification": {
"RoundingRuleId": 103,
"PriceCoefficientRate": 1,
"IncludeVAT": null
},
"Culture": {
"PreferedCultureCode": null,
"InputDataCultureCode": null,
"CultureCode": "en-GB"
},
"LocalShippingOptions": [
{
"Carrier": "globaleintegration_standard",
"CarrierTitle": "globaleintegration_standard",
"CarrierName": "globaleintegration_standard",
"Code": "globaleintegration_standard",
"Method": "globaleintegration_standard",
"MethodTitle": "globaleintegration_standard",
"MethodDescription": "globaleintegration_standard",
"Price": 0,
"IsPreferred": true
}
],
"MerchantCartToken": "21531332-b15f-4640-ad5e-60887271a89a",
"MerchantOrderId": "45345454",
"PlatformURLs": {
"SiteURL": "https://test.com/my_url.html",
"RedirectToCartURL": "https://test.com/callback_URL.html",
"PaymentCallbackURL": "https://test.com/paymentCallback_URL.html"
},
"Products": [
{
"ProductCode": "XE08801",
"ProductGroupCode": null,
"Name": "Socks",
"URL": "https://www.test.com/products/08801",
"Description": "Naturally Close 5 Pack White Value Trainer Liner Socks",
"ImageURL": "https://test.test.com/1.jpg",
"SalePrice": "8.95",
"OriginalSalePrice": "5",
"SalePriceBeforeRounding": "8.905175000000000000",
"LocalVATRateType": {
"VATRateTypeCode": "merchantVATRateType_20",
"Name": "merchantVATRateType_20",
"Rate": 20,
"InternalVATRateTypeId": 0
},
"OrderedQuantity": 1,
"CartItemId": "111",
"IsBackOrdered": false,
"IsFixedPrice": true,
"ListPrice": 58.2,
"Attributes": [
{
"AttributeCode": "color",
"Name": "WHITE",
"AttributeTypeCode": "color"
},
{
"AttributeCode": "size",
"Name": "ONE SIZE",
"AttributeTypeCode": "size"
}
],
"MetaData": {
"Attributes": [
{
"AttributeKey": "earliestDeliveryDate",
"AttributeValue": "1717763520"
},
{
"AttributeKey": "earliestShipDate",
"AttributeValue": "1716985920"
}
]
}
}
],
"CartToken": null,
"UserDetails": {
"UserId": 12345,
"AddressDetails": [
{
"UserId": 12345,
"FirstName": "Test",
"LastName": "Test-e",
"Phone1": "01234567",
"Email": "mmm.bbb@gmail.com",
"Address1": "2-4 Test St",
"City": "Alexandria",
"Zip": "2015",
"CountryCode": "AU",
"IsShipping": true,
"IsBilling": true,
"IsDefaultShipping": true,
"IsDefaultBilling": true
}
]
},
"Discounts": [],
"VATRegistration": {
"VatRegistrationNumber": null,
"DoNotChargeVAT": false
},
"rateData": "bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=",
"IsMoto": 1
}
'import requests
url = "https://{globale_api_domain}/Checkout/SendCartV2"
payload = {
"CountryCode": "AU",
"ClientIP": "128.128.128.128",
"Currency": {
"OriginalCurrencyCode": "GBP",
"CurrencyCode": "AUD"
},
"PriceModification": {
"RoundingRuleId": 103,
"PriceCoefficientRate": 1,
"IncludeVAT": None
},
"Culture": {
"PreferedCultureCode": None,
"InputDataCultureCode": None,
"CultureCode": "en-GB"
},
"LocalShippingOptions": [
{
"Carrier": "globaleintegration_standard",
"CarrierTitle": "globaleintegration_standard",
"CarrierName": "globaleintegration_standard",
"Code": "globaleintegration_standard",
"Method": "globaleintegration_standard",
"MethodTitle": "globaleintegration_standard",
"MethodDescription": "globaleintegration_standard",
"Price": 0,
"IsPreferred": True
}
],
"MerchantCartToken": "21531332-b15f-4640-ad5e-60887271a89a",
"MerchantOrderId": "45345454",
"PlatformURLs": {
"SiteURL": "https://test.com/my_url.html",
"RedirectToCartURL": "https://test.com/callback_URL.html",
"PaymentCallbackURL": "https://test.com/paymentCallback_URL.html"
},
"Products": [
{
"ProductCode": "XE08801",
"ProductGroupCode": None,
"Name": "Socks",
"URL": "https://www.test.com/products/08801",
"Description": "Naturally Close 5 Pack White Value Trainer Liner Socks",
"ImageURL": "https://test.test.com/1.jpg",
"SalePrice": "8.95",
"OriginalSalePrice": "5",
"SalePriceBeforeRounding": "8.905175000000000000",
"LocalVATRateType": {
"VATRateTypeCode": "merchantVATRateType_20",
"Name": "merchantVATRateType_20",
"Rate": 20,
"InternalVATRateTypeId": 0
},
"OrderedQuantity": 1,
"CartItemId": "111",
"IsBackOrdered": False,
"IsFixedPrice": True,
"ListPrice": 58.2,
"Attributes": [
{
"AttributeCode": "color",
"Name": "WHITE",
"AttributeTypeCode": "color"
},
{
"AttributeCode": "size",
"Name": "ONE SIZE",
"AttributeTypeCode": "size"
}
],
"MetaData": { "Attributes": [
{
"AttributeKey": "earliestDeliveryDate",
"AttributeValue": "1717763520"
},
{
"AttributeKey": "earliestShipDate",
"AttributeValue": "1716985920"
}
] }
}
],
"CartToken": None,
"UserDetails": {
"UserId": 12345,
"AddressDetails": [
{
"UserId": 12345,
"FirstName": "Test",
"LastName": "Test-e",
"Phone1": "01234567",
"Email": "mmm.bbb@gmail.com",
"Address1": "2-4 Test St",
"City": "Alexandria",
"Zip": "2015",
"CountryCode": "AU",
"IsShipping": True,
"IsBilling": True,
"IsDefaultShipping": True,
"IsDefaultBilling": True
}
]
},
"Discounts": [],
"VATRegistration": {
"VatRegistrationNumber": None,
"DoNotChargeVAT": False
},
"rateData": "bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=",
"IsMoto": 1
}
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({
CountryCode: 'AU',
ClientIP: '128.128.128.128',
Currency: {OriginalCurrencyCode: 'GBP', CurrencyCode: 'AUD'},
PriceModification: {RoundingRuleId: 103, PriceCoefficientRate: 1, IncludeVAT: null},
Culture: {PreferedCultureCode: null, InputDataCultureCode: null, CultureCode: 'en-GB'},
LocalShippingOptions: [
{
Carrier: 'globaleintegration_standard',
CarrierTitle: 'globaleintegration_standard',
CarrierName: 'globaleintegration_standard',
Code: 'globaleintegration_standard',
Method: 'globaleintegration_standard',
MethodTitle: 'globaleintegration_standard',
MethodDescription: 'globaleintegration_standard',
Price: 0,
IsPreferred: true
}
],
MerchantCartToken: '21531332-b15f-4640-ad5e-60887271a89a',
MerchantOrderId: '45345454',
PlatformURLs: {
SiteURL: 'https://test.com/my_url.html',
RedirectToCartURL: 'https://test.com/callback_URL.html',
PaymentCallbackURL: 'https://test.com/paymentCallback_URL.html'
},
Products: [
{
ProductCode: 'XE08801',
ProductGroupCode: null,
Name: 'Socks',
URL: 'https://www.test.com/products/08801',
Description: 'Naturally Close 5 Pack White Value Trainer Liner Socks',
ImageURL: 'https://test.test.com/1.jpg',
SalePrice: '8.95',
OriginalSalePrice: '5',
SalePriceBeforeRounding: '8.905175000000000000',
LocalVATRateType: {
VATRateTypeCode: 'merchantVATRateType_20',
Name: 'merchantVATRateType_20',
Rate: 20,
InternalVATRateTypeId: 0
},
OrderedQuantity: 1,
CartItemId: '111',
IsBackOrdered: false,
IsFixedPrice: true,
ListPrice: 58.2,
Attributes: [
{AttributeCode: 'color', Name: 'WHITE', AttributeTypeCode: 'color'},
{AttributeCode: 'size', Name: 'ONE SIZE', AttributeTypeCode: 'size'}
],
MetaData: {
Attributes: [
{AttributeKey: 'earliestDeliveryDate', AttributeValue: '1717763520'},
{AttributeKey: 'earliestShipDate', AttributeValue: '1716985920'}
]
}
}
],
CartToken: null,
UserDetails: {
UserId: 12345,
AddressDetails: [
{
UserId: 12345,
FirstName: 'Test',
LastName: 'Test-e',
Phone1: '01234567',
Email: 'mmm.bbb@gmail.com',
Address1: '2-4 Test St',
City: 'Alexandria',
Zip: '2015',
CountryCode: 'AU',
IsShipping: true,
IsBilling: true,
IsDefaultShipping: true,
IsDefaultBilling: true
}
]
},
Discounts: [],
VATRegistration: {VatRegistrationNumber: null, DoNotChargeVAT: false},
rateData: 'bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=',
IsMoto: 1
})
};
fetch('https://{globale_api_domain}/Checkout/SendCartV2', 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://{globale_api_domain}/Checkout/SendCartV2",
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([
'CountryCode' => 'AU',
'ClientIP' => '128.128.128.128',
'Currency' => [
'OriginalCurrencyCode' => 'GBP',
'CurrencyCode' => 'AUD'
],
'PriceModification' => [
'RoundingRuleId' => 103,
'PriceCoefficientRate' => 1,
'IncludeVAT' => null
],
'Culture' => [
'PreferedCultureCode' => null,
'InputDataCultureCode' => null,
'CultureCode' => 'en-GB'
],
'LocalShippingOptions' => [
[
'Carrier' => 'globaleintegration_standard',
'CarrierTitle' => 'globaleintegration_standard',
'CarrierName' => 'globaleintegration_standard',
'Code' => 'globaleintegration_standard',
'Method' => 'globaleintegration_standard',
'MethodTitle' => 'globaleintegration_standard',
'MethodDescription' => 'globaleintegration_standard',
'Price' => 0,
'IsPreferred' => true
]
],
'MerchantCartToken' => '21531332-b15f-4640-ad5e-60887271a89a',
'MerchantOrderId' => '45345454',
'PlatformURLs' => [
'SiteURL' => 'https://test.com/my_url.html',
'RedirectToCartURL' => 'https://test.com/callback_URL.html',
'PaymentCallbackURL' => 'https://test.com/paymentCallback_URL.html'
],
'Products' => [
[
'ProductCode' => 'XE08801',
'ProductGroupCode' => null,
'Name' => 'Socks',
'URL' => 'https://www.test.com/products/08801',
'Description' => 'Naturally Close 5 Pack White Value Trainer Liner Socks',
'ImageURL' => 'https://test.test.com/1.jpg',
'SalePrice' => '8.95',
'OriginalSalePrice' => '5',
'SalePriceBeforeRounding' => '8.905175000000000000',
'LocalVATRateType' => [
'VATRateTypeCode' => 'merchantVATRateType_20',
'Name' => 'merchantVATRateType_20',
'Rate' => 20,
'InternalVATRateTypeId' => 0
],
'OrderedQuantity' => 1,
'CartItemId' => '111',
'IsBackOrdered' => false,
'IsFixedPrice' => true,
'ListPrice' => 58.2,
'Attributes' => [
[
'AttributeCode' => 'color',
'Name' => 'WHITE',
'AttributeTypeCode' => 'color'
],
[
'AttributeCode' => 'size',
'Name' => 'ONE SIZE',
'AttributeTypeCode' => 'size'
]
],
'MetaData' => [
'Attributes' => [
[
'AttributeKey' => 'earliestDeliveryDate',
'AttributeValue' => '1717763520'
],
[
'AttributeKey' => 'earliestShipDate',
'AttributeValue' => '1716985920'
]
]
]
]
],
'CartToken' => null,
'UserDetails' => [
'UserId' => 12345,
'AddressDetails' => [
[
'UserId' => 12345,
'FirstName' => 'Test',
'LastName' => 'Test-e',
'Phone1' => '01234567',
'Email' => 'mmm.bbb@gmail.com',
'Address1' => '2-4 Test St',
'City' => 'Alexandria',
'Zip' => '2015',
'CountryCode' => 'AU',
'IsShipping' => true,
'IsBilling' => true,
'IsDefaultShipping' => true,
'IsDefaultBilling' => true
]
]
],
'Discounts' => [
],
'VATRegistration' => [
'VatRegistrationNumber' => null,
'DoNotChargeVAT' => false
],
'rateData' => 'bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=',
'IsMoto' => 1
]),
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://{globale_api_domain}/Checkout/SendCartV2"
payload := strings.NewReader("{\n \"CountryCode\": \"AU\",\n \"ClientIP\": \"128.128.128.128\",\n \"Currency\": {\n \"OriginalCurrencyCode\": \"GBP\",\n \"CurrencyCode\": \"AUD\"\n },\n \"PriceModification\": {\n \"RoundingRuleId\": 103,\n \"PriceCoefficientRate\": 1,\n \"IncludeVAT\": null\n },\n \"Culture\": {\n \"PreferedCultureCode\": null,\n \"InputDataCultureCode\": null,\n \"CultureCode\": \"en-GB\"\n },\n \"LocalShippingOptions\": [\n {\n \"Carrier\": \"globaleintegration_standard\",\n \"CarrierTitle\": \"globaleintegration_standard\",\n \"CarrierName\": \"globaleintegration_standard\",\n \"Code\": \"globaleintegration_standard\",\n \"Method\": \"globaleintegration_standard\",\n \"MethodTitle\": \"globaleintegration_standard\",\n \"MethodDescription\": \"globaleintegration_standard\",\n \"Price\": 0,\n \"IsPreferred\": true\n }\n ],\n \"MerchantCartToken\": \"21531332-b15f-4640-ad5e-60887271a89a\",\n \"MerchantOrderId\": \"45345454\",\n \"PlatformURLs\": {\n \"SiteURL\": \"https://test.com/my_url.html\",\n \"RedirectToCartURL\": \"https://test.com/callback_URL.html\",\n \"PaymentCallbackURL\": \"https://test.com/paymentCallback_URL.html\"\n },\n \"Products\": [\n {\n \"ProductCode\": \"XE08801\",\n \"ProductGroupCode\": null,\n \"Name\": \"Socks\",\n \"URL\": \"https://www.test.com/products/08801\",\n \"Description\": \"Naturally Close 5 Pack White Value Trainer Liner Socks\",\n \"ImageURL\": \"https://test.test.com/1.jpg\",\n \"SalePrice\": \"8.95\",\n \"OriginalSalePrice\": \"5\",\n \"SalePriceBeforeRounding\": \"8.905175000000000000\",\n \"LocalVATRateType\": {\n \"VATRateTypeCode\": \"merchantVATRateType_20\",\n \"Name\": \"merchantVATRateType_20\",\n \"Rate\": 20,\n \"InternalVATRateTypeId\": 0\n },\n \"OrderedQuantity\": 1,\n \"CartItemId\": \"111\",\n \"IsBackOrdered\": false,\n \"IsFixedPrice\": true,\n \"ListPrice\": 58.2,\n \"Attributes\": [\n {\n \"AttributeCode\": \"color\",\n \"Name\": \"WHITE\",\n \"AttributeTypeCode\": \"color\"\n },\n {\n \"AttributeCode\": \"size\",\n \"Name\": \"ONE SIZE\",\n \"AttributeTypeCode\": \"size\"\n }\n ],\n \"MetaData\": {\n \"Attributes\": [\n {\n \"AttributeKey\": \"earliestDeliveryDate\",\n \"AttributeValue\": \"1717763520\"\n },\n {\n \"AttributeKey\": \"earliestShipDate\",\n \"AttributeValue\": \"1716985920\"\n }\n ]\n }\n }\n ],\n \"CartToken\": null,\n \"UserDetails\": {\n \"UserId\": 12345,\n \"AddressDetails\": [\n {\n \"UserId\": 12345,\n \"FirstName\": \"Test\",\n \"LastName\": \"Test-e\",\n \"Phone1\": \"01234567\",\n \"Email\": \"mmm.bbb@gmail.com\",\n \"Address1\": \"2-4 Test St\",\n \"City\": \"Alexandria\",\n \"Zip\": \"2015\",\n \"CountryCode\": \"AU\",\n \"IsShipping\": true,\n \"IsBilling\": true,\n \"IsDefaultShipping\": true,\n \"IsDefaultBilling\": true\n }\n ]\n },\n \"Discounts\": [],\n \"VATRegistration\": {\n \"VatRegistrationNumber\": null,\n \"DoNotChargeVAT\": false\n },\n \"rateData\": \"bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=\",\n \"IsMoto\": 1\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://{globale_api_domain}/Checkout/SendCartV2")
.header("Content-Type", "application/json")
.body("{\n \"CountryCode\": \"AU\",\n \"ClientIP\": \"128.128.128.128\",\n \"Currency\": {\n \"OriginalCurrencyCode\": \"GBP\",\n \"CurrencyCode\": \"AUD\"\n },\n \"PriceModification\": {\n \"RoundingRuleId\": 103,\n \"PriceCoefficientRate\": 1,\n \"IncludeVAT\": null\n },\n \"Culture\": {\n \"PreferedCultureCode\": null,\n \"InputDataCultureCode\": null,\n \"CultureCode\": \"en-GB\"\n },\n \"LocalShippingOptions\": [\n {\n \"Carrier\": \"globaleintegration_standard\",\n \"CarrierTitle\": \"globaleintegration_standard\",\n \"CarrierName\": \"globaleintegration_standard\",\n \"Code\": \"globaleintegration_standard\",\n \"Method\": \"globaleintegration_standard\",\n \"MethodTitle\": \"globaleintegration_standard\",\n \"MethodDescription\": \"globaleintegration_standard\",\n \"Price\": 0,\n \"IsPreferred\": true\n }\n ],\n \"MerchantCartToken\": \"21531332-b15f-4640-ad5e-60887271a89a\",\n \"MerchantOrderId\": \"45345454\",\n \"PlatformURLs\": {\n \"SiteURL\": \"https://test.com/my_url.html\",\n \"RedirectToCartURL\": \"https://test.com/callback_URL.html\",\n \"PaymentCallbackURL\": \"https://test.com/paymentCallback_URL.html\"\n },\n \"Products\": [\n {\n \"ProductCode\": \"XE08801\",\n \"ProductGroupCode\": null,\n \"Name\": \"Socks\",\n \"URL\": \"https://www.test.com/products/08801\",\n \"Description\": \"Naturally Close 5 Pack White Value Trainer Liner Socks\",\n \"ImageURL\": \"https://test.test.com/1.jpg\",\n \"SalePrice\": \"8.95\",\n \"OriginalSalePrice\": \"5\",\n \"SalePriceBeforeRounding\": \"8.905175000000000000\",\n \"LocalVATRateType\": {\n \"VATRateTypeCode\": \"merchantVATRateType_20\",\n \"Name\": \"merchantVATRateType_20\",\n \"Rate\": 20,\n \"InternalVATRateTypeId\": 0\n },\n \"OrderedQuantity\": 1,\n \"CartItemId\": \"111\",\n \"IsBackOrdered\": false,\n \"IsFixedPrice\": true,\n \"ListPrice\": 58.2,\n \"Attributes\": [\n {\n \"AttributeCode\": \"color\",\n \"Name\": \"WHITE\",\n \"AttributeTypeCode\": \"color\"\n },\n {\n \"AttributeCode\": \"size\",\n \"Name\": \"ONE SIZE\",\n \"AttributeTypeCode\": \"size\"\n }\n ],\n \"MetaData\": {\n \"Attributes\": [\n {\n \"AttributeKey\": \"earliestDeliveryDate\",\n \"AttributeValue\": \"1717763520\"\n },\n {\n \"AttributeKey\": \"earliestShipDate\",\n \"AttributeValue\": \"1716985920\"\n }\n ]\n }\n }\n ],\n \"CartToken\": null,\n \"UserDetails\": {\n \"UserId\": 12345,\n \"AddressDetails\": [\n {\n \"UserId\": 12345,\n \"FirstName\": \"Test\",\n \"LastName\": \"Test-e\",\n \"Phone1\": \"01234567\",\n \"Email\": \"mmm.bbb@gmail.com\",\n \"Address1\": \"2-4 Test St\",\n \"City\": \"Alexandria\",\n \"Zip\": \"2015\",\n \"CountryCode\": \"AU\",\n \"IsShipping\": true,\n \"IsBilling\": true,\n \"IsDefaultShipping\": true,\n \"IsDefaultBilling\": true\n }\n ]\n },\n \"Discounts\": [],\n \"VATRegistration\": {\n \"VatRegistrationNumber\": null,\n \"DoNotChargeVAT\": false\n },\n \"rateData\": \"bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=\",\n \"IsMoto\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/Checkout/SendCartV2")
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 \"CountryCode\": \"AU\",\n \"ClientIP\": \"128.128.128.128\",\n \"Currency\": {\n \"OriginalCurrencyCode\": \"GBP\",\n \"CurrencyCode\": \"AUD\"\n },\n \"PriceModification\": {\n \"RoundingRuleId\": 103,\n \"PriceCoefficientRate\": 1,\n \"IncludeVAT\": null\n },\n \"Culture\": {\n \"PreferedCultureCode\": null,\n \"InputDataCultureCode\": null,\n \"CultureCode\": \"en-GB\"\n },\n \"LocalShippingOptions\": [\n {\n \"Carrier\": \"globaleintegration_standard\",\n \"CarrierTitle\": \"globaleintegration_standard\",\n \"CarrierName\": \"globaleintegration_standard\",\n \"Code\": \"globaleintegration_standard\",\n \"Method\": \"globaleintegration_standard\",\n \"MethodTitle\": \"globaleintegration_standard\",\n \"MethodDescription\": \"globaleintegration_standard\",\n \"Price\": 0,\n \"IsPreferred\": true\n }\n ],\n \"MerchantCartToken\": \"21531332-b15f-4640-ad5e-60887271a89a\",\n \"MerchantOrderId\": \"45345454\",\n \"PlatformURLs\": {\n \"SiteURL\": \"https://test.com/my_url.html\",\n \"RedirectToCartURL\": \"https://test.com/callback_URL.html\",\n \"PaymentCallbackURL\": \"https://test.com/paymentCallback_URL.html\"\n },\n \"Products\": [\n {\n \"ProductCode\": \"XE08801\",\n \"ProductGroupCode\": null,\n \"Name\": \"Socks\",\n \"URL\": \"https://www.test.com/products/08801\",\n \"Description\": \"Naturally Close 5 Pack White Value Trainer Liner Socks\",\n \"ImageURL\": \"https://test.test.com/1.jpg\",\n \"SalePrice\": \"8.95\",\n \"OriginalSalePrice\": \"5\",\n \"SalePriceBeforeRounding\": \"8.905175000000000000\",\n \"LocalVATRateType\": {\n \"VATRateTypeCode\": \"merchantVATRateType_20\",\n \"Name\": \"merchantVATRateType_20\",\n \"Rate\": 20,\n \"InternalVATRateTypeId\": 0\n },\n \"OrderedQuantity\": 1,\n \"CartItemId\": \"111\",\n \"IsBackOrdered\": false,\n \"IsFixedPrice\": true,\n \"ListPrice\": 58.2,\n \"Attributes\": [\n {\n \"AttributeCode\": \"color\",\n \"Name\": \"WHITE\",\n \"AttributeTypeCode\": \"color\"\n },\n {\n \"AttributeCode\": \"size\",\n \"Name\": \"ONE SIZE\",\n \"AttributeTypeCode\": \"size\"\n }\n ],\n \"MetaData\": {\n \"Attributes\": [\n {\n \"AttributeKey\": \"earliestDeliveryDate\",\n \"AttributeValue\": \"1717763520\"\n },\n {\n \"AttributeKey\": \"earliestShipDate\",\n \"AttributeValue\": \"1716985920\"\n }\n ]\n }\n }\n ],\n \"CartToken\": null,\n \"UserDetails\": {\n \"UserId\": 12345,\n \"AddressDetails\": [\n {\n \"UserId\": 12345,\n \"FirstName\": \"Test\",\n \"LastName\": \"Test-e\",\n \"Phone1\": \"01234567\",\n \"Email\": \"mmm.bbb@gmail.com\",\n \"Address1\": \"2-4 Test St\",\n \"City\": \"Alexandria\",\n \"Zip\": \"2015\",\n \"CountryCode\": \"AU\",\n \"IsShipping\": true,\n \"IsBilling\": true,\n \"IsDefaultShipping\": true,\n \"IsDefaultBilling\": true\n }\n ]\n },\n \"Discounts\": [],\n \"VATRegistration\": {\n \"VatRegistrationNumber\": null,\n \"DoNotChargeVAT\": false\n },\n \"rateData\": \"bkep2SfLA8VXnA3+mU1e16u5InvGPYAmwm7RpmXveyU=\",\n \"IsMoto\": 1\n}"
response = http.request(request)
puts response.read_body{
"cartInfo": {
"CartToken": "<string>"
}
}Body
Details about the end customer's cart contents from the Merchant's site. Includes user details, product details, discount details, conversion information, vouchers, and any other information required for cart creation
List of Product objects.
Show child attributes
Show child attributes
Indicates if the end customer’s consent to receive emails from Merchants should be pre-selected in Global‑e checkout. TRUE - Preselect consent to receive emails. FALSE - Do not preselect consent.
Details about the cart currency
Show child attributes
Show child attributes
A string that represents the Merchant order id if it is known already at the point when the user is still in the cart page on the Merchant’s store.
Data regarding cart price modifications
Show child attributes
Show child attributes
The value returned from the previous call to SendCart for the same client (must be stored in the client session or persistent cookie on the Merchant’s side). This parameter is used to support cart updates.
The end customer’s IP address.
2-char ISO country code of the shipping country either pre-defined using geo-location or actively selected by the end customer. This may be different from the shippingDetails.CountryCode property denoting the registered user’s country defined below.
Cart culture data
Show child attributes
Show child attributes
Indicates type of delivery.
List of Discounts to be applied to the cart. Discounts of any type (“cart”, “shipping”, etc.) may be specified.
Show child attributes
Show child attributes
Holds information required carts that were awarded free international shipping according to the Merchant platform (as opposed to the flat shipping pricing system on the global-e system).
Show child attributes
Show child attributes
The 2-character ISO country code representing the country to which this hub belongs.
Identifier of the Global‑e’s Local Hub previously returned by the ActiveHubDetails method. If not specified, the default Merchant’s Hub will be used instead.
Indicates whether the person placing the order is a customer support agent or a regular customer. TRUE – The customer is a customer support agent and an “Offline order” takes place, FALSE - (default value) – The customer is a regular customer.
List of JSON-serialized Shipping Options available for local shipping of the order from the Merchant to Global‑e’s Local Hub previously returned by the ActiveHubDetails method. If the “globaleintegration_standard” shipping method has been created and enabled for Global‑e on the Merchant’s site, Global‑e will prefer this Shipping Option when posting the order back to the Merchant’s site (using the SendOrderToMerchant API method). Therefore, all other shipping methods available for local shipping may be omitted in LocalShippingOptions .
Show child attributes
Show child attributes
Holds information for Merchant-side loyalty points to be applied.
Show child attributes
Show child attributes
Holds information on the registered user to apply loyalty points on the checkout page.
Show child attributes
Show child attributes
Hash optionally generated by the Merchant, to be returned to the Merchant with the order API call. This hash may be used for additional cart and order validation purposes on the Merchant’s side.
Cart or session identifier used for the cart on the Merchant’s site, to be returned to the Merchant with the order API call.
Unique identifier of Merchant internal order ID.
Unique identifier of Merchant order ID.
The amended Merchant's price for duties. Can be used to declare a value for a free item for customs purposes. Note: Either MerchantPriceForDuties or OriginalMerchantPriceForDuties or both can be provided. Used by SendCartV2 API.
The original Merchant's price for duties. Can be used to declare a value for a free item for customs purposes. Note: Either MerchantPriceForDuties or OriginalMerchantPriceForDuties or both can be provided. Used by SendCartV2 API.
List of available payment instalment amounts.
Cart price modification data
Currency data used by Global‑e to verify the currency rate. Return the value received in the used currency rate.
Indicates the ship-to-shop code.
List of JSON-serialized KeyValuePairs that denote parameter values to be specified in the respective Merchant’s RESTFul API action URLs. For example, to instruct Global‑e to include the “ en-AU ” locale in the SendOrderToMerchant call for this cart, urlParameters should include: KeyValuePair: [{"Key":"locale", "Value":"en-AU"}] . In this example “locale” parameter should be configured for the SendOrderToMerchant URL for this Merchant on the Global‑e side.
All available details of the user including all relevant addresses.
Show child attributes
Show child attributes
Holds information required for VAT exemption within the EU.
Show child attributes
Show child attributes
Holds information for Merchant-side vouchers to be applied (includes loyalty vouchers and one-time vouchers).
Show child attributes
Show child attributes
Code used on the Merchant’s side to identify the web store where the current cart is originating from. This code should be used in case of a multi-store setup on the Merchant’s site.
Code used on the Merchant’s side to identify the web store instance where the current cart is originating from. This code should be used in case of multi-store domains set up on the Merchant’s site.
Response
Response Parameters
Contains details about the end customer's cart.
Show child attributes
Show child attributes

